fix: read version from package.json instead of modifying session.ts (#753)
I am working to simplify the build process. As a first step, update `session.ts` so it reads the `version` from `package.json` at runtime so we no longer have to modify it during the build process. I want to get to a place where the build looks like: ``` cd codex-cli pnpm i pnpm build RELEASE_DIR=$(mktemp -d) cp -r bin "$RELEASE_DIR/bin" cp -r dist "$RELEASE_DIR/dist" cp -r src "$RELEASE_DIR/src" # important if we want sourcemaps to continue to work cp ../README.md "$RELEASE_DIR" VERSION=$(printf '0.1.%d' $(date +%y%m%d%H%M)) jq --arg version "$VERSION" '.version = $version' package.json > "$RELEASE_DIR/package.json" ``` Then the contents of `$RELEASE_DIR` should be good to `npm publish`, no?
This commit is contained in:
@@ -640,7 +640,7 @@ To publish a new version of the CLI, run the release scripts defined in `codex-c
|
||||
3. Bump the version and `CLI_VERSION` to current datetime: `pnpm release:version`
|
||||
4. Commit the version bump (with DCO sign-off):
|
||||
```bash
|
||||
git add codex-cli/src/utils/session.ts codex-cli/package.json
|
||||
git add codex-cli/package.json
|
||||
git commit -s -m "chore(release): codex-cli v$(node -p \"require('./codex-cli/package.json').version\")"
|
||||
```
|
||||
5. Copy README, build, and publish to npm: `pnpm release`
|
||||
|
||||
Reference in New Issue
Block a user