Skip to content

No lockfile + loosely-pinned dependencies makes builds fragile to upstream drift #4

Description

@michielbdejong

Problem

OLSKBundleClearPackageLock() (invoked from olsk-bundle, this repo's setup/postinstall step) deliberately deletes package-lock.json, and several dependencies are pinned loosely (git refs with no commit SHA, "latest", bare majors). This means the exact dependency graph resolved on any given day is not reproducible.

Concrete instance

While working on #1, npm run build failed with:

TypeError: require(...) is not a constructor
  at OLSKRollupPluginLocalize/main.js:62 -> new (require('magic-string'))(...)

because the unpinned transitive magic-string resolved to 1.1.0, which is ESM-only ("type": "module", no CJS entry) — incompatible with the require() call. Fixed for now via a package.json overrides pin to ^0.25.0, but the same class of break can recur with any other loosely-pinned transitive dependency whenever upstream publishes a new major.

Suggested next steps

  • Consider committing a lockfile (tension with OLSKBundleClearPackageLock's intent — worth a design discussion across the OLSK toolchain, not just this repo)
  • Or: audit and pin the dependencies most likely to break (build-time rollup/babel plugins, similar to the magic-string override already added)

https://claude.ai/code/session_01AcjKc8vk2fb84yYZsE8k5d

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions