@celljs/vite 0.0.0-stage → 4.0.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.
Files changed (166) hide show
  1. package/README.md +29 -2
  2. package/assets/favicon.ico +0 -0
  3. package/lib/builder/cell-builder.d.ts +19 -0
  4. package/lib/builder/cell-builder.d.ts.map +1 -0
  5. package/lib/builder/cell-builder.js +59 -0
  6. package/lib/builder/cell-builder.js.map +1 -0
  7. package/lib/builder/cell-builder.spec.d.ts +2 -0
  8. package/lib/builder/cell-builder.spec.d.ts.map +1 -0
  9. package/lib/builder/cell-builder.spec.js +280 -0
  10. package/lib/builder/cell-builder.spec.js.map +1 -0
  11. package/lib/constants.d.ts +24 -0
  12. package/lib/constants.d.ts.map +1 -0
  13. package/lib/constants.js +23 -0
  14. package/lib/constants.js.map +1 -0
  15. package/lib/dev/cell-dev-server.d.ts +113 -0
  16. package/lib/dev/cell-dev-server.d.ts.map +1 -0
  17. package/lib/dev/cell-dev-server.js +307 -0
  18. package/lib/dev/cell-dev-server.js.map +1 -0
  19. package/lib/dev/cell-dev-server.spec.d.ts +2 -0
  20. package/lib/dev/cell-dev-server.spec.d.ts.map +1 -0
  21. package/lib/dev/cell-dev-server.spec.js +188 -0
  22. package/lib/dev/cell-dev-server.spec.js.map +1 -0
  23. package/lib/expression/expression-evaluator.d.ts +24 -0
  24. package/lib/expression/expression-evaluator.d.ts.map +1 -0
  25. package/lib/expression/expression-evaluator.js +97 -0
  26. package/lib/expression/expression-evaluator.js.map +1 -0
  27. package/lib/expression/expression-evaluator.spec.d.ts +2 -0
  28. package/lib/expression/expression-evaluator.spec.d.ts.map +1 -0
  29. package/lib/expression/expression-evaluator.spec.js +23 -0
  30. package/lib/expression/expression-evaluator.spec.js.map +1 -0
  31. package/lib/generator/config-generator.d.ts +18 -0
  32. package/lib/generator/config-generator.d.ts.map +1 -0
  33. package/lib/generator/config-generator.js +45 -0
  34. package/lib/generator/config-generator.js.map +1 -0
  35. package/lib/generator/container-generator.d.ts +13 -0
  36. package/lib/generator/container-generator.d.ts.map +1 -0
  37. package/lib/generator/container-generator.js +41 -0
  38. package/lib/generator/container-generator.js.map +1 -0
  39. package/lib/generator/generator.spec.d.ts +2 -0
  40. package/lib/generator/generator.spec.d.ts.map +1 -0
  41. package/lib/generator/generator.spec.js +61 -0
  42. package/lib/generator/generator.spec.js.map +1 -0
  43. package/lib/generator/html-generator.d.ts +13 -0
  44. package/lib/generator/html-generator.d.ts.map +1 -0
  45. package/lib/generator/html-generator.js +42 -0
  46. package/lib/generator/html-generator.js.map +1 -0
  47. package/lib/index.d.ts +21 -0
  48. package/lib/index.d.ts.map +1 -0
  49. package/lib/index.js +21 -0
  50. package/lib/index.js.map +1 -0
  51. package/lib/output/asset-embedder.d.ts +19 -0
  52. package/lib/output/asset-embedder.d.ts.map +1 -0
  53. package/lib/output/asset-embedder.js +35 -0
  54. package/lib/output/asset-embedder.js.map +1 -0
  55. package/lib/output/externals-copier.d.ts +20 -0
  56. package/lib/output/externals-copier.d.ts.map +1 -0
  57. package/lib/output/externals-copier.js +62 -0
  58. package/lib/output/externals-copier.js.map +1 -0
  59. package/lib/output/externals-copier.spec.d.ts +2 -0
  60. package/lib/output/externals-copier.spec.d.ts.map +1 -0
  61. package/lib/output/externals-copier.spec.js +30 -0
  62. package/lib/output/externals-copier.spec.js.map +1 -0
  63. package/lib/output/output-writer.d.ts +39 -0
  64. package/lib/output/output-writer.d.ts.map +1 -0
  65. package/lib/output/output-writer.js +102 -0
  66. package/lib/output/output-writer.js.map +1 -0
  67. package/lib/output/output-writer.spec.d.ts +2 -0
  68. package/lib/output/output-writer.spec.d.ts.map +1 -0
  69. package/lib/output/output-writer.spec.js +34 -0
  70. package/lib/output/output-writer.spec.js.map +1 -0
  71. package/lib/plugin/cell-plugin.d.ts +134 -0
  72. package/lib/plugin/cell-plugin.d.ts.map +1 -0
  73. package/lib/plugin/cell-plugin.js +429 -0
  74. package/lib/plugin/cell-plugin.js.map +1 -0
  75. package/lib/plugin/cell-plugin.spec.d.ts +2 -0
  76. package/lib/plugin/cell-plugin.spec.d.ts.map +1 -0
  77. package/lib/plugin/cell-plugin.spec.js +74 -0
  78. package/lib/plugin/cell-plugin.spec.js.map +1 -0
  79. package/lib/plugin/node-polyfills.d.ts +13 -0
  80. package/lib/plugin/node-polyfills.d.ts.map +1 -0
  81. package/lib/plugin/node-polyfills.js +55 -0
  82. package/lib/plugin/node-polyfills.js.map +1 -0
  83. package/lib/plugin/node-polyfills.spec.d.ts +2 -0
  84. package/lib/plugin/node-polyfills.spec.d.ts.map +1 -0
  85. package/lib/plugin/node-polyfills.spec.js +16 -0
  86. package/lib/plugin/node-polyfills.spec.js.map +1 -0
  87. package/lib/project/component-collector.d.ts +32 -0
  88. package/lib/project/component-collector.d.ts.map +1 -0
  89. package/lib/project/component-collector.js +93 -0
  90. package/lib/project/component-collector.js.map +1 -0
  91. package/lib/project/config-loader.d.ts +16 -0
  92. package/lib/project/config-loader.d.ts.map +1 -0
  93. package/lib/project/config-loader.js +76 -0
  94. package/lib/project/config-loader.js.map +1 -0
  95. package/lib/project/env-overrides.d.ts +23 -0
  96. package/lib/project/env-overrides.d.ts.map +1 -0
  97. package/lib/project/env-overrides.js +48 -0
  98. package/lib/project/env-overrides.js.map +1 -0
  99. package/lib/project/env-overrides.spec.d.ts +2 -0
  100. package/lib/project/env-overrides.spec.d.ts.map +1 -0
  101. package/lib/project/env-overrides.spec.js +41 -0
  102. package/lib/project/env-overrides.spec.js.map +1 -0
  103. package/lib/project/module-resolver.d.ts +15 -0
  104. package/lib/project/module-resolver.d.ts.map +1 -0
  105. package/lib/project/module-resolver.js +32 -0
  106. package/lib/project/module-resolver.js.map +1 -0
  107. package/lib/project/project-loader.d.ts +54 -0
  108. package/lib/project/project-loader.d.ts.map +1 -0
  109. package/lib/project/project-loader.js +117 -0
  110. package/lib/project/project-loader.js.map +1 -0
  111. package/lib/project/project-loader.spec.d.ts +2 -0
  112. package/lib/project/project-loader.spec.d.ts.map +1 -0
  113. package/lib/project/project-loader.spec.js +178 -0
  114. package/lib/project/project-loader.spec.js.map +1 -0
  115. package/lib/test/fixture-project.d.ts +17 -0
  116. package/lib/test/fixture-project.d.ts.map +1 -0
  117. package/lib/test/fixture-project.js +43 -0
  118. package/lib/test/fixture-project.js.map +1 -0
  119. package/lib/testing/memory-http.d.ts +82 -0
  120. package/lib/testing/memory-http.d.ts.map +1 -0
  121. package/lib/testing/memory-http.js +210 -0
  122. package/lib/testing/memory-http.js.map +1 -0
  123. package/lib/testing/test-app.d.ts +54 -0
  124. package/lib/testing/test-app.d.ts.map +1 -0
  125. package/lib/testing/test-app.js +132 -0
  126. package/lib/testing/test-app.js.map +1 -0
  127. package/lib/testing/test-app.spec.d.ts +2 -0
  128. package/lib/testing/test-app.spec.d.ts.map +1 -0
  129. package/lib/testing/test-app.spec.js +115 -0
  130. package/lib/testing/test-app.spec.js.map +1 -0
  131. package/lib/utils/config-util.d.ts +6 -0
  132. package/lib/utils/config-util.d.ts.map +1 -0
  133. package/lib/utils/config-util.js +25 -0
  134. package/lib/utils/config-util.js.map +1 -0
  135. package/lib/utils/config-util.spec.d.ts +2 -0
  136. package/lib/utils/config-util.spec.d.ts.map +1 -0
  137. package/lib/utils/config-util.spec.js +22 -0
  138. package/lib/utils/config-util.spec.js.map +1 -0
  139. package/lib/utils/tsconfig-util.d.ts +5 -0
  140. package/lib/utils/tsconfig-util.d.ts.map +1 -0
  141. package/lib/utils/tsconfig-util.js +21 -0
  142. package/lib/utils/tsconfig-util.js.map +1 -0
  143. package/package.json +50 -4
  144. package/src/builder/cell-builder.ts +72 -0
  145. package/src/constants.ts +30 -0
  146. package/src/dev/cell-dev-server.ts +387 -0
  147. package/src/expression/expression-evaluator.ts +106 -0
  148. package/src/generator/config-generator.ts +45 -0
  149. package/src/generator/container-generator.ts +41 -0
  150. package/src/generator/html-generator.ts +43 -0
  151. package/src/index.ts +20 -0
  152. package/src/output/asset-embedder.ts +42 -0
  153. package/src/output/externals-copier.ts +64 -0
  154. package/src/output/output-writer.ts +113 -0
  155. package/src/plugin/cell-plugin.ts +481 -0
  156. package/src/plugin/node-polyfills.ts +57 -0
  157. package/src/project/component-collector.ts +107 -0
  158. package/src/project/config-loader.ts +77 -0
  159. package/src/project/env-overrides.ts +55 -0
  160. package/src/project/module-resolver.ts +39 -0
  161. package/src/project/project-loader.ts +153 -0
  162. package/src/test/fixture-project.ts +50 -0
  163. package/src/testing/memory-http.ts +238 -0
  164. package/src/testing/test-app.ts +155 -0
  165. package/src/utils/config-util.ts +21 -0
  166. package/src/utils/tsconfig-util.ts +19 -0
