Skip to content

Commit

Permalink
Merge branch 'main' into rohin/add-old-parser-snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava authored Jan 29, 2025
2 parents 7dbba3d + f38c445 commit a04bdf8
Show file tree
Hide file tree
Showing 154 changed files with 3,491 additions and 1,584 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy-fdr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
FERNIE_SLACK_APP_TOKEN: ${{ secrets.FERNIE_SLACK_APP_TOKEN }}
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
CLOUDFRONT_KEY_PAIR_ID: ${{ secrets.CLOUDFRONT_KEY_PAIR_ID }}

jobs:
sdk:
Expand All @@ -45,6 +46,7 @@ jobs:
ALGOLIA_SEARCH_INDEX: ${{ secrets.ALGOLIA_SEARCH_INDEX }}
ALGOLIA_SEARCH_V2_DOMAINS: "workato,rohin-bhargava-staging,monite,humanloop,cohere,buildwithfern.com/learn"
ALGOLIA_SEARCH_API_KEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }}
CLOUDFRONT_KEY_PAIR_ID: ${{ secrets.CLOUDFRONT_KEY_PAIR_ID }}
APPLICATION_ENVIRONMENT: dev
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -85,6 +87,7 @@ jobs:
VERSION="${git_version}" pnpm --filter=@fern-platform/fdr-deploy deploy:dev
env:
DATABASE_URL: ${{ secrets.DEV_POSTGRES_URL }}/fdr?schema=public&connection_limit=6&pool_timeout=30
CLOUDFRONT_KEY_PAIR_ID: ${{ secrets.CLOUDFRONT_KEY_PAIR_ID }}

smoke-test:
needs: deploy_dev
Expand Down
22 changes: 5 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,6 @@ To run the integration tests: `pnpm test:ete`.

