xbintsc 0.6.23 → 0.6.24

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 (30) hide show
  1. package/dist/src/cli/help.d.ts +1 -1
  2. package/dist/src/driver/bundler/concatenate.d.ts +23 -0
  3. package/dist/src/driver/bundler/concatenate.js +210 -0
  4. package/dist/src/driver/bundler/concatenate.js.map +1 -0
  5. package/dist/src/driver/bundler/merge.d.ts +4 -4
  6. package/dist/src/driver/bundler/merge.js +24 -207
  7. package/dist/src/driver/bundler/merge.js.map +1 -1
  8. package/dist/src/driver/bundler/{namespace-import.d.ts → namespace-object.d.ts} +5 -1
  9. package/dist/src/driver/bundler/{namespace-import.js → namespace-object.js} +6 -2
  10. package/dist/src/driver/bundler/namespace-object.js.map +1 -0
  11. package/dist/src/driver/bundler/{reexport-fixup.d.ts → reexport-resolution.d.ts} +9 -3
  12. package/dist/src/driver/bundler/{reexport-fixup.js → reexport-resolution.js} +16 -6
  13. package/dist/src/driver/bundler/reexport-resolution.js.map +1 -0
  14. package/dist/src/driver/modules.d.ts +12 -5
  15. package/dist/src/driver/modules.js +12 -5
  16. package/dist/src/driver/modules.js.map +1 -1
  17. package/dist/src/driver/version.d.ts +1 -1
  18. package/dist/src/driver/version.js +1 -1
  19. package/dist/tests/driver/deferred-reexport.test.js +25 -0
  20. package/dist/tests/driver/deferred-reexport.test.js.map +1 -1
  21. package/package.json +7 -7
  22. package/src/driver/bundler/README.md +55 -0
  23. package/src/driver/bundler/concatenate.ts +244 -0
  24. package/src/driver/bundler/merge.ts +24 -215
  25. package/src/driver/bundler/{namespace-import.ts → namespace-object.ts} +5 -1
  26. package/src/driver/bundler/{reexport-fixup.ts → reexport-resolution.ts} +15 -5
  27. package/src/driver/modules.ts +12 -5
  28. package/src/driver/version.ts +1 -1
  29. package/dist/src/driver/bundler/namespace-import.js.map +0 -1
  30. package/dist/src/driver/bundler/reexport-fixup.js.map +0 -1
@@ -1,54 +1,47 @@
1
1
  /**
2
- * Merge every reachable module's statements into a single source file.
2
+ * Bundling pass orchestrator (phases 1-3).
3
3
  *
4
4
  * Dependencies come first (post-order over the import graph), the entry module
5
- * last. Top-level bindings are renamed to globally unique names and imports are
6
- * rewritten to the (renamed) exported binding; namespace imports are lowered
7
- * to a synthetic object literal.
5
+ * last. These passes record each module's exports, pick globally unique final
6
+ * names, rewrite imported names and lower deferred imports. `concatenate.ts`
7
+ * then emits the statement list and applies the final renames (phases 4-5).
8
8
  */
9
9
 
10
10
  import { dirname } from "node:path";
11
11
  import {
12
12
  ModifierKind,
13
13
  SyntaxKind,
14
- type ExportAssignment,
15
14
  type ExportDeclaration,
16
15
  type Identifier,
17
16
  type ImportDeclaration,
18
- type Modifier,
19
17
  type Node,
20
- type SourceFileNode,
21
18
  type Statement,
22
- type VariableDeclaration,
23
- type VariableDeclarationList,
24
19
  type VariableStatement,
25
20
  } from "../../ast/nodes.js";
26
- import { namespaceImportToStatement } from "./namespace-import.js";
27
- import { resolveReexports } from "./reexport-fixup.js";
28
21
  import type { BindingName } from "../../ast/declarations.js";
29
22
  import { SymbolKind } from "../../binder/binder.js";
30
23
  import type { DiagnosticBag } from "../../diagnostics/diagnostic.js";
31
24
  import type { AssetLoader } from "../../extensions/registry.js";
