@antelopejs/dms 0.3.7 → 0.4.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/implementations/dms/guards.d.ts +1 -1
  3. package/dist/implementations/dms/page.js +2 -2
  4. package/dist/implementations/dms/page.js.map +1 -1
  5. package/dist/implementations/dms-base/table-view.d.ts +1 -1
  6. package/dist/pages/settings/users/category.d.ts +1 -1
  7. package/dist/pages/settings/users/members.d.ts +2 -2
  8. package/dist/pages/settings/users/notifications.d.ts +2 -2
  9. package/dist/test/antelope.test.js +16 -5
  10. package/dist/test/antelope.test.js.map +1 -1
  11. package/dist/test/api-endpoint/index.d.ts +5 -0
  12. package/dist/test/api-endpoint/index.js +8 -0
  13. package/dist/test/api-endpoint/index.js.map +1 -0
  14. package/dist/test/attachment-host/native.d.ts +2 -2
  15. package/dist/test/helpers/http.d.ts +1 -0
  16. package/dist/test/helpers/http.js +16 -4
  17. package/dist/test/helpers/http.js.map +1 -1
  18. package/dist/test/unit/implementations/dms/notify-menu-changed.test.js +21 -0
  19. package/dist/test/unit/implementations/dms/notify-menu-changed.test.js.map +1 -1
  20. package/dist/test/unit/interfaces/dms-base/table-view-form-page-urls.test.d.ts +1 -0
  21. package/dist/test/unit/interfaces/dms-base/table-view-form-page-urls.test.js +308 -0
  22. package/dist/test/unit/interfaces/dms-base/table-view-form-page-urls.test.js.map +1 -0
  23. package/dist/test/unit/interfaces/dms-base/table-view-form-redirect.test.d.ts +1 -0
  24. package/dist/test/unit/interfaces/dms-base/table-view-form-redirect.test.js +241 -0
  25. package/dist/test/unit/interfaces/dms-base/table-view-form-redirect.test.js.map +1 -0
  26. package/dist/test/unit/interfaces/dms-base/table-view-route-param-filter-defaults.test.d.ts +1 -0
  27. package/dist/test/unit/interfaces/dms-base/table-view-route-param-filter-defaults.test.js +254 -0
  28. package/dist/test/unit/interfaces/dms-base/table-view-route-param-filter-defaults.test.js.map +1 -0
  29. package/dist/validation/auth.schema.d.ts +18 -18
  30. package/dist/validation/onboarding/register-admin.schema.d.ts +3 -3
  31. package/frontend-vue/layers/dms-layout/app/composables/page/useSiteLayout.ts +49 -20
  32. package/frontend-vue/layers/dms-ui/app/build/components/table/Table.vue +6 -1
  33. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTable.ts +2 -0
  34. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableColumns.ts +13 -7
  35. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +49 -20
  36. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewConfig.ts +43 -5
  37. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +23 -29
  38. package/frontend-vue/layers/dms-ui/app/components/table-view/TableView.vue +3 -0
  39. package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +35 -25
  40. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +5 -1
  41. package/frontend-vue/pnpm-lock.yaml +4 -4
  42. package/frontend-vue/tests/form-page-url-fill.test.ts +63 -0
  43. package/frontend-vue/tests/form-redirect-placeholders.test.ts +69 -0
  44. package/frontend-vue/tests/route-param-filter-defaults.test.ts +59 -0
  45. package/frontend-vue/tests/route-param-occurrences.test.ts +109 -0
  46. package/package.json +8 -19
  47. package/skills/dms/REFERENCE.md +2 -3
  48. package/skills/dms/SKILL.md +1 -1
  49. package/skills/dms-module/REFERENCE.md +4 -5
  50. package/skills/dms-module/SKILL.md +1 -1
  51. package/frontend-vue/tests/theming-browser.mjs +0 -130
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms",
3
- "version": "0.3.7",
3
+ "version": "0.4.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/AntelopeJS/dms.git"
@@ -9,6 +9,7 @@
9
9
  "types": "dist/index.d.ts",
10
10
  "files": [
11
11
  "dist",
12
+ "!dist/.tsbuildinfo",
12
13
  "frontend-vue",
13
14
  "skills",
14
15
  "package.json",
@@ -51,7 +52,7 @@
51
52
  "zod": "~3.24.2"
52
53
  },
