@bensandee/tooling 0.68.0 → 0.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/bst.mjs ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Stable bin target for `bst`.
4
+ *
5
+ * This file exists only so that `node_modules/.bin/bst` can be created, and it is committed
6
+ * rather than built for exactly that reason. pnpm links bins **during install**, and skips one
7
+ * whose target is missing -- so pointing `bin` straight at `dist/bin.mjs` works only in a tree
8
+ * that already happens to be built. A fresh checkout installs before it builds, pnpm warns
9
+ * (`Failed to create bin ... ENOENT`) and moves on, and building afterwards does not go back and
10
+ * create the link. Every later `pnpm exec bst` then fails with `Command "bst" not found`, which
11
+ * is what broke CI on this repo's own `check` script.
12
+ *
13
+ * The indirection costs one module load and makes the bin link independent of build state: the
14
+ * link always exists, and `dist/bin.mjs` only has to be there by the time someone runs it. When
15
+ * it is not, the failure is an explicit ERR_MODULE_NOT_FOUND naming the missing build output --
16
+ * a far better error than a command that appears not to exist.
17
+ *
18
+ * Consumers installing from the registry get both files (`files` ships `bin` and `dist`) and are
19
+ * unaffected either way, since a published tarball is always built.
20
+ *
21
+ * Loaded with a dynamic `await import` rather than a bare `import "../dist/bin.mjs"`, which is an
22
+ * unassigned import and trips `import(no-unassigned-import)`. Suppressing that rule would be the
23
+ * wrong trade for a file whose entire purpose is a side effect: the dynamic form says "run this"
24
+ * rather than "bring in these bindings", which is what is actually meant here.
25
+ */
26
+ await import("../dist/bin.mjs");