32
- import { loadGraph } from "./graph.js";
25
+ import { concatenateModules } from "./concatenate.js";
33
26
  import { lowerCommonJSRequires, prepareCommonJS } from "./commonjs.js";
34
- import { prepareDynamicImports } from "./dynamic-import.js";
35
- import { classifyDependency } from "./resolve.js";
36
27
  import {
37
28
  computeDeferredModules,
38
29
  deferredAliasName,
39
- deferredModuleFunctions,
40
30
  deferredWrapperName,
41
- eagerModuleFunctions,
42
31
  isDeferredMarkerImport,
43
32
  type DeferredAlias,
44
33
  } from "./deferred.js";
34
+ import { prepareDynamicImports } from "./dynamic-import.js";
35
+ import { loadGraph } from "./graph.js";
36
+ import { namespaceImportToStatement } from "./namespace-object.js";
37
+ import { resolveReexports } from "./reexport-resolution.js";
38
+ import { classifyDependency } from "./resolve.js";
45
39
  import {
46
40
  declarationName,
47
41
  hasModifier,
48
42
  moduleScope,
49
43
  renameImport,
50
44
  renameReferences,
51
- renameSymbol,
52
45
  topLevelSymbols,
53
46
  } from "./symbols.js";
54
47
  import type { BundleResult, ModuleRecord } from "./types.js";
@@ -304,7 +297,7 @@ export function bundleModules(
304
297
  }
305
298
 
306
299
  if (clause.name) {
307
- const target = dependency.exports.get("default") ?? dependency.exports.get("default");
300
+ const target = dependency.exports.get("default");
308
301
  const local = scope.symbols.get(clause.name.text);
309
302
  if (target && local) renameImport(record, local, target);
310
303
  }
@@ -347,152 +340,18 @@ export function bundleModules(
347
340
  // the final renamed names (multi-level re-export chains and cycle back-edges).
348
341
  resolveReexports(records, dependencyOf, namespaceStatements, deferredModules);
349
342
 
350
- // Phase 4: concatenate statements, dropping imports and pure export wrappers.
351
- const merged: Statement[] = [];
352
- /* Every node keeps the module it was parsed from, so a later codegen
353
- * diagnostic can name the right file and line instead of pointing into the
354
- * entry module (whose text happens to start at the same offsets). */
355
- const origins = new Map<object, string>();
356
- /* A synthesized module (an extension asset loader such as the `gui` `.html`
357
- * transform) may contain spans copied from another file — a `<script
358
- * src="app.js">` body, say. Nodes inside such a span keep that file, so a
359
- * diagnostic points at real source and a plain-`.js` script stays exempt
360
- * from the type checker. */
361
- const originOf = (record: ModuleRecord, node: Node): string => {
362
- const ranges = record.originRanges;
363
- if (ranges === undefined) return record.path;
364
- for (const range of ranges) {
365
- if (node.start >= range.start && node.end <= range.end) return range.file;
366
- }
367
- return record.path;
368
- };
369
- const trackOrigin = (record: ModuleRecord, root: Node): void => {
370
- const visit = (node: Node): void => {
371
- origins.set(node, originOf(record, node));
372
- const fields = node as unknown as Record<string, unknown>;
373
- for (const key of Object.keys(fields)) {
374
- if (key === "kind" || key === "start" || key === "end" || key === "text" || key === "value" || key === "raw") {
375
- continue;
376
- }
377
- const value = fields[key];
378
- if (Array.isArray(value)) {
379
- for (const child of value) if (isNode(child)) visit(child);
380
- } else if (isNode(value)) {
381
- visit(value);
382
- }
383
- }
384
- };
385
- visit(root);
386
- };
387
- const push = (record: ModuleRecord, statement: Statement): void => {
388
- trackOrigin(record, statement);
389
- merged.push(statement);
390
- };
391
- const first = records[records.length - 1]!;
392
- for (const record of records) {
393
- if (deferredModules.has(record.path)) {
394
- /* A deferred module is evaluated by the wrapper when a script runs. Its
395
- * external imports stay top-level (codegen resolves them there); eager
396
- * namespace objects likewise. */
397
- const topLevel: Statement[] = [];
398
- const body: Statement[] = [];
399
- for (const statement of record.sourceFile.statements) {
400
- if (statement.kind === SyntaxKind.ImportDeclaration) {
401
- const declaration = statement as ImportDeclaration;
402
- const resolution = classifyDependency(
403
- dirname(record.path), declaration.moduleSpecifier.value, externalSpecifiers, moduleOverrides,
404
- );
405
- if (resolution.kind === "external") topLevel.push(statement);
406
- const synthetic = namespaceStatements.get(statement);
407
- if (synthetic) topLevel.push(synthetic);
408
- continue;
409
- }
410
- if (statement.kind === SyntaxKind.ExportDeclaration) {
411
- const declaration = statement as ExportDeclaration;
412
- const inner = (declaration as unknown as { declaration?: Statement }).declaration;
413
- if (inner) body.push(inner);
414
- continue;
415
- }
416
- if (statement.kind === SyntaxKind.ExportAssignment) {
417
- body.push(exportAssignmentToStatement(record, statement as ExportAssignment));
418
- continue;
419
- }
420
- stripExportModifiers(statement);
421
- body.push(statement);
422
- }
423
- for (const statement of topLevel) push(record, statement);
424
- for (const statement of deferredModuleFunctions(
425
- record,
426
- deferredAliases.get(record.path) ?? [],
427
- body,
428
- )) {
429
- push(record, statement);
430
- }
431
- continue;
432
- }
433
- for (const statement of record.sourceFile.statements) {
434
- if (statement.kind === SyntaxKind.ImportDeclaration) {
435
- // External (extension / built-in) imports stay in place for codegen.
436
- const declaration = statement as ImportDeclaration;
437
- const resolution = classifyDependency(
438
- dirname(record.path), declaration.moduleSpecifier.value, externalSpecifiers, moduleOverrides,
439
- );
440
- if (resolution.kind === "external") {
441
- push(record, statement);
442
- } else {
443
- const synthetic = namespaceStatements.get(statement);
444
- if (synthetic) push(record, synthetic);
445
- }
446
- continue;
447
- }
448
- if (statement.kind === SyntaxKind.ExportDeclaration) {
449
- const declaration = statement as ExportDeclaration;
450
- const synthetic = namespaceStatements.get(statement);
451
- if (synthetic) {
452
- push(record, synthetic);
453
- continue;
454
- }
455
- const inner = (declaration as unknown as { declaration?: Statement }).declaration;
456
- if (inner) push(record, inner);
457
- continue;
458
- }
459
- if (statement.kind === SyntaxKind.ExportAssignment) {
460
- const assignment = statement as ExportAssignment;
461
- push(record, exportAssignmentToStatement(record, assignment));
462
- continue;
463
- }
464
- push(record, statement);
465
- }
466
- }
467
-
468
- /* A marker or dynamic-import target that stayed eager still needs a wrapper:
469
- * its exports are already initialised. */
470
- for (const record of records) {
471
- if (deferredModules.has(record.path) || (!markerTargets.has(record.path) && !dynamicTargets.has(record.path))) continue;
472
- for (const statement of eagerModuleFunctions(record)) push(record, statement);
473
- }
474
-
475
- // Phase 5: rename every top-level binding (declaration + references) to its
476
- // unique final name, now that import references have been rewritten.
477
- for (const record of records) {
478
- for (const symbol of topLevelSymbols(record)) {
479
- if (symbol.kind === SymbolKind.Import) continue;
480
- const finalName = record.finalNames.get(symbol.id);
481
- if (finalName) renameSymbol(symbol, finalName);
482
- }
483
- }
484
-
485
- const sourceFile: SourceFileNode = {
486
- kind: SyntaxKind.SourceFile,
487
- statements: merged,
488
- fileName: first.path,
489
- origins,
490
- moduleTexts: new Map(records.map((record) => [record.path, record.text])),
491
- modulePrefixes: records.map((record) => record.prefix),
492
- text: records.map((record) => record.text).join("\n"),
493
- start: 0,
494
- end: 0,
495
- };
343
+ // Phases 4-5: concatenate the modules into one file and give every top-level
344
+ // binding its final name.
345
+ const sourceFile = concatenateModules({
346
+ records,
347
+ deferredModules,
348
+ deferredAliases,
349
+ markerTargets,
350
+ dynamicTargets,
351
+ namespaceStatements,
352
+ externalSpecifiers,
353
+ moduleOverrides,
354
+ });
496
355
  return { sourceFile, text: sourceFile.text, moduleCount: records.length };
497
356
  }
