@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.
- package/README.md +29 -2
- package/assets/favicon.ico +0 -0
- package/lib/builder/cell-builder.d.ts +19 -0
- package/lib/builder/cell-builder.d.ts.map +1 -0
- package/lib/builder/cell-builder.js +59 -0
- package/lib/builder/cell-builder.js.map +1 -0
- package/lib/builder/cell-builder.spec.d.ts +2 -0
- package/lib/builder/cell-builder.spec.d.ts.map +1 -0
- package/lib/builder/cell-builder.spec.js +280 -0
- package/lib/builder/cell-builder.spec.js.map +1 -0
- package/lib/constants.d.ts +24 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +23 -0
- package/lib/constants.js.map +1 -0
- package/lib/dev/cell-dev-server.d.ts +113 -0
- package/lib/dev/cell-dev-server.d.ts.map +1 -0
- package/lib/dev/cell-dev-server.js +307 -0
- package/lib/dev/cell-dev-server.js.map +1 -0
- package/lib/dev/cell-dev-server.spec.d.ts +2 -0
- package/lib/dev/cell-dev-server.spec.d.ts.map +1 -0
- package/lib/dev/cell-dev-server.spec.js +188 -0
- package/lib/dev/cell-dev-server.spec.js.map +1 -0
- package/lib/expression/expression-evaluator.d.ts +24 -0
- package/lib/expression/expression-evaluator.d.ts.map +1 -0
- package/lib/expression/expression-evaluator.js +97 -0
- package/lib/expression/expression-evaluator.js.map +1 -0
- package/lib/expression/expression-evaluator.spec.d.ts +2 -0
- package/lib/expression/expression-evaluator.spec.d.ts.map +1 -0
- package/lib/expression/expression-evaluator.spec.js +23 -0
- package/lib/expression/expression-evaluator.spec.js.map +1 -0
- package/lib/generator/config-generator.d.ts +18 -0
- package/lib/generator/config-generator.d.ts.map +1 -0
- package/lib/generator/config-generator.js +45 -0
- package/lib/generator/config-generator.js.map +1 -0
- package/lib/generator/container-generator.d.ts +13 -0
- package/lib/generator/container-generator.d.ts.map +1 -0
- package/lib/generator/container-generator.js +41 -0
- package/lib/generator/container-generator.js.map +1 -0
- package/lib/generator/generator.spec.d.ts +2 -0
- package/lib/generator/generator.spec.d.ts.map +1 -0
- package/lib/generator/generator.spec.js +61 -0
- package/lib/generator/generator.spec.js.map +1 -0
- package/lib/generator/html-generator.d.ts +13 -0
- package/lib/generator/html-generator.d.ts.map +1 -0
- package/lib/generator/html-generator.js +42 -0
- package/lib/generator/html-generator.js.map +1 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/output/asset-embedder.d.ts +19 -0
- package/lib/output/asset-embedder.d.ts.map +1 -0
- package/lib/output/asset-embedder.js +35 -0
- package/lib/output/asset-embedder.js.map +1 -0
- package/lib/output/externals-copier.d.ts +20 -0
- package/lib/output/externals-copier.d.ts.map +1 -0
- package/lib/output/externals-copier.js +62 -0
- package/lib/output/externals-copier.js.map +1 -0
- package/lib/output/externals-copier.spec.d.ts +2 -0
- package/lib/output/externals-copier.spec.d.ts.map +1 -0
- package/lib/output/externals-copier.spec.js +30 -0
- package/lib/output/externals-copier.spec.js.map +1 -0
- package/lib/output/output-writer.d.ts +39 -0
- package/lib/output/output-writer.d.ts.map +1 -0
- package/lib/output/output-writer.js +102 -0
- package/lib/output/output-writer.js.map +1 -0
- package/lib/output/output-writer.spec.d.ts +2 -0
- package/lib/output/output-writer.spec.d.ts.map +1 -0
- package/lib/output/output-writer.spec.js +34 -0
- package/lib/output/output-writer.spec.js.map +1 -0
- package/lib/plugin/cell-plugin.d.ts +134 -0
- package/lib/plugin/cell-plugin.d.ts.map +1 -0
- package/lib/plugin/cell-plugin.js +429 -0
- package/lib/plugin/cell-plugin.js.map +1 -0
- package/lib/plugin/cell-plugin.spec.d.ts +2 -0
- package/lib/plugin/cell-plugin.spec.d.ts.map +1 -0
- package/lib/plugin/cell-plugin.spec.js +74 -0
- package/lib/plugin/cell-plugin.spec.js.map +1 -0
- package/lib/plugin/node-polyfills.d.ts +13 -0
- package/lib/plugin/node-polyfills.d.ts.map +1 -0
- package/lib/plugin/node-polyfills.js +55 -0
- package/lib/plugin/node-polyfills.js.map +1 -0
- package/lib/plugin/node-polyfills.spec.d.ts +2 -0
- package/lib/plugin/node-polyfills.spec.d.ts.map +1 -0
- package/lib/plugin/node-polyfills.spec.js +16 -0
- package/lib/plugin/node-polyfills.spec.js.map +1 -0
- package/lib/project/component-collector.d.ts +32 -0
- package/lib/project/component-collector.d.ts.map +1 -0
- package/lib/project/component-collector.js +93 -0
- package/lib/project/component-collector.js.map +1 -0
- package/lib/project/config-loader.d.ts +16 -0
- package/lib/project/config-loader.d.ts.map +1 -0
- package/lib/project/config-loader.js +76 -0
- package/lib/project/config-loader.js.map +1 -0
- package/lib/project/env-overrides.d.ts +23 -0
- package/lib/project/env-overrides.d.ts.map +1 -0
- package/lib/project/env-overrides.js +48 -0
- package/lib/project/env-overrides.js.map +1 -0
- package/lib/project/env-overrides.spec.d.ts +2 -0
- package/lib/project/env-overrides.spec.d.ts.map +1 -0
- package/lib/project/env-overrides.spec.js +41 -0
- package/lib/project/env-overrides.spec.js.map +1 -0
- package/lib/project/module-resolver.d.ts +15 -0
- package/lib/project/module-resolver.d.ts.map +1 -0
- package/lib/project/module-resolver.js +32 -0
- package/lib/project/module-resolver.js.map +1 -0
- package/lib/project/project-loader.d.ts +54 -0
- package/lib/project/project-loader.d.ts.map +1 -0
- package/lib/project/project-loader.js +117 -0
- package/lib/project/project-loader.js.map +1 -0
- package/lib/project/project-loader.spec.d.ts +2 -0
- package/lib/project/project-loader.spec.d.ts.map +1 -0
- package/lib/project/project-loader.spec.js +178 -0
- package/lib/project/project-loader.spec.js.map +1 -0
- package/lib/test/fixture-project.d.ts +17 -0
- package/lib/test/fixture-project.d.ts.map +1 -0
- package/lib/test/fixture-project.js +43 -0
- package/lib/test/fixture-project.js.map +1 -0
- package/lib/testing/memory-http.d.ts +82 -0
- package/lib/testing/memory-http.d.ts.map +1 -0
- package/lib/testing/memory-http.js +210 -0
- package/lib/testing/memory-http.js.map +1 -0
- package/lib/testing/test-app.d.ts +54 -0
- package/lib/testing/test-app.d.ts.map +1 -0
- package/lib/testing/test-app.js +132 -0
- package/lib/testing/test-app.js.map +1 -0
- package/lib/testing/test-app.spec.d.ts +2 -0
- package/lib/testing/test-app.spec.d.ts.map +1 -0
- package/lib/testing/test-app.spec.js +115 -0
- package/lib/testing/test-app.spec.js.map +1 -0
- package/lib/utils/config-util.d.ts +6 -0
- package/lib/utils/config-util.d.ts.map +1 -0
- package/lib/utils/config-util.js +25 -0
- package/lib/utils/config-util.js.map +1 -0
- package/lib/utils/config-util.spec.d.ts +2 -0
- package/lib/utils/config-util.spec.d.ts.map +1 -0
- package/lib/utils/config-util.spec.js +22 -0
- package/lib/utils/config-util.spec.js.map +1 -0
- package/lib/utils/tsconfig-util.d.ts +5 -0
- package/lib/utils/tsconfig-util.d.ts.map +1 -0
- package/lib/utils/tsconfig-util.js +21 -0
- package/lib/utils/tsconfig-util.js.map +1 -0
- package/package.json +50 -4
- package/src/builder/cell-builder.ts +72 -0
- package/src/constants.ts +30 -0
- package/src/dev/cell-dev-server.ts +387 -0
- package/src/expression/expression-evaluator.ts +106 -0
- package/src/generator/config-generator.ts +45 -0
- package/src/generator/container-generator.ts +41 -0
- package/src/generator/html-generator.ts +43 -0
- package/src/index.ts +20 -0
- package/src/output/asset-embedder.ts +42 -0
- package/src/output/externals-copier.ts +64 -0
- package/src/output/output-writer.ts +113 -0
- package/src/plugin/cell-plugin.ts +481 -0
- package/src/plugin/node-polyfills.ts +57 -0
- package/src/project/component-collector.ts +107 -0
- package/src/project/config-loader.ts +77 -0
- package/src/project/env-overrides.ts +55 -0
- package/src/project/module-resolver.ts +39 -0
- package/src/project/project-loader.ts +153 -0
- package/src/test/fixture-project.ts +50 -0
- package/src/testing/memory-http.ts +238 -0
- package/src/testing/test-app.ts +155 -0
- package/src/utils/config-util.ts +21 -0
- package/src/utils/tsconfig-util.ts +19 -0
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @celljs/vite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Cell 4 的构建核心:把一个 Cell 项目(组件图、DI 模块、`cell.yml` 配置)交给 Vite 构建成 `.cell/output`。一般通过 [`@celljs/cli`](../cli) 的 `cell build` 使用,也可以单独使用。
|
|
4
|
+
|
|
5
|
+
- `ProjectLoader`:只读 package.json 与 `cell*.yml`,生成可 JSON 序列化的项目模型(组件、mode、各目标的 DI 模块、入口、合并后的配置),不执行项目代码。
|
|
6
|
+
- `CellPlugin` / `cell()`:Vite 插件,提供 `client`(前端,输出 `public/`)和 `server`(后端,输出单个 `server/index.mjs`)两个环境;DI 装配代码、合并后的配置和项目模型同时写到 `.cell/generated/`。
|
|
7
|
+
- `CellBuilder`:一次构建全部目标,失败时抛 `CellError`(`@celljs/kit`)。
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { CellBuilder } from '@celljs/vite';
|
|
11
|
+
|
|
12
|
+
const project = await new CellBuilder({
|
|
13
|
+
root: process.cwd(),
|
|
14
|
+
mode: ['production'],
|
|
15
|
+
entryName: 'http', // 后端入口名,从组件的 cell.entries 中选
|
|
16
|
+
format: 'esm',
|
|
17
|
+
outDir: '.cell/output',
|
|
18
|
+
}).build();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
构建规则:
|
|
22
|
+
|
|
23
|
+
- 后端依赖全部内联;组件声明的 `cell.optionalDependencies` 解析不到时 external;原生模块和 `external` 按依赖关系拷到 `server/node_modules`。产物可以拷到项目外单独运行。
|
|
24
|
+
- 后端配置里的 `${...}` 在运行时求值,前端配置和 `index.html` 在构建时求值。
|
|
25
|
+
- `CELL_BACKEND__*` 环境变量由服务端在启动时覆盖配置,`CELL_FRONTEND__*` 在构建时覆盖前端配置,都早于 `${...}` 求值(`@celljs/core` 的 `EnvConfigUtil`);结果记在 `TargetModel.envOverrides`。
|
|
26
|
+
- 后端配置带 `paths.public`(默认 `public`,相对输出目录),服务端启动时解析成绝对路径。
|
|
27
|
+
- 用户源码由 Oxc 转译,开启 legacy 装饰器和 `emitDecoratorMetadata`。
|
|
28
|
+
- 前端的 Node 内置模块 polyfill 只在项目安装了对应 polyfill 包时启用。
|
|
29
|
+
|
|
30
|
+
需要 Node.js `^20.19.0 || >=22.12.0`。
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CellError, type ProjectModel } from '@celljs/kit';
|
|
2
|
+
import type { PluginOption, UserConfig } from 'vite';
|
|
3
|
+
import { type CellPluginOptions } from '../plugin/cell-plugin.js';
|
|
4
|
+
export interface CellBuilderOptions extends CellPluginOptions {
|
|
5
|
+
logLevel?: 'info' | 'warn' | 'error' | 'silent';
|
|
6
|
+
/** Merged into the Vite configuration (the `vite` field of cell.config.ts). */
|
|
7
|
+
vite?: UserConfig;
|
|
8
|
+
/** Plugins of toolchain modules, after the Cell plugin. */
|
|
9
|
+
plugins?: PluginOption[];
|
|
10
|
+
}
|
|
11
|
+
/** Builds every target of a project; the programmatic form of `cell build`. */
|
|
12
|
+
export declare class CellBuilder {
|
|
13
|
+
protected readonly options: CellBuilderOptions;
|
|
14
|
+
constructor(options?: CellBuilderOptions);
|
|
15
|
+
build(): Promise<ProjectModel>;
|
|
16
|
+
/** Bundler failures become `CELL_BUILD_FAILED` with the failing file; Cell errors pass through. */
|
|
17
|
+
static toCellError(error: unknown): CellError;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=cell-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-builder.d.ts","sourceRoot":"","sources":["../../src/builder/cell-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAgB,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE9E,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IACzD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAChD,+EAA+E;IAC/E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AAQD,+EAA+E;AAC/E,qBAAa,WAAW;IACR,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB;IAA1D,YAA+B,OAAO,GAAE,kBAAuB,EAAI;IAE7D,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC,CAgBnC;IAED,mGAAmG;IACnG,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CA4B5C;CACJ"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { stripVTControlCharacters } from 'node:util';
|
|
2
|
+
import { CellError } from '@celljs/kit';
|
|
3
|
+
import { CellPlugin } from '../plugin/cell-plugin.js';
|
|
4
|
+
/** Builds every target of a project; the programmatic form of `cell build`. */
|
|
5
|
+
export class CellBuilder {
|
|
6
|
+
options;
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this.options = options;
|
|
9
|
+
}
|
|
10
|
+
async build() {
|
|
11
|
+
const { createBuilder, mergeConfig } = await import('vite');
|
|
12
|
+
const plugin = new CellPlugin(this.options);
|
|
13
|
+
try {
|
|
14
|
+
const config = {
|
|
15
|
+
root: this.options.root ?? process.cwd(),
|
|
16
|
+
configFile: false,
|
|
17
|
+
logLevel: this.options.logLevel ?? 'warn',
|
|
18
|
+
plugins: [plugin.toVitePlugin(), ...(this.options.plugins ?? [])],
|
|
19
|
+
};
|
|
20
|
+
const builder = await createBuilder(this.options.vite ? mergeConfig(config, this.options.vite) : config, null);
|
|
21
|
+
await builder.buildApp();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
throw CellBuilder.toCellError(error);
|
|
25
|
+
}
|
|
26
|
+
return plugin.project;
|
|
27
|
+
}
|
|
28
|
+
/** Bundler failures become `CELL_BUILD_FAILED` with the failing file; Cell errors pass through. */
|
|
29
|
+
static toCellError(error) {
|
|
30
|
+
const cause = error?.cause;
|
|
31
|
+
if (CellError.is(error)) {
|
|
32
|
+
return error;
|
|
33
|
+
}
|
|
34
|
+
if (CellError.is(cause)) {
|
|
35
|
+
return cause;
|
|
36
|
+
}
|
|
37
|
+
const e = error;
|
|
38
|
+
const errors = error.errors;
|
|
39
|
+
const first = errors?.[0] ?? e;
|
|
40
|
+
const lines = stripVTControlCharacters(String(first?.message ?? error)).split('\n');
|
|
41
|
+
const summary = lines.find(line => line.trim() && !/^Build failed/.test(line)) ?? String(error);
|
|
42
|
+
// Rolldown wraps plugin failures as "plugin X threw an error" and puts the reason under "Caused by:".
|
|
43
|
+
const causedBy = lines.findIndex(line => /^\s*Caused by:/.test(line));
|
|
44
|
+
const reason = causedBy >= 0 ? lines.slice(causedBy + 1).find(line => line.trim()) : undefined;
|
|
45
|
+
const message = reason ? `${reason.trim()} (${summary.replace(/ threw an error$/, '').trim()})` : summary;
|
|
46
|
+
return new CellError({
|
|
47
|
+
code: 'CELL_BUILD_FAILED',
|
|
48
|
+
message: message.trim(),
|
|
49
|
+
file: first?.loc?.file ?? first?.id,
|
|
50
|
+
line: first?.loc?.line,
|
|
51
|
+
column: first?.loc?.column,
|
|
52
|
+
hint: first?.plugin
|
|
53
|
+
? `The ${first.plugin} step failed; fix the reported file, or check that its dependencies are installed.`
|
|
54
|
+
: 'Fix the reported file, or check that its dependencies are installed.',
|
|
55
|
+
cause: error,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=cell-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-builder.js","sourceRoot":"","sources":["../../src/builder/cell-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAw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OAAO,CAAC;QAC1G,OAAO,IAAI,SAAS,CAAC;YACjB,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;YACvB,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE;YACnC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI;YACtB,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM;YAC1B,IAAI,EAAE,KAAK,EAAE,MAAM;gBACf,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,oFAAoF;gBACzG,CAAC,CAAC,sEAAsE;YAC5E,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-builder.spec.d.ts","sourceRoot":"","sources":["../../src/builder/cell-builder.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { afterAll, beforeAll, describe, expect, it } from 'bun:test';
|
|
2
|
+
import { execFileSync, spawn } from 'node:child_process';
|
|
3
|
+
import { cpSync, existsSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync } from 'node:fs';
|
|
4
|
+
import { createServer } from 'node:net';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { dirname, join } from 'node:path';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
import { CellError } from '@celljs/kit';
|
|
9
|
+
import { CellBuilder } from './cell-builder.js';
|
|
10
|
+
const FIXTURES = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'fixtures');
|
|
11
|
+
const BACKEND = join(FIXTURES, 'backend-app');
|
|
12
|
+
const FRONTEND = join(FIXTURES, 'frontend-app');
|
|
13
|
+
function freePort() {
|
|
14
|
+
return new Promise(resolve => {
|
|
15
|
+
const server = createServer().listen(0, () => {
|
|
16
|
+
const { port } = server.address();
|
|
17
|
+
server.close(() => resolve(port));
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Whether this machine can listen on `host` (IPv6 loopback is missing in some containers). */
|
|
22
|
+
function canListen(host) {
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
const server = createServer()
|
|
25
|
+
.once('error', () => resolve(false))
|
|
26
|
+
.listen(0, host, () => server.close(() => resolve(true)));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const IPV6_LOOPBACK = await canListen('::1');
|
|
30
|
+
/** Starts a built server on a free port (set through CELL_BACKEND__SERVER__PORT) and waits until `host` answers. */
|
|
31
|
+
async function startServer(file, env, host = '127.0.0.1') {
|
|
32
|
+
const port = await freePort();
|
|
33
|
+
const child = spawn(process.execPath.includes('bun') ? 'node' : process.execPath, [file], {
|
|
34
|
+
cwd: dirname(file),
|
|
35
|
+
env: { ...process.env, CELL_BACKEND__SERVER__PORT: String(port), ...(typeof env === 'function' ? env(port) : env) },
|
|
36
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
37
|
+
});
|
|
38
|
+
let stderr = '';
|
|
39
|
+
child.stderr?.on('data', chunk => {
|
|
40
|
+
stderr += chunk;
|
|
41
|
+
});
|
|
42
|
+
const url = `http://${host.includes(':') ? `[${host}]` : host}:${port}`;
|
|
43
|
+
for (let i = 0; i < 50; i++) {
|
|
44
|
+
try {
|
|
45
|
+
await fetch(url);
|
|
46
|
+
return { url, port, child, stderr: () => stderr };
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
await new Promise(r => setTimeout(r, 100));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
child.kill();
|
|
53
|
+
throw new Error(`server ${file} did not start: ${stderr}`);
|
|
54
|
+
}
|
|
55
|
+
async function reachable(url) {
|
|
56
|
+
try {
|
|
57
|
+
await fetch(url);
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
for (const format of ['esm', 'cjs']) {
|
|
65
|
+
describe(`CellBuilder (backend, ${format})`, () => {
|
|
66
|
+
const outDir = `.cell/test-${format}`;
|
|
67
|
+
const server = join(BACKEND, outDir, 'server', format === 'esm' ? 'index.mjs' : 'index.cjs');
|
|
68
|
+
let app;
|
|
69
|
+
let copy;
|
|
70
|
+
beforeAll(async () => {
|
|
71
|
+
await new CellBuilder({ root: BACKEND, format, outDir, entryName: 'http', preset: 'node', logLevel: 'silent' }).build();
|
|
72
|
+
// Run a copy outside the repository: the output must not depend on the project's node_modules.
|
|
73
|
+
copy = mkdtempSync(join(tmpdir(), 'cell-output-'));
|
|
74
|
+
cpSync(join(BACKEND, outDir), copy, { recursive: true });
|
|
75
|
+
app = await startServer(join(copy, 'server', server.split('/').pop()), { GREETING_NAME: 'agent' });
|
|
76
|
+
}, 60000);
|
|
77
|
+
afterAll(() => {
|
|
78
|
+
app?.child.kill();
|
|
79
|
+
rmSync(join(BACKEND, outDir), { recursive: true, force: true });
|
|
80
|
+
rmSync(copy, { recursive: true, force: true });
|
|
81
|
+
});
|
|
82
|
+
it('takes the named entry from the component that provides it', () => {
|
|
83
|
+
const project = JSON.parse(readFileSync(join(BACKEND, '.cell', 'generated', 'project.json'), 'utf8'));
|
|
84
|
+
expect(project.backend.entry).toBe('@celljs/express-adapter/lib/node/http-application-entry');
|
|
85
|
+
expect(project.backend.entryComponent).toBe('@celljs/express-adapter');
|
|
86
|
+
});
|
|
87
|
+
it('emits one server file and a manifest', () => {
|
|
88
|
+
expect(readdirSync(dirname(server))).toEqual([server.split('/').pop()]);
|
|
89
|
+
expect(JSON.parse(readFileSync(join(BACKEND, outDir, 'manifest.json'), 'utf8'))).toEqual({
|
|
90
|
+
schemaVersion: 1,
|
|
91
|
+
preset: 'node',
|
|
92
|
+
format,
|
|
93
|
+
targets: ['backend'],
|
|
94
|
+
server: `server/${server.split('/').pop()}`,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
it('serves controllers resolved through decorator metadata', async () => {
|
|
98
|
+
expect(await (await fetch(app.url)).text()).toBe('Welcome to Cell');
|
|
99
|
+
expect(await (await fetch(`${app.url}/items/2`)).json()).toEqual({ id: 2, doubled: 4 });
|
|
100
|
+
expect((await fetch(`${app.url}/missing`)).status).toBe(404);
|
|
101
|
+
});
|
|
102
|
+
it('evaluates configuration expressions at runtime', async () => {
|
|
103
|
+
expect(await (await fetch(`${app.url}/greeting`)).text()).toBe('Hello agent');
|
|
104
|
+
});
|
|
105
|
+
it('overrides keys from CELL_BACKEND__ variables before evaluating expressions', async () => {
|
|
106
|
+
// startServer itself sets the port through CELL_BACKEND__SERVER__PORT.
|
|
107
|
+
const other = await startServer(join(copy, 'server', server.split('/').pop()), {
|
|
108
|
+
GREETING_NAME: 'agent',
|
|
109
|
+
CELL_BACKEND__GREETING: 'Hi ${env.GREETING_NAME} on ${cell.server.port}',
|
|
110
|
+
});
|
|
111
|
+
try {
|
|
112
|
+
expect(await (await fetch(`${other.url}/greeting`)).text()).toBe(`Hi agent on ${other.port}`);
|
|
113
|
+
expect(other.stderr()).not.toContain('[cell]');
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
other.child.kill();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
it('evaluates a CELL_BACKEND__ value that is an expression, e.g. a port from the platform', async () => {
|
|
120
|
+
const other = await startServer(join(copy, 'server', server.split('/').pop()), port => ({
|
|
121
|
+
PLATFORM_PORT: String(port),
|
|
122
|
+
CELL_BACKEND__SERVER__PORT: '${env.PLATFORM_PORT}',
|
|
123
|
+
CELL_BACKEND__GREETING: '${"port " + cell.server.port}',
|
|
124
|
+
}));
|
|
125
|
+
try {
|
|
126
|
+
expect(await (await fetch(`${other.url}/greeting`)).text()).toBe(`port ${other.port}`);
|
|
127
|
+
expect(other.stderr()).not.toContain('[cell]');
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
other.child.kill();
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
it('resolves paths.public against the output directory after CELL_BACKEND__ variables apply', async () => {
|
|
134
|
+
const file = join(copy, 'server', server.split('/').pop());
|
|
135
|
+
const publicDir = async (env) => {
|
|
136
|
+
const other = await startServer(file, { ...env, CELL_BACKEND__GREETING: '${paths.public}' });
|
|
137
|
+
try {
|
|
138
|
+
return await (await fetch(`${other.url}/greeting`)).text();
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
other.child.kill();
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const byDefault = await publicDir({});
|
|
145
|
+
expect(realpathSync(dirname(byDefault))).toBe(realpathSync(copy));
|
|
146
|
+
expect(byDefault.split('/').pop()).toBe('public');
|
|
147
|
+
expect(await publicDir({ CELL_BACKEND__PATHS__PUBLIC: 'static' })).toBe(join(dirname(byDefault), 'static'));
|
|
148
|
+
expect(await publicDir({ CELL_BACKEND__PATHS__PUBLIC: '/srv/www' })).toBe('/srv/www');
|
|
149
|
+
});
|
|
150
|
+
it('warns on stderr about CELL_BACKEND__ variables that do not apply and keeps serving', async () => {
|
|
151
|
+
const other = await startServer(join(copy, 'server', server.split('/').pop()), {
|
|
152
|
+
GREETING_NAME: 'agent',
|
|
153
|
+
CELL_BACKEND__SERVER__PROT: '1',
|
|
154
|
+
CELL_BACKEND__GREETING__TEXT: 'x',
|
|
155
|
+
});
|
|
156
|
+
try {
|
|
157
|
+
expect(await (await fetch(`${other.url}/greeting`)).text()).toBe('Hello agent');
|
|
158
|
+
const warnings = other
|
|
159
|
+
.stderr()
|
|
160
|
+
.split('\n')
|
|
161
|
+
.filter(line => line.startsWith('[cell]'));
|
|
162
|
+
expect(warnings).toEqual([
|
|
163
|
+
"[cell] CELL_BACKEND__GREETING__TEXT is ignored: cell.greeting is not an object, so it has no key 'TEXT'.",
|
|
164
|
+
expect.stringContaining("[cell] CELL_BACKEND__SERVER__PROT is ignored: no key 'PROT' under cell.server (keys: path, port, host, endpoint)"),
|
|
165
|
+
]);
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
other.child.kill();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
it('listens on cell.server.host: 127.0.0.1 by default, CELL_BACKEND__SERVER__HOST to change it', async () => {
|
|
172
|
+
expect(await reachable(app.url)).toBe(true);
|
|
173
|
+
if (!IPV6_LOOPBACK) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
expect(await reachable(`http://[::1]:${app.port}`)).toBe(false);
|
|
177
|
+
const other = await startServer(join(copy, 'server', server.split('/').pop()), { CELL_BACKEND__SERVER__HOST: '::1' }, '::1');
|
|
178
|
+
try {
|
|
179
|
+
expect(await (await fetch(other.url)).text()).toBe('Welcome to Cell');
|
|
180
|
+
expect(await reachable(`http://127.0.0.1:${other.port}`)).toBe(false);
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
other.child.kill();
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
describe('CellBuilder (DI container)', () => {
|
|
189
|
+
const outDir = '.cell/test-di';
|
|
190
|
+
afterAll(() => rmSync(join(BACKEND, outDir), { recursive: true, force: true }));
|
|
191
|
+
it('builds a container with every binding resolvable and writes the generated code', async () => {
|
|
192
|
+
const model = await new CellBuilder({ root: BACKEND, outDir, logLevel: 'silent' }).build();
|
|
193
|
+
expect(model.backend?.modules.map(m => m.component)).toContain('fixture-backend-app');
|
|
194
|
+
const probe = "const m = await import(process.argv[1]); const c = await m.container; const keys = [...c._bindingDictionary._map.keys()]; const failed = keys.filter(k => { try { c.getAll(k); return false; } catch { return true; } }).map(String); console.log(JSON.stringify({ count: keys.length, failed, home: keys.some(k => k.name === 'HomeController') })); process.exit(0);";
|
|
195
|
+
const result = JSON.parse(execFileSync('node', ['--input-type=module', '-e', probe, join(BACKEND, outDir, 'server', 'index.mjs')], { encoding: 'utf8' })
|
|
196
|
+
.trim()
|
|
197
|
+
.split('\n')
|
|
198
|
+
.pop());
|
|
199
|
+
expect(result.home).toBe(true);
|
|
200
|
+
expect(result.count).toBeGreaterThan(50);
|
|
201
|
+
expect(result.failed.filter((k) => !/Symbol\((Value|PROVIDER)\)/.test(k))).toEqual([]);
|
|
202
|
+
expect(readFileSync(join(BACKEND, '.cell', 'generated', 'backend', 'container.js'), 'utf8')).toContain('backend-app/src/module.ts');
|
|
203
|
+
}, 60000);
|
|
204
|
+
});
|
|
205
|
+
describe('CellBuilder (frontend)', () => {
|
|
206
|
+
const outDir = '.cell/test-frontend';
|
|
207
|
+
const publicDir = join(FRONTEND, outDir, 'public');
|
|
208
|
+
beforeAll(() => new CellBuilder({ root: FRONTEND, outDir, targets: ['frontend'], logLevel: 'silent' }).build(), 60000);
|
|
209
|
+
afterAll(() => rmSync(join(FRONTEND, outDir), { recursive: true, force: true }));
|
|
210
|
+
it('renders the page from cell.yml and links the entry bundle', () => {
|
|
211
|
+
const html = readFileSync(join(publicDir, 'index.html'), 'utf8');
|
|
212
|
+
expect(html).toContain('<title>Fixture Frontend</title>');
|
|
213
|
+
expect(html).toContain('<div id="fixture-root"></div>');
|
|
214
|
+
expect(html).toMatch(/<script type="module" crossorigin src="\.\/assets\/index-[\w-]+\.js"><\/script>/);
|
|
215
|
+
});
|
|
216
|
+
it('bundles the frontend modules and copies favicon and assets', () => {
|
|
217
|
+
const bundles = readdirSync(join(publicDir, 'assets'))
|
|
218
|
+
.filter(f => f.endsWith('.js'))
|
|
219
|
+
.map(f => readFileSync(join(publicDir, 'assets', f), 'utf8'))
|
|
220
|
+
.join('\n');
|
|
221
|
+
expect(bundles).toContain('fixture frontend module loaded');
|
|
222
|
+
expect(existsSync(join(publicDir, 'favicon.ico'))).toBe(true);
|
|
223
|
+
expect(readFileSync(join(publicDir, 'assets', 'note.txt'), 'utf8')).toBe('static asset\n');
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
describe('CellBuilder (backend, workerd)', () => {
|
|
227
|
+
const outDir = '.cell/test-workerd';
|
|
228
|
+
const bundle = join(BACKEND, outDir, 'server', 'index.mjs');
|
|
229
|
+
beforeAll(async () => {
|
|
230
|
+
await new CellBuilder({ root: BACKEND, outDir, entryName: 'http', preset: 'cloudflare', runtime: 'workerd', logLevel: 'silent' }).build();
|
|
231
|
+
}, 60000);
|
|
232
|
+
afterAll(() => rmSync(join(BACKEND, outDir), { recursive: true, force: true }));
|
|
233
|
+
it('leaves no import.meta in the server bundle: Cloudflare Workers do not define it', () => {
|
|
234
|
+
const code = readFileSync(bundle, 'utf8');
|
|
235
|
+
expect(code).not.toMatch(/import\.meta\.(url|dirname|filename)/);
|
|
236
|
+
expect(code).toContain('createRequire("file:///bundle/server/index.mjs")');
|
|
237
|
+
// paths.public resolves against the directory above the bundle path.
|
|
238
|
+
expect(code).toContain('new URL("..", "file:///bundle/server/index.mjs")');
|
|
239
|
+
});
|
|
240
|
+
it('starts the application only when ApplicationHost.beforeStart resolves (the first request on Workers)', () => {
|
|
241
|
+
// Node.js runs the bundle, as in production; the host records the order of events.
|
|
242
|
+
const script = [
|
|
243
|
+
'const events = [];',
|
|
244
|
+
'let release;',
|
|
245
|
+
"globalThis[Symbol.for('@celljs/core/application-host')] = {",
|
|
246
|
+
" beforeStart: () => { events.push('beforeStart'); return new Promise(resolve => (release = resolve)); },",
|
|
247
|
+
" started: app => { events.push('started:' + typeof app.handler); app.stop().then(() => { console.log(JSON.stringify(events)); process.exit(0); }); },",
|
|
248
|
+
' failed: error => { console.error(error); process.exit(1); },',
|
|
249
|
+
'};',
|
|
250
|
+
`await import(${JSON.stringify(pathToFileURL(bundle).href)});`,
|
|
251
|
+
'await new Promise(resolve => setTimeout(resolve, 100));',
|
|
252
|
+
"events.push('released');",
|
|
253
|
+
'release();',
|
|
254
|
+
].join('\n');
|
|
255
|
+
const output = execFileSync('node', ['--input-type=module', '-e', script], { encoding: 'utf8' });
|
|
256
|
+
expect(JSON.parse(output.trim().split('\n').pop() ?? '')).toEqual(['beforeStart', 'released', 'started:function']);
|
|
257
|
+
}, 30000);
|
|
258
|
+
});
|
|
259
|
+
describe('CellBuilder (errors)', () => {
|
|
260
|
+
it('reports the reason under "Caused by:" instead of the plugin wrapper', () => {
|
|
261
|
+
const wrapped = new Error('Build failed with 1 error:\n\n[builtin:vite-transform] plugin `builtin:vite-transform` threw an error\n\nCaused by:\n Tsconfig not found /app/missing\n');
|
|
262
|
+
expect(CellBuilder.toCellError(wrapped).message).toBe('Tsconfig not found /app/missing ([builtin:vite-transform] plugin `builtin:vite-transform`)');
|
|
263
|
+
expect(CellBuilder.toCellError(new Error('Build failed with 1 error:\n\nUnexpected token')).message).toBe('Unexpected token');
|
|
264
|
+
});
|
|
265
|
+
it('reports an unresolvable DI module as CELL_MODULE_NOT_FOUND', async () => {
|
|
266
|
+
const error = await new CellBuilder({
|
|
267
|
+
root: FRONTEND,
|
|
268
|
+
outDir: '.cell/test-error',
|
|
269
|
+
targets: ['frontend'],
|
|
270
|
+
entry: { frontend: './src/missing-entry' },
|
|
271
|
+
logLevel: 'silent',
|
|
272
|
+
})
|
|
273
|
+
.build()
|
|
274
|
+
.catch(e => e);
|
|
275
|
+
rmSync(join(FRONTEND, '.cell', 'test-error'), { recursive: true, force: true });
|
|
276
|
+
expect(CellError.is(error)).toBe(true);
|
|
277
|
+
expect(error.code).toBe('CELL_BUILD_FAILED');
|
|
278
|
+
}, 60000);
|
|
279
|
+
});
|
|
280
|
+
//# sourceMappingURL=cell-builder.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-builder.spec.js","sourceRoot":"","sources":["../../src/builder/cell-builder.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAqB,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAA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AC,gDAAgD,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAClI,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;QACxE,MAAM,KAAK,GAAG,MAAM,IAAI,WAAW,CAAC;YAChC,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,kBAAkB;YAC1B,OAAO,EAAE,CAAC,UAAU,CAAC;YACrB,KAAK,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE;YAC1C,QAAQ,EAAE,QAAQ;SACrB,CAAC;aACG,KAAK,EAAE;aACP,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACjD,CAAC,EAAE,KAAK,CAAC,CAAC;AACd,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Target } from '@celljs/kit';
|
|
2
|
+
export declare const TARGETS: Target[];
|
|
3
|
+
/** Application entry used when neither the options nor a preset choose one. */
|
|
4
|
+
export declare const DEFAULT_ENTRY = "@celljs/core/lib/common/application/application-entry";
|
|
5
|
+
/** Vite environment that builds each target, and the reverse mapping. */
|
|
6
|
+
export declare const ENVIRONMENT_OF: Record<Target, string>;
|
|
7
|
+
export declare const TARGET_OF: Record<string, Target>;
|
|
8
|
+
/** Keys of the merged cell.yml that are not application configuration as such: the target sections and the mode. */
|
|
9
|
+
export declare const TOOLING_KEYS: string[];
|
|
10
|
+
/** Directory of the frontend output inside the output directory; the backend default of `paths.public`. */
|
|
11
|
+
export declare const PUBLIC_DIR = "public";
|
|
12
|
+
/** URL of the frontend entry inside the generated HTML page. */
|
|
13
|
+
export declare const ENTRY_URL = "/@cell/entry.js";
|
|
14
|
+
/**
|
|
15
|
+
* Where the server bundle pretends to be on Cloudflare Workers, which has no `import.meta.url`:
|
|
16
|
+
* workerd runs the modules from `/bundle` (its working directory).
|
|
17
|
+
*/
|
|
18
|
+
export declare const WORKERD_SERVER_FILE = "/bundle/server/index.mjs";
|
|
19
|
+
/** Key of the global under which a `--single` server bundle registers its embedded frontend files (read by @celljs/serve-static). */
|
|
20
|
+
export declare const EMBEDDED_ASSETS_KEY = "@celljs/serve-static/assets";
|
|
21
|
+
/** Entry of a `--single` server bundle: the embedded frontend files, then the backend entry. */
|
|
22
|
+
export declare const SINGLE_ENTRY_ID = "virtual:cell/single-entry";
|
|
23
|
+
export declare const ASSETS_ID = "virtual:cell/assets";
|
|
24
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,MAAM,EAA4B,CAAC;AAEzD,+EAA+E;AAC/E,eAAO,MAAM,aAAa,0DAA0D,CAAC;AAErF,yEAAyE;AACzE,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA6C,CAAC;AAChG,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA6C,CAAC;AAE3F,oHAAoH;AACpH,eAAO,MAAM,YAAY,UAAkC,CAAC;AAE5D,2GAA2G;AAC3G,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,gEAAgE;AAChE,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAC9D,qIAAqI;AACrI,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AACjE,gGAAgG;AAChG,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAC3D,eAAO,MAAM,SAAS,wBAAwB,CAAC"}
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const TARGETS = ['frontend', 'backend'];
|
|
2
|
+
/** Application entry used when neither the options nor a preset choose one. */
|
|
3
|
+
export const DEFAULT_ENTRY = '@celljs/core/lib/common/application/application-entry';
|
|
4
|
+
/** Vite environment that builds each target, and the reverse mapping. */
|
|
5
|
+
export const ENVIRONMENT_OF = { frontend: 'client', backend: 'server' };
|
|
6
|
+
export const TARGET_OF = { client: 'frontend', server: 'backend' };
|
|
7
|
+
/** Keys of the merged cell.yml that are not application configuration as such: the target sections and the mode. */
|
|
8
|
+
export const TOOLING_KEYS = ['mode', 'frontend', 'backend'];
|
|
9
|
+
/** Directory of the frontend output inside the output directory; the backend default of `paths.public`. */
|
|
10
|
+
export const PUBLIC_DIR = 'public';
|
|
11
|
+
/** URL of the frontend entry inside the generated HTML page. */
|
|
12
|
+
export const ENTRY_URL = '/@cell/entry.js';
|
|
13
|
+
/**
|
|
14
|
+
* Where the server bundle pretends to be on Cloudflare Workers, which has no `import.meta.url`:
|
|
15
|
+
* workerd runs the modules from `/bundle` (its working directory).
|
|
16
|
+
*/
|
|
17
|
+
export const WORKERD_SERVER_FILE = '/bundle/server/index.mjs';
|
|
18
|
+
/** Key of the global under which a `--single` server bundle registers its embedded frontend files (read by @celljs/serve-static). */
|
|
19
|
+
export const EMBEDDED_ASSETS_KEY = '@celljs/serve-static/assets';
|
|
20
|
+
/** Entry of a `--single` server bundle: the embedded frontend files, then the backend entry. */
|
|
21
|
+
export const SINGLE_ENTRY_ID = 'virtual:cell/single-entry';
|
|
22
|
+
export const ASSETS_ID = 'virtual:cell/assets';
|
|
23
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG,uDAAuD,CAAC;AAErF,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAA2B,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAChG,MAAM,CAAC,MAAM,SAAS,GAA2B,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAE3F,oHAAoH;AACpH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAE5D,2GAA2G;AAC3G,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAEnC,gEAAgE;AAChE,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAC9D,qIAAqI;AACrI,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AACjE,gGAAgG;AAChG,MAAM,CAAC,MAAM,eAAe,GAAG,2BAA2B,CAAC;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import { CellError, type ProjectModel } from '@celljs/kit';
|
|
3
|
+
import type { Logger, Plugin, PluginOption, UserConfig, ViteDevServer } from 'vite';
|
|
4
|
+
import { CellPlugin, type CellPluginOptions } from '../plugin/cell-plugin.js';
|
|
5
|
+
/** What a backend entry hands to the host (`ApplicationHost` of @celljs/core). */
|
|
6
|
+
export interface StartedApplication {
|
|
7
|
+
container: unknown;
|
|
8
|
+
handler?: (req: IncomingMessage, res: ServerResponse, next?: (error?: unknown) => void) => void;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
/** A request the backend answered in `cell dev` (frontend modules and assets are left out). */
|
|
12
|
+
export interface DevRequestRecord {
|
|
13
|
+
time: string;
|
|
14
|
+
method: string;
|
|
15
|
+
url: string;
|
|
16
|
+
status: number;
|
|
17
|
+
durationMs: number;
|
|
18
|
+
}
|
|
19
|
+
export interface CellDevServerOptions extends CellPluginOptions {
|
|
20
|
+
/** Port of the one server for frontend and backend. Default: `cell.server.port` of the backend, else 3000. */
|
|
21
|
+
port?: number;
|
|
22
|
+
/** Interface to listen on. Default: `cell.server.host` of the backend, else 127.0.0.1. */
|
|
23
|
+
host?: string;
|
|
24
|
+
logLevel?: 'info' | 'warn' | 'error' | 'silent';
|
|
25
|
+
/** Vite logger, e.g. one that writes to stderr for `--json`. */
|
|
26
|
+
logger?: Logger;
|
|
27
|
+
/** Merged into the Vite configuration (the `vite` field of cell.config.ts). */
|
|
28
|
+
vite?: UserConfig;
|
|
29
|
+
/** Plugins of toolchain modules, after the Cell plugin. */
|
|
30
|
+
plugins?: PluginOption[];
|
|
31
|
+
/** Handlers of toolchain modules by path prefix, before the backend. */
|
|
32
|
+
devHandlers?: {
|
|
33
|
+
path: string;
|
|
34
|
+
handler: (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => void;
|
|
35
|
+
}[];
|
|
36
|
+
/** More files whose change restarts with a new toolchain (`cell.addWatchFile`). */
|
|
37
|
+
watchFiles?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Listen on a port and watch files. Default `true`; `false` runs in-process only (`createTestApp`):
|
|
40
|
+
* requests go through {@link CellDevServer.handler}.
|
|
41
|
+
*/
|
|
42
|
+
listen?: boolean;
|
|
43
|
+
/** Start the backend entry. Default `true`; `false` only loads modules on request ({@link CellDevServer.import}), as `cell check` does. */
|
|
44
|
+
backend?: boolean;
|
|
45
|
+
/** How long the backend may take to start. Default 60s. */
|
|
46
|
+
startTimeout?: number;
|
|
47
|
+
/** Files changed that the project model depends on (cell*.yml, package.json, cell.config.*): restart with a new toolchain. */
|
|
48
|
+
onRestart?(files: string[]): void;
|
|
49
|
+
/** The backend was reloaded after `files` changed; `error` when it failed to start again. */
|
|
50
|
+
onReload?(files: string[], error?: CellError): void;
|
|
51
|
+
/** A request reached the backend and was answered. */
|
|
52
|
+
onRequest?(record: DevRequestRecord): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `cell dev` on one port (docs/design/architecture.md §6): Vite serves the frontend with HMR, and
|
|
56
|
+
* the backend runs in the `server` environment's module runner. Its entry hands the request handler
|
|
57
|
+
* over through `ApplicationHost` instead of listening; when one of its files changes, the old
|
|
58
|
+
* application is stopped, the runner forgets every module and the entry is imported again.
|
|
59
|
+
*/
|
|
60
|
+
export declare class CellDevServer {
|
|
61
|
+
protected readonly options: CellDevServerOptions;
|
|
62
|
+
static readonly DEFAULT_PORT = 3000;
|
|
63
|
+
static readonly DEFAULT_HOST = "127.0.0.1";
|
|
64
|
+
static readonly CONTENT_TYPES: Record<string, string>;
|
|
65
|
+
static readonly CONFIG_FILE: RegExp;
|
|
66
|
+
protected vite: ViteDevServer;
|
|
67
|
+
protected plugin: CellPlugin;
|
|
68
|
+
protected backend?: StartedApplication;
|
|
69
|
+
protected backendError?: CellError;
|
|
70
|
+
protected loading: Promise<void>;
|
|
71
|
+
protected pending: Set<string>;
|
|
72
|
+
protected timer?: ReturnType<typeof setTimeout>;
|
|
73
|
+
protected closed: boolean;
|
|
74
|
+
constructor(options?: CellDevServerOptions);
|
|
75
|
+
get project(): ProjectModel;
|
|
76
|
+
get url(): string;
|
|
77
|
+
get address(): {
|
|
78
|
+
host: string;
|
|
79
|
+
port: number;
|
|
80
|
+
};
|
|
81
|
+
/** The running backend: its DI container and request handler. */
|
|
82
|
+
get application(): StartedApplication | undefined;
|
|
83
|
+
/** The last error of the backend, until it starts again. */
|
|
84
|
+
get error(): CellError | undefined;
|
|
85
|
+
start(): Promise<this>;
|
|
86
|
+
/** Imports a module into the backend's module runner (with the generated container and configuration). */
|
|
87
|
+
import<T = Record<string, unknown>>(specifier: string): Promise<T>;
|
|
88
|
+
/** Every request handler of the server in one: Vite, the frontend page, module handlers, the backend. */
|
|
89
|
+
get handler(): (req: IncomingMessage, res: ServerResponse) => void;
|
|
90
|
+
close(): Promise<void>;
|
|
91
|
+
/** Files whose change makes a new project model: the component's cell*.yml and package.json, and the project's cell.config.*. */
|
|
92
|
+
get configFiles(): string[];
|
|
93
|
+
/** Stops the running backend and starts it again from fresh modules. */
|
|
94
|
+
reload(files: string[]): Promise<void>;
|
|
95
|
+
protected get serverEnvironment(): ViteDevServer['environments'][string] & {
|
|
96
|
+
runner: {
|
|
97
|
+
import(url: string): Promise<unknown>;
|
|
98
|
+
clearCache(): void;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
protected importBackend(): Promise<StartedApplication>;
|
|
102
|
+
protected stopBackend(): Promise<void>;
|
|
103
|
+
protected onFileChange(event: string, file: string): void;
|
|
104
|
+
protected devPlugin(): Plugin;
|
|
105
|
+
protected listenOptions(): {
|
|
106
|
+
port: number;
|
|
107
|
+
host: string;
|
|
108
|
+
};
|
|
109
|
+
protected handle(req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void): Promise<void>;
|
|
110
|
+
protected record(req: IncomingMessage, res: ServerResponse): void;
|
|
111
|
+
static toCellError(error: unknown, code: string): CellError;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=cell-dev-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-dev-server.d.ts","sourceRoot":"","sources":["../../src/dev/cell-dev-server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,C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