@ttsc/unplugin 0.28.3 → 0.28.5

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.
Files changed (46) hide show
  1. package/README.md +70 -8
  2. package/lib/api.js +3 -0
  3. package/lib/api.js.map +1 -1
  4. package/lib/api.mjs +1 -0
  5. package/lib/api.mjs.map +1 -1
  6. package/lib/core/index.d.cts +17 -6
  7. package/lib/core/index.d.mts +17 -6
  8. package/lib/core/index.d.ts +17 -6
  9. package/lib/core/index.js +117 -21
  10. package/lib/core/index.js.map +1 -1
  11. package/lib/core/index.mjs +115 -21
  12. package/lib/core/index.mjs.map +1 -1
  13. package/lib/core/transform.d.cts +93 -25
  14. package/lib/core/transform.d.mts +93 -25
  15. package/lib/core/transform.d.ts +93 -25
  16. package/lib/core/transform.js +803 -121
  17. package/lib/core/transform.js.map +1 -1
  18. package/lib/core/transform.mjs +804 -122
  19. package/lib/core/transform.mjs.map +1 -1
  20. package/lib/core/tsconfigPaths.d.cts +61 -0
  21. package/lib/core/tsconfigPaths.d.mts +61 -0
  22. package/lib/core/tsconfigPaths.d.ts +61 -0
  23. package/lib/core/tsconfigPaths.js +190 -7
  24. package/lib/core/tsconfigPaths.js.map +1 -1
  25. package/lib/core/tsconfigPaths.mjs +188 -8
  26. package/lib/core/tsconfigPaths.mjs.map +1 -1
  27. package/lib/next.d.cts +27 -10
  28. package/lib/next.d.mts +27 -10
  29. package/lib/next.d.ts +27 -10
  30. package/lib/next.js +229 -8
  31. package/lib/next.js.map +1 -1
  32. package/lib/next.mjs +229 -8
  33. package/lib/next.mjs.map +1 -1
  34. package/lib/turbopack.d.cts +5 -4
  35. package/lib/turbopack.d.mts +5 -4
  36. package/lib/turbopack.d.ts +5 -4
  37. package/lib/turbopack.js +13 -7
  38. package/lib/turbopack.js.map +1 -1
  39. package/lib/turbopack.mjs +14 -8
  40. package/lib/turbopack.mjs.map +1 -1
  41. package/package.json +3 -3
  42. package/src/core/index.ts +122 -21
  43. package/src/core/transform.ts +1073 -132
  44. package/src/core/tsconfigPaths.ts +254 -8
  45. package/src/next.ts +262 -10
  46. package/src/turbopack.ts +13 -9
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfigPaths.mjs","sources":["../../src/core/tsconfigPaths.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACG,SAAU,0BAA0B,CACxC,QAAgB,EAAA;AAEhB,IAAA,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC;AACrE,IAAA,IAAI,QAAQ,KAAK,IAAI,EAAE;AACrB,QAAA,OAAO,EAAE;IACX;IACA,MAAM,MAAM,GAA6B,EAAE;AAC3C,IAAA,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC3B;QACF;QACA,MAAM,QAAQ,GAAG;aACd,MAAM,CAAC,CAAC,MAAM,KAAuB,OAAO,MAAM,KAAK,QAAQ;AAC/D,aAAA,GAAG,CAAC,CAAC,MAAM,KAAK,qBAAqB,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACnE,QAAA,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;AACzB,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ;QACxB;IACF;AACA,IAAA,OAAO,MAAM;AACf;AAEA;;;;AAIG;AACG,SAAU,qBAAqB,CAAC,OAAe,EAAE,MAAc,EAAA;AACnE,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM;AACrC,UAAE;UACA,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC;IACjC,OAAO,QAAQ,C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AIG;AACH,SAAS,iBAAiB,CAAC,KAAa,EAAE,IAAY,EAAA;AACpD,IAAA,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC3C,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAE;QACzB,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,EAAE;AAChC,YAAA,OAAO,OAAO;QAChB;IACF;AACA,IAAA,OAAO,SAAS;AAClB;;;;"}
package/lib/next.d.cts CHANGED
@@ -2,8 +2,8 @@ import type { TtscUnpluginOptions } from "./core/options.cjs";
2
2
  /**
3
3
  * Minimal structural type for a Next.js configuration object.
4
4
  *
5
- * Only the `webpack` field is used by this adapter; all other Next.js options
6
- * are forwarded as-is through the spread operator.
5
+ * Only `webpack` and `turbopack` are used by this adapter; all other Next.js
6
+ * options are forwarded as-is through the spread operator.
7
7
  */
8
8
  export type NextLikeConfig = Record<string, unknown> & {
9
9
  /**
@@ -12,6 +12,11 @@ export type NextLikeConfig = Record<string, unknown> & {
12
12
  * webpack plugin.
13
13
  */
14
14
  webpack?: (config: WebpackLikeConfig, options: unknown) => WebpackLikeConfig;
15
+ /**
16
+ * Optional existing Turbopack configuration. Preserved whole; only the ttsc
17
+ * rules are merged into its `rules` map.
18
+ */
19
+ turbopack?: TurbopackLikeConfig;
15
20
  };
16
21
  /**
17
22
  * Minimal structural type for a webpack configuration object as seen by the
@@ -21,17 +26,29 @@ export type WebpackLikeConfig = Record<string, unknown> & {
21
26
  /** The webpack plugin array; initialised to `[]` by this adapter if absent. */
22
27
  plugins?: unknown[];
23
28
  };
29
+ /** Minimal structural type for Next.js's `turbopack` configuration block. */
30
+ export type TurbopackLikeConfig = Record<string, unknown> & {
31
+ /** Per-glob loader rules. Other Turbopack settings are preserved untouched. */
32
+ rules?: Record<string, unknown>;
33
+ };
24
34
  /**
25
- * Wrap a Next.js config object so that the ttsc webpack plugin is injected into
26
- * every webpack build Next.js performs.
35
+ * Wrap a Next.js config object so that ttsc runs under whichever bundler
36
+ * Next.js uses.
37
+ *
38
+ * The webpack plugin is injected through the `webpack` hook, and the Turbopack
39
+ * loader is wired through `turbopack.rules`, with the same options reaching
40
+ * both. Covering only webpack meant that a project on Turbopack, which is the
41
+ * default bundler in current Next majors, silently got no transform at all: the
42
+ * build succeeded and every plugin-driven construct in it, a typia
43
+ * `assert<T>()` above all, survived untransformed into a runtime failure
44
+ * (samchon/ttsc#1310).
27
45
  *
28
- * The adapter uses `unshift` to ensure the ttsc plugin runs before any other
29
- * plugins in the array (unplugin `enforce: "pre"` semantics). An existing
30
- * `nextConfig.webpack` hook is preserved and called after the plugin is
31
- * injected.
46
+ * Both halves are additive. An existing `webpack` hook is preserved and called
47
+ * after the plugin is injected, and an existing `turbopack` block keeps every
48
+ * setting and every rule it already had.
32
49
  *
33
50
  * @param nextConfig - The caller's existing Next.js config (spread into the
34
- * returned object unchanged, except for `webpack`).
35
- * @param options - Ttsc plugin options forwarded to the webpack adapter.
51
+ * returned object unchanged, except for `webpack` and `turbopack`).
52
+ * @param options - Ttsc plugin options forwarded to both bundlers.
36
53
  */
37
54
  export default function next(nextConfig?: NextLikeConfig, options?: TtscUnpluginOptions): NextLikeConfig;
package/lib/next.d.mts CHANGED
@@ -2,8 +2,8 @@ import type { TtscUnpluginOptions } from "./core/options.mjs";
2
2
  /**
3
3
  * Minimal structural type for a Next.js configuration object.
4
4
  *
5
- * Only the `webpack` field is used by this adapter; all other Next.js options
6
- * are forwarded as-is through the spread operator.
5
+ * Only `webpack` and `turbopack` are used by this adapter; all other Next.js
6
+ * options are forwarded as-is through the spread operator.
7
7
  */
