@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.20.2
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.20.1...v0.20.2)
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **dms:** Scaffold a builder module on the interface ranges the DMS declares ([#1052](https://github.com/AntelopeJS/dms/pull/1052))
|
|
10
|
+
- **dms:** Sign in to a checked database with the URL's credentials only ([#1057](https://github.com/AntelopeJS/dms/pull/1057))
|
|
11
|
+
|
|
12
|
+
### 📦 Build
|
|
13
|
+
|
|
14
|
+
- **deps:** Lock @antelopejs/core 1.23.3 in the workspace ([#1054](https://github.com/AntelopeJS/dms/pull/1054))
|
|
15
|
+
- **deps:** Move to @antelopejs/tooling-configs 0.7.2 ([#1053](https://github.com/AntelopeJS/dms/pull/1053))
|
|
16
|
+
|
|
17
|
+
### ❤️ Contributors
|
|
18
|
+
|
|
19
|
+
- Antony Rizzitelli ([@Upd4ting](http://github.com/Upd4ting))
|
|
20
|
+
|
|
21
|
+
## v0.20.1
|
|
22
|
+
|
|
23
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.20.0...v0.20.1)
|
|
24
|
+
|
|
25
|
+
### 🚀 Enhancements
|
|
26
|
+
|
|
27
|
+
- **dms:** Fail a layer's lint on a Dms component nothing installed registers ([#1033](https://github.com/AntelopeJS/dms/pull/1033))
|
|
28
|
+
|
|
29
|
+
### 🩹 Fixes
|
|
30
|
+
|
|
31
|
+
- **dms:** Restrict credential files to their owner on Windows ([#1008](https://github.com/AntelopeJS/dms/pull/1008))
|
|
32
|
+
- **dms:** Keep a logo file the app config builds with +, concat or join ([#1024](https://github.com/AntelopeJS/dms/pull/1024))
|
|
33
|
+
- **interface-dms:** Keep one pending invite when a cancel, accept or expiry lands during a fresh invite's withdrawal ([#1021](https://github.com/AntelopeJS/dms/pull/1021))
|
|
34
|
+
- **dms:** Install a scaffolded module outside the project's pnpm workspace ([#1022](https://github.com/AntelopeJS/dms/pull/1022))
|
|
35
|
+
- **dms:** Check preview_blocks sketches with the mockup compiler's sanitizer and publish it as @antelopejs/dms/sketch ([#1009](https://github.com/AntelopeJS/dms/pull/1009))
|
|
36
|
+
- **dms:** Offer the MySQL driver on interface-database 0.4 ([#1029](https://github.com/AntelopeJS/dms/pull/1029))
|
|
37
|
+
- **dms:** Capture the auth middleware's toast before its first await ([#1031](https://github.com/AntelopeJS/dms/pull/1031))
|
|
38
|
+
- **dms:** Finish a dms-control watch restart of the playground ([#1035](https://github.com/AntelopeJS/dms/pull/1035))
|
|
39
|
+
- **dms:** Keep a logo the app config names in a query, a fragment or a literal-only join ([#1036](https://github.com/AntelopeJS/dms/pull/1036))
|
|
40
|
+
- **interface-dms:** Let a resend through a withdrawn fresh invite left by a failed delete, and name the invite that blocks it ([#1037](https://github.com/AntelopeJS/dms/pull/1037))
|
|
41
|
+
- **deps:** Require zod 3.25 in interface-dms and dms so a reused lock drops zod 3.24 ([#1039](https://github.com/AntelopeJS/dms/pull/1039))
|
|
42
|
+
- **interface-dms:** Hand a fresh invite whose rival retires during its withdrawal a pending invitation ([#1038](https://github.com/AntelopeJS/dms/pull/1038))
|
|
43
|
+
- **dms:** Refuse access and refresh tokens that carry no session ([#1042](https://github.com/AntelopeJS/dms/pull/1042))
|
|
44
|
+
- **dms:** Keep a logo the app config names in a percent-encoded optimizer URL ([#1041](https://github.com/AntelopeJS/dms/pull/1041))
|
|
45
|
+
- **interface-dms:** Keep a new invitation's re-read when its stray-removal retry finds the read invite cancelled ([#1045](https://github.com/AntelopeJS/dms/pull/1045))
|
|
46
|
+
- **dms:** Run the DMS component check without @antelopejs/dms-frontend, and name what a layer must install ([#1044](https://github.com/AntelopeJS/dms/pull/1044))
|
|
47
|
+
- **interface-dms:** Settle a fresh invite once as kept or withdrawn, so no caller yields to one that then withdraws ([#1046](https://github.com/AntelopeJS/dms/pull/1046))
|
|
48
|
+
- **dms:** Report a connection variable the starting environment shadows instead of writing it to .env ([#1049](https://github.com/AntelopeJS/dms/pull/1049))
|
|
49
|
+
- **dms:** Let a restart load a .env value after a builder call loaded the configuration ([#1050](https://github.com/AntelopeJS/dms/pull/1050))
|
|
50
|
+
- **deps:** Cap every @antelopejs range below the next minor ([#1051](https://github.com/AntelopeJS/dms/pull/1051))
|
|
51
|
+
|
|
52
|
+
### 📖 Documentation
|
|
53
|
+
|
|
54
|
+
- **interface-dms-builder:** Say when a second catalog provider needs exportPriority or a pin ([#1026](https://github.com/AntelopeJS/dms/pull/1026))
|
|
55
|
+
- **dms:** Replace dms-ai and dms-builder with dms-assistant ([#894](https://github.com/AntelopeJS/dms/pull/894))
|
|
56
|
+
- Name the assistant dms-assistant where dms-ai was left ([#1048](https://github.com/AntelopeJS/dms/pull/1048))
|
|
57
|
+
|
|
58
|
+
### 🏡 Chore
|
|
59
|
+
|
|
60
|
+
- **release:** @antelopejs/interface-dms v0.14.1 ([a53e6e9b](https://github.com/AntelopeJS/dms/commit/a53e6e9b))
|
|
61
|
+
- **release:** @antelopejs/interface-dms v0.14.2 ([82a1a90e](https://github.com/AntelopeJS/dms/commit/82a1a90e))
|
|
62
|
+
|
|
63
|
+
### ✅ Tests
|
|
64
|
+
|
|
65
|
+
- **dms:** Let the invite host take any zod 3.x and spawn npm through its Windows shim ([#1023](https://github.com/AntelopeJS/dms/pull/1023))
|
|
66
|
+
- **dms:** Load TableView in the table runtime setup, not the first test ([#1025](https://github.com/AntelopeJS/dms/pull/1025))
|
|
67
|
+
- **dms:** Acknowledge test MongoDB writes on apply so Windows integration runs stop stalling ([#1027](https://github.com/AntelopeJS/dms/pull/1027))
|
|
68
|
+
- **dms:** Restore the mail renderer and sender after each suite that captures emails ([#1030](https://github.com/AntelopeJS/dms/pull/1030))
|
|
69
|
+
- **dms:** Give the menu-access-events setup hook a timeout sized to its sign-ups ([#1032](https://github.com/AntelopeJS/dms/pull/1032))
|
|
70
|
+
- **dms:** Size the sketch rebuild test's timeout to its seventeen checks ([#1040](https://github.com/AntelopeJS/dms/pull/1040))
|
|
71
|
+
- **dms:** Keep the integration file storage off the test mongod's disk ([#1028](https://github.com/AntelopeJS/dms/pull/1028))
|
|
72
|
+
- **dms:** Move cold module and Intl setup out of two frontend-vue test bodies ([#1047](https://github.com/AntelopeJS/dms/pull/1047))
|
|
73
|
+
|
|
74
|
+
### 🤖 CI
|
|
75
|
+
|
|
76
|
+
- Run the CI on Windows in parallel with Linux ([#906](https://github.com/AntelopeJS/dms/pull/906))
|
|
77
|
+
|
|
78
|
+
### ❤️ Contributors
|
|
79
|
+
|
|
80
|
+
- Antony Rizzitelli ([@Upd4ting](http://github.com/Upd4ting))
|
|
81
|
+
|
|
3
82
|
## v0.20.0
|
|
4
83
|
|
|
5
84
|
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.19.6...v0.20.0)
|
package/README.md
CHANGED
|
@@ -79,20 +79,20 @@ export class SalesPage extends PageController("sales", {
|
|
|
79
79
|
|
|
80
80
|
| Package | Supported | Tested with |
|
|
81
81
|
| ------------------------------------------- | ------------------ | ----------- |
|
|
82
|
-
| `@antelopejs/core` |
|
|
83
|
-
| `@antelopejs/interface-api` | `>=0.3.2 <
|
|
84
|
-
| `@antelopejs/interface-api-util` | `>=0.3.0 <
|
|
85
|
-
| `@antelopejs/interface-core` | `>=0.5.1 <
|
|
86
|
-
| `@antelopejs/interface-data-api` | `>=0.8.0 <
|
|
87
|
-
| `@antelopejs/interface-database` | `>=0.4.0 <
|
|
88
|
-
| `@antelopejs/interface-database-catalog` | `>=0.0
|
|
89
|
-
| `@antelopejs/interface-database-decorators` | `>=0.5.2 <
|
|
90
|
-
| `@antelopejs/interface-dms` | `>=0.14.0 <0.15.0` | `
|
|
91
|
-
| `@antelopejs/interface-dms-automation` | `>=0.
|
|
92
|
-
| `@antelopejs/interface-dms-builder` | `>=0.5.0 <0.6.0` | `
|
|
93
|
-
| `@antelopejs/interface-email` | `>=0.
|
|
94
|
-
| `@antelopejs/interface-file-storage` | `>=0.1.4 <
|
|
95
|
-
| `@antelopejs/interface-redis` | `>=0.0.9 <1.0
|
|
82
|
+
| `@antelopejs/core` | `~1.23.0` | `1.23.3` |
|
|
83
|
+
| `@antelopejs/interface-api` | `>=0.3.2 <0.4.0` | `0.3.2` |
|
|
84
|
+
| `@antelopejs/interface-api-util` | `>=0.3.0 <0.4.0` | `0.3.0` |
|
|
85
|
+
| `@antelopejs/interface-core` | `>=0.5.1 <0.6.0` | `0.5.1` |
|
|
86
|
+
| `@antelopejs/interface-data-api` | `>=0.8.0 <0.9.0` | `0.8.0` |
|
|
87
|
+
| `@antelopejs/interface-database` | `>=0.4.0 <0.5.0` | `0.4.0` |
|
|
88
|
+
| `@antelopejs/interface-database-catalog` | `>=0.1.0 <0.2.0` | `0.1.0` |
|
|
89
|
+
| `@antelopejs/interface-database-decorators` | `>=0.5.2 <0.6.0` | `0.5.2` |
|
|
90
|
+
| `@antelopejs/interface-dms` | `>=0.14.0 <0.15.0` | `0.14.2` |
|
|
91
|
+
| `@antelopejs/interface-dms-automation` | `>=0.7.0 <0.8.0` | `0.7.0` |
|
|
92
|
+
| `@antelopejs/interface-dms-builder` | `>=0.5.0 <0.6.0` | `0.5.1` |
|
|
93
|
+
| `@antelopejs/interface-email` | `>=0.2.1 <0.3.0` | `0.2.1` |
|
|
94
|
+
| `@antelopejs/interface-file-storage` | `>=0.1.4 <0.2.0` | `0.1.4` |
|
|
95
|
+
| `@antelopejs/interface-redis` | `>=0.0.9 <0.1.0` | `0.0.9` |
|
|
96
96
|
|
|
97
97
|
<!-- antelopejs-docs-compat:end -->
|
|
98
98
|
|
|
@@ -119,3 +119,10 @@ This package lives in the [`AntelopeJS/dms`](https://github.com/AntelopeJS/dms)
|
|
|
119
119
|
## License
|
|
120
120
|
|
|
121
121
|
[Apache-2.0](./LICENSE)
|
|
122
|
+
|
|
123
|
+
## Requirements
|
|
124
|
+
|
|
125
|
+
<!-- antelopejs-docs-node:start -->
|
|
126
|
+
|
|
127
|
+
This package requires Node.js `^20.19.0 || >=22.12.0`.
|
|
128
|
+
<!-- antelopejs-docs-node:end -->
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
+
import { join } from "node:path";
|
|
2
3
|
import test from "node:test";
|
|
3
4
|
import { freshDatabase, restartBackend } from "./backend.mjs";
|
|
4
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
commandOf,
|
|
7
|
+
moduleRootOfBackend,
|
|
8
|
+
newRun,
|
|
9
|
+
served,
|
|
10
|
+
startedOn,
|
|
11
|
+
} from "./helpers/fake-run.mjs";
|
|
5
12
|
import { isRunning } from "./identity.mjs";
|
|
6
13
|
import { loadRun, saveRun } from "./run-state.mjs";
|
|
7
14
|
|
|
@@ -63,6 +70,39 @@ await test("a journey that pins watch gets ajs project dev -w, not the dev stand
|
|
|
63
70
|
);
|
|
64
71
|
});
|
|
65
72
|
|
|
73
|
+
await test("a watch backend loads the module from the checkout's module folder, which the run's copy only links to, and a production or dev backend from the copy", async (t) => {
|
|
74
|
+
const state = await newRun(t);
|
|
75
|
+
await freshDatabase(state, "j001", { backend: "watch" });
|
|
76
|
+
const watching = await served(state);
|
|
77
|
+
await restartBackend(state);
|
|
78
|
+
const restarted = await served(state);
|
|
79
|
+
await freshDatabase(state, "j002");
|
|
80
|
+
const production = await served(state);
|
|
81
|
+
await freshDatabase(state, "j003", { backend: "dev" });
|
|
82
|
+
const dev = await served(state);
|
|
83
|
+
assert.deepEqual(
|
|
84
|
+
await Promise.all(
|
|
85
|
+
[watching, restarted, production, dev].map(({ pid }) =>
|
|
86
|
+
moduleRootOfBackend(pid),
|
|
87
|
+
),
|
|
88
|
+
),
|
|
89
|
+
[state.moduleRoot, state.moduleRoot, null, null],
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
await test("a watch backend restarted on another build, as the base version's, loads that build's module folder", async (t) => {
|
|
94
|
+
const state = await newRun(t);
|
|
95
|
+
await freshDatabase(state, "j001", { backend: "watch" });
|
|
96
|
+
const baseModuleRoot = join(state.dir, "base-module");
|
|
97
|
+
await restartBackend(state, {
|
|
98
|
+
playground: state.playground,
|
|
99
|
+
cwd: state.runPlayground ?? state.playground,
|
|
100
|
+
moduleRoot: baseModuleRoot,
|
|
101
|
+
});
|
|
102
|
+
const base = await served(state);
|
|
103
|
+
assert.equal(await moduleRootOfBackend(base.pid), baseModuleRoot);
|
|
104
|
+
});
|
|
105
|
+
|
|
66
106
|
await test("a restart inside a journey that pins production in a dev run keeps production", async (t) => {
|
|
67
107
|
const state = await newRun(t);
|
|
68
108
|
state.backendMode = "dev";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
withoutStartTimes,
|
|
16
16
|
} from "./helpers/fake-run.mjs";
|
|
17
17
|
import { canChoosePid, chooseNextPid } from "./helpers/pids.mjs";
|
|
18
|
-
import { isRunning } from "./identity.mjs";
|
|
18
|
+
import { hasProc, isRunning } from "./identity.mjs";
|
|
19
19
|
import { startDetached } from "./processes.mjs";
|
|
20
20
|
import { backendsFolder, recordBackend } from "./run-state.mjs";
|
|
21
21
|
import { down, liveBackends } from "./stack.mjs";
|
|
@@ -34,45 +34,61 @@ function stderrOf(t) {
|
|
|
34
34
|
write.mock.calls.map((call) => String(call.arguments[0])).join("");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
await test(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
37
|
+
await test(
|
|
38
|
+
"a process that took the pid of a backend the run recorded is not stopped, even with that backend's database in its environment",
|
|
39
|
+
{
|
|
40
|
+
skip:
|
|
41
|
+
!hasProc() &&
|
|
42
|
+
"a start time tells a process from another that took its pid, and only /proc gives one",
|
|
43
|
+
},
|
|
44
|
+
async (t) => {
|
|
45
|
+
const state = await newRun(t);
|
|
46
|
+
await freshDatabase(state, "j001");
|
|
47
|
+
const database = `${state.databasePrefix}_j002`;
|
|
48
|
+
const standby = await startedOn(database);
|
|
49
|
+
const record = liveBackends(state).find(
|
|
50
|
+
(backend) => backend.pid === standby.pid,
|
|
51
|
+
);
|
|
52
|
+
assert.ok(record, "the standby is recorded");
|
|
53
|
+
const other = bystander(t, { ...process.env, MONGO_DATABASE: database });
|
|
54
|
+
recordBackend(state.dir, { ...record, pid: other });
|
|
55
|
+
await freshDatabase(state, "r1");
|
|
56
|
+
assert.equal(isRunning(other), true);
|
|
57
|
+
await down(state);
|
|
58
|
+
assert.equal(isRunning(other), true);
|
|
59
|
+
assert.deepEqual(running(), []);
|
|
60
|
+
},
|
|
61
|
+
);
|
|
54
62
|
|
|
55
|
-
await test(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
await test(
|
|
64
|
+
"a process that took the pid of a process run.json records is not stopped by a restart or by down",
|
|
65
|
+
{
|
|
66
|
+
skip:
|
|
67
|
+
!hasProc() &&
|
|
68
|
+
"a start time tells a process from another that took its pid, and only /proc gives one",
|
|
69
|
+
},
|
|
70
|
+
async (t) => {
|
|
71
|
+
const state = await newRun(t);
|
|
72
|
+
await freshDatabase(state, "j001");
|
|
73
|
+
const serving = state.processes.find((entry) => entry.name === "backend");
|
|
74
|
+
assert.ok(serving, "run.json records the backend");
|
|
75
|
+
const other = bystander(t, {
|
|
76
|
+
...process.env,
|
|
77
|
+
MONGO_DATABASE: state.database,
|
|
78
|
+
});
|
|
79
|
+
const reused = { ...serving, pid: other };
|
|
80
|
+
state.processes = state.processes.map((entry) =>
|
|
81
|
+
entry === serving ? reused : entry,
|
|
82
|
+
);
|
|
83
|
+
await restartBackend(state);
|
|
84
|
+
assert.equal(isRunning(other), true);
|
|
85
|
+
assert.equal((await served(state)).database, state.database);
|
|
86
|
+
state.processes = [...state.processes, { ...reused, name: "frontend" }];
|
|
87
|
+
await down(state);
|
|
88
|
+
assert.equal(isRunning(other), true);
|
|
89
|
+
assert.deepEqual(running(), []);
|
|
90
|
+
},
|
|
91
|
+
);
|
|
76
92
|
|
|
77
93
|
await test("a backend record removed while the records are read counts as gone", async (t) => {
|
|
78
94
|
const state = await newRun(t);
|
|
@@ -165,42 +181,58 @@ function forwarderOf(state) {
|
|
|
165
181
|
return api;
|
|
166
182
|
}
|
|
167
183
|
|
|
168
|
-
await test(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
184
|
+
await test(
|
|
185
|
+
"a run.json record without a start time, as an earlier dms-control wrote, is stopped by down only while its pid runs a process started when the record says; a version that trusts the pid alone stops a process started days later",
|
|
186
|
+
{
|
|
187
|
+
skip:
|
|
188
|
+
!hasProc() &&
|
|
189
|
+
"a start time tells a process from another that took its pid, and only /proc gives one",
|
|
190
|
+
},
|
|
191
|
+
async (t) => {
|
|
192
|
+
const state = await newRun(t);
|
|
193
|
+
const later = bystander(t);
|
|
194
|
+
const own = bystander(t);
|
|
195
|
+
const now = new Date();
|
|
196
|
+
/**
|
|
197
|
+
* @param {string} name
|
|
198
|
+
* @param {number} pid
|
|
199
|
+
* @param {Date} at
|
|
200
|
+
*/
|
|
201
|
+
const recorded = (name, pid, at) => ({
|
|
202
|
+
name,
|
|
203
|
+
pid,
|
|
204
|
+
command: "a process an earlier dms-control started",
|
|
205
|
+
cwd: state.dir,
|
|
206
|
+
log: join(state.logs, `${name}.log`),
|
|
207
|
+
startedAt: at.toISOString(),
|
|
208
|
+
});
|
|
209
|
+
state.processes = [
|
|
210
|
+
recorded("frontend", later, new Date(now.getTime() - SIX_DAYS_MS)),
|
|
211
|
+
recorded("mail", own, now),
|
|
212
|
+
];
|
|
213
|
+
await down(state);
|
|
214
|
+
assert.equal(isRunning(later), true);
|
|
215
|
+
assert.equal(isRunning(own), false);
|
|
216
|
+
},
|
|
217
|
+
);
|
|
194
218
|
|
|
195
|
-
await test(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
219
|
+
await test(
|
|
220
|
+
"a backend record without a start time, as this branch wrote before, is stopped by down; a version that skips such a record leaves the standby running",
|
|
221
|
+
{
|
|
222
|
+
skip:
|
|
223
|
+
!hasProc() &&
|
|
224
|
+
"only /proc gives a start time, so no record holds one to leave out",
|
|
225
|
+
},
|
|
226
|
+
async (t) => {
|
|
227
|
+
const state = await newRun(t);
|
|
228
|
+
await freshDatabase(state, "j001");
|
|
229
|
+
await startedOn(`${state.databasePrefix}_j002`);
|
|
230
|
+
assert.equal(withoutStartTimes(state), 2);
|
|
231
|
+
assert.equal(liveBackends(state).length, 2);
|
|
232
|
+
await down(state);
|
|
233
|
+
assert.deepEqual(running(), []);
|
|
234
|
+
},
|
|
235
|
+
);
|
|
204
236
|
|
|
205
237
|
await test(
|
|
206
238
|
"a recorded backend that exits while a fresh database waits for the standby, and whose pid another process takes, is not signalled; a version that kills from the list it read before the wait kills that process",
|
|
@@ -247,30 +279,52 @@ await test(
|
|
|
247
279
|
},
|
|
248
280
|
);
|
|
249
281
|
|
|
250
|
-
await test(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
282
|
+
await test(
|
|
283
|
+
"a forwarder that exited, whose pid another process holds, is started again and the API answers; a version that trusts a live pid leaves the API port closed",
|
|
284
|
+
{
|
|
285
|
+
skip:
|
|
286
|
+
!hasProc() &&
|
|
287
|
+
"a start time tells a process from another that took its pid, and only /proc gives one",
|
|
288
|
+
},
|
|
289
|
+
async (t) => {
|
|
290
|
+
const state = await newRun(t);
|
|
291
|
+
await freshDatabase(state, "j001");
|
|
292
|
+
const api = forwarderOf(state);
|
|
293
|
+
process.kill(api.pid, "SIGKILL");
|
|
294
|
+
while (isRunning(api.pid)) await sleep(20);
|
|
295
|
+
const other = bystander(t);
|
|
296
|
+
state.processes = state.processes.map((entry) =>
|
|
297
|
+
entry === api ? { ...api, pid: other } : entry,
|
|
298
|
+
);
|
|
299
|
+
await freshDatabase(state, "j002");
|
|
300
|
+
assert.equal(
|
|
301
|
+
(await served(state)).database,
|
|
302
|
+
`${state.databasePrefix}_j002`,
|
|
303
|
+
);
|
|
304
|
+
assert.equal(isRunning(other), true);
|
|
305
|
+
},
|
|
306
|
+
);
|
|
264
307
|
|
|
265
|
-
await test(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
308
|
+
await test(
|
|
309
|
+
"doctor fails a recorded process whose pid another process holds; a version that checks only that the pid is alive passes it",
|
|
310
|
+
{
|
|
311
|
+
skip:
|
|
312
|
+
!hasProc() &&
|
|
313
|
+
"a start time tells a process from another that took its pid, and only /proc gives one",
|
|
314
|
+
},
|
|
315
|
+
async (t) => {
|
|
316
|
+
const state = await newRun(t);
|
|
317
|
+
await freshDatabase(state, "j001");
|
|
318
|
+
const api = forwarderOf(state);
|
|
319
|
+
const other = bystander(t);
|
|
320
|
+
state.processes = [
|
|
321
|
+
...state.processes,
|
|
322
|
+
{ ...api, name: "mail", pid: other },
|
|
323
|
+
];
|
|
324
|
+
const lines = await doctor(state);
|
|
325
|
+
const okOf = (/** @type {string} */ check) =>
|
|
326
|
+
lines.find((line) => line.check === check)?.ok;
|
|
327
|
+
assert.equal(okOf(`api pid ${api.pid} alive`), true);
|
|
328
|
+
assert.equal(okOf(`mail pid ${other} alive`), false);
|
|
329
|
+
},
|
|
330
|
+
);
|
package/bin/control/backend.mjs
CHANGED
|
@@ -47,7 +47,7 @@ export function assertForwardedRun(state) {
|
|
|
47
47
|
* so a restart inside a journey keeps the mode the journey asked for.
|
|
48
48
|
*
|
|
49
49
|
* @param {RunState} state The run
|
|
50
|
-
* @param {{ playground: string, cwd: string }} [build] Another build to start
|
|
50
|
+
* @param {{ playground: string, cwd: string, moduleRoot: string }} [build] Another build to start
|
|
51
51
|
* @returns {Promise<void>} Resolves once the backend answers again
|
|
52
52
|
*/
|
|
53
53
|
export async function restartBackend(state, build) {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
utimesSync,
|
|
12
12
|
writeFileSync,
|
|
13
13
|
} from "node:fs";
|
|
14
|
+
import { platform } from "node:os";
|
|
14
15
|
import { dirname, join } from "node:path";
|
|
15
16
|
import test from "node:test";
|
|
16
17
|
import { freshDatabase, restartBackend } from "./backend.mjs";
|
|
@@ -190,7 +191,9 @@ await test("while a build folder is missing, a fresh database refuses before it
|
|
|
190
191
|
await test(
|
|
191
192
|
"a build folder that cannot be read keeps a standby from being used; a version that counts what it cannot read as unchanged uses it",
|
|
192
193
|
{
|
|
193
|
-
skip:
|
|
194
|
+
skip:
|
|
195
|
+
(process.getuid?.() === 0 && "root reads a folder whatever its mode") ||
|
|
196
|
+
(platform() === "win32" && "Windows reads a folder whatever its mode"),
|
|
194
197
|
},
|
|
195
198
|
async (t) => {
|
|
196
199
|
const state = await newRun(t);
|
package/bin/control/base.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { runPrepare } from "./verify/skill.mjs";
|
|
|
8
8
|
import { COPY_SKIPPED, layOutCopy } from "./run-copy.mjs";
|
|
9
9
|
import { cliPaths, ENVIRONMENT, spec } from "./launch.mjs";
|
|
10
10
|
import { restartBackend } from "./backend.mjs";
|
|
11
|
+
import { moduleRootOf } from "./module-root.mjs";
|
|
11
12
|
|
|
12
13
|
const READY_MARK = ".dms-control-ready";
|
|
13
14
|
|
|
@@ -84,7 +85,11 @@ export async function withBaseBackend(state, skill, action) {
|
|
|
84
85
|
cwd,
|
|
85
86
|
),
|
|
86
87
|
);
|
|
87
|
-
await restartBackend(state, {
|
|
88
|
+
await restartBackend(state, {
|
|
89
|
+
playground,
|
|
90
|
+
cwd,
|
|
91
|
+
moduleRoot: moduleRootOf(playground, base.dir),
|
|
92
|
+
});
|
|
88
93
|
try {
|
|
89
94
|
await action(base.sha);
|
|
90
95
|
} finally {
|
|
@@ -56,20 +56,20 @@ await test("a package copied into a linked package's node_modules refuses the ke
|
|
|
56
56
|
"node_modules",
|
|
57
57
|
);
|
|
58
58
|
write(join(checkout, store, "color-lib", "index.js"), "export default 1;\n");
|
|
59
|
-
for (const name of ["color-lib",
|
|
60
|
-
const copied = join(shared, "node_modules", name);
|
|
59
|
+
for (const name of [["color-lib"], ["@acme", "color-lib"]]) {
|
|
60
|
+
const copied = join(shared, "node_modules", ...name);
|
|
61
61
|
write(join(copied, "index.js"), 'export default "COLOR-V1";\n');
|
|
62
62
|
assert.throws(
|
|
63
63
|
() => keyOf(frontend, side),
|
|
64
64
|
new RegExp(
|
|
65
|
-
`${name} is a package copied into a linked package's node_modules`,
|
|
65
|
+
`${name.join("[\\\\/]")} is a package copied into a linked package's node_modules`,
|
|
66
66
|
"u",
|
|
67
67
|
),
|
|
68
68
|
"a key that skips a linked package's node_modules serves the build of the copy's old files",
|
|
69
69
|
);
|
|
70
70
|
rmSync(copied, { recursive: true });
|
|
71
71
|
symlinkSync(
|
|
72
|
-
join("../".repeat(name.
|
|
72
|
+
join("../".repeat(name.length + 2), store, "color-lib"),
|
|
73
73
|
copied,
|
|
74
74
|
);
|
|
75
75
|
}
|
|
@@ -93,7 +93,7 @@ await test("a link the key cannot follow refuses the key; a link into a keyed pa
|
|
|
93
93
|
symlinkSync("missing.js", join(shared, "dangling.js"));
|
|
94
94
|
assert.throws(
|
|
95
95
|
() => keyOf(frontend, side),
|
|
96
|
-
/node_modules
|
|
96
|
+
/node_modules[\\/]inner links to .*packages[\\/]inner, which the build cache does not key/u,
|
|
97
97
|
"a key reading a linked package's node_modules by link text serves a build of the old files of a package linked only from inside it",
|
|
98
98
|
);
|
|
99
99
|
symlinkSync("../../packages/inner", join(modules, "inner"));
|
|
@@ -109,7 +109,7 @@ await test("a link the key cannot follow refuses the key; a link into a keyed pa
|
|
|
109
109
|
symlinkSync(theme, join(shared, "theme.css"));
|
|
110
110
|
assert.throws(
|
|
111
111
|
() => keyOf(frontend, side),
|
|
112
|
-
/shared-ui
|
|
112
|
+
/shared-ui[\\/]theme\.css links to .*elsewhere[\\/]theme\.css, which the build cache does not key/u,
|
|
113
113
|
"a key that hashes a link's text serves a build of the old file it reaches",
|
|
114
114
|
);
|
|
115
115
|
rmSync(join(shared, "theme.css"));
|
|
@@ -117,7 +117,7 @@ await test("a link the key cannot follow refuses the key; a link into a keyed pa
|
|
|
117
117
|
symlinkSync("../inner/.dms-frontend/dist/chunk.js", join(shared, "chunk.js"));
|
|
118
118
|
assert.throws(
|
|
119
119
|
() => keyOf(frontend, side),
|
|
120
|
-
/shared-ui
|
|
120
|
+
/shared-ui[\\/]chunk\.js links to .*\.dms-frontend[\\/]dist[\\/]chunk\.js, which the build cache does not key/u,
|
|
121
121
|
"a key that counts a keyed package's run outputs as keyed serves a build of the output it reached",
|
|
122
122
|
);
|
|
123
123
|
});
|
|
@@ -132,7 +132,7 @@ await test("a link inside a package copied into node_modules that the key cannot
|
|
|
132
132
|
symlinkSync(color, join(modules, "ui-kit", "node_modules", "color-lib"));
|
|
133
133
|
assert.throws(
|
|
134
134
|
() => keyOf(frontend, side),
|
|
135
|
-
/ui-kit
|
|
135
|
+
/ui-kit[\\/]node_modules[\\/]color-lib links to/u,
|
|
136
136
|
"a key that hashes a copied package's links by their text serves a build of the old files they reach",
|
|
137
137
|
);
|
|
138
138
|
});
|
|
@@ -78,8 +78,9 @@ function escaped(text) {
|
|
|
78
78
|
/**
|
|
79
79
|
* Replaces the run's web URL, where a file holds it as a whole
|
|
80
80
|
* double-quoted value, and the workspace folder, where a file holds it or a
|
|
81
|
-
* path under it as one,
|
|
82
|
-
* of the file reads as a
|
|
81
|
+
* path under it as one, joined by `/` or by the system's separator, with
|
|
82
|
+
* placeholders. `%` is escaped first, so no text of the file reads as a
|
|
83
|
+
* placeholder.
|
|
83
84
|
*
|
|
84
85
|
* @param {string} webUrl The run's web URL
|
|
85
86
|
* @param {string[]} folders The workspace folder, as given and resolved
|
|
@@ -92,10 +93,11 @@ function leavingOutRunValues(webUrl, folders) {
|
|
|
92
93
|
...folders.flatMap((folder) => {
|
|
93
94
|
const quoted = JSON.stringify(folder);
|
|
94
95
|
/** @type {Array<[string, string]>} */
|
|
95
|
-
const forms = [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
const forms = [[quoted, `"${ESCAPE}P"`]];
|
|
97
|
+
for (const separator of new Set(["/", sep])) {
|
|
98
|
+
const under = JSON.stringify(separator).slice(1, -1);
|
|
99
|
+
forms.push([`${quoted.slice(0, -1)}${under}`, `"${ESCAPE}P/`]);
|
|
100
|
+
}
|
|
99
101
|
return forms;
|
|
100
102
|
}),
|
|
101
103
|
];
|
|
@@ -394,13 +394,14 @@ await test("links of one name and one link text in two node_modules are keyed by
|
|
|
394
394
|
});
|
|
395
395
|
|
|
396
396
|
await test("an install record above TMPDIR that the key cannot read leaves the fixture's keys unchanged", (t) => {
|
|
397
|
-
const outer = realpathSync(
|
|
397
|
+
const outer = realpathSync.native(
|
|
398
398
|
mkdtempSync(join(tmpdir(), "dms-control-build-key-outer-")),
|
|
399
399
|
);
|
|
400
400
|
t.after(() => rmSync(outer, { recursive: true, force: true }));
|
|
401
401
|
write(join(outer, "node_modules", ".modules.yaml"), '{"layoutVersion":5}\n');
|
|
402
402
|
write(join(outer, "tmp", ".keep"), "");
|
|
403
|
-
|
|
403
|
+
const temp = join(outer, "tmp");
|
|
404
|
+
setEnv(t, { TMPDIR: temp, TEMP: temp, TMP: temp });
|
|
404
405
|
const { frontend, prepare } = fixture(t);
|
|
405
406
|
const side = prepare("run-a", 1001);
|
|
406
407
|
assert.throws(
|