Skip to content

Commit

Permalink
fix: reorganize fern docs
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Dec 19, 2024
1 parent ece9ae7 commit 645965e
Show file tree
Hide file tree
Showing 3,162 changed files with 59,081 additions and 43,366 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 11 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ module.exports = {
"@typescript-eslint/no-empty-function": [
"error",
{
allow: ["private-constructors", "protected-constructors", "decoratedFunctions"],
allow: [
"private-constructors",
"protected-constructors",
"decoratedFunctions",
],
},
],
"@typescript-eslint/await-thenable": "error",
Expand Down Expand Up @@ -127,7 +131,11 @@ module.exports = {
},
},
{
files: ["packages/fdr-sdk/**/*", "servers/fdr-deploy/**/*", "servers/fdr/**/*"],
files: [
"packages/fdr-sdk/**/*",
"servers/fdr-deploy/**/*",
"servers/fdr/**/*",
],
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand All @@ -144,7 +152,7 @@ module.exports = {
},
},
{
files: ["packages/ui/**/*"],
files: ["packages/fern-docs/**/*"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
Expand Down
14 changes: 10 additions & 4 deletions .eslintrc.lint-staged.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
const DEFAULT_CONFIG = require("./.eslintrc.js");

const TYPESCRIPT_ESLINT = "@typescript-eslint";
const TYPESCRIPT_ESLINT_PARSER_OPTIONS = new Set(["project", "allowAutomaticSingleRunInference", "tsconfigRootDir"]);
const TYPESCRIPT_ESLINT_PARSER_OPTIONS = new Set([
"project",
"allowAutomaticSingleRunInference",
"tsconfigRootDir",
]);

module.exports = {
...DEFAULT_CONFIG,
extends: [
...DEFAULT_CONFIG.extends.filter((extended) => !extended.startsWith(`plugin:${TYPESCRIPT_ESLINT}/`)),
...DEFAULT_CONFIG.extends.filter(
(extended) => !extended.startsWith(`plugin:${TYPESCRIPT_ESLINT}/`)
),
// needed to disable recommended eslint rules that don't apply
"plugin:@typescript-eslint/eslint-recommended",
],
Expand All @@ -17,7 +23,7 @@ module.exports = {
}
return newParserOptions;
},
{},
{}
),
rules: Object.entries(DEFAULT_CONFIG.rules).reduce(
(newRules, [ruleId, rule]) => {
Expand All @@ -28,7 +34,7 @@ module.exports = {
},
{
"no-unused-vars": "off",
},
}
),
};

Expand Down
5 changes: 2 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
* @dsinghvi
packages/template-resolver/** @armandobelardo
packages/ui/** @abvthecity
packages/ui/fern-dashboard/** @armandobelardo
packages/fern-docs/** @abvthecity
packages/parsers/** @RohinBhargava
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ jobs:
uses: ./.github/actions/install

- name: Build components
run: pnpm turbo --filter=@fern-ui/components compile
run: pnpm turbo --filter=@fern-docs/components compile

- name: Run Chromatic
uses: chromaui/action@latest
# Chromatic CI config: https://www.chromatic.com/docs/github-actions/
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: packages/ui/components
workingDir: packages/fern-docs/components
onlyChanged: true

fern-generate:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs-bundle-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy @fern-ui/docs-bundle (dev)
name: Deploy @fern-docs/bundle (dev)

on:
push:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
token: ${{ secrets.VERCEL_TOKEN }}
project: "app-dev.buildwithfern.com"
package: "@fern-ui/docs-bundle"
package: "@fern-docs/bundle"
environment: "production"
branch: main

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy-docs-bundle-preview.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Preview @fern-ui/docs-bundle
name: Preview @fern-docs/bundle

on:
pull_request:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
with:
token: ${{ secrets.VERCEL_TOKEN }}
project: "app.buildwithfern.com"
package: "@fern-ui/docs-bundle"
package: "@fern-docs/bundle"
environment: "preview"
branch: ${{ github.event.pull_request.head.ref || github.ref_name || github.ref }}

Expand Down Expand Up @@ -100,26 +100,26 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bundle
path: packages/ui/docs-bundle/.next/analyze/__bundle_analysis.json
path: packages/fern-docs/bundle/.next/analyze/__bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v6
if: success() && github.event.number
with:
workflow: deploy-docs-bundle-preview.yml
branch: ${{ github.event.pull_request.base.ref }}
path: packages/ui/docs-bundle/.next/analyze/base
path: packages/fern-docs/bundle/.next/analyze/base

# https://infrequently.org/2021/03/the-performance-inequality-gap/
- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR packages/ui/docs-bundle/.next/analyze/base && pnpm --package=nextjs-bundle-analysis dlx compare
run: ls -laR packages/fern-docs/bundle/.next/analyze/base && pnpm --package=nextjs-bundle-analysis dlx compare

- name: Comment PR Bundle Analysis
if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
filePath: packages/ui/docs-bundle/.next/analyze/__bundle_analysis_comment.txt
filePath: packages/fern-docs/bundle/.next/analyze/__bundle_analysis_comment.txt
comment_tag: bundle_analysis

deploy-dev:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs-bundle-prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy @fern-ui/docs-bundle
name: Deploy @fern-docs/bundle

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-fdr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- ".github/workflows/publish-fdr-sdk.yml"
- "packages/fdr-sdk/**"
# Remove this once fdr is no longer needed in the generation
- "packages/ui/fern-docs-search-server/**"
- "packages/fern-docs/search-server/**"
- "pnpm-lock.yaml"

env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-fontawesome-cdn.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy @fern-ui/fontawesome-cdn
name: Deploy @fern-docs/icons-cdn

on:
push:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
token: ${{ secrets.VERCEL_TOKEN }}
project: "icons.ferndocs.com"
package: "@fern-ui/fontawesome-cdn"
package: "@fern-docs/icons-cdn"
environment: "production"
branch: main

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-local-preview-bundle-dryrun.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy @fern-ui/local-preview-bundle (Dry Run)
name: Deploy @fern-docs/local-preview-bundle (Dry Run)

on:
pull_request:
Expand Down Expand Up @@ -26,9 +26,9 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: pnpm turbo --filter=@fern-docs/local-preview-bundle build
- name: Synthesize local preview bundle
run: pnpm --filter=@fern-ui/cdk run synth:dev2
run: pnpm --filter=@fern-platform/cdk run synth:dev2

prod:
runs-on: ubuntu-latest
Expand All @@ -44,6 +44,6 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: pnpm turbo --filter=@fern-docs/local-preview-bundle build
- name: Synthesize local preview bundle
run: pnpm --filter=@fern-ui/cdk run synth:prod
run: pnpm --filter=@fern-platform/cdk run synth:prod
10 changes: 5 additions & 5 deletions .github/workflows/deploy-local-preview-bundle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy @fern-ui/local-preview-bundle
name: Deploy @fern-docs/local-preview-bundle

on:
workflow_dispatch: {}
Expand Down Expand Up @@ -31,9 +31,9 @@ jobs:
- name: Build local preview bundle
run: |
pnpm compile
ENABLE_SOURCE_MAPS=true pnpm turbo --filter=@fern-ui/local-preview-bundle build
ENABLE_SOURCE_MAPS=true pnpm turbo --filter=@fern-docs/local-preview-bundle build
- name: Deploy local preview bundle
run: pnpm --filter=@fern-ui/cdk run deploy:dev2
run: pnpm --filter=@fern-platform/cdk run deploy:dev2

prod:
runs-on: ubuntu-latest
Expand All @@ -50,6 +50,6 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: pnpm turbo --filter=@fern-docs/local-preview-bundle build
- name: Deploy local preview bundle
run: pnpm --filter=@fern-ui/cdk run deploy:prod
run: pnpm --filter=@fern-platform/cdk run deploy:prod
11 changes: 3 additions & 8 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 4,
"overrides": [
{
"files": "*.{yml,yaml,json,md,mdx}",
"options": {
"tabWidth": 2
}
},
{
"files": "*.{json,cjs}",
"options": {
"trailingComma": "none"
}
}
]
],
"plugins": ["prettier-plugin-packagejson"]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"type": "node-terminal",
"request": "launch",
"command": "pnpm docs:dev",
"cwd": "${workspaceFolder}/packages/ui/docs-bundle",
"cwd": "${workspaceFolder}/packages/fern-docs/bundle",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ To build and run the NextJS docs UI, run:
The frontend is served at `localhost:3000`. You can configure which docs are loaded by using `.env.local`:

```bash
# packages/ui/docs-bundle/.env.local
# packages/fern-docs/bundle/.env.local

# uncomment the next line when targeting the production cloud environment
# NEXT_PUBLIC_DOCS_DOMAIN=proficientai.docs.buildwithfern.com
Expand All @@ -103,8 +103,8 @@ Then link vercel to the project:
- When prompted to link to the project, say `yes`

Then, run `vercel pull`, which will create `/fern-platform/.vercel/.env.development.local`
Then, copy that file (creating if necessary) to `/fern-platform/packages/ui/docs-bundle/.env.local`
Finally, to run the dev server, `cd /packages/ui/docs-bundle` and run `pnpm docs:dev`, which should begin running on `localhost:3000`
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`

Expand Down
7 changes: 6 additions & 1 deletion clis/generator-cli/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"ignores": ["@types/jest", "@types/node", "esbuild", "@yarnpkg/esbuild-plugin-pnp"],
"ignores": [
"@types/jest",
"@types/node",
"esbuild",
"@yarnpkg/esbuild-plugin-pnp"
],
"ignore-patterns": ["lib", "dist"]
}
24 changes: 12 additions & 12 deletions clis/generator-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
{
"name": "@fern-api/generator-cli",
"version": "0.0.0",
"files": [
"dist"
],
"type": "module",
"source": "src/index.ts",
"main": "dist/cli.cjs",
"source": "src/index.ts",
"bin": {
"generator-cli": "dist/cli.cjs"
},
"files": [
"dist"
],
"scripts": {
"clean": "rm -rf ./dist && tsc --build --clean",
"compile": "tsup ./src/cli.ts --format cjs && echo '#!/usr/bin/env node' | cat - dist/cli.cjs > dist/tmp && mv dist/tmp dist/cli.cjs",
"test": "vitest --run --passWithNoTests --globals --disable-console-intercept",
"test:update": "vitest -u --run --passWithNoTests --globals --disable-console-intercept",
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
"format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"organize-imports": "organize-imports-cli tsconfig.json",
"depcheck": "depcheck"
"test": "vitest --run --passWithNoTests --globals --disable-console-intercept",
"test:update": "vitest -u --run --passWithNoTests --globals --disable-console-intercept"
},
"dependencies": {
"es-toolkit": "^1.30.0"
},
"devDependencies": {
"@fern-api/fs-utils": "0.15.0-rc63",
Expand All @@ -42,8 +45,5 @@
"typescript": "4.9.5",
"vitest": "^2.1.4",
"yargs": "^17.4.1"
},
"dependencies": {
"es-toolkit": "^1.30.0"
}
}
Loading

0 comments on commit 645965e

Please sign in to comment.