@antelopejs/dms 0.20.0 → 0.20.2
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/CHANGELOG.md +79 -0
- package/README.md +21 -14
- package/bin/control/backend-mode.test.mjs +41 -1
- package/bin/control/backend-records.test.mjs +154 -100
- package/bin/control/backend.mjs +1 -1
- package/bin/control/backend.test.mjs +4 -1
- package/bin/control/base.mjs +6 -1
- package/bin/control/build-key-refusals.test.mjs +8 -8
- package/bin/control/build-key.mjs +8 -6
- package/bin/control/build-key.test.mjs +3 -2
- package/bin/control/build-layout.test.mjs +5 -4
- package/bin/control/forwarder.test.mjs +19 -11
- package/bin/control/helpers/fake-run.mjs +59 -60
- package/bin/control/helpers/key-fixture.mjs +1 -1
- package/bin/control/helpers/pids.mjs +10 -0
- package/bin/control/helpers/tree.mjs +4 -4
- package/bin/control/journey.test.mjs +32 -32
- package/bin/control/mongo-server.test.mjs +64 -19
- package/bin/control/mongo.mjs +12 -3
- package/bin/control/namespaces.test.mjs +50 -31
- package/bin/control/processes.mjs +13 -1
- package/bin/control/processes.test.mjs +98 -64
- package/bin/control/renderer.test.mjs +2 -2
- package/bin/control/run-ports.test.mjs +24 -9
- package/bin/control/stack.mjs +16 -3
- package/bin/control/tab.test.mjs +1 -1
- package/bin/control/verify/formal.test.mjs +2 -2
- package/checks/dms-components.d.mts +38 -0
- package/data/mockup-spec.schema.json +4 -2
- package/data/module-store/catalog.json +1 -7
- package/dist/builder.js +2 -1
- package/dist/builder.js.map +1 -1
- package/dist/crons/cleanup-user-invites.js +7 -1
- package/dist/crons/cleanup-user-invites.js.map +1 -1
- package/dist/dev/module-update-notifications.js +2 -4
- package/dist/dev/module-update-notifications.js.map +1 -1
- package/dist/implementations/dms/dev-handshake.js +2 -5
- package/dist/implementations/dms/dev-handshake.js.map +1 -1
- package/dist/implementations/dms-auth/index.d.ts +3 -4
- package/dist/implementations/dms-auth/index.js +20 -4
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-auth/token-session.d.ts +2 -2
- package/dist/implementations/dms-auth/token-session.js +1 -4
- package/dist/implementations/dms-auth/token-session.js.map +1 -1
- package/dist/implementations/dms-base/bulk-selection.js +1 -1
- package/dist/implementations/dms-base/bulk-selection.js.map +1 -1
- package/dist/implementations/dms-base/footer-summary.js +1 -1
- package/dist/implementations/dms-base/footer-summary.js.map +1 -1
- package/dist/implementations/dms-base/search-route.d.ts +12 -3
- package/dist/implementations/dms-base/search-route.js +8 -4
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-base/table-view.js +38 -16
- package/dist/implementations/dms-base/table-view.js.map +1 -1
- package/dist/implementations/dms-builder/engine/connection-access-config.js +2 -7
- package/dist/implementations/dms-builder/engine/connection-access-config.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-access.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/database-access.js +14 -2
- package/dist/implementations/dms-builder/engine/database-access.js.map +1 -1
- package/dist/implementations/dms-builder/engine/driver-packages.js +4 -18
- package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
- package/dist/implementations/dms-builder/engine/file-paths.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/file-paths.js +18 -0
- package/dist/implementations/dms-builder/engine/file-paths.js.map +1 -0
- package/dist/implementations/dms-builder/engine/index.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/index.js +3 -0
- package/dist/implementations/dms-builder/engine/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/inherited-variables.d.ts +2 -0
- package/dist/implementations/dms-builder/engine/inherited-variables.js +19 -0
- package/dist/implementations/dms-builder/engine/inherited-variables.js.map +1 -0
- package/dist/implementations/dms-builder/engine/map-resources.js +1 -1
- package/dist/implementations/dms-builder/engine/map-resources.js.map +1 -1
- package/dist/implementations/dms-builder/engine/modules.js +3 -5
- package/dist/implementations/dms-builder/engine/modules.js.map +1 -1
- package/dist/implementations/dms-builder/engine/placement.js +2 -1
- package/dist/implementations/dms-builder/engine/placement.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-client.d.ts +4 -0
- package/dist/implementations/dms-builder/engine/probe-client.js +11 -2
- package/dist/implementations/dms-builder/engine/probe-client.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-mongodb.js +92 -36
- package/dist/implementations/dms-builder/engine/probe-mongodb.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-mysql.js +54 -1
- package/dist/implementations/dms-builder/engine/probe-mysql.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-postgres.js +95 -11
- package/dist/implementations/dms-builder/engine/probe-postgres.js.map +1 -1
- package/dist/implementations/dms-builder/engine/project-config-ops.js +2 -1
- package/dist/implementations/dms-builder/engine/project-config-ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/project-env.js +5 -0
- package/dist/implementations/dms-builder/engine/project-env.js.map +1 -1
- package/dist/implementations/dms-builder/engine/project-scaffold.d.ts +1 -8
- package/dist/implementations/dms-builder/engine/project-scaffold.js +55 -18
- package/dist/implementations/dms-builder/engine/project-scaffold.js.map +1 -1
- package/dist/implementations/dms-builder/engine/scram-bound.d.ts +5 -0
- package/dist/implementations/dms-builder/engine/scram-bound.js +60 -0
- package/dist/implementations/dms-builder/engine/scram-bound.js.map +1 -0
- package/dist/implementations/dms-builder/engine/theme-app-config.d.ts +1 -1
- package/dist/implementations/dms-builder/engine/theme-app-config.js +96 -22
- package/dist/implementations/dms-builder/engine/theme-app-config.js.map +1 -1
- package/dist/mcp/page-verify/page-probe.d.ts +12 -12
- package/dist/mcp/project-files.js +2 -8
- package/dist/mcp/project-files.js.map +1 -1
- package/dist/mcp/tools/preview-blocks.js +8 -24
- package/dist/mcp/tools/preview-blocks.js.map +1 -1
- package/dist/mcp/tools/typecheck.js +2 -5
- package/dist/mcp/tools/typecheck.js.map +1 -1
- package/dist/mockup/json-schema.js +2 -2
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/sketch-allowlist.d.ts +11 -0
- package/dist/mockup/sketch-allowlist.js +368 -0
- package/dist/mockup/sketch-allowlist.js.map +1 -0
- package/dist/mockup/sketch-css.d.ts +3 -0
- package/dist/mockup/sketch-css.js +306 -0
- package/dist/mockup/sketch-css.js.map +1 -0
- package/dist/mockup/sketch-html.d.ts +7 -0
- package/dist/mockup/sketch-html.js +243 -0
- package/dist/mockup/sketch-html.js.map +1 -0
- package/dist/mockup/sketch-limits.d.ts +1 -0
- package/dist/mockup/sketch-limits.js +5 -0
- package/dist/mockup/sketch-limits.js.map +1 -0
- package/dist/mockup/sketch-scan.d.ts +1 -0
- package/dist/mockup/sketch-scan.js +136 -0
- package/dist/mockup/sketch-scan.js.map +1 -0
- package/dist/mockup/sketch-tokens.d.ts +22 -0
- package/dist/mockup/sketch-tokens.js +42 -0
- package/dist/mockup/sketch-tokens.js.map +1 -0
- package/dist/mockup/sketch.d.ts +19 -1
- package/dist/mockup/sketch.js +78 -94
- package/dist/mockup/sketch.js.map +1 -1
- package/dist/routes/auth/logout.d.ts +2 -2
- package/dist/routes/auth/logout.js +3 -9
- package/dist/routes/auth/logout.js.map +1 -1
- package/dist/routes/auth/refresh.js +6 -8
- package/dist/routes/auth/refresh.js.map +1 -1
- package/dist/routes/auth/switch-tenant.js +8 -11
- package/dist/routes/auth/switch-tenant.js.map +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/auth.js.map +1 -1
- package/dist/store/registry.js +2 -4
- package/dist/store/registry.js.map +1 -1
- package/dist/store/tarball.js +12 -6
- package/dist/store/tarball.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/owner-only-file.d.ts +1 -0
- package/dist/utils/owner-only-file.js +60 -0
- package/dist/utils/owner-only-file.js.map +1 -0
- package/dist/utils/package-manager/index.d.ts +1 -0
- package/dist/utils/package-manager/index.js +18 -0
- package/dist/utils/package-manager/index.js.map +1 -0
- package/dist/utils/package-manager.d.ts +12 -0
- package/dist/utils/package-manager.js +28 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/frontend-vue/build/backend-boundary.ts +84 -79
- package/frontend-vue/layers/dms-auth/app/middleware/auth.ts +11 -7
- package/frontend-vue/layers/dms-layout/app/composables/useHeaderActions.ts +4 -4
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +0 -4
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +0 -4
- package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +9 -0
- package/frontend-vue/package.json +1 -1
- package/frontend-vue/scripts/check-autoimport-boundaries.mjs +12 -7
- package/frontend-vue/scripts/check-dms-components.mjs +519 -0
- package/frontend-vue/scripts/check-invariants.mjs +7 -1
- package/frontend-vue/scripts/dms-components-dependencies.mjs +89 -0
- package/frontend-vue/scripts/test-dms-components.mjs +255 -0
- package/package.json +32 -17
- package/skills/dms/REFERENCE.md +1 -1
- package/skills/dms/SKILL.md +1 -1
- package/skills/dms-module/SKILL.md +1 -1
- package/skills/dms-module/cases.json +3 -3
- package/skills/dms-project/SKILL.md +1 -1
- package/skills/dms-project/scripts/dms-dev.sh +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
export const RENDERER = "@antelopejs/dms-frontend";
|
|
7
|
+
|
|
8
|
+
function manifest(path) {
|
|
9
|
+
return JSON.parse(readFileSync(new URL(path, import.meta.url), "utf8"));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const FRONTEND = manifest("../package.json");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The development dependencies the check resolves, at the range the
|
|
16
|
+
* installed `@antelopejs/dms` declares for each. `typescript` and `vue` parse
|
|
17
|
+
* the layer's files; the renderer only lists the components it registers
|
|
18
|
+
* itself, such as `DmsLink`.
|
|
19
|
+
*/
|
|
20
|
+
const DMS_COMPONENTS_DEPENDENCIES = Object.freeze({
|
|
21
|
+
typescript: manifest("../../package.json").peerDependencies.typescript,
|
|
22
|
+
vue: FRONTEND.peerDependencies.vue,
|
|
23
|
+
[RENDERER]: FRONTEND.engines[RENDERER],
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/** How the package manager running the check adds a development dependency. */
|
|
27
|
+
const ADD_DEV_DEPENDENCY = {
|
|
28
|
+
pnpm: "pnpm add -D",
|
|
29
|
+
npm: "npm install -D",
|
|
30
|
+
yarn: "yarn add -D",
|
|
31
|
+
bun: "bun add -d",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** The command that adds `packages` at their range, for the package manager running the check. */
|
|
35
|
+
export function addCommand(packages) {
|
|
36
|
+
const manager = (process.env.npm_config_user_agent ?? "").split("/")[0];
|
|
37
|
+
const add = Object.hasOwn(ADD_DEV_DEPENDENCY, manager)
|
|
38
|
+
? ADD_DEV_DEPENDENCY[manager]
|
|
39
|
+
: ADD_DEV_DEPENDENCY.pnpm;
|
|
40
|
+
const specs = packages.map(
|
|
41
|
+
(name) => `"${name}@${DMS_COMPONENTS_DEPENDENCIES[name]}"`,
|
|
42
|
+
);
|
|
43
|
+
return `${add} ${specs.join(" ")}`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function resolveFirst(requires, specifier) {
|
|
47
|
+
for (const require of requires) {
|
|
48
|
+
try {
|
|
49
|
+
return require.resolve(specifier);
|
|
50
|
+
} catch {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Resolves `typescript` and `vue` from the layer, then from the installed
|
|
59
|
+
* `@antelopejs/dms`, and the renderer from the layer alone.
|
|
60
|
+
*/
|
|
61
|
+
export function dependencies(layer) {
|
|
62
|
+
const manifest = join(layer, "package.json");
|
|
63
|
+
if (!existsSync(manifest)) throw new Error(`No package.json in ${layer}`);
|
|
64
|
+
const fromLayer = createRequire(manifest);
|
|
65
|
+
const parsers = [fromLayer, createRequire(import.meta.url)];
|
|
66
|
+
const typescript = resolveFirst(parsers, "typescript");
|
|
67
|
+
const sfc = resolveFirst(parsers, "vue/compiler-sfc");
|
|
68
|
+
const missing = [
|
|
69
|
+
...(typescript ? [] : ["typescript"]),
|
|
70
|
+
...(sfc ? [] : ["vue"]),
|
|
71
|
+
];
|
|
72
|
+
if (missing.length)
|
|
73
|
+
throw new Error(
|
|
74
|
+
`The DMS component check parses the layer with typescript and vue, and ${missing.join(" and ")} cannot be resolved from ${layer}. In ${layer}, run: ${addCommand(missing)}`,
|
|
75
|
+
);
|
|
76
|
+
const require = createRequire(import.meta.url);
|
|
77
|
+
return {
|
|
78
|
+
ts: require(typescript),
|
|
79
|
+
parse: require(sfc).parse,
|
|
80
|
+
rendererGlobals: resolveFirst([fromLayer], `${RENDERER}/eslint-globals`),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The `Dms` components the `@antelopejs/dms-frontend` renderer registers itself, or none when it is not installed. */
|
|
85
|
+
export async function rendererComponentNames(globalsPath) {
|
|
86
|
+
if (!globalsPath) return [];
|
|
87
|
+
const { default: globals } = await import(pathToFileURL(globalsPath).href);
|
|
88
|
+
return Object.keys(globals).filter((name) => /^Dms[A-Z]/.test(name));
|
|
89
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import {
|
|
3
|
+
copyFileSync,
|
|
4
|
+
mkdirSync,
|
|
5
|
+
mkdtempSync,
|
|
6
|
+
rmSync,
|
|
7
|
+
symlinkSync,
|
|
8
|
+
writeFileSync,
|
|
9
|
+
} from "node:fs";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { dirname, join, relative } from "node:path";
|
|
12
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
|
+
import {
|
|
14
|
+
assertDmsComponents,
|
|
15
|
+
checkDmsComponents,
|
|
16
|
+
} from "./check-dms-components.mjs";
|
|
17
|
+
|
|
18
|
+
const NODE_MODULES = fileURLToPath(new URL("../node_modules", import.meta.url));
|
|
19
|
+
|
|
20
|
+
const FIXTURE_FILES = {
|
|
21
|
+
"frontend-vue/package.json": "{}",
|
|
22
|
+
"frontend-vue/dms.frontend.ts": [
|
|
23
|
+
'const PREFIX = "DmsAcme";',
|
|
24
|
+
"export default {",
|
|
25
|
+
" componentPrefix: PREFIX,",
|
|
26
|
+
" setup(sdk) {",
|
|
27
|
+
' sdk.registerComponent("extra-panel", {});',
|
|
28
|
+
' sdk.registerComponent("DmsAcmeRawPanel", {}, { prefix: false });',
|
|
29
|
+
' sdk.registerComponent("DmsChip", {});',
|
|
30
|
+
" },",
|
|
31
|
+
"};",
|
|
32
|
+
"const other = { componentPrefix: this.componentPrefix };",
|
|
33
|
+
].join("\n"),
|
|
34
|
+
"frontend-vue/app/components/StatusBoard.vue": "<template><div /></template>",
|
|
35
|
+
"frontend-vue/app/custom-layouts/Board.vue": "<template><div /></template>",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
async function diagnose({
|
|
39
|
+
screen = "<div />",
|
|
40
|
+
script = "",
|
|
41
|
+
backend = "",
|
|
42
|
+
renderer = true,
|
|
43
|
+
asserted = false,
|
|
44
|
+
}) {
|
|
45
|
+
const module = mkdtempSync(join(tmpdir(), "dms-components-"));
|
|
46
|
+
const layer = join(module, "frontend-vue");
|
|
47
|
+
try {
|
|
48
|
+
mkdirSync(layer);
|
|
49
|
+
if (renderer)
|
|
50
|
+
symlinkSync(NODE_MODULES, join(layer, "node_modules"), "junction");
|
|
51
|
+
const files = {
|
|
52
|
+
...FIXTURE_FILES,
|
|
53
|
+
"frontend-vue/app/pages/Screen.vue": [
|
|
54
|
+
"<script setup>",
|
|
55
|
+
'import DmsLocalPanel from "./DmsLocalPanel.vue";',
|
|
56
|
+
script,
|
|
57
|
+
"</script>",
|
|
58
|
+
"<template>",
|
|
59
|
+
screen,
|
|
60
|
+
"</template>",
|
|
61
|
+
].join("\n"),
|
|
62
|
+
"src/pages/home.ts": backend,
|
|
63
|
+
"src/pages/home.test.ts": 'CustomComponent("DmsCard");',
|
|
64
|
+
};
|
|
65
|
+
for (const [file, content] of Object.entries(files)) {
|
|
66
|
+
mkdirSync(dirname(join(module, file)), { recursive: true });
|
|
67
|
+
writeFileSync(join(module, file), content);
|
|
68
|
+
}
|
|
69
|
+
const shown = relative(process.cwd(), module).length + 1;
|
|
70
|
+
const options = { layer, sources: [join(module, "src")] };
|
|
71
|
+
if (asserted)
|
|
72
|
+
return await assertDmsComponents(options).then(
|
|
73
|
+
() => [],
|
|
74
|
+
(error) => error.message.replaceAll(layer, "<layer>").split("\n"),
|
|
75
|
+
);
|
|
76
|
+
const diagnostics = await checkDmsComponents(options);
|
|
77
|
+
return diagnostics.map((line) =>
|
|
78
|
+
line
|
|
79
|
+
.slice(shown)
|
|
80
|
+
.replaceAll("\\", "/")
|
|
81
|
+
.replace(/^frontend-vue\//, "")
|
|
82
|
+
.replace(/` is no component .*$/, "`"),
|
|
83
|
+
);
|
|
84
|
+
} finally {
|
|
85
|
+
rmSync(module, { recursive: true, force: true });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
assert.deepEqual(await diagnose({ screen: "<DmsCard />" }), [
|
|
90
|
+
"app/pages/Screen.vue:6: `DmsCard`",
|
|
91
|
+
]);
|
|
92
|
+
assert.deepEqual(await diagnose({ screen: "<DmsCardPanel />" }), []);
|
|
93
|
+
|
|
94
|
+
assert.deepEqual(
|
|
95
|
+
await diagnose({
|
|
96
|
+
screen: [
|
|
97
|
+
"<div>",
|
|
98
|
+
" <dms-card />",
|
|
99
|
+
' <component is="DmsBanner" />',
|
|
100
|
+
" <DmsAcmeNoSuchPanel />",
|
|
101
|
+
" <DmsCardpanel />",
|
|
102
|
+
" <DmsDefaultLayout />",
|
|
103
|
+
" <DmsChip />",
|
|
104
|
+
"</div>",
|
|
105
|
+
].join("\n"),
|
|
106
|
+
script: 'const card = resolveComponent("DmsSelect");',
|
|
107
|
+
}),
|
|
108
|
+
[
|
|
109
|
+
"app/pages/Screen.vue:7: `dms-card`",
|
|
110
|
+
"app/pages/Screen.vue:8: `DmsBanner`",
|
|
111
|
+
"app/pages/Screen.vue:9: `DmsAcmeNoSuchPanel`",
|
|
112
|
+
"app/pages/Screen.vue:10: `DmsCardpanel`",
|
|
113
|
+
"app/pages/Screen.vue:11: `DmsDefaultLayout`",
|
|
114
|
+
"app/pages/Screen.vue:12: `DmsChip`",
|
|
115
|
+
"app/pages/Screen.vue:3: `DmsSelect`",
|
|
116
|
+
],
|
|
117
|
+
);
|
|
118
|
+
assert.deepEqual(
|
|
119
|
+
await diagnose({
|
|
120
|
+
screen: [
|
|
121
|
+
"<div>",
|
|
122
|
+
" <dms-card-panel />",
|
|
123
|
+
' <component is="DmsNoticeBanner" />',
|
|
124
|
+
" <DmsAcmeStatusBoard />",
|
|
125
|
+
" <DmsAcmeExtraPanel />",
|
|
126
|
+
" <DmsLocalPanel />",
|
|
127
|
+
" <dms-local-panel />",
|
|
128
|
+
" <DmsLazyPanel />",
|
|
129
|
+
" <DmsPickedPanel />",
|
|
130
|
+
" <DmsAcmeRawPanel />",
|
|
131
|
+
" <DmsLink />",
|
|
132
|
+
" <DmsSectionBlock />",
|
|
133
|
+
"</div>",
|
|
134
|
+
].join("\n"),
|
|
135
|
+
script: [
|
|
136
|
+
"const DmsLazyPanel = defineAsyncComponent(() => import('./Panel.vue'));",
|
|
137
|
+
"const { DmsPickedPanel } = panels;",
|
|
138
|
+
'const card = resolveComponent("DmsInputSelect");',
|
|
139
|
+
].join("\n"),
|
|
140
|
+
}),
|
|
141
|
+
[],
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
assert.deepEqual(
|
|
145
|
+
await diagnose({
|
|
146
|
+
backend: [
|
|
147
|
+
'const card = CustomComponent("DmsCard");',
|
|
148
|
+
'const banner = new ComponentBuilder("dms-banner");',
|
|
149
|
+
'const layout = { componentName: "DmsEyebrow" };',
|
|
150
|
+
'const notice = { key: "trial", variant: "info", component: "DmsAcmeNoSuchBanner" };',
|
|
151
|
+
'const NAME = "dms-select";',
|
|
152
|
+
"const field = new ComponentBuilder(NAME);",
|
|
153
|
+
"const input = CustomComponent(`DmsTextarea` as const);",
|
|
154
|
+
'const board = CustomComponent("DmsBoard");',
|
|
155
|
+
'const componentName = "DmsMeter";',
|
|
156
|
+
"const info = { componentName };",
|
|
157
|
+
'function make() { const INNER = "DmsChip"; return CustomComponent(INNER); }',
|
|
158
|
+
].join("\n"),
|
|
159
|
+
}),
|
|
160
|
+
[
|
|
161
|
+
"src/pages/home.ts:1: `DmsCard`",
|
|
162
|
+
"src/pages/home.ts:2: `dms-banner`",
|
|
163
|
+
"src/pages/home.ts:3: `DmsEyebrow`",
|
|
164
|
+
"src/pages/home.ts:4: `DmsAcmeNoSuchBanner`",
|
|
165
|
+
"src/pages/home.ts:6: `dms-select`",
|
|
166
|
+
"src/pages/home.ts:7: `DmsTextarea`",
|
|
167
|
+
"src/pages/home.ts:8: `DmsBoard`",
|
|
168
|
+
"src/pages/home.ts:10: `DmsMeter`",
|
|
169
|
+
"src/pages/home.ts:11: `DmsChip`",
|
|
170
|
+
],
|
|
171
|
+
);
|
|
172
|
+
assert.deepEqual(
|
|
173
|
+
await diagnose({
|
|
174
|
+
backend: [
|
|
175
|
+
'const card = CustomComponent("DmsCardPanel");',
|
|
176
|
+
'const banner = new ComponentBuilder("dms-notice-banner");',
|
|
177
|
+
'const layout = { componentName: "dms-default-layout" };',
|
|
178
|
+
'const board = { componentName: "dms-board" };',
|
|
179
|
+
'const notice = { key: "trial", variant: "info", component: "DmsAcmeStatusBoard" };',
|
|
180
|
+
'const extra = CustomComponent("dms-acme-extra-panel");',
|
|
181
|
+
'const logger = child({ component: "dms-mailing" });',
|
|
182
|
+
'const database = connect("dms-database");',
|
|
183
|
+
'const component = "dms-mailing";',
|
|
184
|
+
"log.child({ component });",
|
|
185
|
+
"export function build(component) { return CustomComponent(component); }",
|
|
186
|
+
].join("\n"),
|
|
187
|
+
}),
|
|
188
|
+
[],
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
assert.deepEqual(
|
|
192
|
+
await diagnose({
|
|
193
|
+
screen: "<DmsCardPanel />",
|
|
194
|
+
renderer: false,
|
|
195
|
+
asserted: true,
|
|
196
|
+
}),
|
|
197
|
+
[],
|
|
198
|
+
);
|
|
199
|
+
assert.match(
|
|
200
|
+
(
|
|
201
|
+
await diagnose({ screen: "<DmsLink />", renderer: false, asserted: true })
|
|
202
|
+
).at(-1),
|
|
203
|
+
/^@antelopejs\/dms-frontend is not installed in <layer>, so the components its renderer registers, such as DmsLink, count as unknown\. If the layer uses one, run in <layer>: \S+ (?:add|install) -[Dd] "@antelopejs\/dms-frontend@>=0\.11\.0 <0\.12\.0"$/,
|
|
204
|
+
);
|
|
205
|
+
assert.deepEqual(await diagnose({ screen: "<DmsLink />", asserted: true }), []);
|
|
206
|
+
|
|
207
|
+
/** Installs of typescript and vue whose entry is missing: resolution stops at them and fails, whatever the host has above. */
|
|
208
|
+
const BROKEN_PARSERS = {
|
|
209
|
+
"node_modules/typescript/package.json": { main: "missing.js" },
|
|
210
|
+
"node_modules/vue/package.json": {
|
|
211
|
+
exports: { "./compiler-sfc": "./missing.js" },
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
async function checkWithoutParsers() {
|
|
216
|
+
const root = mkdtempSync(join(tmpdir(), "dms-components-parsers-"));
|
|
217
|
+
try {
|
|
218
|
+
for (const [file, manifest] of Object.entries(BROKEN_PARSERS)) {
|
|
219
|
+
mkdirSync(dirname(join(root, file)), { recursive: true });
|
|
220
|
+
writeFileSync(join(root, file), JSON.stringify(manifest));
|
|
221
|
+
}
|
|
222
|
+
const frontend = join(root, "dms", "frontend-vue");
|
|
223
|
+
mkdirSync(join(frontend, "scripts"), { recursive: true });
|
|
224
|
+
for (const file of [
|
|
225
|
+
"scripts/check-dms-components.mjs",
|
|
226
|
+
"scripts/dms-components-dependencies.mjs",
|
|
227
|
+
"package.json",
|
|
228
|
+
])
|
|
229
|
+
copyFileSync(
|
|
230
|
+
new URL(`../${file}`, import.meta.url),
|
|
231
|
+
join(frontend, file),
|
|
232
|
+
);
|
|
233
|
+
copyFileSync(
|
|
234
|
+
new URL("../../package.json", import.meta.url),
|
|
235
|
+
join(root, "dms", "package.json"),
|
|
236
|
+
);
|
|
237
|
+
const layer = join(root, "layer");
|
|
238
|
+
mkdirSync(layer);
|
|
239
|
+
writeFileSync(join(layer, "package.json"), "{}");
|
|
240
|
+
const copy = await import(
|
|
241
|
+
pathToFileURL(join(frontend, "scripts", "check-dms-components.mjs")).href
|
|
242
|
+
);
|
|
243
|
+
return await copy.checkDmsComponents({ layer }).then(
|
|
244
|
+
() => "",
|
|
245
|
+
(error) => error.message.replaceAll(layer, "<layer>"),
|
|
246
|
+
);
|
|
247
|
+
} finally {
|
|
248
|
+
rmSync(root, { recursive: true, force: true });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
assert.match(
|
|
253
|
+
await checkWithoutParsers(),
|
|
254
|
+
/^The DMS component check parses the layer with typescript and vue, and typescript and vue cannot be resolved from <layer>\. In <layer>, run: \S+ (?:add|install) -[Dd] "typescript@>=5\.8\.0 <7\.0\.0" "vue@\^3\.5\.0"$/,
|
|
255
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -64,6 +64,9 @@
|
|
|
64
64
|
"LICENSE"
|
|
65
65
|
],
|
|
66
66
|
"license": "Apache-2.0",
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
69
|
+
},
|
|
67
70
|
"antelopeJs": {
|
|
68
71
|
"implements": [
|
|
69
72
|
"@antelopejs/interface-dms",
|
|
@@ -77,16 +80,17 @@
|
|
|
77
80
|
},
|
|
78
81
|
"dependencies": {
|
|
79
82
|
"2fa": "^0.1.2",
|
|
80
|
-
"@antelopejs/interface-api": ">=0.3.2 <
|
|
81
|
-
"@antelopejs/interface-api-util": ">=0.3.0 <
|
|
82
|
-
"@antelopejs/interface-core": ">=0.5.1 <
|
|
83
|
-
"@antelopejs/interface-data-api": ">=0.8.0 <
|
|
84
|
-
"@antelopejs/interface-database": ">=0.4.0 <
|
|
85
|
-
"@antelopejs/interface-database-decorators": ">=0.5.2 <
|
|
83
|
+
"@antelopejs/interface-api": ">=0.3.2 <0.4.0",
|
|
84
|
+
"@antelopejs/interface-api-util": ">=0.3.0 <0.4.0",
|
|
85
|
+
"@antelopejs/interface-core": ">=0.5.1 <0.6.0",
|
|
86
|
+
"@antelopejs/interface-data-api": ">=0.8.0 <0.9.0",
|
|
87
|
+
"@antelopejs/interface-database": ">=0.4.0 <0.5.0",
|
|
88
|
+
"@antelopejs/interface-database-decorators": ">=0.5.2 <0.6.0",
|
|
86
89
|
"@antelopejs/interface-dms": ">=0.14.0 <0.15.0",
|
|
87
90
|
"@antelopejs/interface-dms-builder": ">=0.5.0 <0.6.0",
|
|
88
|
-
"@antelopejs/interface-email": ">=0.
|
|
89
|
-
"@antelopejs/interface-file-storage": ">=0.1.4 <
|
|
91
|
+
"@antelopejs/interface-email": ">=0.2.1 <0.3.0",
|
|
92
|
+
"@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
|
|
93
|
+
"@csstools/css-tokenizer": "4.0.0",
|
|
90
94
|
"@types/jsonwebtoken": "^9.0.10",
|
|
91
95
|
"archiver": "^7.0.1",
|
|
92
96
|
"csv-stringify": "^6.7.0",
|
|
@@ -97,19 +101,20 @@
|
|
|
97
101
|
"jsonwebtoken": "^9.0.3",
|
|
98
102
|
"mmdb-lib": "^3.0.3",
|
|
99
103
|
"node-cron": "^4.2.1",
|
|
104
|
+
"parse5": "^7.3.0",
|
|
100
105
|
"randomstring": "^1.3.1",
|
|
101
106
|
"semver": "^7.7.2",
|
|
102
107
|
"smol-toml": "^1.9.1",
|
|
103
108
|
"striptags": "^3.2.0",
|
|
104
109
|
"ts-morph": "^28.0.0",
|
|
105
110
|
"ua-parser-js": "^2.0.9",
|
|
106
|
-
"zod": "^3.
|
|
111
|
+
"zod": "^3.25.0",
|
|
107
112
|
"zod-to-json-schema": "~3.24.6"
|
|
108
113
|
},
|
|
109
114
|
"devDependencies": {
|
|
110
|
-
"@antelopejs/api": "
|
|
111
|
-
"@antelopejs/core": "
|
|
112
|
-
"@antelopejs/tooling-configs": "
|
|
115
|
+
"@antelopejs/api": "~1.7.0",
|
|
116
|
+
"@antelopejs/core": "~1.23.0",
|
|
117
|
+
"@antelopejs/tooling-configs": ">=0.7.2 <0.8.0",
|
|
113
118
|
"@types/archiver": "^6.0.4",
|
|
114
119
|
"@types/chai": "^4.3.20",
|
|
115
120
|
"@types/jsdom": "^28.0.3",
|
|
@@ -124,12 +129,14 @@
|
|
|
124
129
|
"chai": "^4.5.0",
|
|
125
130
|
"knip": "^6.34.0",
|
|
126
131
|
"mongodb": "^7.1.1",
|
|
132
|
+
"mongodb-connection-string-url": "^7.0.1",
|
|
127
133
|
"mongodb-memory-server-core": "^11.0.1",
|
|
128
134
|
"mysql2": "^3.24.6",
|
|
129
135
|
"oxfmt": "^0.66.0",
|
|
130
136
|
"oxlint": "1.81.0",
|
|
131
137
|
"oxlint-tsgolint": "^7.0.2001",
|
|
132
138
|
"pg": "^8.22.0",
|
|
139
|
+
"pg-connection-string": "^2.14.1",
|
|
133
140
|
"release-it": "^19.2.4",
|
|
134
141
|
"release-it-changelogen": "^0.1.0",
|
|
135
142
|
"rethinkdb-ts": "^2.7.0",
|
|
@@ -144,10 +151,18 @@
|
|
|
144
151
|
"default": "./dist/index.js"
|
|
145
152
|
},
|
|
146
153
|
"./package.json": "./package.json",
|
|
154
|
+
"./sketch": {
|
|
155
|
+
"types": "./dist/mockup/sketch.d.ts",
|
|
156
|
+
"default": "./dist/mockup/sketch.js"
|
|
157
|
+
},
|
|
147
158
|
"./checks/api-error-presentation": {
|
|
148
159
|
"types": "./checks/api-error-presentation.d.mts",
|
|
149
160
|
"default": "./frontend-vue/scripts/check-api-error-presentation.mjs"
|
|
150
161
|
},
|
|
162
|
+
"./checks/dms-components": {
|
|
163
|
+
"types": "./checks/dms-components.d.mts",
|
|
164
|
+
"default": "./frontend-vue/scripts/check-dms-components.mjs"
|
|
165
|
+
},
|
|
151
166
|
"./eslint-globals": {
|
|
152
167
|
"types": "./frontend-vue/eslint-globals.generated.d.mts",
|
|
153
168
|
"default": "./frontend-vue/eslint-globals.generated.mjs"
|
|
@@ -160,13 +175,13 @@
|
|
|
160
175
|
"registry": "https://registry.npmjs.org/"
|
|
161
176
|
},
|
|
162
177
|
"optionalDependencies": {
|
|
163
|
-
"@antelopejs/interface-database-catalog": ">=0.0
|
|
164
|
-
"@antelopejs/interface-dms-automation": ">=0.
|
|
165
|
-
"@antelopejs/interface-redis": ">=0.0.9 <1.0
|
|
178
|
+
"@antelopejs/interface-database-catalog": ">=0.1.0 <0.2.0",
|
|
179
|
+
"@antelopejs/interface-dms-automation": ">=0.7.0 <0.8.0",
|
|
180
|
+
"@antelopejs/interface-redis": ">=0.0.9 <0.1.0",
|
|
166
181
|
"playwright-core": "~1.65.0"
|
|
167
182
|
},
|
|
168
183
|
"peerDependencies": {
|
|
169
|
-
"@antelopejs/core": "
|
|
184
|
+
"@antelopejs/core": "~1.23.0",
|
|
170
185
|
"mongodb": "^6.21.0 || ^7.0.0",
|
|
171
186
|
"mysql2": "^3.24.6",
|
|
172
187
|
"pg": "^8.22.0",
|
package/skills/dms/REFERENCE.md
CHANGED
|
@@ -16,7 +16,7 @@ List a section to see its files. Guide paths below are relative to `packages/dms
|
|
|
16
16
|
| `docs/05.extending-the-dashboard/` | Dashboard chrome, theming, custom DataTypes (frontend side), table-view displays, component events, period filtering |
|
|
17
17
|
| `docs/06.frontend-composables/` | Composables a custom frontend module's Vue calls: auth'd requests, realtime, page context, UI toolkit |
|
|
18
18
|
| `packages/interface-dms/docs/` | The contract reference for `@antelopejs/interface-dms`, one folder per domain: `core`, `auth`, `base`, `notifications`, `html-render` |
|
|
19
|
-
| `docs/08.ai-and-claude-code/` | The skill suite, installing it in Claude Code, dms-
|
|
19
|
+
| `docs/08.ai-and-claude-code/` | The skill suite, installing it in Claude Code, dms-assistant, best practices, design fidelity, the `/dms-preview` page, shipping a module skill |
|
|
20
20
|
|
|
21
21
|
## Exact interface surfaces: don't memorize, look them up
|
|
22
22
|
|
package/skills/dms/SKILL.md
CHANGED
|
@@ -73,7 +73,7 @@ export class SubmitRecipePage extends PageController("submit-recipe", {
|
|
|
73
73
|
|
|
74
74
|
**dms-project**, **dms-auth** and **dms-module** ship in this package (`skills/`, declared via
|
|
75
75
|
`antelopeJs.skills`). The **antelopejs** plugin links them into a project's `.claude/skills/`, and
|
|
76
|
-
|
|
76
|
+
dms-assistant loads them for every loaded module. The `antelopejs:` workflow skills ship with
|
|
77
77
|
the **antelopejs** plugin, not with this package.
|
|
78
78
|
|
|
79
79
|
## Docs & exact interface surfaces
|
|
@@ -38,7 +38,7 @@ out a module without it.
|
|
|
38
38
|
**Ship a skill.** Add `skills/<module-name>/SKILL.md` (frontmatter `name`, a trigger-rich
|
|
39
39
|
`description`, `icon`, `category`, `tags`) saying when and how to use the module, list `"skills"` in
|
|
40
40
|
`files`, and declare `"antelopeJs": { "skills": ["./skills"] }`. The **antelopejs** plugin links it into
|
|
41
|
-
Claude Code and Codex projects and dms-
|
|
41
|
+
Claude Code and Codex projects and dms-assistant loads it — `docs/08.ai-and-claude-code/8.module-skills.md`.
|
|
42
42
|
|
|
43
43
|
## The lifecycle entry (`src/index.ts`)
|
|
44
44
|
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"id": "ai-ship-module-skills",
|
|
21
|
-
"area": "dms-
|
|
21
|
+
"area": "dms-assistant",
|
|
22
22
|
"style": "clean",
|
|
23
|
-
"prompt": "Make our module ship its own skill so dms-
|
|
23
|
+
"prompt": "Make our module ship its own skill so dms-assistant loads it.",
|
|
24
24
|
"expect": {
|
|
25
25
|
"skills": ["dms-module"],
|
|
26
|
-
"acceptable": ["dms-
|
|
26
|
+
"acceptable": ["dms-assistant", "antelopejs"]
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -176,7 +176,7 @@ building or deploying the frontend server belong to the **dms-frontend** skill (
|
|
|
176
176
|
|
|
177
177
|
### Never from inside the DMS
|
|
178
178
|
|
|
179
|
-
An agent running inside the DMS (the dms-
|
|
179
|
+
An agent running inside the DMS (the dms-assistant chat, whose sidecar the backend spawns, or any
|
|
180
180
|
process these dev servers started) **leaves the servers running**: stopping the backend takes the
|
|
181
181
|
agent down with it. It relies on hot reload and, when a change needs a full restart, asks the user
|
|
182
182
|
to run it. The script refuses to stop a process tree that contains its calling shell.
|
|
@@ -240,7 +240,7 @@ self_ancestors() {
|
|
|
240
240
|
done
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
# An agent spawned by the backend (e.g. dms-
|
|
243
|
+
# An agent spawned by the backend (e.g. dms-assistant) would take its own host down.
|
|
244
244
|
refuse_if_hosting_self() {
|
|
245
245
|
local hosting
|
|
246
246
|
hosting="$(printf '%s\n' "$@" | grep -Fx -f <(self_ancestors) | head -1)"
|