sanoma 0.11.17 → 0.11.18
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/dist/config.js +13 -37
- package/dist/config.js.map +1 -1
- package/package.json +3 -3
package/dist/config.js
CHANGED
|
@@ -47,46 +47,22 @@ export async function loadConfig(cwd = process.cwd()) {
|
|
|
47
47
|
config.file ??= file;
|
|
48
48
|
const root = config.root ?? dirname(file);
|
|
49
49
|
// Imported here, not at the top: `cli.ts` loads this module before any command needs the runtime.
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const modules = (await Promise.all(paths.map(importReal)));
|
|
57
|
-
for (const [i, { default: wf }] of modules.entries()) {
|
|
58
|
-
const path = paths[i];
|
|
59
|
-
if (wf === undefined)
|
|
60
|
-
continue;
|
|
61
|
-
if (!isWorkflow(wf)) {
|
|
62
|
-
throw new UsageError(`${realpathSync(path)}'s default export is not a workflow: a file of workflows/ exports one, \`export default defineWorkflow({ … })\`, or none (a helper the workflows import)`);
|
|
63
|
-
}
|
|
64
|
-
workflows.add(wf);
|
|
65
|
-
}
|
|
66
|
-
if (workflows.size > 0)
|
|
67
|
-
config.workflows = [...workflows];
|
|
50
|
+
const { declarationFiles, errorMessage, joinDeclarations } = await import("@sanoma-ai/workflows");
|
|
51
|
+
const files = declarationFiles(root);
|
|
52
|
+
// The workflows' first; joined in the files' order.
|
|
53
|
+
const modules = { workflows: await importReal(files.workflows), data: await importReal(files.data) };
|
|
54
|
+
try {
|
|
55
|
+
joinDeclarations(config, modules);
|
|
68
56
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
for (const path of kindDirs(root, "resources").map((dir) => join(dir, "data.ts"))) {
|
|
72
|
-
if (!existsSync(path))
|
|
73
|
-
continue;
|
|
74
|
-
for (const [name, value] of Object.entries((await importReal(path)))) {
|
|
75
|
-
if (!isCollection(value)) {
|
|
76
|
-
throw new UsageError(`${realpathSync(path)} exports ${name}, which is not a collection: resources/data.ts holds collections only, each \`export const ${name} = collection({ name, key, fields })\` with collection from "sanoma/data"`);
|
|
77
|
-
}
|
|
78
|
-
collections.add(value);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (collections.size > 0)
|
|
82
|
-
config.collections = [...collections];
|
|
57
|
+
catch (err) {
|
|
58
|
+
throw new UsageError(errorMessage(err));
|
|
83
59
|
}
|
|
84
60
|
return { config, root };
|
|
85
61
|
}
|
|
86
|
-
/** The
|
|
87
|
-
const importReal = (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
62
|
+
/** The modules at `paths`, at once, each by its real path (the module a relative import of it is), beside it. */
|
|
63
|
+
const importReal = (paths) => Promise.all(paths.map(async (path) => {
|
|
64
|
+
const real = realpathSync(path);
|
|
65
|
+
return [real, (await import(__rewriteRelativeImportExtension(pathToFileURL(real).href)))];
|
|
66
|
+
}));
|
|
91
67
|
const isConfig = (x) => typeof x === "object" && x !== null && "connectors" in x;
|
|
92
68
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,qHAAqH;AAC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AAC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IACrG,IAAI,CAAC;QACH,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,GAAG,CAAC,KAAe,EAA+B,EAAE,CAClE,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAA6B,EAAE;IAClD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,MAAM,kCAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAC,CAAW,CAAC,CAAC;AACpE,CAAC,CAAC,CACH,CAAC;AAEJ,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAqB,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,YAAY,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanoma",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.18",
|
|
4
4
|
"description": "One command over a Sanoma repo: run the worker and the app, check it, write its .env.example, export a run's ledger",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"approvals",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@sanoma-ai/app": "0.10.
|
|
77
|
+
"@sanoma-ai/app": "0.10.14",
|
|
78
78
|
"@sanoma-ai/bridge": "0.5.6",
|
|
79
79
|
"@sanoma-ai/connector-better-auth": "0.2.6",
|
|
80
|
-
"@sanoma-ai/workflows": "0.11.
|
|
80
|
+
"@sanoma-ai/workflows": "0.11.17",
|
|
81
81
|
"@types/node": "^26.6.4",
|
|
82
82
|
"oxlint": "^1.87.0",
|
|
83
83
|
"pg": "^8.23.1",
|