@@ -0,0 +1,97 @@
1
+ import { createRequire } from 'node:module';
2
+ import { join } from 'node:path';
3
+ import { CellError } from '@celljs/kit';
4
+ /**
5
+ * Evaluates `${...}` expressions with the project's own @celljs/core compiler, so build-time and
6
+ * runtime evaluation have identical semantics. The context is the object itself plus `extra`.
7
+ */
8
+ export class ExpressionEvaluator {
9
+ static compilers = new Map();
10
+ compiler;
11
+ constructor(root) {
12
+ this.compiler = ExpressionEvaluator.compilerFor(root);
13
+ }
14
+ static compilerFor(root) {
15
+ let compiler = ExpressionEvaluator.compilers.get(root);
16
+ if (!compiler) {
17
+ const require = createRequire(join(root, 'package.json'));
18
+ require('reflect-metadata');
19
+ const { ExpressionCompilerImpl } = require('@celljs/core/lib/common/el/expression-compiler');
20
+ const { JexlEngineProviderImpl } = require('@celljs/core/lib/common/el/jexl-engine-provider');
21
+ compiler = new ExpressionCompilerImpl();
22
+ Object.defineProperty(compiler, 'jexlEngineProvider', { value: new JexlEngineProviderImpl() });
23
+ ExpressionEvaluator.compilers.set(root, compiler);
24
+ }
25
+ return compiler;
26
+ }
27
+ /** Evaluates every string of `target` in place and returns it. */
28
+ evaluate(target, extra = {}) {
29
+ const ctx = Object.assign(target, extra);
30
+ try {
31
+ this.walk(ctx, '', ctx, extra);
32
+ }
33
+ finally {
34
+ for (const key of Object.keys(extra)) {
35
+ delete ctx[key];
36
+ }
37
+ }
38
+ return target;
39
+ }
40
+ /** Evaluates one text against `ctx`. */
41
+ evaluateText(text, ctx, path = 'value') {
42
+ let sections;
43
+ try {
44
+ sections = this.compiler.compileSections(text, {});
45
+ }
46
+ catch (cause) {
47
+ throw new CellError({
48
+ code: 'CELL_CONFIG_EXPRESSION',
49
+ message: `Invalid expression at ${path}: ${text}`,
50
+ hint: 'Expressions are jexl inside ${...}; check quotes and braces.',
51
+ cause,
52
+ });
53
+ }
54
+ if (!sections.some(s => typeof s !== 'string')) {
55
+ return text;
56
+ }
57
+ if (sections.length === 1) {
58
+ return this.run(sections[0], ctx, text, path);
59
+ }
60
+ return sections.map(s => (typeof s === 'string' ? s : this.run(s, ctx, text, path))).join('');
61
+ }
62
+ run(section, ctx, text, path) {
63
+ if (typeof section === 'string') {
64
+ return section;
65
+ }
66
+ let value;
67
+ try {
68
+ value = section.evalSync(ctx);
69
+ }
70
+ catch (cause) {
71
+ throw new CellError({
72
+ code: 'CELL_CONFIG_EXPRESSION',
73
+ message: `Cannot evaluate ${path}: ${text} (${cause.message})`,
74
+ hint: 'Only configuration keys and `env` are available in expressions.',
75
+ cause,
76
+ });
77
+ }
78
+ return typeof value === 'string' ? this.evaluateText(value, ctx, path) : value;
79
+ }
80
+ walk(node, path, ctx, extra) {
81
+ const record = node;
82
+ for (const key of Object.keys(record)) {
83
+ if (node === ctx && key in extra) {
84
+ continue;
85
+ }
86
+ const value = record[key];
87
+ const child = path ? `${path}.${key}` : key;
88
+ if (typeof value === 'string') {
89
+ record[key] = this.evaluateText(value, ctx, child);
90
+ }
91
+ else if (value && typeof value === 'object') {
92
+ this.walk(value, child, ctx, extra);
93
+ }
94
+ }
95
+ }
96
+ }
97
+ //# sourceMappingURL=expression-evaluator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression-evaluator.js","sourceRoot":"","sources":["../../src/expression/expression-evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAA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AC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACvD,CAAC;iBAAM,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC5C,IAAI,CAAC,IAAI,CAAC,KAAgC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACnE,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=expression-evaluator.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression-evaluator.spec.d.ts","sourceRoot":"","sources":["../../src/expression/expression-evaluator.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { FixtureProject } from '../test/fixture-project.js';
3
+ import { ExpressionEvaluator } from './expression-evaluator.js';
4
+ describe('ExpressionEvaluator', () => {
5
+ const evaluator = new ExpressionEvaluator(FixtureProject.BASE);
6
+ it('resolves references to other keys, env and the elvis default', () => {
7
+ const config = { cell: { server: { port: 3000, endpoint: 'http://localhost:${cell.server.port}' }, db: "${env.DB_HOST ?: 'localhost'}" } };
8
+ expect(evaluator.evaluate(config, { env: {} })).toEqual({ cell: { server: { port: 3000, endpoint: 'http://localhost:3000' }, db: 'localhost' } });
9
+ });
10
+ it('keeps the type of a single expression and joins mixed text', () => {
11
+ const config = { a: '${[1, 2]}', b: 'x-${1 + 1}-y', c: 'plain' };
12
+ expect(evaluator.evaluate(config)).toEqual({ a: [1, 2], b: 'x-2-y', c: 'plain' });
13
+ });
14
+ it('evaluates nested arrays and removes the extra context afterwards', () => {
15
+ const config = { list: [{ host: '${env.HOST}' }] };
16
+ evaluator.evaluate(config, { env: { HOST: 'db' } });
17
+ expect(config).toEqual({ list: [{ host: 'db' }] });
18
+ });
19
+ it('reports unknown transforms as CELL_CONFIG_EXPRESSION with the key path', () => {
20
+ expect(() => evaluator.evaluate({ cell: { keys: "${ ['x'] | onTarget('backend') }" } })).toThrow(expect.objectContaining({ code: 'CELL_CONFIG_EXPRESSION', message: expect.stringContaining('cell.keys') }));
21
+ });
22
+ });
23
+ //# sourceMappingURL=expression-evaluator.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression-evaluator.spec.js","sourceRoot":"","sources":["../../src/expression/expression-evaluator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACjC,MAAM,SAAS,GAAG,IAAI,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAE/D,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACpE,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,sCAAsC,EAAE,EAAE,EAAE,EAAE,+BAA+B,EAAE,EAAE,CAAC;QAC3I,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,uBAAuB,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;IACtJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAW,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QACxE,MAAM,MAAM,GAA4B,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;QAC5E,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;QAC9E,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAC5F,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC,CAC7G,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Target } from '@celljs/kit';
2
+ /**
3
+ * Generates the code that replaces @celljs/core's `common/config/dynamic-config.js`. Backend
4
+ * `${...}` expressions stay as strings: @celljs/core evaluates them at runtime against the config
5
+ * and `process.env`, so one build serves every environment. `CELL_BACKEND__*` environment variables
6
+ * override keys at startup, then `paths.public` (relative to the output directory) becomes absolute.
7
+ */
8
+ export declare class ConfigGenerator {
9
+ protected readonly target: Target;
10
+ protected readonly format: 'esm' | 'cjs';
11
+ /** Absolute output directory; by default the parent of the server bundle. `cell dev` has no bundle. */
12
+ protected readonly outputDir?: string | undefined;
13
+ constructor(target: Target, format?: 'esm' | 'cjs',
14
+ /** Absolute output directory; by default the parent of the server bundle. `cell dev` has no bundle. */
15
+ outputDir?: string | undefined);
16
+ generate(config: Record<string, unknown>): string;
17
+ }
18
+ //# sourceMappingURL=config-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../src/generator/config-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;GAKG;AACH,qBAAa,eAAe;IAEpB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK;IACxC,uGAAuG;IACvG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM;IAJzC,YACuB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,KAAK,GAAG,KAAa;IAChD,uGAAuG;IACpF,SAAS,CAAC,EAAE,MAAM,YAAA,EACrC;IAEJ,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CA0BhD;CACJ"}
@@ -0,0 +1,45 @@
1
+ import { PUBLIC_DIR } from '../constants.js';
2
+ /**
3
+ * Generates the code that replaces @celljs/core's `common/config/dynamic-config.js`. Backend
4
+ * `${...}` expressions stay as strings: @celljs/core evaluates them at runtime against the config
5
+ * and `process.env`, so one build serves every environment. `CELL_BACKEND__*` environment variables
6
+ * override keys at startup, then `paths.public` (relative to the output directory) becomes absolute.
7
+ */
8
+ export class ConfigGenerator {
9
+ target;
10
+ format;
11
+ outputDir;
12
+ constructor(target, format = 'esm',
13
+ /** Absolute output directory; by default the parent of the server bundle. `cell dev` has no bundle. */
14
+ outputDir) {
15
+ this.target = target;
16
+ this.format = format;
17
+ this.outputDir = outputDir;
18
+ }
19
+ generate(config) {
20
+ const lines = ['// Generated by @celljs/vite. Do not edit.'];
21
+ if (this.target === 'backend') {
22
+ if (this.format === 'esm' && !this.outputDir) {
23
+ lines.push("import { fileURLToPath } from 'node:url';");
24
+ }
25
+ lines.push("import { isAbsolute, join } from 'node:path';");
26
+ // This module replaces common/config/dynamic-config.js of @celljs/core, next to env-config-util.js.
27
+ lines.push("import { EnvConfigUtil } from './env-config-util.js';");
28
+ }
29
+ lines.push(`export const config = ${JSON.stringify(config)};`);
30
+ if (this.target === 'backend') {
31
+ const outputDir = this.outputDir
32
+ ? JSON.stringify(this.outputDir)
33
+ : this.format === 'esm'
34
+ ? "fileURLToPath(new URL('..', import.meta.url))"
35
+ : "join(__dirname, '..')";
36
+ lines.push(`config.paths = { public: '${PUBLIC_DIR}', ...config.paths };`);
37
+ // CELL_BACKEND__* variables override keys before any ${...} is evaluated.
38
+ lines.push('EnvConfigUtil.applyProcessEnv(config);');
39
+ // paths.public is relative to the output directory (the parent of server/), unless absolute or an expression.
40
+ lines.push(`const publicDir = config.paths.public; if (typeof publicDir === 'string' && !isAbsolute(publicDir) && !publicDir.includes('$' + '{')) config.paths.public = join(${outputDir}, publicDir);`);
41
+ }
42
+ return `${lines.join('\n')}\n`;
43
+ }
44
+ }
45
+ //# sourceMappingURL=config-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-generator.js","sourceRoot":"","sources":["../../src/generator/config-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAED,MAAM;IACN,MAAM;IAEN,SAAS;IAJhC,YACuB,MAAc,EACd,MAAM,GAAkB,KAAK;IAChD,uGAAuG;IACpF,SAAkB;sBAHlB,MAAM;sBACN,MAAM;yBAEN,SAAS;IAC7B,CAAC;IAEJ,QAAQ,CAAC,MAA+B;QACpC,MAAM,KAAK,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC3C,KAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;YAC5D,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YAC5D,oGAAoG;YACpG,KAAK,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACxE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS;gBAC5B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;gBAChC,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK;oBACrB,CAAC,CAAC,+CAA+C;oBACjD,CAAC,CAAC,uBAAuB,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,6BAA6B,UAAU,uBAAuB,CAAC,CAAC;YAC3E,0EAA0E;YAC1E,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;YACrD,8GAA8G;YAC9G,KAAK,CAAC,IAAI,CACN,oKAAoK,SAAS,eAAe,CAC/L,CAAC;QACN,CAAC;QACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACnC,CAAC;CACJ"}
@@ -0,0 +1,13 @@
1
+ import type { Target } from '@celljs/kit';
2
+ /**
3
+ * Generates the code that replaces @celljs/core's `common/container/dynamic-container.js`: static
4
+ * modules load synchronously, the other modules in order. Core-internal imports are relative, so
5
+ * they hit the very same module instances as the rest of the application.
6
+ */
7
+ export declare class ContainerGenerator {
8
+ protected readonly target: Target;
9
+ constructor(target: Target);
10
+ generate(staticIds: string[], moduleIds: string[]): string;
11
+ protected prelude(): string[];
12
+ }
13
+ //# sourceMappingURL=container-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-generator.d.ts","sourceRoot":"","sources":["../../src/generator/container-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,qBAAa,kBAAkB;IACf,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAA7C,YAA+B,MAAM,EAAE,MAAM,EAAI;IAEjD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAsBzD;IAED,SAAS,CAAC,OAAO,IAAI,MAAM,EAAE,CAK5B;CACJ"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Generates the code that replaces @celljs/core's `common/container/dynamic-container.js`: static
3
+ * modules load synchronously, the other modules in order. Core-internal imports are relative, so
4
+ * they hit the very same module instances as the rest of the application.
5
+ */
6
+ export class ContainerGenerator {
7
+ target;
8
+ constructor(target) {
9
+ this.target = target;
10
+ }
11
+ generate(staticIds, moduleIds) {
12
+ const statics = staticIds.map((id, i) => `import cellStatic${i} from ${JSON.stringify(id)};`);
13
+ const loads = staticIds.map((_, i) => `instance.load(cellStatic${i});`);
14
+ const chain = moduleIds.map(id => `\n .then(() => import(${JSON.stringify(id)})).then(load)`).join('');
15
+ return [
16
+ `// Generated by @celljs/vite for the ${this.target}. Do not edit.`,
17
+ ...this.prelude(),
18
+ "import { ContainerFactory } from './container-factory.js';",
19
+ ...statics,
20
+ '',
21
+ 'const instance = ContainerFactory.create();',
22
+ ...loads,
23
+ '',
24
+ 'function load(mod) {',
25
+ ' return Promise.resolve(mod.default).then(m => instance.load(m));',
26
+ '}',
27
+ '',
28
+ `export const container = Promise.resolve()${chain}`,
29
+ // A module that fails to load fails the entry: it stops the process or reports to the ApplicationHost.
30
+ ' .then(() => instance);',
31
+ '',
32
+ ].join('\n');
33
+ }
34
+ prelude() {
35
+ if (this.target === 'frontend') {
36
+ return ["import 'reflect-metadata';", "import 'setimmediate';", "import '../../browser/index.js';"];
37
+ }
38
+ return ["import 'reflect-metadata';"];
39
+ }
40
+ }
41
+ //# sourceMappingURL=container-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-generator.js","sourceRoot":"","sources":["../../src/generator/container-generator.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACI,MAAM;IAArC,YAA+B,MAAc;sBAAd,MAAM;IAAW,CAAC;IAEjD,QAAQ,CAAC,SAAmB,EAAE,SAAmB;QAC7C,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9F,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACxE,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1G,OAAO;YACH,wCAAwC,IAAI,CAAC,MAAM,gBAAgB;YACnE,GAAG,IAAI,CAAC,OAAO,EAAE;YACjB,4DAA4D;YAC5D,GAAG,OAAO;YACV,EAAE;YACF,6CAA6C;YAC7C,GAAG,KAAK;YACR,EAAE;YACF,sBAAsB;YACtB,sEAAsE;YACtE,GAAG;YACH,EAAE;YACF,6CAA6C,KAAK,EAAE;YACpD,uGAAuG;YACvG,4BAA4B;YAC5B,EAAE;SACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAES,OAAO;QACb,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO,CAAC,4BAA4B,EAAE,wBAAwB,EAAE,kCAAkC,CAAC,CAAC;QACxG,CAAC;QACD,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC1C,CAAC;CACJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generator.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.spec.d.ts","sourceRoot":"","sources":["../../src/generator/generator.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,61 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { ENTRY_URL } from '../constants.js';
3
+ import { ExpressionEvaluator } from '../expression/expression-evaluator.js';
4
+ import { FixtureProject } from '../test/fixture-project.js';
5
+ import { ConfigGenerator } from './config-generator.js';
6
+ import { ContainerGenerator } from './container-generator.js';
7
+ import { HtmlGenerator } from './html-generator.js';
8
+ describe('ContainerGenerator', () => {
9
+ it('loads static modules first, then modules in order', () => {
10
+ const code = new ContainerGenerator('backend').generate(['/s.js'], ['/a.js', '/b.js']);
11
+ expect(code).toContain('import cellStatic0 from "/s.js";');
12
+ expect(code).toContain('instance.load(cellStatic0);');
13
+ expect(code.indexOf('import("/a.js")')).toBeLessThan(code.indexOf('import("/b.js")'));
14
+ expect(code).not.toContain('setimmediate');
15
+ });
16
+ it('adds the browser prelude for the frontend', () => {
17
+ const code = new ContainerGenerator('frontend').generate([], []);
18
+ expect(code).toContain("import 'setimmediate';");
19
+ expect(code).toContain("import '../../browser/index.js';");
20
+ // A failing module rejects the container, so the entry (or the ApplicationHost) sees the error.
21
+ expect(code).not.toContain('.catch(');
22
+ expect(code.trimEnd().endsWith('.then(() => instance);')).toBe(true);
23
+ });
24
+ });
25
+ describe('ConfigGenerator', () => {
26
+ it('inlines frontend config as is', () => {
27
+ expect(new ConfigGenerator('frontend').generate({ a: 1 })).toContain('export const config = {"a":1};');
28
+ });
29
+ it('applies CELL_BACKEND__ variables when the server starts, with the util next to the replaced module', () => {
30
+ const code = new ConfigGenerator('backend').generate({});
31
+ expect(code).toContain("import { EnvConfigUtil } from './env-config-util.js';");
32
+ expect(code).toContain('EnvConfigUtil.applyProcessEnv(config);');
33
+ expect(new ConfigGenerator('frontend').generate({})).not.toContain('EnvConfigUtil');
34
+ });
35
+ it('defaults paths.public, applies the variables, then resolves it against the output directory', () => {
36
+ const lines = new ConfigGenerator('backend', 'esm').generate({}).trimEnd().split('\n');
37
+ const at = (text) => lines.findIndex(line => line.includes(text));
38
+ expect(at("config.paths = { public: 'public', ...config.paths };")).toBeGreaterThan(at('export const config'));
39
+ expect(at('EnvConfigUtil.applyProcessEnv(config);')).toBeGreaterThan(at('config.paths = '));
40
+ expect(at("join(fileURLToPath(new URL('..', import.meta.url)), publicDir)")).toBe(lines.length - 1);
41
+ expect(new ConfigGenerator('backend', 'cjs').generate({})).toContain("join(join(__dirname, '..'), publicDir)");
42
+ expect(new ConfigGenerator('backend', 'cjs').generate({})).not.toContain('import.meta');
43
+ });
44
+ });
45
+ describe('HtmlGenerator', () => {
46
+ const generator = new HtmlGenerator(new ExpressionEvaluator(FixtureProject.BASE));
47
+ const config = { cell: { name: 'Demo', hostDomId: 'root', server: { path: '/app/' } } };
48
+ it('renders the default page from the frontend config', () => {
49
+ const html = generator.generate(config);
50
+ expect(html).toContain('<title>Demo</title>');
51
+ expect(html).toContain('<div id="root"></div>');
52
+ expect(html).toContain('<base href="/app/">');
53
+ expect(html).toContain(`<script type="module" src="${ENTRY_URL}"></script>`);
54
+ });
55
+ it('adds the entry script to a custom page only once', () => {
56
+ expect(generator.generate(config, '<body>${cell.name}</body>')).toBe(`<body>Demo <script type="module" src="${ENTRY_URL}"></script>\n </body>`);
57
+ const custom = `<script type="module" src="${ENTRY_URL}"></script>`;
58
+ expect(generator.generate(config, custom)).toBe(custom);
59
+ });
60
+ });
61
+ //# sourceMappingURL=generator.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.spec.js","sourceRoot":"","sources":["../../src/generator/generator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,MAAM,IAAI,GAAG,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QACvF,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC;QAC3D,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;QACtD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACtF,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACjD,MAAM,IAAI,GAAG,IAAI,kBAAkB,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C;IAExF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,8BAA8B,SAAS,aAAa,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,0CAA0C,SAAS,wBAAwB,CAAC,CAAC;QAClJ,MAAM,MAAM,GAAG,8BAA8B,SAAS,aAAa,CAAC;QACpE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { ExpressionEvaluator } from '../expression/expression-evaluator.js';
2
+ /**
3
+ * Generates the frontend HTML page: the project's `index.html` or a default page, with `${...}`
4
+ * evaluated against the frontend configuration and the entry script added.
5
+ */
6
+ export declare class HtmlGenerator {
7
+ protected readonly evaluator: ExpressionEvaluator;
8
+ static readonly DEFAULT_TEMPLATE: string;
9
+ constructor(evaluator: ExpressionEvaluator);
10
+ generate(config: Record<string, unknown>, template?: string): string;
11
+ protected withEntryScript(html: string): string;
12
+ }
13
+ //# sourceMappingURL=html-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-generator.d.ts","sourceRoot":"","sources":["../../src/generator/html-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;;GAGG;AACH,qBAAa,aAAa;IAqBV,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,mBAAmB;IApB7D,MAAM,CAAC,QAAQ,CAAC,gBAAgB,SAkBnB;IAEb,YAA+B,SAAS,EAAE,mBAAmB,EAAI;IAEjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,SAAiC,GAAG,MAAM,CAG3F;IAED,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM9C;CACJ"}
@@ -0,0 +1,42 @@
1
+ import { ENTRY_URL } from '../constants.js';
2
+ /**
3
+ * Generates the frontend HTML page: the project's `index.html` or a default page, with `${...}`
4
+ * evaluated against the frontend configuration and the entry script added.
5
+ */
6
+ export class HtmlGenerator {
7
+ evaluator;
8
+ static DEFAULT_TEMPLATE = [
9
+ '<!DOCTYPE html>',
10
+ '<html>',
11
+ ' <head>',
12
+ ' <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">',
13
+ ' <meta http-equiv="X-UA-Compatible" content="edge">',
14
+ ' <meta name="renderer" content="webkit">',
15
+ ' <meta charset="UTF-8">',
16
+ ' <title>${cell.name}</title>',
17
+ ' <style>body { margin: 0; }</style>',
18
+ ' <base href="${cell.server.path ?: \'/\'}">',
19
+ ' <link rel="icon" href="favicon.ico" vite-ignore>',
20
+ ' </head>',
21
+ ' <body>',
22
+ ' <div id="${cell.hostDomId}"></div>',
23
+ ' </body>',
24
+ '</html>',
25
+ '',
26
+ ].join('\n');
27
+ constructor(evaluator) {
28
+ this.evaluator = evaluator;
29
+ }
30
+ generate(config, template = HtmlGenerator.DEFAULT_TEMPLATE) {
31
+ const html = String(this.evaluator.evaluateText(template, structuredClone(config), 'index.html'));
32
+ return this.withEntryScript(html);
33
+ }
34
+ withEntryScript(html) {
35
+ if (html.includes(ENTRY_URL)) {
36
+ return html;
37
+ }
38
+ const tag = `<script type="module" src="${ENTRY_URL}"></script>`;
39
+ return html.includes('</body>') ? html.replace('</body>', ` ${tag}\n </body>`) : `${html}\n${tag}\n`;
40
+ }
41
+ }
42
+ //# sourceMappingURL=html-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-generator.js","sourceRoot":"","sources":["../../src/generator/html-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C;;;GAGG;AACH,MAAM,OAAO,aAAa;IAqBS,SAAS;IApBxC,MAAM,CAAU,gBAAgB,GAAG;QAC/B,iBAAiB;QACjB,QAAQ;QACR,UAAU;QACV,6GAA6G;QAC7G,wDAAwD;QACxD,6CAA6C;QAC7C,4BAA4B;QAC5B,iCAAiC;QACjC,wCAAwC;QACxC,gDAAgD;QAChD,sDAAsD;QACtD,WAAW;QACX,UAAU;QACV,wCAAwC;QACxC,WAAW;QACX,SAAS;QACT,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,YAA+B,SAA8B;yBAA9B,SAAS;IAAwB,CAAC;IAEjE,QAAQ,CAAC,MAA+B,EAAE,QAAQ,GAAG,aAAa,CAAC,gBAAgB;QAC/E,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAES,eAAe,CAAC,IAAY;QAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,GAAG,GAAG,8BAA8B,SAAS,aAAa,CAAC;QACjE,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,GAAG,IAAI,CAAC;IAC3G,CAAC;CACJ"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ export * from './builder/cell-builder.js';
2
+ export * from './constants.js';
3
+ export * from './dev/cell-dev-server.js';
4
+ export * from './expression/expression-evaluator.js';
5
+ export * from './generator/config-generator.js';
6
+ export * from './generator/container-generator.js';
7
+ export * from './generator/html-generator.js';
8
+ export * from './output/asset-embedder.js';
9
+ export * from './output/externals-copier.js';
10
+ export * from './output/output-writer.js';
11
+ export { CellPlugin, type CellPluginOptions, cell } from './plugin/cell-plugin.js';
12
+ export * from './plugin/node-polyfills.js';
13
+ export * from './project/component-collector.js';
14
+ export * from './project/config-loader.js';
15
+ export * from './project/env-overrides.js';
16
+ export * from './project/module-resolver.js';
17
+ export * from './project/project-loader.js';
18
+ export * from './testing/test-app.js';
19
+ export * from './utils/config-util.js';
20
+ export * from './utils/tsconfig-util.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACnF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,21 @@
1
+ export * from './builder/cell-builder.js';
2
+ export * from './constants.js';
3
+ export * from './dev/cell-dev-server.js';
4
+ export * from './expression/expression-evaluator.js';
5
+ export * from './generator/config-generator.js';
6
+ export * from './generator/container-generator.js';
7
+ export * from './generator/html-generator.js';
8
+ export * from './output/asset-embedder.js';
9
+ export * from './output/externals-copier.js';
10
+ export * from './output/output-writer.js';
11
+ export { CellPlugin, cell } from './plugin/cell-plugin.js';
12
+ export * from './plugin/node-polyfills.js';
13
+ export * from './project/component-collector.js';
14
+ export * from './project/config-loader.js';
15
+ export * from './project/env-overrides.js';
16
+ export * from './project/module-resolver.js';
17
+ export * from './project/project-loader.js';
18
+ export * from './testing/test-app.js';
19
+ export * from './utils/config-util.js';
20
+ export * from './utils/tsconfig-util.js';
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA0B,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACnF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,19 @@
1
+ /** A frontend file inside a `--single` server bundle. */
2
+ export interface EmbeddedAsset {
3
+ /** Base64 of the content. */
4
+ body: string;
5
+ /** Strong ETag of the content. */
6
+ etag: string;
7
+ }
8
+ /**
9
+ * Turns the public directory into a module of the server bundle (`--single`, docs/design/architecture.md
10
+ * L2): it registers every file by URL path under `Symbol.for('@celljs/serve-static/assets')`, where
11
+ * @celljs/serve-static serves them from memory instead of the disk.
12
+ */
13
+ export declare class AssetEmbedder {
14
+ protected readonly dir: string;
15
+ constructor(dir: string);
16
+ files(): Map<string, EmbeddedAsset>;
17
+ generate(): string;
18
+ }
19
+ //# sourceMappingURL=asset-embedder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-embedder.d.ts","sourceRoot":"","sources":["../../src/output/asset-embedder.ts"],"names":[],"mappings":"AAKA,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC1B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACV,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM;IAA1C,YAA+B,GAAG,EAAE,MAAM,EAAI;IAE9C,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAclC;IAED,QAAQ,IAAI,MAAM,CAGjB;CACJ"}
@@ -0,0 +1,35 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readdirSync, readFileSync, statSync } from 'node:fs';
3
+ import { join, sep } from 'node:path';
4
+ import { EMBEDDED_ASSETS_KEY } from '../constants.js';
5
+ /**
6
+ * Turns the public directory into a module of the server bundle (`--single`, docs/design/architecture.md
7
+ * L2): it registers every file by URL path under `Symbol.for('@celljs/serve-static/assets')`, where
8
+ * @celljs/serve-static serves them from memory instead of the disk.
9
+ */
10
+ export class AssetEmbedder {
11
+ dir;
12
+ constructor(dir) {
13
+ this.dir = dir;
14
+ }
15
+ files() {
16
+ const assets = new Map();
17
+ for (const name of readdirSync(this.dir, { recursive: true }).sort()) {
18
+ const file = join(this.dir, name);
19
+ if (!statSync(file).isFile()) {
20
+ continue;
21
+ }
22
+ const content = readFileSync(file);
23
+ assets.set(`/${name.split(sep).join('/')}`, {
24
+ body: content.toString('base64'),
25
+ etag: `"${createHash('sha1').update(content).digest('hex').slice(0, 16)}"`,
26
+ });
27
+ }
28
+ return assets;
29
+ }
30
+ generate() {
31
+ const entries = JSON.stringify([...this.files()]);
32
+ return `globalThis[Symbol.for(${JSON.stringify(EMBEDDED_ASSETS_KEY)})] = new Map(${entries});\n`;
33
+ }
34
+ }
35
+ //# sourceMappingURL=asset-embedder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-embedder.js","sourceRoot":"","sources":["../../src/output/asset-embedder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAUtD;;;;GAIG;AACH,MAAM,OAAO,aAAa;IACS,GAAG;IAAlC,YAA+B,GAAW;mBAAX,GAAG;IAAW,CAAC;IAE9C,KAAK;QACD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;QAChD,KAAK,MAAM,IAAI,IAAK,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAc,CAAC,IAAI,EAAE,EAAE,CAAC;YACjF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAClC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC3B,SAAS;YACb,CAAC;YACD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;gBACxC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAChC,IAAI,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG;aAC7E,CAAC,CAAC;QACP,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,QAAQ;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAClD,OAAO,yBAAyB,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,MAAM,CAAC;IACrG,CAAC;CACJ"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copies installed external packages, with their production dependencies, into
3
+ * `<outDir>/node_modules` so the server bundle runs from its own directory. Packages that are not
4
+ * installed are skipped: optional dependencies may legitimately be absent at runtime.
5
+ */
6
+ export declare class ExternalsCopier {
7
+ protected readonly root: string;
8
+ protected readonly outDir: string;
9
+ protected readonly found: Map<string, string>;
10
+ constructor(root: string, outDir: string);
11
+ /** Returns the names of the copied packages. */
12
+ copy(names: string[]): string[];
13
+ protected visit(name: string, from: string): void;
14
+ /**
15
+ * The package.json of `name` as Node finds the package from `from`. Looked up on disk rather than
16
+ * with `require.resolve('<name>/package.json')`, which fails for packages whose `exports` leave it out.
17
+ */
18
+ protected findManifest(name: string, from: string): string | undefined;
19
+ }
20
+ //# sourceMappingURL=externals-copier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"externals-copier.d.ts","sourceRoot":"","sources":["../../src/output/externals-copier.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,qBAAa,eAAe;IAIpB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAC/B,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAJrC,SAAS,CAAC,QAAQ,CAAC,KAAK,sBAA6B;IAErD,YACuB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACjC;IAEJ,gDAAgD;IAChD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAa9B;IAED,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAchD;IAED;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUrE;CACJ"}