Skip to content

chore: stop tracking generated utils/version.ts - #429

Open
matthewelwell wants to merge 1 commit into
mainfrom
chore/release-please-sdk-version
Open

matthewelwell wants to merge 1 commit into
mainfrom
chore/release-please-sdk-version

Conversation

@matthewelwell

@matthewelwell matthewelwell commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

utils/version.ts is a build artifact generated by write-version.js, and .gitignore:45 says so — but it was committed in the same PR that added the ignore rule (#332), so the rule never took effect. It shows as modified after every build, and its committed contents had drifted to 11.0.0 against a 12.4.0 package. Published packages were never affected (@flagsmith/flagsmith@12.4.0 correctly embeds 12.4.0), since both workflows run npm run build and its prebuild step regenerates the file.

Untracking it means a fresh clone has no utils/version.ts and nothing generates it before npm test / npm run typecheck, which then fail with Cannot find module './utils/version' — so generation moves to prepare, which npm runs after npm i.

🤖 Generated with Claude Code

@matthewelwell
matthewelwell requested a review from a team as a code owner October 6, 2026 07:35
@matthewelwell
matthewelwell requested review from kyle-ssg and removed request for a team October 6, 2026 07:35
@matthewelwell
matthewelwell force-pushed the chore/release-please-sdk-version branch from d289c7b to 4e5765c Compare October 6, 2026 08:05
@matthewelwell matthewelwell changed the title chore: have release-please keep SDK_VERSION in step chore: stop tracking generated utils/version.ts Oct 6, 2026
utils/version.ts is a build artifact generated by write-version.js, and
.gitignore:45 says so. It was nonetheless committed in the same PR that
added the ignore rule (#332), so the rule has never had any effect: the
file is tracked, shows as modified after every build, and its committed
contents drifted to 11.0.0 against a 12.4.0 package.

Published packages were never affected - publish.yml and pull-request.yml
both run `npm run build`, whose prebuild step regenerates the file from
lib/flagsmith/package.json. The published @Flagsmith/flagsmith@12.4.0
correctly embeds 12.4.0.

Untrack it so the ignore rule applies. Nothing generated it on install,
so `npm test` and `npm run typecheck` would fail on a fresh clone with
"Cannot find module './utils/version'"; generating it from `prepare`
fixes that, since npm runs prepare after `npm i`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@matthewelwell
matthewelwell force-pushed the chore/release-please-sdk-version branch from 4e5765c to 44c9262 Compare October 6, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant