Skip to content

chore: add prepare script so git-URL installs auto-build#6

Merged
mpge merged 1 commit into
masterfrom
chore/add-prepare-script
Apr 19, 2026
Merged

chore: add prepare script so git-URL installs auto-build#6
mpge merged 1 commit into
masterfrom
chore/add-prepare-script

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 19, 2026

Summary

Enable consumers to install the SDK from a GitHub URL (e.g. npm install github:escalated-dev/escalated-plugin-sdk#v0.1.0) without committing build output to the repo. npm runs the prepare lifecycle immediately after cloning a git dep, so declaring prepare: npm run build here makes the git-ref install produce a working build/ tree automatically.

This unblocks escalated-adonis#34: the adonis package has 6 direct TS2307 errors on @escalated-dev/plugin-sdk plus ~39 cascading implicit-any errors downstream. Once this PR merges and we tag a release, adonis can reference the SDK as a real (non-stubbed, non-hacked) dep.

Also aligns npm test with what CI runs (npx tsx --test ...). The old node --test tests/**/*.test.ts failed locally because the test files use .js ESM imports that Node's NodeNext resolver can't load without tsx's type-stripping step.

Test plan

  • rm -rf build/ && npm ci now produces a complete build/ tree via the new prepare hook
  • npm test — 5 tests pass
  • CI run-tests.yml is unchanged — still runs npm ci && npm run build && npx tsx --test; the extra build after prepare is a harmless double-build

Consumers that install this package from a GitHub URL
(e.g. `npm i github:escalated-dev/escalated-plugin-sdk#v0.1.0` from
escalated-adonis) need the build/ artifacts to exist before import-
resolution runs. npm calls the `prepare` lifecycle script right after
cloning a git dep, so declaring it here makes the package usable from a
git ref without committing build output to the repo.

Also align `npm test` with what CI runs (`npx tsx --test ...`). The old
`node --test tests/**/*.test.ts` failed locally because Node's module
resolver with NodeNext can't load the `.js`-suffixed ESM imports in
test files without tsx's type-stripping step.
@mpge mpge merged commit e8d8023 into master Apr 19, 2026
2 checks passed
@mpge mpge deleted the chore/add-prepare-script branch April 19, 2026 20:10
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