@antelopejs/dms-frontend 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ pnpm exec ajs dms start -b https://api.example.com -p 3001
|
|
|
53
53
|
|
|
54
54
|
| Package | Supported | Tested with |
|
|
55
55
|
| ------------------ | ------------- | ----------- |
|
|
56
|
-
| `@antelopejs/core` | `>=1.16.0 <2` | `1.21.
|
|
56
|
+
| `@antelopejs/core` | `>=1.16.0 <2` | `1.21.2` |
|
|
57
57
|
|
|
58
58
|
<!-- antelopejs-docs-compat:end -->
|
|
59
59
|
|
package/dist/project-modules.js
CHANGED
|
@@ -180,16 +180,23 @@ async function loadProjectConfig(projectDir, environment) {
|
|
|
180
180
|
])),
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
+
function gitCloneName(remote) {
|
|
184
|
+
return remote.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
185
|
+
}
|
|
186
|
+
function moduleFolderCandidates(projectDir, cacheFolder, source) {
|
|
187
|
+
if (source.type === "local" && source.path)
|
|
188
|
+
return [(0, node_path_1.resolve)(projectDir, source.path)];
|
|
189
|
+
if (source.type === "git" && source.remote)
|
|
190
|
+
return [(0, node_path_1.resolve)(projectDir, cacheFolder, gitCloneName(source.remote))];
|
|
191
|
+
if (source.package)
|
|
192
|
+
return [
|
|
193
|
+
(0, node_path_1.join)(projectDir, "node_modules", source.package),
|
|
194
|
+
(0, node_path_1.resolve)(projectDir, cacheFolder, source.package),
|
|
195
|
+
];
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
183
198
|
function moduleFolder(projectDir, cacheFolder, source) {
|
|
184
|
-
|
|
185
|
-
? [(0, node_path_1.resolve)(projectDir, source.path)]
|
|
186
|
-
: source.package
|
|
187
|
-
? [
|
|
188
|
-
(0, node_path_1.join)(projectDir, "node_modules", source.package),
|
|
189
|
-
(0, node_path_1.resolve)(projectDir, cacheFolder, source.package),
|
|
190
|
-
]
|
|
191
|
-
: [];
|
|
192
|
-
return candidates.find((folder) => (0, node_fs_1.existsSync)((0, node_path_1.join)(folder, "package.json")));
|
|
199
|
+
return moduleFolderCandidates(projectDir, cacheFolder, source).find((folder) => (0, node_fs_1.existsSync)((0, node_path_1.join)(folder, "package.json")));
|
|
193
200
|
}
|
|
194
201
|
function readShippingPackage(sourcePath) {
|
|
195
202
|
try {
|
package/dist/workspace.js
CHANGED
|
@@ -105,7 +105,7 @@ function directorySize(dir) {
|
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
107
|
for (const entry of entries) {
|
|
108
|
-
const path =
|
|
108
|
+
const path = `${current}${node_path_1.sep}${entry.name}`;
|
|
109
109
|
if (entry.isDirectory()) {
|
|
110
110
|
pending.push(path);
|
|
111
111
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-frontend",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Frontend-agnostic loader for AntelopeJS DMS, shipping the Vue 3 renderer (Vite, Inertia, SSR)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelope",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "rimraf dist && tsc",
|
|
62
62
|
"prepack": "pnpm run build",
|
|
63
|
-
"release": "pnpm run lint && pnpm run format:check && pnpm run test && pnpm run test:cli && release-it",
|
|
63
|
+
"release": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run test && pnpm run test:cli && release-it",
|
|
64
64
|
"test": "node --import tsx --test 'tests/!(cli|cli-*).test.{ts,mts}'",
|
|
65
65
|
"test:cli": "pnpm run build && DMS_PREBUILT=1 node --import tsx --test tests/cli.test.ts 'tests/cli-*.test.{ts,mts}'",
|
|
66
66
|
"test:real-source": "pnpm run build && node dist/verify-source-runner.js",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"docs:reference": "tsx scripts/docs-reference.ts",
|
|
74
74
|
"docs:reference:check": "tsx scripts/docs-reference.ts --check",
|
|
75
75
|
"source-checks": "tsx scripts/source-checks.ts",
|
|
76
|
-
"prepare": "if
|
|
76
|
+
"prepare": "if [ -e .git ] && command -v git >/dev/null 2>&1 && command -v lefthook >/dev/null 2>&1 && GIT_DIR=.git GIT_WORK_TREE=. git rev-parse --git-dir >/dev/null 2>&1; then GIT_DIR=.git GIT_WORK_TREE=. lefthook install; fi",
|
|
77
77
|
"checks": "antelopejs-checks",
|
|
78
78
|
"size": "antelopejs-check-size",
|
|
79
79
|
"sync": "antelopejs-sync",
|
|
@@ -91,9 +91,9 @@
|
|
|
91
91
|
"yaml": "^2.9.1"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@antelopejs/core": "^1.21.
|
|
94
|
+
"@antelopejs/core": "^1.21.2",
|
|
95
95
|
"@antelopejs/interface-dms": "^0.10.0",
|
|
96
|
-
"@antelopejs/tooling-configs": "^0.
|
|
96
|
+
"@antelopejs/tooling-configs": "^0.5.1",
|
|
97
97
|
"@iconify/utils": "^3.1.0",
|
|
98
98
|
"@iconify/vue": "^5.0.1",
|
|
99
99
|
"@inertiajs/vue3": "^3.7.1",
|
|
@@ -108,13 +108,17 @@
|
|
|
108
108
|
"fast-check": "^4.10.2",
|
|
109
109
|
"knip": "^6.34.0",
|
|
110
110
|
"lefthook": "^2.2.2",
|
|
111
|
+
"mongodb-memory-server": "^11.3.0",
|
|
111
112
|
"ofetch": "^1.5.1",
|
|
112
113
|
"oxfmt": "^0.66.0",
|
|
113
114
|
"oxlint": "1.81.0",
|
|
114
115
|
"oxlint-tsgolint": "^7.0.2001",
|
|
116
|
+
"pixelmatch": "^8.0.0",
|
|
117
|
+
"playwright-core": "^1.56.1",
|
|
115
118
|
"release-it": "^19.2.4",
|
|
116
119
|
"release-it-changelogen": "^0.1.0",
|
|
117
120
|
"rimraf": "^6.1.2",
|
|
121
|
+
"sharp": "^0.35.5",
|
|
118
122
|
"tsx": "^4.23.15",
|
|
119
123
|
"typescript": "^6.0.3",
|
|
120
124
|
"unplugin-auto-import": "^20.2.0",
|
|
@@ -139,6 +143,13 @@
|
|
|
139
143
|
"pnpm": {
|
|
140
144
|
"patchedDependencies": {
|
|
141
145
|
"@vueuse/core@14.4.0": "templates/vue/patches/@vueuse__core@14.4.0.patch"
|
|
146
|
+
},
|
|
147
|
+
"packageExtensions": {
|
|
148
|
+
"@antelopejs/core@1.21": {
|
|
149
|
+
"dependencies": {
|
|
150
|
+
"@types/mocha": "^10.0.10"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
142
153
|
}
|
|
143
154
|
},
|
|
144
155
|
"antelopeJs": {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
const HIDDEN_NAME = /^\./;
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* Rolldown's `output
|
|
4
|
+
* Rolldown's `output` for the client build: how it splits the code, and the
|
|
5
|
+
* file names it gives the chunks.
|
|
3
6
|
*
|
|
4
7
|
* By default Rolldown gives every set of dynamic imports that shares a module
|
|
5
8
|
* its own common chunk. The DMS's pages are hundreds of dynamic imports (a
|
|
@@ -9,7 +12,7 @@
|
|
|
9
12
|
* than the single entry file Rollup made, for no byte saved.
|
|
10
13
|
*
|
|
11
14
|
* The `$initial` tag is every module the entry imports statically, directly or
|
|
12
|
-
* not. One group over it puts them in
|
|
15
|
+
* not. One group over it puts them in a single chunk again, and leaves every
|
|
13
16
|
* lazy chunk to Rolldown's own splitting, which a page only loads when it needs
|
|
14
17
|
* it: what an anonymous page loads is still what that page's own routes pull.
|
|
15
18
|
*
|
|
@@ -19,10 +22,26 @@
|
|
|
19
22
|
* uses any of it, and the anonymous pages pay 70 to 115 KB of Brotli for code
|
|
20
23
|
* only the signed-in shell uses.
|
|
21
24
|
*
|
|
22
|
-
*
|
|
25
|
+
* What the lazy chunks share still comes out as about two hundred common
|
|
26
|
+
* chunks, most under 2 KB. `experimentalInlineCommonChunks` copies each one
|
|
27
|
+
* under 8 KB of source into the chunks that import it, behind a shared
|
|
28
|
+
* runtime that keeps one instance of each module: half the files on every
|
|
29
|
+
* page, for 1 to 2% more bytes. It turns on `strictExecutionOrder`, and puts
|
|
30
|
+
* the entry's code in a chunk of its own, which Rolldown names after the
|
|
31
|
+
* folder the build runs in, `.dms-frontend`. The server serves no file whose
|
|
32
|
+
* name starts with a dot, so that chunk and its stylesheet are named `index`.
|
|
33
|
+
*
|
|
34
|
+
* @type {import("vite").Rolldown.OutputOptions}
|
|
23
35
|
*/
|
|
24
|
-
export const
|
|
25
|
-
|
|
36
|
+
export const clientOutput = {
|
|
37
|
+
codeSplitting: {
|
|
38
|
+
groups: [{ name: "entry", tags: ["$initial"] }],
|
|
39
|
+
experimentalInlineCommonChunks: { maxSize: 8192 },
|
|
40
|
+
},
|
|
41
|
+
chunkFileNames: ({ name }) =>
|
|
42
|
+
`assets/${HIDDEN_NAME.test(name) ? "index" : "[name]"}-[hash].js`,
|
|
43
|
+
assetFileNames: ({ names }) =>
|
|
44
|
+
`assets/${names.some((name) => HIDDEN_NAME.test(name)) ? "index" : "[name]"}-[hash][extname]`,
|
|
26
45
|
};
|
|
27
46
|
|
|
28
47
|
const MODULE_ENTRY = /[\\/]dms\.frontend\.[cm]?[jt]sx?$/;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
normalizePath,
|
|
10
10
|
type Plugin,
|
|
11
11
|
} from "vite";
|
|
12
|
-
import {
|
|
12
|
+
import { clientOutput, onBuildLog } from "./client-chunking.mjs";
|
|
13
13
|
import { recordEntryWeight } from "./entry-weight.mjs";
|
|
14
14
|
import { rejectBackendSources } from "./backend-boundary.mjs";
|
|
15
15
|
import { rejectServerSourcesInClient } from "./client-server-guard.mjs";
|
|
@@ -318,7 +318,7 @@ export default defineConfig({
|
|
|
318
318
|
environments: {
|
|
319
319
|
client: {
|
|
320
320
|
build: {
|
|
321
|
-
rolldownOptions: { output:
|
|
321
|
+
rolldownOptions: { output: clientOutput },
|
|
322
322
|
},
|
|
323
323
|
},
|
|
324
324
|
},
|