8
8
  export type NextLikeConfig = Record<string, unknown> & {
9
9
  /**
@@ -12,6 +12,11 @@ export type NextLikeConfig = Record<string, unknown> & {
12
12
  * webpack plugin.
13
13
  */
14
14
  webpack?: (config: WebpackLikeConfig, options: unknown) => WebpackLikeConfig;
15
+ /**
16
+ * Optional existing Turbopack configuration. Preserved whole; only the ttsc
17
+ * rules are merged into its `rules` map.
18
+ */
19
+ turbopack?: TurbopackLikeConfig;
15
20
  };
16
21
  /**
17
22
  * Minimal structural type for a webpack configuration object as seen by the
@@ -21,17 +26,29 @@ export type WebpackLikeConfig = Record<string, unknown> & {
21
26
  /** The webpack plugin array; initialised to `[]` by this adapter if absent. */
22
27
  plugins?: unknown[];
23
28
  };
29
+ /** Minimal structural type for Next.js's `turbopack` configuration block. */
30
+ export type TurbopackLikeConfig = Record<string, unknown> & {
31
+ /** Per-glob loader rules. Other Turbopack settings are preserved untouched. */
32
+ rules?: Record<string, unknown>;
33
+ };
24
34
  /**
25
- * Wrap a Next.js config object so that the ttsc webpack plugin is injected into
26
- * every webpack build Next.js performs.
35
+ * Wrap a Next.js config object so that ttsc runs under whichever bundler
36
+ * Next.js uses.
37
+ *
38
+ * The webpack plugin is injected through the `webpack` hook, and the Turbopack
39
+ * loader is wired through `turbopack.rules`, with the same options reaching
40
+ * both. Covering only webpack meant that a project on Turbopack, which is the
41
+ * default bundler in current Next majors, silently got no transform at all: the
42
+ * build succeeded and every plugin-driven construct in it, a typia
43
+ * `assert<T>()` above all, survived untransformed into a runtime failure
44
+ * (samchon/ttsc#1310).
27
45
  *
28
- * The adapter uses `unshift` to ensure the ttsc plugin runs before any other
29
- * plugins in the array (unplugin `enforce: "pre"` semantics). An existing
30
- * `nextConfig.webpack` hook is preserved and called after the plugin is
31
- * injected.
46
+ * Both halves are additive. An existing `webpack` hook is preserved and called
47
+ * after the plugin is injected, and an existing `turbopack` block keeps every
48
+ * setting and every rule it already had.
32
49
  *
33
50
  * @param nextConfig - The caller's existing Next.js config (spread into the
34
- * returned object unchanged, except for `webpack`).
35
- * @param options - Ttsc plugin options forwarded to the webpack adapter.
51
+ * returned object unchanged, except for `webpack` and `turbopack`).
52
+ * @param options - Ttsc plugin options forwarded to both bundlers.
36
53
  */
37
54
  export default function next(nextConfig?: NextLikeConfig, options?: TtscUnpluginOptions): NextLikeConfig;
package/lib/next.d.ts CHANGED
@@ -2,8 +2,8 @@ import type { TtscUnpluginOptions } from "./core/options";
2
2
  /**
3
3
  * Minimal structural type for a Next.js configuration object.
4
4
  *
5
- * Only the `webpack` field is used by this adapter; all other Next.js options
6
- * are forwarded as-is through the spread operator.
5
+ * Only `webpack` and `turbopack` are used by this adapter; all other Next.js
6
+ * options are forwarded as-is through the spread operator.
7
7
  */
8
8
  export type NextLikeConfig = Record<string, unknown> & {
9
9
  /**
@@ -12,6 +12,11 @@ export type NextLikeConfig = Record<string, unknown> & {
12
12
  * webpack plugin.
13
13
  */
14
14
  webpack?: (config: WebpackLikeConfig, options: unknown) => WebpackLikeConfig;
15
+ /**
16
+ * Optional existing Turbopack configuration. Preserved whole; only the ttsc
17
+ * rules are merged into its `rules` map.
18
+ */
19
+ turbopack?: TurbopackLikeConfig;
15
20
  };
16
21
  /**
17
22
  * Minimal structural type for a webpack configuration object as seen by the
@@ -21,17 +26,29 @@ export type WebpackLikeConfig = Record<string, unknown> & {
21
26
  /** The webpack plugin array; initialised to `[]` by this adapter if absent. */