498
357
 
@@ -514,57 +373,7 @@ function collectBindingIdentifiers(name: BindingName, out: string[]): void {
514
373
  out.push(name.text);
515
374
  return;
516
375
  }
517
- const elements = name.kind === SyntaxKind.ArrayBindingPattern ? name.elements : name.elements;
518
- for (const element of elements) {
376
+ for (const element of name.elements) {
519
377
  if (element) collectBindingIdentifiers(element.name, out);
520
378
  }
521
379
  }
522
-
523
-
524
- /** Drop `export` / `export default` from a statement moved into a wrapper. */
525
- function stripExportModifiers(statement: Statement): void {
526
- const modifiers = (statement as { modifiers?: Modifier[] }).modifiers;
527
- if (!modifiers) return;
528
- (statement as { modifiers: Modifier[] }).modifiers = modifiers.filter(
529
- (modifier) => modifier.modifierKind !== ModifierKind.Export && modifier.modifierKind !== ModifierKind.Default,
530
- );
531
- }
532
-
533
- /** True for anything shaped like an AST node (constructed nodes carry no trivia). */
534
- function isNode(value: unknown): value is Node {
535
- return !!value && typeof value === "object" && "kind" in (value as object);
536
- }
537
-
538
- /** Turn `export default expr` into a synthetic `const` declaration. */
539
- function exportAssignmentToStatement(record: ModuleRecord, assignment: ExportAssignment): Statement {
540
- const name: Identifier = {
541
- kind: SyntaxKind.Identifier,
542
- text: `${record.prefix}default`,
543
- start: assignment.start,
544
- end: assignment.start,
545
- };
546
- record.exports.set("default", name.text);
547
- const declaration: VariableDeclaration = {
548
- kind: SyntaxKind.VariableDeclaration,
549
- name,
550
- exclamation: false,
551
- initializer: assignment.expression,
552
- start: assignment.start,
553
- end: assignment.end,
554
- };
555
- const list: VariableDeclarationList = {
556
- kind: SyntaxKind.VariableDeclarationList,
557
- declarationKind: "const" as const,
558
- declarations: [declaration],
559
- start: assignment.start,
560
- end: assignment.end,
561
- };
562
- const statement: VariableStatement = {
563
- kind: SyntaxKind.VariableStatement,
564
- declarationList: list,
565
- modifiers: [],
566
- start: assignment.start,
567
- end: assignment.end,
568
- };
569
- return statement;
570
- }
@@ -1,5 +1,9 @@
1
1
  /**
2
- * Synthetic AST statement builders used by the module merge.
2
+ * Build the synthetic object literal that stands in for a namespace binding.
3
+ *
4
+ * `import * as ns from "./mod"` and `export * as ns from "./mod"` are lowered
5
+ * to `const <final> = { exportName: finalName, ... }`, because the merged
6
+ * module has no runtime namespace object to point at.
3
7
  */
4
8
 
