@guanjinke/artifact-client 1.12.1 → 1.13.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.
@@ -415,6 +415,13 @@ a {
415
415
  font-size: 12px;
416
416
  }
417
417
 
418
+ .btn.tiny {
419
+ padding: 2px 8px;
420
+ font-size: 11px;
421
+ line-height: 1.5;
422
+ border-radius: 8px;
423
+ }
424
+
418
425
  .btn:disabled {
419
426
  opacity: .45;
420
427
  cursor: not-allowed;
@@ -527,6 +534,13 @@ a {
527
534
  white-space: nowrap;
528
535
  }
529
536
 
537
+ .env-url {
538
+ display: inline-flex;
539
+ align-items: center;
540
+ gap: 6px;
541
+ min-width: 0;
542
+ }
543
+
530
544
  .env-site {
531
545
  color: var(--cyan);
532
546
  font-size: 12.5px;
@@ -1414,6 +1428,15 @@ a {
1414
1428
  color: var(--muted);
1415
1429
  }
1416
1430
 
1431
+ /* A value with its inline action button (copy the address, open the directory). */
1432
+ .config-inline {
1433
+ display: inline-flex;
1434
+ align-items: center;
1435
+ flex-wrap: wrap;
1436
+ gap: 8px;
1437
+ min-width: 0;
1438
+ }
1439
+
1417
1440
  .config-sublist {
1418
1441
  display: grid;
1419
1442
  gap: 6px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanjinke/artifact-client",
3
- "version": "1.12.1",
3
+ "version": "1.13.0",
4
4
  "description": "Artifact management client and CLI for Azure Storage and Aliyun OSS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,95 +0,0 @@
1
- /**
2
- * The 3D scene assets bundled with this package.
3
- *
4
- * Wyn's 3D scene document designer loads its scene assets (HDR environments,
5
- * geometry thumbnails, ground and flare textures) from `/3DScene` at the
6
- * Server's own web root, so a created environment needs exactly those files
7
- * below `<root>/Server/wwwroot/3DScene`. They are part of this package
8
- * (`resources/3DScene`) and are copied from the package's installation
9
- * directory — the downloaded product artifacts do not ship them.
10
- */
11
- export declare const sceneResourceName = "3DScene";
12
- /** Environment-relative destination of the bundled 3D scene assets (POSIX separators). */
13
- export declare const sceneResourceDestination = "Server/wwwroot/3DScene";
14
- /**
15
- * The `resources` directory of this package.
16
- *
17
- * Resolved from the compiled file location instead of the working directory:
18
- * `__dirname` is `<package>/dist/environment` in an installed package and
19
- * `<repository>/src/environment` under ts-jest, and the directory that holds
20
- * `package.json` and `resources/` is two levels up in both layouts. `dist` is
21
- * never named, so a differently compiled layout keeps working; the copy itself
22
- * reports the resolved path when it is missing.
23
- */
24
- export declare function bundledResourcesDirectory(): string;
25
- /** One named resource tree inside a bundled resources directory. */
26
- export declare function bundledResourceDirectory(name: string, resources?: string): string;
27
- /**
28
- * Copy every file of `source` into `destination` and return the relative POSIX
29
- * paths that were written.
30
- *
31
- * Copies are exclusive, exactly like the rest of the builder: an existing file
32
- * at a destination path fails the whole layout instead of being replaced, so a
33
- * packed environment can never silently shadow the packaged assets (or the
34
- * other way round). Directories are only merged when they are real directories.
35
- */
36
- export declare function copyBundledResource(source: string, destination: string): Promise<string[]>;
37
- /**
38
- * How one packaged file stands against its destination.
39
- *
40
- * `missing` is a file the environment does not have yet, `identical` a file that
41
- * already holds exactly the packaged bytes, and `different` a file whose content
42
- * differs. The package is the authority for this managed tree, so an update
43
- * refreshes a different file; identical files are left alone, which makes a
44
- * second run a true no-op.
45
- */
46
- export type BundledResourceFileStatus = 'missing' | 'identical' | 'different';
47
- /** One file of a bundled resource tree and what an update would do with it. */
48
- export interface BundledResourceFilePlan {
49
- relative: string;
50
- status: BundledResourceFileStatus;
51
- }
52
- /** A plan for one bundled resource tree: every packaged file, and the totals. */
53
- export interface BundledResourcePlan {
54
- files: BundledResourceFilePlan[];
55
- added: number;
56
- updated: number;
57
- }
58
- /** The relative POSIX paths an apply really wrote, split by kind. */
59
- export interface BundledResourceApply {
60
- added: string[];
61
- updated: string[];
62
- }
63
- /**
64
- * Plan one bundled resource tree against its destination without writing anything.
65
- *
66
- * Every packaged file is classified (missing, identical or different) and the
67
- * result carries the sorted relative POSIX paths plus the `added`/`updated`
68
- * totals the update reports. A missing or unusable bundled directory fails loudly
69
- * with the expected path, before anything is written, exactly like
70
- * `copyBundledResource` fails a create — an environment whose 3D scene designer
71
- * cannot load its assets is broken rather than degraded.
72
- *
73
- * `assumeMissing` covers an update that replaces a directory this tree lives in:
74
- * the Server module owns `Server/`, so refreshing it removes the whole
75
- * `wwwroot/3DScene` tree moments later. Classifying against content that is about
76
- * to be deleted would report every file identical, write nothing, and leave the
77
- * environment with no 3D scene assets at all.
78
- */
79
- export declare function planBundledResource(source: string, destination: string, assumeMissing?: boolean): Promise<BundledResourcePlan>;
80
- /**
81
- * Reconcile one planned bundled tree into `destination`.
82
- *
83
- * A missing file is copied with the same exclusive discipline the builder uses,
84
- * so a racing writer is never overwritten. A different file is first copied into
85
- * `scratch` and then replaced through a temporary file and an atomic rename, so a
86
- * reader never sees a partial file. Identical files are not touched at all. When
87
- * any write fails, the files this call added are removed, the files it replaced
88
- * are restored from `scratch` and the directories it created are removed again —
89
- * a failed layout never leaves a half-applied resource tree behind.
90
- *
91
- * `scratch` must be on the same volume as `destination` (the update workspace
92
- * beside the environment root is) and is only used for the replaced content.
93
- */
94
- export declare function applyBundledResource(source: string, destination: string, plan: BundledResourcePlan, scratch: string): Promise<BundledResourceApply>;
95
- //# sourceMappingURL=package-resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-resource.d.ts","sourceRoot":"","sources":["../../src/environment/package-resource.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,0FAA0F;AAC1F,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AAEjE;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,oEAAoE;AACpE,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAoC,GAAG,MAAM,CAE9G;AAmBD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA8BhG;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE9E,+EAA+E;AAC/E,MAAM,WAAW,uBAAuB;IAAG,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,yBAAyB,CAAA;CAAE;AAEhG,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAAG,KAAK,EAAE,uBAAuB,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;AAEzG,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IAAG,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE;AA0C5E;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,UAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoBlI;AAmCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoCzJ"}
@@ -1,323 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.sceneResourceDestination = exports.sceneResourceName = void 0;
37
- exports.bundledResourcesDirectory = bundledResourcesDirectory;
38
- exports.bundledResourceDirectory = bundledResourceDirectory;
39
- exports.copyBundledResource = copyBundledResource;
40
- exports.planBundledResource = planBundledResource;
41
- exports.applyBundledResource = applyBundledResource;
42
- const fs = __importStar(require("fs/promises"));
43
- const fsSync = __importStar(require("fs"));
44
- const path = __importStar(require("path"));
45
- const crypto_1 = require("crypto");
46
- const atomic_1 = require("../utils/atomic");
47
- /**
48
- * The 3D scene assets bundled with this package.
49
- *
50
- * Wyn's 3D scene document designer loads its scene assets (HDR environments,
51
- * geometry thumbnails, ground and flare textures) from `/3DScene` at the
52
- * Server's own web root, so a created environment needs exactly those files
53
- * below `<root>/Server/wwwroot/3DScene`. They are part of this package
54
- * (`resources/3DScene`) and are copied from the package's installation
55
- * directory — the downloaded product artifacts do not ship them.
56
- */
57
- exports.sceneResourceName = '3DScene';
58
- /** Environment-relative destination of the bundled 3D scene assets (POSIX separators). */
59
- exports.sceneResourceDestination = 'Server/wwwroot/3DScene';
60
- /**
61
- * The `resources` directory of this package.
62
- *
63
- * Resolved from the compiled file location instead of the working directory:
64
- * `__dirname` is `<package>/dist/environment` in an installed package and
65
- * `<repository>/src/environment` under ts-jest, and the directory that holds
66
- * `package.json` and `resources/` is two levels up in both layouts. `dist` is
67
- * never named, so a differently compiled layout keeps working; the copy itself
68
- * reports the resolved path when it is missing.
69
- */
70
- function bundledResourcesDirectory() {
71
- return path.resolve(__dirname, '..', '..', 'resources');
72
- }
73
- /** One named resource tree inside a bundled resources directory. */
74
- function bundledResourceDirectory(name, resources = bundledResourcesDirectory()) {
75
- return path.join(resources, name);
76
- }
77
- /**
78
- * Whether a bundling layout is usable at all: the resource tree must be a real
79
- * directory, not a link or a file. A missing tree fails loudly with the path
80
- * that was expected — the alternative (skipping the copy) would produce an
81
- * environment whose 3D scene designer is silently broken.
82
- */
83
- async function resourceRoot(source, destination) {
84
- let stat;
85
- try {
86
- stat = await fs.lstat(source);
87
- }
88
- catch (error) {
89
- if (error.code !== 'ENOENT')
90
- throw error;
91
- throw new Error(`Bundled resource directory is missing: ${source}. This installation is incomplete and the environment would have no resources at ${destination}; reinstall the package, or create the environment with a complete installation.`);
92
- }
93
- if (!stat.isDirectory() || stat.isSymbolicLink())
94
- throw new Error(`Bundled resource directory is not a regular directory: ${source}.`);
95
- }
96
- /**
97
- * Copy every file of `source` into `destination` and return the relative POSIX
98
- * paths that were written.
99
- *
100
- * Copies are exclusive, exactly like the rest of the builder: an existing file
101
- * at a destination path fails the whole layout instead of being replaced, so a
102
- * packed environment can never silently shadow the packaged assets (or the
103
- * other way round). Directories are only merged when they are real directories.
104
- */
105
- async function copyBundledResource(source, destination) {
106
- await resourceRoot(source, destination);
107
- const written = [];
108
- const visit = async (from, to, relative) => {
109
- for (const entry of await fs.readdir(from, { withFileTypes: true })) {
110
- const child = relative ? `${relative}/${entry.name}` : entry.name;
111
- const target = path.join(to, entry.name);
112
- if (entry.isDirectory()) {
113
- try {
114
- await fs.mkdir(target);
115
- }
116
- catch (error) {
117
- if (error.code !== 'EEXIST')
118
- throw error;
119
- const stat = await fs.lstat(target);
120
- if (!stat.isDirectory() || stat.isSymbolicLink())
121
- throw new Error(`Bundled resource destination is not a directory: ${target}.`);
122
- }
123
- await visit(path.join(from, entry.name), target, child);
124
- }
125
- else if (entry.isFile()) {
126
- try {
127
- await fs.copyFile(path.join(from, entry.name), target, fsSync.constants.COPYFILE_EXCL);
128
- }
129
- catch (error) {
130
- if (error.code === 'EEXIST')
131
- throw new Error(`Bundled resource file already exists at ${target}. Bundled resources are copied exclusively and never overwrite an existing file.`);
132
- throw error;
133
- }
134
- written.push(child);
135
- }
136
- else
137
- throw new Error(`Unexpected link in bundled resource ${source}: ${child}.`);
138
- }
139
- };
140
- await fs.mkdir(destination, { recursive: true });
141
- await visit(source, destination, '');
142
- return written.sort();
143
- }
144
- /** Whether two regular files hold exactly the same bytes. */
145
- async function sameContent(left, right) {
146
- const digest = async (file) => {
147
- const hash = (0, crypto_1.createHash)('sha256');
148
- for await (const chunk of fsSync.createReadStream(file))
149
- hash.update(chunk);
150
- return hash.digest('hex');
151
- };
152
- return await digest(left) === await digest(right);
153
- }
154
- /** Classify one packaged file against its destination; fail loudly on an unusable destination. */
155
- async function fileStatus(from, to) {
156
- let stat;
157
- try {
158
- stat = await fs.lstat(to);
159
- }
160
- catch (error) {
161
- const code = error.code;
162
- if (code === 'ENOENT')
163
- return 'missing';
164
- if (code === 'ENOTDIR')
165
- throw new Error(`Bundled resource destination is not a directory: ${path.dirname(to)}.`);
166
- throw error;
167
- }
168
- if (!stat.isFile() || stat.isSymbolicLink())
169
- throw new Error(`Bundled resource destination is not a regular file: ${to}.`);
170
- if ((await fs.lstat(from)).size !== stat.size)
171
- return 'different';
172
- return await sameContent(from, to) ? 'identical' : 'different';
173
- }
174
- /**
175
- * A destination directory is usable only when it is a real directory, or when it
176
- * does not exist yet and will be created by the apply. A file or a link where the
177
- * packaged tree needs a directory fails the plan, on every platform, before
178
- * anything is written.
179
- */
180
- async function checkDestinationDirectory(directory) {
181
- const stat = await fs.lstat(directory).catch((error) => {
182
- if (error.code === 'ENOENT' || error.code === 'ENOTDIR')
183
- return undefined;
184
- throw error;
185
- });
186
- if (stat && (!stat.isDirectory() || stat.isSymbolicLink()))
187
- throw new Error(`Bundled resource destination is not a directory: ${directory}.`);
188
- }
189
- /**
190
- * Plan one bundled resource tree against its destination without writing anything.
191
- *
192
- * Every packaged file is classified (missing, identical or different) and the
193
- * result carries the sorted relative POSIX paths plus the `added`/`updated`
194
- * totals the update reports. A missing or unusable bundled directory fails loudly
195
- * with the expected path, before anything is written, exactly like
196
- * `copyBundledResource` fails a create — an environment whose 3D scene designer
197
- * cannot load its assets is broken rather than degraded.
198
- *
199
- * `assumeMissing` covers an update that replaces a directory this tree lives in:
200
- * the Server module owns `Server/`, so refreshing it removes the whole
201
- * `wwwroot/3DScene` tree moments later. Classifying against content that is about
202
- * to be deleted would report every file identical, write nothing, and leave the
203
- * environment with no 3D scene assets at all.
204
- */
205
- async function planBundledResource(source, destination, assumeMissing = false) {
206
- await resourceRoot(source, destination);
207
- await checkDestinationDirectory(destination);
208
- const files = [];
209
- const visit = async (from, to, relative) => {
210
- for (const entry of await fs.readdir(from, { withFileTypes: true })) {
211
- const child = relative ? `${relative}/${entry.name}` : entry.name;
212
- if (entry.isDirectory()) {
213
- const directory = path.join(to, entry.name);
214
- await checkDestinationDirectory(directory);
215
- await visit(path.join(from, entry.name), directory, child);
216
- continue;
217
- }
218
- if (!entry.isFile())
219
- throw new Error(`Unexpected link in bundled resource ${source}: ${child}.`);
220
- files.push({ relative: child, status: assumeMissing ? 'missing' : await fileStatus(path.join(from, entry.name), path.join(to, entry.name)) });
221
- }
222
- };
223
- await visit(source, destination, '');
224
- files.sort((left, right) => left.relative < right.relative ? -1 : left.relative > right.relative ? 1 : 0);
225
- return { files, added: files.filter(file => file.status === 'missing').length, updated: files.filter(file => file.status === 'different').length };
226
- }
227
- /**
228
- * Create one destination directory and every missing parent of it, remembering
229
- * what was created so a failed apply can remove exactly those directories again.
230
- */
231
- async function ensureDirectory(directory, created) {
232
- const missing = [];
233
- for (let current = directory;;) {
234
- let stat;
235
- try {
236
- stat = await fs.lstat(current);
237
- }
238
- catch (error) {
239
- if (error.code !== 'ENOENT')
240
- throw error;
241
- missing.unshift(current);
242
- const parent = path.dirname(current);
243
- if (parent === current)
244
- break;
245
- current = parent;
246
- continue;
247
- }
248
- if (!stat.isDirectory() || stat.isSymbolicLink())
249
- throw new Error(`Bundled resource destination is not a directory: ${current}.`);
250
- break;
251
- }
252
- for (const item of missing) {
253
- try {
254
- await fs.mkdir(item);
255
- created.push(item);
256
- }
257
- catch (error) {
258
- if (error.code !== 'EEXIST')
259
- throw error;
260
- const stat = await fs.lstat(item);
261
- if (!stat.isDirectory() || stat.isSymbolicLink())
262
- throw new Error(`Bundled resource destination is not a directory: ${item}.`);
263
- }
264
- }
265
- }
266
- /**
267
- * Reconcile one planned bundled tree into `destination`.
268
- *
269
- * A missing file is copied with the same exclusive discipline the builder uses,
270
- * so a racing writer is never overwritten. A different file is first copied into
271
- * `scratch` and then replaced through a temporary file and an atomic rename, so a
272
- * reader never sees a partial file. Identical files are not touched at all. When
273
- * any write fails, the files this call added are removed, the files it replaced
274
- * are restored from `scratch` and the directories it created are removed again —
275
- * a failed layout never leaves a half-applied resource tree behind.
276
- *
277
- * `scratch` must be on the same volume as `destination` (the update workspace
278
- * beside the environment root is) and is only used for the replaced content.
279
- */
280
- async function applyBundledResource(source, destination, plan, scratch) {
281
- const added = [];
282
- const updated = [];
283
- const temporary = [];
284
- const replaced = [];
285
- const directories = [];
286
- const targetOf = (relative) => path.join(destination, ...relative.split('/'));
287
- try {
288
- for (const file of plan.files) {
289
- if (file.status === 'identical')
290
- continue;
291
- const from = path.join(source, ...file.relative.split('/'));
292
- const target = targetOf(file.relative);
293
- await ensureDirectory(path.dirname(target), directories);
294
- if (file.status === 'missing') {
295
- await fs.copyFile(from, target, fsSync.constants.COPYFILE_EXCL);
296
- added.push(file.relative);
297
- continue;
298
- }
299
- const pending = `${target}.afm-tmp`;
300
- await fs.copyFile(from, pending);
301
- temporary.push(pending);
302
- const backup = path.join(scratch, ...file.relative.split('/'));
303
- await fs.mkdir(path.dirname(backup), { recursive: true });
304
- await fs.copyFile(target, backup);
305
- await (0, atomic_1.renameAtomic)(pending, target);
306
- replaced.push({ target, backup });
307
- updated.push(file.relative);
308
- }
309
- }
310
- catch (error) {
311
- for (const file of temporary)
312
- await fs.rm(file, { force: true }).catch(() => { });
313
- for (const relative of added)
314
- await fs.rm(targetOf(relative), { force: true }).catch(() => { });
315
- for (const item of replaced)
316
- await (0, atomic_1.renameAtomic)(item.backup, item.target).catch(() => { });
317
- for (const directory of directories.reverse())
318
- await fs.rmdir(directory).catch(() => { });
319
- throw error;
320
- }
321
- return { added, updated };
322
- }
323
- //# sourceMappingURL=package-resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-resource.js","sourceRoot":"","sources":["../../src/environment/package-resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,8DAEC;AAGD,4DAEC;AA4BD,kDA8BC;AA8ED,kDAoBC;AAiDD,oDAoCC;AAvRD,gDAAkC;AAClC,2CAA6B;AAC7B,2CAA6B;AAC7B,mCAAoC;AACpC,4CAA+C;AAE/C;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAE3C,0FAA0F;AAC7E,QAAA,wBAAwB,GAAG,wBAAwB,CAAC;AAEjE;;;;;;;;;GASG;AACH,SAAgB,yBAAyB;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC;AAED,oEAAoE;AACpE,SAAgB,wBAAwB,CAAC,IAAY,EAAE,YAAoB,yBAAyB,EAAE;IACpG,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC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AC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAkC,CAAC,CAAC,CAAC;QAC1H,KAAK,MAAM,SAAS,IAAI,WAAW,CAAC,OAAO,EAAE;YAAE,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAkC,CAAC,CAAC,CAAC;QACzH,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
@@ -1,36 +0,0 @@
1
- import { LayoutMapping } from './types';
2
- /**
3
- * Where the Server serves the 3D scene designer's static resources from.
4
- *
5
- * Wyn's 3D scene document designer requests its scene assets from `/3DScene` at
6
- * the Server's own web root, so a package that ships them in a directory of its
7
- * own (`resource/3DScene`) has to be laid out here — not at `Server/resource/3DScene`,
8
- * which is where a whole-archive mapping into `Server` would put them.
9
- */
10
- export declare const resourceDestination = "Server/wwwroot/3DScene";
11
- /**
12
- * Whether a directory inside an artifact archive is a 3D scene resource tree.
13
- *
14
- * The last two path segments are compared, so `resource/3DScene` and
15
- * `resources/3dscene` match at the archive root and when nested (for example
16
- * inside a `Web Contents` folder). Both segments are case-insensitive and either
17
- * singular or plural is accepted, because the packaging side chooses the
18
- * spelling and this layout rule must not depend on a particular artifact.
19
- */
20
- export declare function isResourceDirectory(relative: string): boolean;
21
- /** The layout mapping of one resource directory: static files, no assembly and no service entry. */
22
- export declare function resourceMapping(source: string): LayoutMapping;
23
- /**
24
- * The resource mappings an extracted archive really contains.
25
- *
26
- * Resource trees are not named in the catalog: the same fixed destination
27
- * applies whatever module ships the files, so the archive's own directory list
28
- * decides. Reading the extracted tree keeps `environment.lock.json` truthful —
29
- * an artifact that ships no resource directory gets no mapping, one that does
30
- * gets the mapping that was actually laid out.
31
- *
32
- * The walk is iterative and ignores files, so a deep or wide archive neither
33
- * recurses the stack nor reads anything but directories.
34
- */
35
- export declare function resourceMappings(extracted: string): Promise<LayoutMapping[]>;
36
- //# sourceMappingURL=resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/environment/resource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI7D;AAED,oGAAoG;AACpG,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAE7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAelF"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.resourceDestination = void 0;
37
- exports.isResourceDirectory = isResourceDirectory;
38
- exports.resourceMapping = resourceMapping;
39
- exports.resourceMappings = resourceMappings;
40
- const fs = __importStar(require("fs/promises"));
41
- const path = __importStar(require("path"));
42
- /**
43
- * Where the Server serves the 3D scene designer's static resources from.
44
- *
45
- * Wyn's 3D scene document designer requests its scene assets from `/3DScene` at
46
- * the Server's own web root, so a package that ships them in a directory of its
47
- * own (`resource/3DScene`) has to be laid out here — not at `Server/resource/3DScene`,
48
- * which is where a whole-archive mapping into `Server` would put them.
49
- */
50
- exports.resourceDestination = 'Server/wwwroot/3DScene';
51
- /**
52
- * Whether a directory inside an artifact archive is a 3D scene resource tree.
53
- *
54
- * The last two path segments are compared, so `resource/3DScene` and
55
- * `resources/3dscene` match at the archive root and when nested (for example
56
- * inside a `Web Contents` folder). Both segments are case-insensitive and either
57
- * singular or plural is accepted, because the packaging side chooses the
58
- * spelling and this layout rule must not depend on a particular artifact.
59
- */
60
- function isResourceDirectory(relative) {
61
- const segments = relative.split('/');
62
- if (segments.length < 2)
63
- return false;
64
- return /^resources?$/i.test(segments[segments.length - 2]) && /^3dscene$/i.test(segments[segments.length - 1]);
65
- }
66
- /** The layout mapping of one resource directory: static files, no assembly and no service entry. */
67
- function resourceMapping(source) {
68
- return { source, destination: exports.resourceDestination, assemblies: [], role: 'resource' };
69
- }
70
- /**
71
- * The resource mappings an extracted archive really contains.
72
- *
73
- * Resource trees are not named in the catalog: the same fixed destination
74
- * applies whatever module ships the files, so the archive's own directory list
75
- * decides. Reading the extracted tree keeps `environment.lock.json` truthful —
76
- * an artifact that ships no resource directory gets no mapping, one that does
77
- * gets the mapping that was actually laid out.
78
- *
79
- * The walk is iterative and ignores files, so a deep or wide archive neither
80
- * recurses the stack nor reads anything but directories.
81
- */
82
- async function resourceMappings(extracted) {
83
- const found = [];
84
- const pending = [''];
85
- while (pending.length) {
86
- const relative = pending.pop();
87
- for (const entry of await fs.readdir(path.join(extracted, relative), { withFileTypes: true })) {
88
- if (!entry.isDirectory())
89
- continue;
90
- const child = relative ? `${relative}/${entry.name}` : entry.name;
91
- // The matched directory is a leaf for this walk: a nested resource tree of
92
- // its own would be part of the same 3D scene assets.
93
- if (isResourceDirectory(child))
94
- found.push(child);
95
- else
96
- pending.push(child);
97
- }
98
- }
99
- return found.sort().map(resourceMapping);
100
- }
101
- //# sourceMappingURL=resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/environment/resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,kDAIC;AAGD,0CAEC;AAcD,4CAeC;AA7DD,gDAAkC;AAClC,2CAA6B;AAG7B;;;;;;;GAOG;AACU,QAAA,mBAAmB,GAAG,wBAAwB,CAAC;AAE5D;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAAC,QAAgB;IAClD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AACjH,CAAC;AAED,oGAAoG;AACpG,SAAgB,eAAe,CAAC,MAAc;IAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,2BAAmB,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AACxF,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,g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