diff --git a/README.md b/README.md index 8113be23686..a619e65fded 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,13 @@ We welcome contributions via pull requests! Here are some guidelines to help you 3. Ensure you have the required dependencies installed by running: `pnpm install` (assuming pnpm version `8.x`). 4. Make your desired changes and, if applicable, include tests to validate your modifications. 5. Run the following commands to ensure the integrity of your changes: + - `pnpm codegen`: Re-generate the package entrypoints in case you have changed the structure of a package or introduced a new module. - `pnpm check`: Verify that the code compiles. - `pnpm test`: Execute the tests. - `pnpm circular`: Confirm there are no circular imports. - `pnpm lint`: Check for code style adherence (if you happen to encounter any errors during this process, you can use `pnpm lint-fix` to automatically fix some of these style issues). - `pnpm dtslint`: Run type-level tests. - - `pnpm docgen`: Update the automatically generated documentation. + - `pnpm docgen`: Check the integrity of the generated documentation. 6. Create a changeset for your changes: before committing your changes, create a changeset to document the modifications. This helps in tracking and communicating the changes effectively. To create a changeset, run the following command: `pnpm changeset`. Always choose the `patch` option when prompted (please note that we are currently in pre-release mode). 7. Commit your changes: after creating the changeset, commit your changes with a descriptive commit message: `git commit -am 'Add some feature'`. 8. Push your changes to your fork: `git push origin my-new-feature`. diff --git a/package.json b/package.json index 5396312a27b..39b1f2143f8 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ ], "scripts": { "clean": "node scripts/clean.mjs", + "codegen": "pnpm --recursive --parallel run codegen", "build": "tsc -b tsconfig.build.json && pnpm --recursive --parallel run build", "circular": "madge --extensions ts --circular --no-color --no-spinner packages/*/src", "test": "vitest", diff --git a/packages/cli/package.json b/packages/cli/package.json index e29f96076fb..84795898ad8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/effect/package.json b/packages/effect/package.json index 2ef84e8431b..1258b955e6e 100644 --- a/packages/effect/package.json +++ b/packages/effect/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/experimental/package.json b/packages/experimental/package.json index 7af0676a437..6a066d05278 100644 --- a/packages/experimental/package.json +++ b/packages/experimental/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index fb2c43d9321..f8685d03e91 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/platform-browser/package.json b/packages/platform-browser/package.json index 86757759d00..c5288d845d8 100644 --- a/packages/platform-browser/package.json +++ b/packages/platform-browser/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/platform-bun/package.json b/packages/platform-bun/package.json index a71be698add..e9b62b0ae67 100644 --- a/packages/platform-bun/package.json +++ b/packages/platform-bun/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/platform-node/package.json b/packages/platform-node/package.json index 122aa580670..cfcf1ce34ed 100644 --- a/packages/platform-node/package.json +++ b/packages/platform-node/package.json @@ -31,8 +31,8 @@ "node": ">=18.0.0" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/printer-ansi/package.json b/packages/printer-ansi/package.json index 404ba35ef40..ce313863561 100644 --- a/packages/printer-ansi/package.json +++ b/packages/printer-ansi/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/printer/package.json b/packages/printer/package.json index 06f5815f4bb..2677ab11490 100644 --- a/packages/printer/package.json +++ b/packages/printer/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/rpc-http-node/package.json b/packages/rpc-http-node/package.json index d1e50a53968..6978649f055 100644 --- a/packages/rpc-http-node/package.json +++ b/packages/rpc-http-node/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/rpc-http/package.json b/packages/rpc-http/package.json index ba954cca487..4dbdf6aff60 100644 --- a/packages/rpc-http/package.json +++ b/packages/rpc-http/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/rpc-nextjs/package.json b/packages/rpc-nextjs/package.json index 338617e3e7c..5ea34f30991 100644 --- a/packages/rpc-nextjs/package.json +++ b/packages/rpc-nextjs/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/rpc-workers/package.json b/packages/rpc-workers/package.json index 442d73a7fb6..0d4d6244992 100644 --- a/packages/rpc-workers/package.json +++ b/packages/rpc-workers/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/rpc/package.json b/packages/rpc/package.json index 4683c256bfd..3f7148e29ee 100644 --- a/packages/rpc/package.json +++ b/packages/rpc/package.json @@ -28,8 +28,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/schema/package.json b/packages/schema/package.json index fecd6065b44..a300f0790a6 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -32,8 +32,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps", diff --git a/packages/typeclass/package.json b/packages/typeclass/package.json index addc573d7f3..a2d3cfe0bba 100644 --- a/packages/typeclass/package.json +++ b/packages/typeclass/package.json @@ -30,8 +30,8 @@ "directory": "dist" }, "scripts": { - "build": "pnpm build-prepare && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", - "build-prepare": "build-utils prepare-v2", + "codegen": "build-utils prepare-v2", + "build": "pnpm codegen && pnpm build-esm && pnpm build-cjs && pnpm build-annotate && build-utils pack-v2", "build-esm": "tsc -b tsconfig.build.json", "build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", "build-annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps",