From ee6c5eb0c78c18254cc240987e75024f385e8004 Mon Sep 17 00:00:00 2001 From: armandobelardo Date: Tue, 1 Oct 2024 15:19:32 -0400 Subject: [PATCH 1/9] feat(seed): introduce scripts to generators so fern bot can build the SDKs --- packages/cli/cli/package.json | 4 +- packages/cli/configuration/package.json | 4 +- packages/core/package.json | 4 +- packages/seed/fern/definition/config.yml | 86 +++++++++++-------- packages/seed/package.json | 4 +- .../commands/register/registerGenerator.ts | 3 +- .../config/types/ArtifactMetadata.ts | 15 ++++ .../config/types/DockerScriptConfig.ts | 9 ++ .../types/{ScriptConfig.ts => Script.ts} | 3 +- .../types/SeedWorkspaceConfiguration.ts | 3 +- .../api/resources/config/types/index.ts | 4 +- pnpm-lock.yaml | 39 +++------ seed/fastapi/seed.yml | 11 +++ seed/go-fiber/seed.yml | 14 ++- seed/go-model/seed.yml | 14 ++- seed/go-sdk/seed.yml | 14 ++- seed/java-model/seed.yml | 9 +- seed/java-sdk/seed.yml | 15 ++-- seed/pydantic/seed.yml | 11 +++ seed/python-sdk/seed.yml | 38 +++++--- seed/ruby-model/seed.yml | 7 +- seed/ruby-sdk/seed.yml | 13 ++- seed/ts-express/seed.yml | 27 +++--- 23 files changed, 238 insertions(+), 113 deletions(-) create mode 100644 packages/seed/src/config/api/resources/config/types/ArtifactMetadata.ts create mode 100644 packages/seed/src/config/api/resources/config/types/DockerScriptConfig.ts rename packages/seed/src/config/api/resources/config/types/{ScriptConfig.ts => Script.ts} (65%) diff --git a/packages/cli/cli/package.json b/packages/cli/cli/package.json index 1066f0cf110..fa69594a205 100644 --- a/packages/cli/cli/package.json +++ b/packages/cli/cli/package.json @@ -74,7 +74,7 @@ "@fern-api/fern-definition-formatter": "workspace:*", "@fern-api/cli-migrations": "workspace:*", "@fern-api/fern-definition-schema": "workspace:*", - "@fern-fern/generators-sdk": "0.109.0-21be2e5be", + "@fern-fern/generators-sdk": "0.114.0-5745f9e74", "@fern-fern/fiddle-sdk": "0.0.584", "@types/get-port": "^4.2.0", "ansi-escapes": "^5.0.0", @@ -115,4 +115,4 @@ "prettier": "^2.7.1", "typescript": "4.6.4" } -} \ No newline at end of file +} diff --git a/packages/cli/configuration/package.json b/packages/cli/configuration/package.json index dec9724c9af..62afe1df14c 100644 --- a/packages/cli/configuration/package.json +++ b/packages/cli/configuration/package.json @@ -35,7 +35,7 @@ "@fern-api/fern-definition-schema": "workspace:*", "@fern-fern/fdr-cjs-sdk": "0.108.0-dcb0f740c", "@fern-fern/fiddle-sdk": "0.0.584", - "@fern-fern/generators-sdk": "0.109.0-21be2e5be", + "@fern-fern/generators-sdk": "0.114.0-5745f9e74", "find-up": "^6.3.0", "js-yaml": "^4.1.0", "lodash-es": "^4.17.21", @@ -57,4 +57,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} \ No newline at end of file +} diff --git a/packages/core/package.json b/packages/core/package.json index 5cc808d57cd..cccf57baf12 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "@fern-fern/fdr-cjs-sdk": "0.108.0-dcb0f740c", - "@fern-fern/generators-sdk": "0.107.0-00fe26566", + "@fern-fern/generators-sdk": "0.114.0-5745f9e74", "@fern-api/venus-api-sdk": "0.0.38", "@fern-fern/fdr-test-sdk": "^0.0.5297", "@fern-fern/fiddle-sdk": "0.0.584" @@ -44,4 +44,4 @@ "prettier": "^2.7.1", "typescript": "4.6.4" } -} \ No newline at end of file +} diff --git a/packages/seed/fern/definition/config.yml b/packages/seed/fern/definition/config.yml index ac997af6853..0a9fbbd6a04 100644 --- a/packages/seed/fern/definition/config.yml +++ b/packages/seed/fern/definition/config.yml @@ -6,9 +6,9 @@ types: publishGa: PublishCommand publishRc: PublishCommand publishDev: PublishCommand - changelogLocation: + changelogLocation: type: optional - docs: | + docs: | The location of the changelog file, the schema of which must follow FDR's `GeneratorReleaseRequest` object. SeedWorkspaceConfiguration: @@ -18,9 +18,9 @@ types: irVersion: string test: TestConfiguration publish: PublishConfiguration - changelogLocation: + changelogLocation: type: optional - docs: | + docs: | The location of the changelog file, the schema of which must follow FDR's `GeneratorReleaseRequest` object. language: optional @@ -28,20 +28,22 @@ types: defaultOutputMode: OutputMode generatorType: GeneratorType - customFixtureConfig: + artifactMetadata: optional + + customFixtureConfig: type: optional docs: | Configuration that will be used for any custom fixture specified by --custom-fixture fixtures: type: optional>> - scripts: optional> - allowedFailures: + scripts: optional> + allowedFailures: type: optional> - docs: | - List any fixtures that are okay to fail. For normal fixtures + docs: | + List any fixtures that are okay to fail. For normal fixtures just list the fixture name. For configured fixture list {fixture}:{outputFolder}. features: optional - + PublishDockerConfiguration: properties: context: string @@ -63,18 +65,18 @@ types: Commands can be multi-line, we'll run them all! properties: workingDirectory: optional - versionSubstitution: + versionSubstitution: type: optional - docs: | + docs: | The string to substitute for the version in the command. ex. `"$VERSION"` command: DockerCommand PublishConfiguration: discriminated: false - union: + union: - PublishDocker - PublishCommand - + TestDockerConfiguration: properties: image: string @@ -85,38 +87,50 @@ types: docker: TestDockerConfiguration local: optional - LocalBuildInfo: - properties: - workingDirectory: + LocalBuildInfo: + properties: + workingDirectory: type: string - docs: | - The working directory for the generator. - buildCommand: + docs: | + The working directory for the generator. + buildCommand: type: list - docs: | - The command to build the generator locally. - `yarn workspace @fern-api/openapi-generator build` for example. + docs: | + The command to build the generator locally. + `yarn workspace @fern-api/openapi-generator build` for example. runCommand: type: string - docs: | - The command to run the generator locally. + docs: | + The command to run the generator locally. `node generators/openapi/dist/cli.cjs` for example. - env: + env: type: optional> - docs: | + docs: | Environment variables to set when running the generator locally. - DockerCommand: + ArtifactMetadata: + docs: Metadata relating to the artifact produced by this generator + properties: + preInstallScript: optional