53
54
  "devDependencies": {
54
- "@antelopejs/core": ">=1.8.0 <2",
55
+ "@antelopejs/core": ">=1.9.0 <2",
55
56
  "@antelopejs/tooling-configs": ">=0.0.6 <1.0.0",
56
57
  "@types/archiver": "^6.0.4",
57
58
  "@types/chai": "^4.3.20",
@@ -73,7 +74,7 @@
73
74
  "release-it-changelogen": "^0.1.0",
74
75
  "rimraf": "^6.1.3",
75
76
  "tsc-alias": "^1.9.1",
76
- "typescript": "^5.9.3"
77
+ "typescript": "^6.0.3"
77
78
  },
78
79
  "exports": {
79
80
  ".": {
@@ -83,13 +84,6 @@
83
84
  "./package.json": "./package.json",
84
85
  "./interfaces/*": null
85
86
  },
86
- "typesVersions": {
87
- "*": {
88
- "pages": [
89
- "dist/pages/index.d.ts"
90
- ]
91
- }
92
- },
93
87
  "publishConfig": {
94
88
  "access": "public",
95
89
  "provenance": true,
@@ -108,22 +102,17 @@
108
102
  }
109
103
  },
110
104
  "scripts": {
111
- "build": "pnpm --filter @antelopejs/interface-dms build && rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
105
+ "build": "pnpm --filter @antelopejs/interface-dms build && rimraf dist && tsc && tsc-alias",
112
106
  "format": "oxfmt . && pnpm --dir frontend-vue format",
113
107
  "dev": "ajs project run --inspect -w -p playground",
114
108
  "frontend:dev": "pnpm --dir playground frontend:dev",
115
109
  "lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
116
110
  "lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint",
117
- "performance:inertia-navigation": "node scripts/check-inertia-navigation.mjs",
118
- "check:inertia-runtime": "node scripts/check-inertia-runtime.mjs",
119
- "check:inertia-contracts": "node scripts/check-inertia-contracts.mjs",
120
- "check:inertia-modules": "node scripts/check-inertia-modules.mjs",
121
- "typecheck": "pnpm --filter @antelopejs/interface-dms build && tsc -p tsconfig.json",
122
- "check:package": "node scripts/check-package.mjs",
123
- "test": "pnpm run build && ajs module test . && pnpm run check:package",
111
+ "typecheck": "pnpm --filter @antelopejs/interface-dms build && tsc --noEmit",
112
+ "test": "pnpm run build && ajs module test .",
124
113
  "test:unit": "pnpm run build && DMS_TEST_DIR=dist/test/unit ajs module test .",
125
114
  "test:integration": "pnpm run build && DMS_TEST_DIR=dist/test/integration ajs module test .",
126
- "test:watch": "tsc -p tsconfig.build.json -w & tsc-alias -p tsconfig.build.json -w",
115
+ "test:watch": "tsc -w & tsc-alias -w",
127
116
  "release": "pnpm --filter @antelopejs/interface-dms build && pnpm --dir frontend-vue install --frozen-lockfile && release-it",
128
117
  "knip": "knip --dependencies",
129
118
  "knip:all": "knip"
@@ -15,8 +15,7 @@ List a section to see its files:
15
15
  | `docs/04.components/` | Component catalog: charts/widgets, layout, forms, tables, tree, DataTypes, DataController, file storage |
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
- | `docs/07.performance/` | Inertia navigation budgets and how to measure them |
19
- | `docs/08.interfaces/` | The contract reference for `@antelopejs/interface-dms`, one folder per domain: `core`, `auth`, `base`, `notifications`, `html-render` |
18
+ | `docs/07.interfaces/` | The contract reference for `@antelopejs/interface-dms`, one folder per domain: `core`, `auth`, `base`, `notifications`, `html-render` |
20
19
 
21
20
  ## Exact interface surfaces: don't memorize, look them up
22
21
 
@@ -37,7 +36,7 @@ Three ways to read a contract:
37
36
  node "<antelopejs-plugin>/scripts/resolve-interface.mjs" show <scope>/interface-<name>
38
37
  ```
39
38
 
40
- 2. **The prose reference** — `docs/08.interfaces/`, one folder per domain, with the whole subpath
39
+ 2. **The prose reference** — `docs/07.interfaces/`, one folder per domain, with the whole subpath
41
40
  map in its `index.md`.
42
41
 
43
42
  3. **The sources shipped with this skill** — this workspace carries the interface package; read
@@ -75,7 +75,7 @@ chatbox.
75
75
  ## Docs & exact interface surfaces (read for depth)
76
76
 
77
77
  Long-form reference docs live in this package's `docs/` directory (shipped with the package; also
78
- at the repo root), in eight numbered sections — the last, `docs/08.interfaces/`, is the contract
78
+ at the repo root), in seven numbered sections — the last, `docs/07.interfaces/`, is the contract
79
79
  reference for `@antelopejs/interface-dms` domain by domain. DataTypes, component builder options, and auth
80
80
  decorators are **versioned interface contracts** — look them up rather than hand-recalling; treat
81
81
  skill examples as patterns, not gospel. See [REFERENCE.md](REFERENCE.md) for the docs map and the
@@ -55,10 +55,9 @@ AntelopeJS — see the **antelopejs** plugin's author/consume skills. The DMS-sp
55
55
  `src/implementations/<name>/index.ts` in the module, **wire** with `ImplementInterface` in
56
56
  `construct` (the lifecycle entry in [SKILL.md](SKILL.md)). Keep `/** @internal */` on the
57
57
  `internal` namespace — the convention marking the registration surface as non-consumer API.
58
- - **Expose** each directory index as an explicit `exports` entry, plus the `typesVersions`
59
- mapping that lets a consumer on `moduleResolution: node` resolve the types. Consumers add
60
- the interface package to `dependencies` and
61
- `import { … } from "@antelopejs/interface-<name>"`.
58
+ - **Expose** each directory index as an explicit `exports` entry; consumers resolve it with
59
+ `moduleResolution: bundler`, `node16` or `nodenext`. Consumers add the interface package to
60
+ `dependencies` and `import { … } from "@antelopejs/interface-<name>"`.
62
61
  - Anything consumer-facing lives in the interface package; never re-export internal modules —
63
62
  if a helper needs internal infrastructure, use the hook-setter indirection pattern the
64
63
  existing modules use rather than exposing the internals. Runtime behaviour stays in the
@@ -76,7 +75,7 @@ AntelopeJS — see the **antelopejs** plugin's author/consume skills. The DMS-sp
76
75
  3. **Scaffold the layout above**: `src/index.ts`, `src/pages/`, `src/routes/` (if it serves data),
77
76
  `packages/interface-<name>/` + `src/implementations/<name>/` (only if it exposes one),
78
77
  `frontend-vue/` (components registered from the root `dms.frontend.ts`), and the manifest
79
- (`antelopeJs` block, plus the interface package's `exports`/`typesVersions`).
78
+ (`antelopeJs` block, plus the interface package's `exports`).
80
79
  4. **Wire the basics**: `RegisterModule({ id, title, icon, … })`, one `@RegisterPage()` page,
81
80
  the `AddFrontendModule` call. Add the `$dms_<name>.*` keys to **every** locale file under
82
81
  `frontend-vue/i18n/locales/`.
@@ -25,7 +25,7 @@ defining the module's own interface, and the scaffolding checklist.
25
25
  ## The `package.json` manifest
26
26
 
27
27
  The `antelopeJs` block is what makes it a DMS module ([REFERENCE.md](REFERENCE.md) has the full
28
- manifest, including the `exports`/`typesVersions` entries for an interface subpath).
28
+ manifest, including the `exports` entries for an interface subpath).
29
29
  `implements` lists only the interfaces the module *provides* — the official modules keep it `[]`
30
30
  when they provide none (`dms-lang`, `dms-saas`); consumed interfaces are plain `dependencies`
31
31
  (no manifest field). Typical dependencies: `@antelopejs/dms` plus
@@ -1,130 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { execFileSync } from "node:child_process";
3
- import { mkdirSync } from "node:fs";
4
- import { resolve } from "node:path";
5
-
6
- const [url, theme = "custom", screenshots] = process.argv.slice(2);
7
- if (!url)
8
- throw new Error(
9
- "Usage: node tests/theming-browser.mjs URL [custom|default] [screenshots]",
10
- );
11
- const session = "dms-theming-test";
12
- const transitionWait = "500";
13
- const browser = (...args) =>
14
- execFileSync("agent-browser", ["--session", session, ...args], {
15
- encoding: "utf8",
16
- }).trim();
17
- const evaluate = (expression) => JSON.parse(browser("eval", expression));
18
-
19
- function inspectTheme() {
20
- const root = getComputedStyle(document.documentElement);
21
- const probe = document.createElement("span");
22
- document.body.append(probe);
23
- const colors = ["--ui-primary", "--ui-color-primary-600", "--ui-success"].map(
24
- (token) => {
25
- probe.style.backgroundColor = `var(${token})`;
26
- return getComputedStyle(probe).backgroundColor;
27
- },
28
- );
29
- probe.remove();
30
- const background = (selector) =>
31
- getComputedStyle(document.querySelector(selector)).backgroundColor;
32
- const images = [...document.querySelectorAll("main img")].filter(
33
- (image) => image.getClientRects().length,
34
- );
35
- return {
36
- radius: root.getPropertyValue("--ui-radius").trim(),
37
- font: root.getPropertyValue("--font-sans"),
38
- accent: root.getPropertyValue("--dms-accent").trim(),
39
- accentPalette: ["500", "400"].map((shade) =>
40
- root.getPropertyValue(`--ui-color-primary-${shade}`).trim(),
41
- ),
42
- config: document.querySelector("#config").textContent,
43
- colors,
44
- button: background("#primary"),
45
- primary: background("#primary-switch"),
46
- success: background("#success-switch"),
47
- surface: background(".dms-card"),
48
- logosLoaded:
49
- images.length === 2 &&
50
- images.every((image) => image.complete && image.naturalWidth > 0),
51
- logos: images.map((image) => new URL(image.src).pathname),
52
- };
53
- }
54
-
55
- function checkLogos(result, mode) {
56
- assert.ok(result.logosLoaded, "logos loaded");
57
- const logoRoot = theme === "custom" ? "/brand" : "/images/antelope-logo";
58
- assert.deepEqual(result.logos, [
59
- `${logoRoot}/${mode}.svg`,
60
- `${logoRoot}/icon.svg`,
61
- ]);
62
- }
63
-
64
- function checkTheme(mode) {
65
- const result = evaluate(`(${inspectTheme.toString()})()`);
66
- const isCustom = theme === "custom";
67
- assert.ok(result.radius.endsWith("rem"), "radius unit");
68
- assert.equal(
69
- Number.parseFloat(result.radius),
70
- isCustom ? 0.5 : 0.25,
71
- "radius",
72
- );
73
- assert.ok(result.font.includes(isCustom ? "Georgia" : "Geist"), "font");
74
- assert.ok(
75
- result.config.includes(isCustom ? "example" : "dms"),
76
- "layer precedence",
77
- );
78
- assert.equal(result.button, result.colors[0], "primary action");
79
- assert.equal(result.primary, result.colors[1], "primary switch shade");
80
- assert.equal(
81
- result.success,
82
- result.colors[2],
83
- "success switch semantic color",
84
- );
85
- const darkSurface = isCustom ? "rgb(36, 21, 54)" : "rgb(16, 17, 25)";
86
- assert.equal(
87
- result.surface,
88
- mode === "dark" ? darkSurface : "rgb(255, 255, 255)",
89
- );
90
- assert.equal(
91
- result.accent,
92
- result.accentPalette[Number(mode === "dark")],
93
- "glow accent",
94
- );
95
- checkLogos(result, mode);
96
- console.log(`${theme}/${mode}: tokens, switches and logos passed`);
97
- }
98
-
99
- function checkMode(mode) {
100
- const modeCondition = `document.documentElement.classList.contains('dark') === ${mode === "dark"}`;
101
- if (!evaluate(modeCondition)) browser("click", "#mode");
102
- browser("wait", "--fn", modeCondition);
103
- browser("wait", transitionWait);
104
- checkTheme(mode);
105
- browser("click", "#primary-switch");
106
- browser(
107
- "wait",
108
- "--fn",
109
- 'document.querySelector("#primary-switch").getAttribute("aria-checked") === "false"',
110
- );
111
- browser("click", "#primary-switch");
112
- browser("wait", transitionWait);
113
- checkTheme(mode);
114
- if (!screenshots) return;
115
- mkdirSync(screenshots, { recursive: true });
116
- browser("screenshot", resolve(screenshots, `${theme}-${mode}.png`));
117
- }
118
-
119
- try {
120
- browser("open", url);
121
- browser("set", "viewport", "1280", "900", "2");
122
- browser(
123
- "wait",
124
- "--fn",
125
- 'document.querySelector("main")?.dataset.ready === "true"',
126
- );
127
- for (const mode of ["light", "dark"]) checkMode(mode);
128
- } finally {
129
- browser("close");
130
- }