diff --git a/fern/pages/changelogs/cli/2025-01-03.mdx b/fern/pages/changelogs/cli/2025-01-03.mdx index 2fe5cdfd541..3184c1616d8 100644 --- a/fern/pages/changelogs/cli/2025-01-03.mdx +++ b/fern/pages/changelogs/cli/2025-01-03.mdx @@ -1,12 +1,12 @@ ## 0.46.18 **`(fix):`** If an object or request is annotated with `extra-properties: true` then the user can provide an example that includes -extra properties that are no longer in the schema. +extra properties that are no longer in the schema. -For example, check out this fern definition +For example, check out this fern definition ```yml service.yml types: - Item: + Item: extra-properties: true properties: id: string diff --git a/fern/pages/changelogs/cli/2025-01-05.mdx b/fern/pages/changelogs/cli/2025-01-05.mdx index a69a59145f8..e2f7050fb3b 100644 --- a/fern/pages/changelogs/cli/2025-01-05.mdx +++ b/fern/pages/changelogs/cli/2025-01-05.mdx @@ -1,6 +1,6 @@ ## 0.46.20 -**`(feat):`** The `fern init` command now supports a `--mintlify` option. You can pass in -the path to your `mint.json` and the Fern CLI will generate a fern documentation -website. +**`(feat):`** The `fern init` command now supports a `--mintlify` option. You can pass in +the path to your `mint.json` and the Fern CLI will generate a fern documentation +website. diff --git a/fern/pages/changelogs/cli/2025-01-10.mdx b/fern/pages/changelogs/cli/2025-01-10.mdx index d9e6d31ae0e..40060416719 100644 --- a/fern/pages/changelogs/cli/2025-01-10.mdx +++ b/fern/pages/changelogs/cli/2025-01-10.mdx @@ -1,7 +1,7 @@ ## 0.47.2 -**`(feat):`** The CLI now supports checking for broken links in your docs. You will see warnings in `fern check` if your docs link to any -page that can't be resolved, and the `--strict-broken-links` option will cause the command to fail (exit with a non-zero exit code) if -any broken links are found. You can also run the new command `fern docs broken-links` to only check for broken links (ignoring +**`(feat):`** The CLI now supports checking for broken links in your docs. You will see warnings in `fern check` if your docs link to any +page that can't be resolved, and the `--strict-broken-links` option will cause the command to fail (exit with a non-zero exit code) if +any broken links are found. You can also run the new command `fern docs broken-links` to only check for broken links (ignoring other possible errors), with the `--strict` option to cause the command to fail if any broken links are found. diff --git a/fern/pages/changelogs/cli/2025-01-12.mdx b/fern/pages/changelogs/cli/2025-01-12.mdx new file mode 100644 index 00000000000..29d1a647440 --- /dev/null +++ b/fern/pages/changelogs/cli/2025-01-12.mdx @@ -0,0 +1,4 @@ +## 0.47.3 +**`(feat):`** Add the JSON schema to the generators.yml file for validation and autocomplete. + + diff --git a/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts b/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts index 7215044171f..467f25ade78 100644 --- a/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts +++ b/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts @@ -49,7 +49,11 @@ export async function addGeneratorToWorkspaces({ return; } - await writeFile(absolutePathToGeneratorsConfiguration, yaml.dump(newConfiguration)); + await writeFile( + absolutePathToGeneratorsConfiguration, + "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + + yaml.dump(newConfiguration) + ); context.logger.info(chalk.green(`Added ${generatorName} generator`)); }); }) diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 8a00ff06052..2ecdb5bd753 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,8 +1,15 @@ - changelogEntry: - summary: | - The CLI now supports checking for broken links in your docs. You will see warnings in `fern check` if your docs link to any - page that can't be resolved, and the `--strict-broken-links` option will cause the command to fail (exit with a non-zero exit code) if - any broken links are found. You can also run the new command `fern docs broken-links` to only check for broken links (ignoring + Add the JSON schema to the generators.yml file for validation and autocomplete. + type: feat + irVersion: 53 + version: 0.47.3 + +- changelogEntry: + - summary: | + The CLI now supports checking for broken links in your docs. You will see warnings in `fern check` if your docs link to any + page that can't be resolved, and the `--strict-broken-links` option will cause the command to fail (exit with a non-zero exit code) if + any broken links are found. You can also run the new command `fern docs broken-links` to only check for broken links (ignoring other possible errors), with the `--strict` option to cause the command to fail if any broken links are found. type: feat irVersion: 53 @@ -10,8 +17,8 @@ - changelogEntry: - summary: | - Fixes a bug where the OpenAPI parser stopped respecting the =`unions: v1` setting in your `generators.yml` which configures the parser to generate more - idiomatic discriminated unions. + Fixes a bug where the OpenAPI parser stopped respecting the =`unions: v1` setting in your `generators.yml` which configures the parser to generate more + idiomatic discriminated unions. ```yml api: specs: @@ -44,27 +51,27 @@ type: feat irVersion: 53 version: 0.46.22 - -- changelogEntry: + +- changelogEntry: - summary: | The CLI now supports the `prefer-undiscriminated-unions-with-literals` setting in OpenAPI settings. type: fix irVersion: 53 version: 0.46.21 -- changelogEntry: +- changelogEntry: - summary: | - The `fern init` command now supports a `--mintlify` option. You can pass in - the path to your `mint.json` and the Fern CLI will generate a fern documentation - website. + The `fern init` command now supports a `--mintlify` option. You can pass in + the path to your `mint.json` and the Fern CLI will generate a fern documentation + website. type: feat irVersion: 53 version: 0.46.20 - changelogEntry: - summary: | - If a schema in OpenAPI or AsyncAPI has `additionalProperties: true` then the Fern CLI will now respect bringing in - example properties that are not defined in the schema. Previously, the CLI would skip them. + If a schema in OpenAPI or AsyncAPI has `additionalProperties: true` then the Fern CLI will now respect bringing in + example properties that are not defined in the schema. Previously, the CLI would skip them. type: fix irVersion: 53 version: 0.46.19 @@ -72,13 +79,13 @@ - changelogEntry: - summary: | If an object or request is annotated with `extra-properties: true` then the user can provide an example that includes - extra properties that are no longer in the schema. + extra properties that are no longer in the schema. + + For example, check out this fern definition - For example, check out this fern definition - ```yml service.yml types: - Item: + Item: extra-properties: true properties: id: string diff --git a/packages/cli/ete-tests/src/tests/add/__snapshots__/add.test.ts.snap b/packages/cli/ete-tests/src/tests/add/__snapshots__/add.test.ts.snap index 54c7c518522..53254d089b0 100644 --- a/packages/cli/ete-tests/src/tests/add/__snapshots__/add.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/add/__snapshots__/add.test.ts.snap @@ -92,7 +92,8 @@ errors: "type": "file", }, { - "contents": "default-group: local + "contents": "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json +default-group: local groups: local: generators: diff --git a/packages/cli/ete-tests/src/tests/init/__snapshots__/init.test.ts.snap b/packages/cli/ete-tests/src/tests/init/__snapshots__/init.test.ts.snap index 5c9247ba7dd..1d90e588349 100644 --- a/packages/cli/ete-tests/src/tests/init/__snapshots__/init.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/init/__snapshots__/init.test.ts.snap @@ -105,7 +105,8 @@ colors: "type": "file", }, { - "contents": "default-group: local + "contents": "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json +default-group: local groups: local: generators: @@ -186,7 +187,8 @@ exports[`fern init > init openapi 1`] = ` "type": "file", }, { - "contents": "default-group: local + "contents": "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json +default-group: local groups: local: generators: @@ -422,7 +424,8 @@ errors: "type": "file", }, { - "contents": "default-group: local + "contents": "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json +default-group: local groups: local: generators: diff --git a/packages/cli/init/src/createWorkspace.ts b/packages/cli/init/src/createWorkspace.ts index 6d2264853a9..a474825ae9b 100644 --- a/packages/cli/init/src/createWorkspace.ts +++ b/packages/cli/init/src/createWorkspace.ts @@ -132,7 +132,8 @@ async function writeGeneratorsConfiguration({ }): Promise { await writeFile( filepath, - yaml.dump(await getDefaultGeneratorsConfiguration({ cliVersion, context, apiConfiguration })) + "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + + yaml.dump(await getDefaultGeneratorsConfiguration({ cliVersion, context, apiConfiguration })) ); }