Many of our tests rely on [Vite](https://vitejs.dev/) snapshots. To rewrite snapshots, use `-u`: `pnpm test -u` and `pnpm test:ete -u`.

### CLI

To build the CLI, run either:

- `pnpm dist:cli:dev`. This compiles and bundles a CLI that communicates with our dev cloud environment. The CLI is outputted to `packages/cli/cli/dist/dev/cli.cjs`.

- `pnpm dist:cli:prod`. This compiles and bundles a CLI that communicates with our production cloud environment. The CLI is outputted to `packages/cli/cli/dist/prod/cli.cjs`.

To run the locally-generated CLI, run:

```
FERN_NO_VERSION_REDIRECTION=true node <path to CLI> <args>
```

### Docs UI

To build and run the NextJS docs UI, run:
Expand All @@ -91,11 +77,11 @@ The frontend is served at `localhost:3000`. You can configure which docs are loa

### Docs Dev Environment

To run the docs dev environment, make sure vercel is installed:
To run the docs dev environment, first make sure vercel is installed:

- `npm install -g vercel`

Then link vercel to the project:
From the fern-platform repository, link vercel to the Fern project:

- `vercel link --project app.buildwithfern.com`
- When prompted to setup the project, say `yes`
Expand All @@ -106,7 +92,9 @@ Then, run `vercel pull`, which will create `/fern-platform/.vercel/.env.developm
Then, copy that file (creating if necessary) to `/fern-platform/packages/fern-docs/bundle/.env.local`
Finally, to run the dev server, `cd /packages/fern-docs/bundle` and run `pnpm docs:dev`, which should begin running on `localhost:3000`

Optionally, to reroute to a different docs domain, add a `NEXT_PUBLIC_DOCS_DOMAIN` to `.env.local`
To set a dev docs domain, add a `NEXT_PUBLIC_DOCS_DOMAIN` to `.env.local`. For instance:

- `NEXT_PUBLIC_DOCS_DOMAIN=customer.docs.buildwithfern.com`

## Testing in Staging

Expand Down
4 changes: 2 additions & 2 deletions clis/generator-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"@types/node": "^18.7.18",
"@types/yargs": "^17.0.32",
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.15",
"depcheck": "^1.4.3",
"esbuild": "0.20.2",
"depcheck": "^1.4.7",
"esbuild": "0.24.2",
"eslint": "^9",
"execa": "^9.5.1",
"prettier": "^3.4.2",
Expand Down
2 changes: 1 addition & 1 deletion clis/vercel-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@fern-platform/configs": "workspace:*",
"@types/node": "^18.7.18",
"@types/yargs": "^17.0.32",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"tsx": "^4.7.1",
Expand Down
5 changes: 5 additions & 0 deletions fern/apis/fdr/definition/docs/v2/read/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ service:
response: GetSearchApiKeyForIndexSegmentResponse
errors:
- IndexSegmentNotFoundError

prepopulateFdrReadS3Bucket:
method: POST
path: /prepopulate-s3-bucket
docs: Prepopulates the FDR read S3 bucket with docs definitions

types:
DocsUrlMetadata:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"cookie": "0.7.0",
"cross-spawn": "7.0.5",
"elliptic": "6.6.0",
"esbuild": "0.20.2",
"esbuild": "0.24.2",
"eslint": "9.17.0",
"eslint-config-next": "15.1.2",
"instantsearch.js": "4.75.4",
Expand Down Expand Up @@ -81,7 +81,7 @@
"@typescript-eslint/parser": "8.18.1",
"@yarnpkg/sdks": "^3.1.0",
"chalk": "^5.3.0",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"dotenv": "^16.4.5",
"eslint": "^9",
"eslint-config-next": "15.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@types/node": "^18.7.18",
"@types/title": "^3.4.3",
"@types/ua-parser-js": "^0.7.39",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/fdr-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@fern-platform/configs": "workspace:*",
"@types/node": "^18.7.18",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@fern-platform/configs": "workspace:*",
"@types/node": "^18.7.18",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"simple-git": "^3.24.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/loadable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@fern-platform/configs": "workspace:*",
"@types/node": "^18.7.18",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/react-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@fern-platform/configs": "workspace:*",
"@types/node": "^18.7.18",
"@types/react": "^18",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"stylelint": "^16.1.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/fdr-sdk/src/docs/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "../client/generated/api/resources/docs/resources/latest";
export * from "./frontmatter";
export * from "./s3-docs-definition";
3 changes: 3 additions & 0 deletions packages/fdr-sdk/src/docs/s3-docs-definition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function getS3KeyForV1DocsDefinition(domain: string): string {
return `${domain}/v1/fdr.json`;
}
2 changes: 1 addition & 1 deletion packages/fern-docs/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@fern-platform/configs": "workspace:*",
"@types/node": "^18.7.18",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"prettier": "^3.4.2",
"stylelint": "^16.1.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/fern-docs/bundle/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const isTrailingSlashEnabled =
process.env.TRAILING_SLASH === "1" ||
process.env.NEXT_PUBLIC_TRAILING_SLASH === "1";

// TODO: move this to a shared location (this is copied in @fern-docs/ui FernImage.tsx)
const DOCS_FILES_ALLOWLIST = [
{
protocol: "https",
Expand Down Expand Up @@ -66,7 +67,7 @@ const nextConfig = {
"@fern-docs/components",
"@fern-docs/edge-config",
"@fern-docs/mdx",
"@fern-docs/next-seo",
"@fern-docs/seo",
"@fern-docs/search-server",
"@fern-docs/search-ui",
"@fern-docs/search-utils",
Expand Down Expand Up @@ -191,6 +192,10 @@ const nextConfig = {
config.externals = config.externals || [];
config.externals.push("esbuild");
}
config.resolve.fallback = {
...config.resolve.fallback,
crypto: false,
};
config.module.rules.push({
test: /\.(glsl|vs|fs|vert|frag)$/,
exclude: /node_modules/,
Expand Down
10 changes: 8 additions & 2 deletions packages/fern-docs/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"directory": "packages/fern-docs/bundle"
},
"sideEffects": false,
"browser": {
"crypto": false
},
"scripts": {
"depcheck": "depcheck",
"docs:build": "next build",
Expand All @@ -28,6 +31,7 @@
"@ai-sdk/openai": "^1.0.8",
"@algolia/client-search": "^5.15.0",
"@aws-sdk/client-s3": "^3.685.0",
"@aws-sdk/cloudfront-signer": "^3.723.0",
"@aws-sdk/s3-request-presigner": "^3.685.0",
"@fern-api/fdr-sdk": "workspace:*",
"@fern-api/ui-core-utils": "workspace:*",
Expand All @@ -39,6 +43,7 @@
"@fern-docs/search-server": "workspace:*",
"@fern-docs/search-ui": "workspace:*",
"@fern-docs/search-utils": "workspace:*",
"@fern-docs/seo": "workspace:*",
"@fern-docs/syntax-highlighter": "workspace:*",
"@fern-docs/ui": "workspace:*",
"@fern-docs/utils": "workspace:*",
Expand All @@ -57,9 +62,10 @@
"@workos-inc/node": "^7.31.0",
"ai": "^4.0.18",
"algoliasearch": "^5.13.0",
"braintrust": "^0.0.182",
"cssnano": "^6.0.3",
"es-toolkit": "^1.27.0",
"esbuild": "0.20.2",
"esbuild": "0.24.2",
"feed": "^4.2.2",
"iron-session": "^8.0.3",
"jose": "^5.2.3",
Expand All @@ -85,7 +91,7 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.16",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"eslint": "^9",
"glslify-import": "^3.1.0",
"glslify-loader": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { getDocsDomainEdge, getHostEdge } from "@/server/xfernhost/edge";
import { withDefaultProtocol } from "@fern-api/ui-core-utils";
import { APIKeyInjectionConfig, OryAccessTokenSchema } from "@fern-docs/auth";
import { getAuthEdgeConfig } from "@fern-docs/edge-config";
import { COOKIE_FERN_TOKEN } from "@fern-docs/utils";
import { removeTrailingSlash } from "next/dist/shared/lib/router/utils/remove-trailing-slash";
import { COOKIE_FERN_TOKEN, removeTrailingSlash } from "@fern-docs/utils";
import { cookies } from "next/headers";
import { NextRequest, NextResponse } from "next/server";
import urlJoin from "url-join";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SearchConfig, getSearchConfig } from "@fern-docs/search-utils";
import { provideRegistryService } from "@fern-docs/ui";
import { NextRequest, NextResponse } from "next/server";

export const runtime = "edge";
export const runtime = "nodejs";

export async function GET(
req: NextRequest
Expand Down
Loading

0 comments on commit a04bdf8

Please sign in to comment.