22
27
  plugins?: unknown[];
23
28
  };
29
+ /** Minimal structural type for Next.js's `turbopack` configuration block. */
30
+ export type TurbopackLikeConfig = Record<string, unknown> & {
31
+ /** Per-glob loader rules. Other Turbopack settings are preserved untouched. */
32
+ rules?: Record<string, unknown>;
33
+ };
24
34
  /**
25
- * Wrap a Next.js config object so that the ttsc webpack plugin is injected into
26
- * every webpack build Next.js performs.
35
+ * Wrap a Next.js config object so that ttsc runs under whichever bundler
36
+ * Next.js uses.
37
+ *
38
+ * The webpack plugin is injected through the `webpack` hook, and the Turbopack
39
+ * loader is wired through `turbopack.rules`, with the same options reaching
40
+ * both. Covering only webpack meant that a project on Turbopack, which is the
41
+ * default bundler in current Next majors, silently got no transform at all: the
42
+ * build succeeded and every plugin-driven construct in it, a typia
43
+ * `assert<T>()` above all, survived untransformed into a runtime failure
44
+ * (samchon/ttsc#1310).
27
45
  *
28
- * The adapter uses `unshift` to ensure the ttsc plugin runs before any other
29
- * plugins in the array (unplugin `enforce: "pre"` semantics). An existing
30
- * `nextConfig.webpack` hook is preserved and called after the plugin is
31
- * injected.
46
+ * Both halves are additive. An existing `webpack` hook is preserved and called
47
+ * after the plugin is injected, and an existing `turbopack` block keeps every
48
+ * setting and every rule it already had.
32
49
  *
33
50
  * @param nextConfig - The caller's existing Next.js config (spread into the
34
- * returned object unchanged, except for `webpack`).
35
- * @param options - Ttsc plugin options forwarded to the webpack adapter.
51
+ * returned object unchanged, except for `webpack` and `turbopack`).
52
+ * @param options - Ttsc plugin options forwarded to both bundlers.
36
53
  */
37
54
  export default function next(nextConfig?: NextLikeConfig, options?: TtscUnpluginOptions): NextLikeConfig;
package/lib/next.js CHANGED
@@ -4,22 +4,41 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var webpack = require('./webpack.js');
6
6
 
7
+ /** The standalone loader entry Turbopack accepts through `turbopack.rules`. */
8
+ const TURBOPACK_LOADER = "@ttsc/unplugin/turbopack";
7
9
  /**
8
- * Wrap a Next.js config object so that the ttsc webpack plugin is injected into
9
- * every webpack build Next.js performs.
10
+ * The globs the loader is wired for.
10
11
  *
11
- * The adapter uses `unshift` to ensure the ttsc plugin runs before any other
12
- * plugins in the array (unplugin `enforce: "pre"` semantics). An existing
13
- * `nextConfig.webpack` hook is preserved and called after the plugin is
14
- * injected.
12
+ * The same two the manual wiring in the README uses. A wider glob would be
13
+ * harmless, since `isTransformTarget` declines everything else that reaches the
14
+ * loader, but it would also route files through a worker for nothing.
15
+ */
16
+ const TURBOPACK_RULE_GLOBS = ["*.ts", "*.tsx"];
17
+ /**
18
+ * Wrap a Next.js config object so that ttsc runs under whichever bundler
19
+ * Next.js uses.
20
+ *
21
+ * The webpack plugin is injected through the `webpack` hook, and the Turbopack
22
+ * loader is wired through `turbopack.rules`, with the same options reaching
23
+ * both. Covering only webpack meant that a project on Turbopack, which is the
24
+ * default bundler in current Next majors, silently got no transform at all: the
25
+ * build succeeded and every plugin-driven construct in it, a typia
26
+ * `assert<T>()` above all, survived untransformed into a runtime failure
27
+ * (samchon/ttsc#1310).
28
+ *
29
+ * Both halves are additive. An existing `webpack` hook is preserved and called
30
+ * after the plugin is injected, and an existing `turbopack` block keeps every
31
+ * setting and every rule it already had.
15
32
  *
16
33
  * @param nextConfig - The caller's existing Next.js config (spread into the
17
- * returned object unchanged, except for `webpack`).
18
- * @param options - Ttsc plugin options forwarded to the webpack adapter.
34
+ * returned object unchanged, except for `webpack` and `turbopack`).
35
+ * @param options - Ttsc plugin options forwarded to both bundlers.
19
36
  */
