Commit c94955c
committed
Build with tsdown instead of tsup
tsup is no longer maintained (its README now points at tsdown). tsdown is
the rolldown-based successor from the same lineage.
- migrate all 25 build configs; published files now use explicit .mjs/.cjs
extensions, which is what rolldown emits and removes the ambiguity that
made module-format detection guess wrong
- code splitting cannot be disabled in tsdown, so the self-contained CJS
bundles (varlock init-server/init-edge) each get their own build. A
shared chunk in those would emit a require() that cannot resolve where
they get injected into webpack/turbopack runtimes
- rolldown otherwise rewrites bare `require` into a shim calling
createRequire(import.meta.url) at module scope. That is undefined in
workerd, and it defeats the `typeof require === 'function'` guards that
keep runtime/crypto.ts evaluable in edge runtimes, so polyfillRequire is
off
- @env-spec/utils now emits declarations, which lets tsdown inline its
types. varlock's published d.ts has been shipping a broken import of
@env-spec/utils/type-utils, hidden only by skipLibCheck
- drop keepNames: it was an esbuild-era workaround, and with tsdown it
leaked a runtime-chunk import into the parser's declaration files.
Class names survive without it since these builds never minify
- port keepass's esbuild resolver plugin to a rolldown resolveId hook
- infisical patched its bundle by string-replacing 'use strict', which
tsdown does not emit. Use a real banner instead
- the extension change breaks extensionless runtime resolution, so the
nextjs webpack loader and the astro injected route are now explicit
- drop two entries that pointed at files which no longer exist; tsup
ignored them silently, tsdown errors
Also enable publint and attw on every publishable package's build. Both
fail the build on real errors, so exports and type-resolution problems
surface at build time instead of after publish.
attw profile is per package: esm-only where we only ship esm (the node10
algorithm and require() from a cjs consumer are both out of scope), node16
for the genuinely dual and cjs-only packages.
Fixing what they found:
- repository.url everywhere is a full git+https URL
- @varlock/nextjs-integration declares "type": "commonjs" rather than making
node sniff it, which is accurate: it is cjs-only to match @next/env. Its
tsdown config moves to .mts, since node otherwise loads the .ts config as
CJS and tsdown is ESM-only
- @env-spec/parser declares "type": "module". Its published output is all
explicit .mjs/.cjs so the field governs nothing there, but src/grammar.js
is generated by peggy with format: 'es', and that is the one bare .js the
field does govern
- keepass now emits declarations like every other plugin. dts was off there
under tsup; it works fine now, and attw flagged the package as untyped
- varlock/test-helpers is internal, so it keeps only the `ts-src` condition
and is excluded from attw. Vitest resolves dependencies through the ssr
pipeline, which does not inherit resolve.conditions, so the plugin vitest
configs now set ssr.resolve.conditions too
Review follow-ups (pullfrog on #1021), all the same class of bug: strings in
source that resolve against built output, which nothing typechecks.
- the turbopack symlink fallback still aliased four .js runtime files. That
branch only runs when varlock is symlinked, so the framework tests (which
install from packed tarballs) never execute it
- .github/workflows/deploy-tests.yaml invoked dist/cli/cli-executable.js
- .github/workflows/bundle-size-check.yaml filtered on the removed
tsup.config.ts, so a change to the active build config would have silently
skipped the size check
Add a test pinning that invariant for the nextjs integration: every
hardcoded dist path and every relative require.resolve must name a file the
build actually emits, with an explicit extension.
Also drop two tsup-era workarounds that tsdown makes unnecessary, and update
comments that still named tsup.config.ts:
- the `typeof execSync` type workaround for egoist/tsup#1367
- the vite integration force-externalized `crypto` for SSR because esbuild
stripped the node: prefix, leaving varlock's dist importing bare 'crypto'.
rolldown preserves the prefix (dist has no bare node builtins at all), and
vite auto-externalizes node:-prefixed specifiers
Fix the bundle-size report, which counted only .d.ts/.d.cts as type defs. Every
ESM declaration is .d.mts now, and a .d.mts matches neither that test nor the
js test, so 82.7KB of type defs fell out of the breakdown entirely and the
report showed a bogus -98% drop. Type defs actually grew ~10%, which is
expected: @env-spec/utils types are inlined rather than imported.
Add an "Other" row for anything the buckets do not recognise, so a future
extension change shows up instead of silently vanishing.1 parent 1277ae4 commit c94955c
106 files changed
Lines changed: 955 additions & 676 deletions
File tree
- .bumpy
- .github/workflows
- packages
- ci-env-info
- env-spec-parser
- scripts
- integrations
- astro
- src
- cloudflare
- bin
- src
- expo
- src
- nextjs
- src
- test
- vite
- src
- native-helpers
- darwin
- linux-arm64
- linux-x64
- win32-x64
- plugins
- 1password
- akeyless
- aws-secrets
- azure-key-vault
- bitwarden
- dashlane
- doppler
- google-secret-manager
- hashicorp-vault
- infisical
- keepass
- src
- test
- keeper
- kubernetes
- passbolt
- pass
- proton-pass
- utils
- varlock
- bin
- scripts
- src
- lib
- vscode-plugin
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | | - | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | | - | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | | - | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments