chore(internal): improve build scripts #10872
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Standardizes build scripts across all generator packages by consolidating disparate build approaches into a unified
build.mjssystem. This PR eliminates custombuild.cjsfiles and directtsupcalls in favor of the centralized@fern-api/configs/build-utils.mjsutilities.Changes
Build Script Standardization
build.mjsfiles usingbuildGenerator()helper across:Dynamic Snippets Cleanup
build.cjs) from dynamic-snippets packages:distscripts from dynamic-snippetspackage.jsonfilestsup,@esbuild-plugins/node-globals-polyfill, and@esbuild-plugins/node-modules-polyfillfrom packages that no longer need themBase Package Cleanup
dist:cliandpublish:cliscripts from go-v2/base, java-v2/base, and php/basetsupdependency from these base packagesProtoc-gen Package Cleanup
protoc-gen-fern:build.tsconfig.json(custom TypeScript config for dist builds)distscript frompackage.jsondistscript was creating adist/cjs/folder with compiled code. This was being incorrectly picked up by pnpm because it contained adist/cjs/package.json, when it should have been using the rootpackage.jsoninstead. Since the script wasn't being used in the standard build flow, it was safe to remove.Updated Build Commands
All affected
package.jsonfiles now use:Instead of inline
tsupcommands or custombuild.cjsscripts.Benefits
@fern-api/configs/build-utils.mjsTesting
pnpm dist:cli,pnpm dockerTagLatest) work correctly for all affected generators