20
37
  function next(nextConfig = {}, options) {
38
+ warnAboutSuppressedWebpackConfig(nextConfig);
21
39
  return {
22
40
  ...nextConfig,
41
+ turbopack: withTtscTurbopackRules(nextConfig.turbopack, options),
23
42
  webpack(config, webpackOptions) {
24
43
  config.plugins = Array.isArray(config.plugins) ? config.plugins : [];
25
44
  // Prepend so ttsc runs before any user-added plugins.
@@ -31,6 +50,208 @@ function next(nextConfig = {}, options) {
31
50
  },
32
51
  };
33
52
  }
53
+ /**
54
+ * Say what Next.js can no longer say once this wrapper defines `turbopack`.
55
+ *
56
+ * Next stops the build when a config carries a `webpack` hook and no
57
+ * `turbopack` block, because the webpack hook is then silently ignored. Read
58
+ * from Next 16.3.2's own `dist/lib/turbopack-warning.js`, it is
59
+ * `log.error(...)` followed by `process.exit(1)` — a refusal, not a warning —
60
+ * and it is gated on `process.env.TURBOPACK === "auto"`, which
61
+ * `dist/lib/bundler.js` sets only when no bundler flag was passed. Next's
62
+ * comment there gives the reason: an explicit `--turbopack` means the user
63
+ * chose it and is assumed to have configured it. So the check fires on a plain
64
+ * `next build` or `next dev`, which is how Next 16 is normally run.
65
+ *
66
+ * `hasTurboConfig` is read from the raw exported config, which is this
67
+ * wrapper's return value, and this wrapper always defines `turbopack`. The
68
+ * check therefore can never fire again for anyone who uses `withTtsc`, and a
69
+ * caller's own webpack customisation would be dropped on a Turbopack build with
70
+ * nothing said. Wiring ttsc for Turbopack is worth exactly one line, not the
71
+ * loss of the refusal Next already gave.
72
+ *
73
+ * Verifying that gate is what this docstring exists for: measured with an
74
+ * explicit `--turbopack`, the check is silent, and a reading that stopped there
75
+ * would conclude Next says nothing and delete a true statement.
76
+ *
77
+ * Only for a caller who wrote a `webpack` hook and no `turbopack` block. A
78
+ * caller who configured Turbopack has already made that decision, and a caller
79
+ * with neither has no webpack-only configuration to lose.
80
+ */
81
+ function warnAboutSuppressedWebpackConfig(nextConfig) {
82
+ if (typeof nextConfig.webpack !== "function" ||
83
+ nextConfig.turbopack !== undefined) {
84
+ return;
85
+ }
86
+ process.stderr.write("@ttsc/unplugin: withTtsc now configures Turbopack as well as webpack, so " +
87
+ "Next.js will no longer stop the build to tell you that your own " +
88
+ "`webpack` hook is ignored on a Turbopack build. Port it to `turbopack`, " +
89
+ "or run the bundler you configured with `next build --webpack` / " +
90
+ "`next dev --webpack`." +
91
+ String.fromCharCode(10));
92
+ }
93
+ /**
94
+ * Merge the ttsc loader rules into a caller's Turbopack configuration.
95
+ *
96
+ * Additive in every direction: unrelated Turbopack settings and unrelated rules
97
+ * are carried through untouched, and a glob the caller already configured keeps
98
+ * its own loaders with ttsc placed where the chain runs it first. A caller who
99
+ * already wired this loader by hand is left exactly as they are, so following
100
+ * the README's manual instructions and then adopting the wrapper cannot
101
+ * register it twice.
102
+ */
103
+ function withTtscTurbopackRules(existing, options) {
104
+ const rules = { ...(existing?.rules ?? {}) };
105
+ for (const glob of TURBOPACK_RULE_GLOBS) {
106
+ const rule = rules[glob];
107
+ const loaders = selectTurbopackLoaders(rule);
108
+ if (loaders.some(referencesTtscLoader)) {
109
+ continue;
110
+ }
111
+ // The caller may have written the same file set under a different glob.
112
+ // Adding ours beside theirs makes every matching module run the loader
113
+ // twice, and the second pass receives the first pass's output, so the
114
+ // guard has to cover the spellings a caller plausibly uses rather than
115
+ // only the two this wrapper writes (samchon/ttsc#1314).
116
+ if (coveredByAnotherRule(rules, glob)) {
117
+ continue;
118
+ }
119
+ const entry = { loader: TURBOPACK_LOADER, options: options ?? {} };
120
+ // Appended, not prepended. Turbopack runs a rule's loaders right to left,
121
+ // so the last entry is the one that sees the original source. ttsc
122
+ // transforms TypeScript into TypeScript, so it has to be that one, which
123
+ // is the same position `enforce: "pre"` gives it on the webpack half.
124
+ //
125
+ // Measured rather than inferred from webpack's `loader-runner`: two
126
+ // loaders on one rule, each marking the source, came back marked in the
127
+ // order that only the last-runs-first chain produces (samchon/ttsc#1319).
128
+ rules[glob] =
129
+ rule === undefined || loaders.length === 0
130
+ ? { loaders: [entry] }
131
+ : Array.isArray(rule)
132
+ ? { loaders: [...loaders, entry] }
133
+ : { ...rule, loaders: [...loaders, entry] };
134
+ }
135
+ return { ...(existing ?? {}), rules };
136
+ }
137
+ /**
138
+ * Whether some other rule already routes this glob's files through the loader.
139
+ *
140
+ * Deciding glob equivalence in general means implementing Turbopack's matcher,
141
+ * which is not worth it here. What is recognised instead is the spellings a
142
+ * caller plausibly writes for "every file with this extension", since only a
143
+ * glob that means every file can make the wrapper's own rules redundant. That
144
+ * is narrower than every glob with those semantics, and narrow on purpose:
145
+ * anything unrecognised is left alone and the wrapper still adds its rules,
146
+ * while skipping on a scoped glob would leave every module outside that scope
147
+ * untransformed, which is samchon/ttsc#1310 again and the quieter of the two
148
+ * failures. {@link matchesExtension} owns the rule and names what it declines.
149
+ */
150
+ function coveredByAnotherRule(rules, glob) {
151
+ const extension = glob.slice(glob.lastIndexOf(".") + 1);
152
+ return Object.entries(rules).some(([candidate, rule]) => {
153
+ if (candidate === glob) {
154
+ return false;
155
+ }
156
+ if (!selectTurbopackLoaders(rule).some(referencesTtscLoader)) {
157
+ return false;
158
+ }
159
+ return matchesExtension(candidate, extension);
160
+ });
161
+ }
162
+ /**
163
+ * Whether one glob names this extension across the whole project.
164
+ *
165
+ * Unscoped only. A rule carrying a path segment says nothing about the rest of
166
+ * the project, so treating it as covering everything would leave every module
167
+ * outside it with no ttsc rule at all. That is the silent failure
168
+ * samchon/ttsc#1310 is about, and it is strictly worse than the double
169
+ * registration this guard exists to prevent: a module no loader ever sees fails
170
+ * at runtime, while a module transformed twice costs time.
171
+ *
172
+ * How little a scoped rule covers is worth stating from measurement rather than
173
+ * from the obvious guess, because the guess is wrong. Against Next.js 16.3.2,
174
+ * `src/*.ts` and `src/**` + `/*.ts` match **nothing at all** — not even the
175
+ * `src/` subtree they name — while `./src/*.ts`, `**` + `/src/*.ts` and a bare
176
+ * `nested-probe.ts` all match a file at `src/`. Declining every one of them is
177
+ * therefore even safer than "it only covers its subtree" implies
178
+ * (samchon/ttsc#1319).
179
+ *
180
+ * The answer comes from {@link PROJECT_WIDE_GLOBS}, an exact set of measured
181
+ * spellings, and that document explains why it is a set rather than a rule.
182
+ */
183
+ function matchesExtension(glob, extension) {
184
+ return PROJECT_WIDE_GLOBS.get(glob.trim())?.includes(extension) === true;
185
+ }
186
+ /**
187
+ * The exact glob spellings a real Turbopack build has shown to name every file
188
+ * with an extension, and which extensions each one covers.
189
+ *
190
+ * An allowlist rather than a predicate, because recognising a glob is a claim
191
+ * about Turbopack's matcher and every claim here has to be one somebody
192
+ * measured. A rule inferred from glob semantics kept being wrong in the silent
193
+ * direction: `{src/,}*.ts` contains a bare `*.ts` alternative and so must cover
194
+ * the project by any set-theoretic reading, yet Turbopack matches nothing with
195
+ * it, and recognising it suppressed this wrapper's rules in favour of a rule
196
+ * that transforms no file at all — samchon/ttsc#1310 caused by the guard meant
197
+ * to prevent it (samchon/ttsc#1319).
198
+ *
199
+ * The deeper problem was that a predicate is open-ended: it answers for every
200
+ * spelling anyone might write, including ones no build has ever driven.
201
+ * `*.{ts}` and `{,**` + `/}*.ts` were both accepted on that reasoning while
202
+ * nothing had checked whether Turbopack expands a single-alternative group or a
203
+ * leading empty one. An exact set cannot overreach, so an unmeasured spelling
204
+ * is simply not recognised, the wrapper adds its own rules, and the failure —
205
+ * if any — is a second registration rather than a module that no loader ever
206
+ * sees.
207
+ *
208
+ * `experimental/test-unplugin` drives every entry through `next build
209
+ * --turbopack` and asserts a nested `.ts`, a root-level `.ts` and a nested
210
+ * `.tsx` all came out transformed, and
211
+ * `test_next_adapter_does_not_double_register_across_globs` asserts these keys
212
+ * and that list are the same set, so an entry cannot be added here without a
213
+ * build proving it.
214
+ */
215
+ const PROJECT_WIDE_GLOBS = new Map([
216
+ ["*.ts", ["ts"]],
217
+ ["**/*.ts", ["ts"]],
218
+ ["{**/,}*.ts", ["ts"]],
219
+ ["*.tsx", ["tsx"]],
220
+ ["**/*.tsx", ["tsx"]],
221
+ ["*.{ts,tsx}", ["ts", "tsx"]],
222
+ ["{*.ts,*.tsx}", ["ts", "tsx"]],
223
+ ["**/*.{ts,tsx}", ["ts", "tsx"]],
224
+ ["**/{*.ts,*.tsx}", ["ts", "tsx"]],
225
+ ["**/**/*.{ts,tsx}", ["ts", "tsx"]],
226
+ ]);
227
+ /**
228
+ * Read the loader list out of one Turbopack rule.
229
+ *
230
+ * Turbopack accepts a bare array of loaders as well as the object form, and a
231
+ * loader is either a module name or a `{ loader, options }` pair, so this
232
+ * normalises only enough to answer "what is already here".
233
+ */
234
+ function selectTurbopackLoaders(rule) {
235
+ if (Array.isArray(rule)) {
236
+ return rule;
237
+ }
238
+ if (typeof rule === "object" && rule !== null) {
239
+ const loaders = rule.loaders;
240
+ if (Array.isArray(loaders)) {
241
+ return loaders;
242
+ }
243
+ }
244
+ return [];
245
+ }
246
+ /** Whether one Turbopack loader entry is already this package's loader. */
247
+ function referencesTtscLoader(loader) {
248
+ if (typeof loader === "string") {
249
+ return loader === TURBOPACK_LOADER;
250
+ }
251
+ return (typeof loader === "object" &&
252
+ loader !== null &&
253
+ loader.loader === TURBOPACK_LOADER);
254
+ }
34
255
 
35
256
  exports.default = next;
36
257
  //# sourceMappingURL=next.js.map
package/lib/next.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"next.js","sources":["../src/next.ts"],"sourcesContent":[null],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