5
9
  import {
@@ -1,13 +1,19 @@
1
1
  /**
2
- * Re-export fixpoint pass.
2
+ * Resolve re-export chains and rebuild namespace objects from final names.
3
3
  *
4
4
  * Phase 2 records `export { x } from "./dep"` by copying the dependency's
5
5
  * export *value* at that moment; if `dep` re-exports an import, that value is
6
6
  * the pre-rename local name and is only corrected by Phase 3's import rewrite.
7
7
  * A multi-level chain (`index -> sdk -> tools`) therefore needs a second pass,
8
8
  * and a namespace import reaching back across a cycle needs the final names.
9
- * This function re-resolves module re-exports until the export maps stop
10
- * changing, then rebuilds every namespace object from those final names.
9
+ * This pass re-resolves module re-exports until the export maps stop changing,
10
+ * then rebuilds every eager namespace object from those final names.
11
+ *
12
+ * Deferred modules (`<script src>`) are the exception: their bindings live in a
13
+ * wrapper function, so Phase 3 already lowered any namespace binding between
14
+ * two deferred modules to an alias that calls `__xt_deferred_<dep>()`. Such a
15
+ * binding must be left alone; rebuilding it here would reference wrapper-local
16
+ * names from the top level (TS3002 `Cannot find name`).
11
17
  */
12
18
 
13
19
  import {
@@ -18,7 +24,7 @@ import {
18
24
  type Statement,
19
25
  } from "../../ast/nodes.js";
20
26
  import type { ModuleRecord } from "./types.js";
21
- import { namespaceImportToStatement } from "./namespace-import.js";
27
+ import { namespaceImportToStatement } from "./namespace-object.js";
22
28
 
23
29
  export function resolveReexports(
24
30
  records: ModuleRecord[],
@@ -89,7 +95,11 @@ export function resolveReexports(
89
95
  const bindings = clause?.namedBindings;
90
96
  if (bindings?.kind === SyntaxKind.NamespaceImport) {
91
97
  const dependency = dependencyOf(record, declaration.moduleSpecifier.value);
92
- if (dependency) {
98
+ /* Phase 3 already lowered a deferred module's namespace import of
99
+ * another deferred module to an alias read from the dependency's
100
+ * wrapper. Rebuilding the object here would reference the
101
+ * dependency's final names, which are wrapper-local (TS3002). */
102
+ if (dependency && !(deferredModules.has(record.path) && deferredModules.has(dependency.path))) {
93
103
  namespaceStatements.set(
94
104
  statement,
95
105
  namespaceImportToStatement(statement, `${record.prefix}${bindings.name.text}`, dependency),
@@ -6,11 +6,18 @@
6
6
  * Each module's top-level bindings are renamed to a globally unique name and
7
7
  * imported names are rewritten to the (renamed) exported binding.
8
8
  *
9
- * The implementation lives under `bundler/` split by concern:
10
- * resolve.ts specifier/path/package resolution
11
- * graph.ts import-graph loading (parse + bind)
12
- * symbols.ts top-level symbol renaming
13
- * merge.ts the bundling passes themselves
9
+ * The implementation lives under `bundler/` (see `bundler/README.md`):
10
+ * resolve.ts specifier/path/package resolution
11
+ * graph.ts import-graph loading (parse + bind)
12
+ * merge.ts bundling pass orchestrator (phases 1-3)
13
+ * reexport-resolution.ts re-export chain fixpoint + namespace objects
14
+ * namespace-object.ts namespace object literal builder
15
+ * deferred.ts `<script src>` deferred module wrappers
16
+ * dynamic-import.ts `import()` lowering
17
+ * commonjs.ts CommonJS compatibility in `node_modules`
18
+ * concatenate.ts final concatenation (phases 4-5)
19
+ * symbols.ts top-level symbol renaming
20
+ * types.ts shared types
14
21
  *
15
22
  * This file remains the public entry point for the driver and tests.
16
23
  */
@@ -9,4 +9,4 @@
9
9
  * `main`/`master` only (see `.githooks/pre-commit`), so feature branches never
10
10
  * change this line and merging two of them cannot conflict here.
11
11
  */
12
- export const COMPILER_VERSION = "0.6.23";
12
+ export const COMPILER_VERSION = "0.6.24";
@@ -1 +0,0 @@
1
- {"version":3,"file":"namespace-import.js","sourceRoot":"","sources":["../../../../src/driver/bundler/namespace-import.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,GAMX,MAAM,oBAAoB,CAAC;AAG5B,6EAA6E;AAC7E,MAAM,UAAU,0BAA0B,CACxC,SAAoB,EACpB,SAAiB,EACjB,UAAwB;I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