@webda/compiler 4.0.0-beta.3
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/LICENSE +166 -0
- package/README.md +125 -0
- package/lib/compiler.d.ts +88 -0
- package/lib/compiler.d.ts.map +1 -0
- package/lib/compiler.js +230 -0
- package/lib/compiler.js.map +1 -0
- package/lib/configuration.d.ts +35 -0
- package/lib/configuration.d.ts.map +1 -0
- package/lib/configuration.js +170 -0
- package/lib/configuration.js.map +1 -0
- package/lib/definition.d.ts +787 -0
- package/lib/definition.d.ts.map +1 -0
- package/lib/definition.js +189 -0
- package/lib/definition.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/module.d.ts +36 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +119 -0
- package/lib/module.js.map +1 -0
- package/lib/morpher/capabilities.d.ts +35 -0
- package/lib/morpher/capabilities.d.ts.map +1 -0
- package/lib/morpher/capabilities.js +66 -0
- package/lib/morpher/capabilities.js.map +1 -0
- package/lib/morpher/imports.d.ts +10 -0
- package/lib/morpher/imports.d.ts.map +1 -0
- package/lib/morpher/imports.js +97 -0
- package/lib/morpher/imports.js.map +1 -0
- package/lib/morpher/morpher.d.ts +34 -0
- package/lib/morpher/morpher.d.ts.map +1 -0
- package/lib/morpher/morpher.js +87 -0
- package/lib/morpher/morpher.js.map +1 -0
- package/lib/operations.d.ts +29 -0
- package/lib/operations.d.ts.map +1 -0
- package/lib/operations.js +197 -0
- package/lib/operations.js.map +1 -0
- package/lib/schema-backend.d.ts +55 -0
- package/lib/schema-backend.d.ts.map +1 -0
- package/lib/schema-backend.js +86 -0
- package/lib/schema-backend.js.map +1 -0
- package/lib/session-types.d.ts +14 -0
- package/lib/session-types.d.ts.map +1 -0
- package/lib/session-types.js +79 -0
- package/lib/session-types.js.map +1 -0
- package/lib/shell-build-dispatch.d.ts +54 -0
- package/lib/shell-build-dispatch.d.ts.map +1 -0
- package/lib/shell-build-dispatch.js +77 -0
- package/lib/shell-build-dispatch.js.map +1 -0
- package/lib/shell.d.ts +3 -0
- package/lib/shell.d.ts.map +1 -0
- package/lib/shell.js +297 -0
- package/lib/shell.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Env flag set on the child process to short-circuit nested dispatch.
|
|
3
|
+
* If a user's `@BuildCommand` invokes `webdac build` (e.g. via a script),
|
|
4
|
+
* the spawned process sees this flag and skips its own dispatch phase
|
|
5
|
+
* instead of forking forever.
|
|
6
|
+
*/
|
|
7
|
+
export declare const WEBDA_BUILD_DISPATCH_ENV = "WEBDA_BUILD_DISPATCH";
|
|
8
|
+
/**
|
|
9
|
+
* Module JSON shape (subset) used by the build-dispatch check.
|
|
10
|
+
*/
|
|
11
|
+
interface ModuleLike {
|
|
12
|
+
moddas?: {
|
|
13
|
+
[type: string]: {
|
|
14
|
+
commands?: {
|
|
15
|
+
build?: unknown;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
beans?: {
|
|
20
|
+
[type: string]: {
|
|
21
|
+
commands?: {
|
|
22
|
+
build?: unknown;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Decide whether `webdac build` should spawn `webda build` after compilation.
|
|
29
|
+
*
|
|
30
|
+
* Returns true iff at least one configured service type appears in the module
|
|
31
|
+
* with a `commands.build` entry.
|
|
32
|
+
* @param module - The parsed webda.module.json produced by compilation.
|
|
33
|
+
* @param configuredTypes - Fully-qualified service types from webda.config.jsonc
|
|
34
|
+
* (see `listConfiguredServiceTypes` in `@webda/utils`).
|
|
35
|
+
* @returns true if at least one configured type declares a build command.
|
|
36
|
+
*/
|
|
37
|
+
export declare function shouldDispatchBuildHooks(module: ModuleLike, configuredTypes: string[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Spawn `webda build` as a subprocess. Inherits stdio, returns its exit code.
|
|
40
|
+
*
|
|
41
|
+
* Sets `WEBDA_BUILD_DISPATCH=1` on the child so nested `webdac build`
|
|
42
|
+
* invocations (e.g. from a misbehaving build hook) short-circuit instead
|
|
43
|
+
* of recursing.
|
|
44
|
+
*
|
|
45
|
+
* A child exit code of `null` means it was terminated by a signal
|
|
46
|
+
* (SIGKILL/SIGTERM) — we surface that as `1` so the parent treats it as
|
|
47
|
+
* failure rather than silently succeeding.
|
|
48
|
+
* @param cwd - Working directory; pass the project root.
|
|
49
|
+
* @param deployment - Optional deployment name (`-d` flag).
|
|
50
|
+
* @returns The child process exit code (0 on success, non-zero on failure or signal).
|
|
51
|
+
*/
|
|
52
|
+
export declare function spawnWebdaBuild(cwd: string, deployment?: string): Promise<number>;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=shell-build-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-build-dispatch.d.ts","sourceRoot":"","sources":["../src/shell-build-dispatch.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;GAEG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG;YAAE,QAAQ,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAC;IAChE,KAAK,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG;YAAE,QAAQ,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CAChE;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,OAAO,CAW/F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA2BjF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Env flag set on the child process to short-circuit nested dispatch.
|
|
6
|
+
* If a user's `@BuildCommand` invokes `webdac build` (e.g. via a script),
|
|
7
|
+
* the spawned process sees this flag and skips its own dispatch phase
|
|
8
|
+
* instead of forking forever.
|
|
9
|
+
*/
|
|
10
|
+
export const WEBDA_BUILD_DISPATCH_ENV = "WEBDA_BUILD_DISPATCH";
|
|
11
|
+
/**
|
|
12
|
+
* Decide whether `webdac build` should spawn `webda build` after compilation.
|
|
13
|
+
*
|
|
14
|
+
* Returns true iff at least one configured service type appears in the module
|
|
15
|
+
* with a `commands.build` entry.
|
|
16
|
+
* @param module - The parsed webda.module.json produced by compilation.
|
|
17
|
+
* @param configuredTypes - Fully-qualified service types from webda.config.jsonc
|
|
18
|
+
* (see `listConfiguredServiceTypes` in `@webda/utils`).
|
|
19
|
+
* @returns true if at least one configured type declares a build command.
|
|
20
|
+
*/
|
|
21
|
+
export function shouldDispatchBuildHooks(module, configuredTypes) {
|
|
22
|
+
const typesWithBuildHook = new Set();
|
|
23
|
+
for (const section of ["moddas", "beans"]) {
|
|
24
|
+
const entries = module[section] || {};
|
|
25
|
+
for (const [type, meta] of Object.entries(entries)) {
|
|
26
|
+
if (meta?.commands && meta.commands.build) {
|
|
27
|
+
typesWithBuildHook.add(type);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return configuredTypes.some(t => typesWithBuildHook.has(t));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Spawn `webda build` as a subprocess. Inherits stdio, returns its exit code.
|
|
35
|
+
*
|
|
36
|
+
* Sets `WEBDA_BUILD_DISPATCH=1` on the child so nested `webdac build`
|
|
37
|
+
* invocations (e.g. from a misbehaving build hook) short-circuit instead
|
|
38
|
+
* of recursing.
|
|
39
|
+
*
|
|
40
|
+
* A child exit code of `null` means it was terminated by a signal
|
|
41
|
+
* (SIGKILL/SIGTERM) — we surface that as `1` so the parent treats it as
|
|
42
|
+
* failure rather than silently succeeding.
|
|
43
|
+
* @param cwd - Working directory; pass the project root.
|
|
44
|
+
* @param deployment - Optional deployment name (`-d` flag).
|
|
45
|
+
* @returns The child process exit code (0 on success, non-zero on failure or signal).
|
|
46
|
+
*/
|
|
47
|
+
export function spawnWebdaBuild(cwd, deployment) {
|
|
48
|
+
return new Promise((resolvePromise, reject) => {
|
|
49
|
+
const args = ["build"];
|
|
50
|
+
if (deployment)
|
|
51
|
+
args.unshift("-d", deployment);
|
|
52
|
+
// Resolve the launcher from the project rather than relying on
|
|
53
|
+
// node_modules/.bin/webda. In a fresh pnpm-workspace install the bin
|
|
54
|
+
// symlink may be missing because @webda/core wasn't built when pnpm
|
|
55
|
+
// first ran, so spawn("webda", ...) fails with ENOENT.
|
|
56
|
+
let command = "webda";
|
|
57
|
+
let spawnArgs = args;
|
|
58
|
+
try {
|
|
59
|
+
const projectRequire = createRequire(join(cwd, "package.json"));
|
|
60
|
+
const launcher = projectRequire.resolve("@webda/core/lib/bin/launcher.js");
|
|
61
|
+
command = process.execPath;
|
|
62
|
+
spawnArgs = [launcher, ...args];
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
/* fallback: rely on PATH (works when the bin symlink exists) */
|
|
66
|
+
}
|
|
67
|
+
const child = spawn(command, spawnArgs, {
|
|
68
|
+
cwd,
|
|
69
|
+
stdio: "inherit",
|
|
70
|
+
shell: false,
|
|
71
|
+
env: { ...process.env, [WEBDA_BUILD_DISPATCH_ENV]: "1" }
|
|
72
|
+
});
|
|
73
|
+
child.on("exit", code => resolvePromise(code ?? 1));
|
|
74
|
+
child.on("error", err => reject(err));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=shell-build-dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-build-dispatch.js","sourceRoot":"","sources":["../src/shell-build-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAU/D;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAkB,EAAE,eAAyB;IACpF,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC7C,KAAK,MAAM,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAU,EAAE,CAAC;QACnD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACnD,IAAI,IAAI,EAAE,QAAQ,IAAK,IAAI,CAAC,QAAgB,CAAC,KAAK,EAAE,CAAC;gBACnD,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,UAAmB;IAC9D,OAAO,IAAI,OAAO,CAAS,CAAC,cAAc,EAAE,MAAM,EAAE,EAA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1,297 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import yargs from "yargs";
|
|
3
|
+
import { WebdaProject } from "./definition.js";
|
|
4
|
+
import { Compiler } from "./compiler.js";
|
|
5
|
+
import { generateConfigurationSchemas } from "./configuration.js";
|
|
6
|
+
import { generateOperations } from "./operations.js";
|
|
7
|
+
import { useWorkerOutput, Fork, InteractiveConsoleLogger } from "@webda/workout";
|
|
8
|
+
import { FileUtils, listConfiguredServiceTypes } from "@webda/utils";
|
|
9
|
+
import { resolve, join } from "path";
|
|
10
|
+
import { runWithCurrentDirectory } from "@webda/utils";
|
|
11
|
+
import { existsSync, mkdirSync, readdirSync, lstatSync, realpathSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { bold, italic, yellow } from "yoctocolors";
|
|
13
|
+
import { WebdaMorpher } from "./morpher/morpher.js";
|
|
14
|
+
import { shouldDispatchBuildHooks, spawnWebdaBuild, WEBDA_BUILD_DISPATCH_ENV } from "./shell-build-dispatch.js";
|
|
15
|
+
/**
|
|
16
|
+
* Scan a single node_modules directory for webda.module.json files
|
|
17
|
+
* @param dir - the node_modules directory path
|
|
18
|
+
* @param mod - the module object to merge into
|
|
19
|
+
* @param seen - set of already-visited directories
|
|
20
|
+
*/
|
|
21
|
+
function scanNodeModules(dir, mod, seen) {
|
|
22
|
+
if (!existsSync(dir))
|
|
23
|
+
return;
|
|
24
|
+
const scan = (current, depth = 0) => {
|
|
25
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
26
|
+
if (entry.name.startsWith("."))
|
|
27
|
+
continue;
|
|
28
|
+
const full = join(current, entry.name);
|
|
29
|
+
if (entry.name.startsWith("@") && depth === 0) {
|
|
30
|
+
scan(full, depth + 1);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
let target = full;
|
|
34
|
+
if (entry.isSymbolicLink()) {
|
|
35
|
+
try {
|
|
36
|
+
target = realpathSync(full);
|
|
37
|
+
if (!lstatSync(target).isDirectory())
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (!entry.isDirectory()) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (seen.has(target))
|
|
48
|
+
continue;
|
|
49
|
+
seen.add(target);
|
|
50
|
+
const modFile = join(target, "webda.module.json");
|
|
51
|
+
if (!existsSync(modFile))
|
|
52
|
+
continue;
|
|
53
|
+
try {
|
|
54
|
+
const depMod = FileUtils.load(modFile, "json");
|
|
55
|
+
// Merge moddas, deployers, and schemas (beans are only from the app itself)
|
|
56
|
+
for (const section of ["moddas", "deployers", "schemas"]) {
|
|
57
|
+
if (depMod[section]) {
|
|
58
|
+
mod[section] = { ...mod[section], ...depMod[section] };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Capabilities: project values override dependencies
|
|
62
|
+
if (depMod.capabilities) {
|
|
63
|
+
mod.capabilities = { ...depMod.capabilities, ...mod.capabilities };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Skip invalid modules
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
scan(dir);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Scan node_modules for webda.module.json files and merge their
|
|
75
|
+
* moddas, deployers, and schemas into the local module.
|
|
76
|
+
* Walks up the directory tree to find hoisted packages (yarn workspaces).
|
|
77
|
+
* @param projectPath - the project root path
|
|
78
|
+
* @param mod - the module object to merge into
|
|
79
|
+
*/
|
|
80
|
+
function mergeDependencyModules(projectPath, mod) {
|
|
81
|
+
const seen = new Set();
|
|
82
|
+
let current = resolve(projectPath);
|
|
83
|
+
const root = resolve("/");
|
|
84
|
+
while (current !== root) {
|
|
85
|
+
scanNodeModules(join(current, "node_modules"), mod, seen);
|
|
86
|
+
const parent = resolve(join(current, ".."));
|
|
87
|
+
if (parent === current)
|
|
88
|
+
break;
|
|
89
|
+
current = parent;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Type guard for the "build" CLI command
|
|
94
|
+
* @param argv - the parsed CLI arguments
|
|
95
|
+
* @returns true if the command is "build"
|
|
96
|
+
*/
|
|
97
|
+
function isBuildCommand(argv) {
|
|
98
|
+
return argv._[0] === "build";
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Type guard for the "code" CLI command
|
|
102
|
+
* @param argv - the parsed CLI arguments
|
|
103
|
+
* @returns true if the command is "code"
|
|
104
|
+
*/
|
|
105
|
+
function isCodeCommand(argv) {
|
|
106
|
+
return argv._[0] === "code";
|
|
107
|
+
}
|
|
108
|
+
const argv = yargs(process.argv.slice(2))
|
|
109
|
+
.command("build", "Build an application", yargs => {
|
|
110
|
+
yargs
|
|
111
|
+
.option("watch", {
|
|
112
|
+
alias: "w",
|
|
113
|
+
describe: "Watch the files for changes",
|
|
114
|
+
type: "boolean",
|
|
115
|
+
default: false
|
|
116
|
+
})
|
|
117
|
+
.option("force", {
|
|
118
|
+
alias: "f",
|
|
119
|
+
describe: "Recompile even when the cache reports nothing changed",
|
|
120
|
+
type: "boolean",
|
|
121
|
+
default: false
|
|
122
|
+
});
|
|
123
|
+
})
|
|
124
|
+
.command("code", "Migrate the application sources to the current Webda version", yargs => {
|
|
125
|
+
yargs.option("module", {
|
|
126
|
+
describe: "Run only these migration modules",
|
|
127
|
+
type: "array"
|
|
128
|
+
});
|
|
129
|
+
})
|
|
130
|
+
.option("appPath", {
|
|
131
|
+
describe: "Path to the application",
|
|
132
|
+
type: "string",
|
|
133
|
+
default: "."
|
|
134
|
+
})
|
|
135
|
+
.demandCommand(1, "You need to specify a command")
|
|
136
|
+
.version()
|
|
137
|
+
.help().argv;
|
|
138
|
+
const { appPath } = argv;
|
|
139
|
+
const targetDir = resolve(appPath || ".");
|
|
140
|
+
const command = argv._[0];
|
|
141
|
+
new InteractiveConsoleLogger(useWorkerOutput());
|
|
142
|
+
Fork(async () => {
|
|
143
|
+
if (isCodeCommand(argv)) {
|
|
144
|
+
const morpher = new WebdaMorpher({
|
|
145
|
+
project: { tsConfigFilePath: join(targetDir, "tsconfig.json") },
|
|
146
|
+
modules: argv.module?.map(String)
|
|
147
|
+
});
|
|
148
|
+
await morpher.check();
|
|
149
|
+
}
|
|
150
|
+
else if (isBuildCommand(argv)) {
|
|
151
|
+
const project = new WebdaProject(targetDir, useWorkerOutput());
|
|
152
|
+
project.on("compiling", () => {
|
|
153
|
+
if (argv.watch) {
|
|
154
|
+
process.stdout.write("\u001B[2J\u001B[0;0f");
|
|
155
|
+
process.stdout.write(bold("web" + yellow("da") + ".io") +
|
|
156
|
+
` watch - ${project.packageDescription.name}@${project.packageDescription.version || "dev"} - ${italic(project.getAppPath())}\n\n`);
|
|
157
|
+
}
|
|
158
|
+
useWorkerOutput().startActivity("Compiling…");
|
|
159
|
+
});
|
|
160
|
+
project.on("compilationError", () => {
|
|
161
|
+
useWorkerOutput().stopActivity("error", "Error during compilation");
|
|
162
|
+
if (!argv.watch) {
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
project.on("analyzing", () => {
|
|
167
|
+
useWorkerOutput().startActivity("Analyzing…");
|
|
168
|
+
});
|
|
169
|
+
project.on("done", () => {
|
|
170
|
+
if (!argv.watch) {
|
|
171
|
+
useWorkerOutput().stopActivity("success", "web" + yellow("da") + ".module.json generated");
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
useWorkerOutput().stopActivity("success", "Watching for file changes…");
|
|
175
|
+
// useWorkerOutput().log("INFO", "Watching for file changes…");
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
await runWithCurrentDirectory(targetDir, async () => {
|
|
179
|
+
const compiler = new Compiler(project);
|
|
180
|
+
if (argv.watch) {
|
|
181
|
+
// Guard against accidental recursion if a build hook re-invokes webdac.
|
|
182
|
+
const recursive = !!process.env[WEBDA_BUILD_DISPATCH_ENV];
|
|
183
|
+
let building = false;
|
|
184
|
+
let pending = false;
|
|
185
|
+
const runHooksOnce = async () => {
|
|
186
|
+
const modulePath = project.getAppPath("webda.module.json");
|
|
187
|
+
if (!existsSync(modulePath))
|
|
188
|
+
return;
|
|
189
|
+
const localMod = FileUtils.load(modulePath, "json");
|
|
190
|
+
mergeDependencyModules(project.getAppPath(), localMod);
|
|
191
|
+
const configPath = FileUtils.getConfigurationFile(project.getAppPath("webda.config"));
|
|
192
|
+
const configuredTypes = listConfiguredServiceTypes(configPath, project.namespace);
|
|
193
|
+
if (!shouldDispatchBuildHooks(localMod, configuredTypes))
|
|
194
|
+
return;
|
|
195
|
+
const code = await spawnWebdaBuild(project.getAppPath());
|
|
196
|
+
if (code !== 0) {
|
|
197
|
+
useWorkerOutput().log("ERROR", `webda build exited with code ${code}`);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const runHooks = async () => {
|
|
201
|
+
if (building) {
|
|
202
|
+
pending = true;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
building = true;
|
|
206
|
+
try {
|
|
207
|
+
await runHooksOnce();
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
useWorkerOutput().log("ERROR", "Build hook dispatch failed", err.message);
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
building = false;
|
|
214
|
+
if (pending) {
|
|
215
|
+
pending = false;
|
|
216
|
+
// Run again — the source changed during the previous run.
|
|
217
|
+
void runHooks();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
if (!recursive) {
|
|
222
|
+
project.on("done", () => {
|
|
223
|
+
void runHooks();
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
compiler.watch(() => { });
|
|
227
|
+
await new Promise(() => { });
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
const needsCompilation = argv.force || compiler.requireCompilation();
|
|
231
|
+
compiler.compile(argv.force);
|
|
232
|
+
if (!needsCompilation) {
|
|
233
|
+
useWorkerOutput().log("INFO", "Cache up-to-date; skipping build (pass --force to recompile)");
|
|
234
|
+
}
|
|
235
|
+
// Generate configuration schemas if the project is an application
|
|
236
|
+
if (needsCompilation && project.isApplication()) {
|
|
237
|
+
const modulePath = project.getAppPath("webda.module.json");
|
|
238
|
+
const mod = FileUtils.load(modulePath, "json");
|
|
239
|
+
mergeDependencyModules(project.getAppPath(), mod);
|
|
240
|
+
// Generate configuration schemas
|
|
241
|
+
try {
|
|
242
|
+
const configPath = FileUtils.getConfigurationFile(project.getAppPath("webda.config"));
|
|
243
|
+
const config = FileUtils.load(configPath);
|
|
244
|
+
const namespace = project.namespace || "Webda";
|
|
245
|
+
const app = {
|
|
246
|
+
getModdas: () => mod.moddas || {},
|
|
247
|
+
getSchema: (type) => mod.schemas?.[type] || mod.moddas?.[type]?.Schema || mod.beans?.[type]?.Schema || mod.deployers?.[type]?.Schema,
|
|
248
|
+
getDeployers: () => mod.deployers || {},
|
|
249
|
+
getConfiguration: () => config,
|
|
250
|
+
getModules: () => mod,
|
|
251
|
+
completeNamespace: (name) => (name.includes("/") ? name : `${namespace}/${name}`)
|
|
252
|
+
};
|
|
253
|
+
generateConfigurationSchemas(app, undefined, undefined, undefined, configPath);
|
|
254
|
+
}
|
|
255
|
+
catch (err) {
|
|
256
|
+
useWorkerOutput().log("WARN", "Cannot generate configuration schemas", err.message);
|
|
257
|
+
}
|
|
258
|
+
// Generate operations.json
|
|
259
|
+
try {
|
|
260
|
+
const operations = generateOperations(mod);
|
|
261
|
+
const webdaDir = project.getAppPath(".webda");
|
|
262
|
+
if (!existsSync(webdaDir)) {
|
|
263
|
+
mkdirSync(webdaDir, { recursive: true });
|
|
264
|
+
}
|
|
265
|
+
writeFileSync(join(webdaDir, "operations.json"), JSON.stringify(operations, undefined, 2));
|
|
266
|
+
useWorkerOutput().log("INFO", "Generated .webda/operations.json");
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
useWorkerOutput().log("WARN", "Cannot generate operations.json", err.message);
|
|
270
|
+
}
|
|
271
|
+
// Build-hook dispatch: if any configured service declares a `build`
|
|
272
|
+
// command, spawn `webda build` to run the hooks.
|
|
273
|
+
// If WEBDA_BUILD_DISPATCH is set, we are already the child of an
|
|
274
|
+
// outer `webdac build` — skip to break any accidental fork loop
|
|
275
|
+
// (e.g. a user's build hook that re-invokes `webdac build`).
|
|
276
|
+
if (!process.env[WEBDA_BUILD_DISPATCH_ENV]) {
|
|
277
|
+
const configPath = FileUtils.getConfigurationFile(project.getAppPath("webda.config"));
|
|
278
|
+
const configuredTypes = listConfiguredServiceTypes(configPath, project.namespace);
|
|
279
|
+
if (shouldDispatchBuildHooks(mod, configuredTypes)) {
|
|
280
|
+
useWorkerOutput().log("INFO", "Running build hooks (webda build)…");
|
|
281
|
+
const code = await spawnWebdaBuild(project.getAppPath());
|
|
282
|
+
if (code !== 0) {
|
|
283
|
+
useWorkerOutput().log("ERROR", `webda build exited with code ${code}`);
|
|
284
|
+
process.exit(code);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}, () => {
|
|
293
|
+
//new InteractiveConsoleLogger(useWorkerOutput(), "WARN");
|
|
294
|
+
}).catch(err => {
|
|
295
|
+
process.exit(1);
|
|
296
|
+
});
|
|
297
|
+
//# sourceMappingURL=shell.js.map
|
package/lib/shell.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAA2B,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EA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EAAE,oCAAoC,CAAC,CAAC;4BACpE,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;4BACzD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gCACf,eAAe,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,gCAAgC,IAAI,EAAE,CAAC,CAAC;gCACvE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;4BACrB,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,EACD,GAAG,EAAE;IACH,0DAA0D;AAC5D,CAAC,CACF,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webda/compiler",
|
|
3
|
+
"version": "4.0.0-beta.3",
|
|
4
|
+
"description": "Expose API with Lambda",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"aws",
|
|
7
|
+
"lamda",
|
|
8
|
+
"api gateway"
|
|
9
|
+
],
|
|
10
|
+
"author": "Remi Cattiau <remi@cattiau.com>",
|
|
11
|
+
"repository": "git://github.com/loopingz/webda.io.git",
|
|
12
|
+
"main": "lib/index.js",
|
|
13
|
+
"bin": {
|
|
14
|
+
"webdac": "./lib/shell.js"
|
|
15
|
+
},
|
|
16
|
+
"typings": "lib/index.d.ts",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@types/json-schema": "^7.0.15",
|
|
19
|
+
"accept-language": "^3.0.20",
|
|
20
|
+
"diff": "^8.0.4",
|
|
21
|
+
"ts-morph": "^27.0.2",
|
|
22
|
+
"typescript": "7.1.0-dev.20260929.1",
|
|
23
|
+
"yargs": "^18.0.0",
|
|
24
|
+
"yoctocolors": "^1.0.0",
|
|
25
|
+
"@webda/content-mapper": "4.0.0-beta.1",
|
|
26
|
+
"@webda/utils": "^4.0.0-beta.3",
|
|
27
|
+
"@webda/workout": "4.0.0-beta.3"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "25.5.0",
|
|
31
|
+
"eslint": "^10.1.0",
|
|
32
|
+
"eslint-plugin-import": "^2.32.0",
|
|
33
|
+
"prettier": "^3.8.1",
|
|
34
|
+
"skott": "^0.35.8",
|
|
35
|
+
"vite": "^6.0.0",
|
|
36
|
+
"vitest": "^4.1.2",
|
|
37
|
+
"@webda/test": "4.0.0-beta.3"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"lib"
|
|
41
|
+
],
|
|
42
|
+
"homepage": "https://webda.io",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"type": "module",
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=22.0.0"
|
|
49
|
+
},
|
|
50
|
+
"license": "LGPL-3.0-only",
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -p tsconfig.json",
|
|
53
|
+
"build:watch": "tsc -p tsconfig.json --watch",
|
|
54
|
+
"deps:graph": "skott --showCircularDependencies --no-trackTypeOnlyDependencies --displayMode=raw -e .ts",
|
|
55
|
+
"format": "prettier --check src/**/*",
|
|
56
|
+
"format:fix": "prettier --write src/**/*",
|
|
57
|
+
"lint": "eslint",
|
|
58
|
+
"lint:fix": "eslint --fix",
|
|
59
|
+
"schema": "ts-json-schema-generator --path src/definition.ts -f ./tsconfig.json --type 'WebdaModule' -o ./webda.module.schema.json",
|
|
60
|
+
"pretest": "pnpm run build",
|
|
61
|
+
"test": "vitest run",
|
|
62
|
+
"test:watch": "vitest",
|
|
63
|
+
"test:coverage": "vitest --coverage"
|
|
64
|
+
}
|
|
65
|
+
}
|