@celljs/kit 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 +17 -2
- package/lib/deployer.d.ts +51 -0
- package/lib/deployer.d.ts.map +1 -0
- package/lib/deployer.js +5 -0
- package/lib/deployer.js.map +1 -0
- package/lib/error.d.ts +39 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +34 -0
- package/lib/error.js.map +1 -0
- package/lib/error.spec.d.ts +2 -0
- package/lib/error.spec.d.ts.map +1 -0
- package/lib/error.spec.js +27 -0
- package/lib/error.spec.js.map +1 -0
- package/lib/events.d.ts +23 -0
- package/lib/events.d.ts.map +1 -0
- package/lib/events.js +34 -0
- package/lib/events.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/module.d.ts +166 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +5 -0
- package/lib/module.js.map +1 -0
- package/lib/options.d.ts +16 -0
- package/lib/options.d.ts.map +1 -0
- package/lib/options.js +2 -0
- package/lib/options.js.map +1 -0
- package/lib/preset.d.ts +78 -0
- package/lib/preset.d.ts.map +1 -0
- package/lib/preset.js +5 -0
- package/lib/preset.js.map +1 -0
- package/lib/types.d.ts +105 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/package.json +36 -4
- package/src/deployer.ts +58 -0
- package/src/error.ts +55 -0
- package/src/events.ts +52 -0
- package/src/index.ts +7 -0
- package/src/module.ts +166 -0
- package/src/options.ts +15 -0
- package/src/preset.ts +85 -0
- package/src/types.ts +99 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** Build targets of a Cell application. */
|
|
2
|
+
export type Target = 'frontend' | 'backend';
|
|
3
|
+
|
|
4
|
+
/** The `cell` field of a component's package.json. Generated for the framework's own packages. */
|
|
5
|
+
export interface ComponentManifest {
|
|
6
|
+
/** DI modules loaded after the static ones, in order, per target. Paths are package subpaths. */
|
|
7
|
+
modules?: Partial<Record<Target, string[]>>;
|
|
8
|
+
/** DI modules loaded synchronously before everything else. */
|
|
9
|
+
staticModules?: Partial<Record<Target, string[]>>;
|
|
10
|
+
/** Dependencies that may be missing; the bundler leaves them external instead of failing. */
|
|
11
|
+
optionalDependencies?: string[];
|
|
12
|
+
/** Targets a project needs once it depends on this component; the project builds their union. */
|
|
13
|
+
targets?: Target[];
|
|
14
|
+
/** Backend entries by name (`http`, `event`, ...), as package subpaths; a preset picks one by name. */
|
|
15
|
+
entries?: Record<string, string>;
|
|
16
|
+
/** Toolchain module of the component (a package subpath), run by the CLI and never bundled. */
|
|
17
|
+
toolchain?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A reference to a DI module: `specifier` is resolved from `importer` with the target's conditions. */
|
|
21
|
+
export interface ModuleRef {
|
|
22
|
+
component: string;
|
|
23
|
+
specifier: string;
|
|
24
|
+
importer: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ComponentInfo {
|
|
28
|
+
name: string;
|
|
29
|
+
version: string;
|
|
30
|
+
dir: string;
|
|
31
|
+
root: boolean;
|
|
32
|
+
/** Configuration files that were merged, in order. */
|
|
33
|
+
configFiles: string[];
|
|
34
|
+
optionalDependencies: string[];
|
|
35
|
+
/** Targets the component declares (`cell.targets`). */
|
|
36
|
+
targets: Target[];
|
|
37
|
+
/** Named backend entries the component provides (`cell.entries`). */
|
|
38
|
+
entries: Record<string, string>;
|
|
39
|
+
/** Toolchain module of the component (`cell.toolchain`). */
|
|
40
|
+
toolchain?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface TargetModel {
|
|
44
|
+
target: Target;
|
|
45
|
+
/** Entry specifier of the target. */
|
|
46
|
+
entry: string;
|
|
47
|
+
/** Component whose `entries` provided the entry; undefined for an explicit or the default entry. */
|
|
48
|
+
entryComponent?: string;
|
|
49
|
+
staticModules: ModuleRef[];
|
|
50
|
+
modules: ModuleRef[];
|
|
51
|
+
/**
|
|
52
|
+
* Merged application configuration. Backend values keep `${...}` for runtime evaluation, and the
|
|
53
|
+
* backend has `paths.public` (default `public`, relative to the output directory), which the
|
|
54
|
+
* server resolves to an absolute path at startup.
|
|
55
|
+
*/
|
|
56
|
+
config: Record<string, unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* `CELL_FRONTEND__*` / `CELL_BACKEND__*` variables of the environment the project was loaded in.
|
|
59
|
+
* Frontend overrides are already applied to `config`; backend ones are applied by the server at
|
|
60
|
+
* startup, so for the backend this tells what the same environment would change. Values are left out.
|
|
61
|
+
*/
|
|
62
|
+
envOverrides: EnvOverrideReport;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Configuration overrides from environment variables (`CELL_BACKEND__SERVER__PORT=8080` → `cell.server.port`). */
|
|
66
|
+
export interface EnvOverrideReport {
|
|
67
|
+
/** `shadows`: the key under `cell` with the same first name that the variable does not set (reach it with `CELL_<TARGET>__CELL__...`). */
|
|
68
|
+
applied: { variable: string; path: string; shadows?: string }[];
|
|
69
|
+
/** Variables with the prefix that match no key or whose value does not fit the key's type. */
|
|
70
|
+
problems: { variable: string; message: string }[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Everything the toolchain knows about a project, as plain JSON (`cell info --json`). */
|
|
74
|
+
export interface ProjectModel {
|
|
75
|
+
schemaVersion: 1;
|
|
76
|
+
root: string;
|
|
77
|
+
mode: string[];
|
|
78
|
+
targets: Target[];
|
|
79
|
+
components: ComponentInfo[];
|
|
80
|
+
frontend?: TargetModel;
|
|
81
|
+
backend?: TargetModel;
|
|
82
|
+
}
|
|
83
|
+
/** `<outDir>/manifest.json`: what `cell build` produced, read by `cell preview`, `cell deploy` and `cell info`. */
|
|
84
|
+
export interface OutputManifest {
|
|
85
|
+
schemaVersion: 1;
|
|
86
|
+
preset?: string;
|
|
87
|
+
format: 'esm' | 'cjs';
|
|
88
|
+
targets: Target[];
|
|
89
|
+
/** Server bundle, relative to the output directory. */
|
|
90
|
+
server?: string;
|
|
91
|
+
/** Frontend directory, relative to the output directory. */
|
|
92
|
+
public?: string;
|
|
93
|
+
/** Further files the preset wrote (platform entry, deployment configuration), relative to the output directory. */
|
|
94
|
+
files?: string[];
|
|
95
|
+
/** The frontend is embedded in the server bundle (`--single`): there is no public directory. */
|
|
96
|
+
single?: true;
|
|
97
|
+
/** Executable of `--compile`, relative to the output directory, and what built it. */
|
|
98
|
+
executable?: { file: string; compiler: 'bun' | 'node' | 'deno'; target?: string };
|
|
99
|
+
}
|