@guanjinke/artifact-client 1.8.0 → 1.9.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.
- package/README.md +2 -7
- package/dist/cli/environment.d.ts +1 -10
- package/dist/cli/environment.d.ts.map +1 -1
- package/dist/cli/environment.js +0 -24
- package/dist/cli/environment.js.map +1 -1
- package/dist/cli/setup.js +5 -8
- package/dist/cli/setup.js.map +1 -1
- package/dist/environment/builder.d.ts.map +1 -1
- package/dist/environment/builder.js +30 -20
- package/dist/environment/builder.js.map +1 -1
- package/dist/environment/catalog.d.ts +8 -0
- package/dist/environment/catalog.d.ts.map +1 -1
- package/dist/environment/catalog.js +25 -0
- package/dist/environment/catalog.js.map +1 -1
- package/dist/environment/plan.d.ts +26 -5
- package/dist/environment/plan.d.ts.map +1 -1
- package/dist/environment/plan.js +63 -11
- package/dist/environment/plan.js.map +1 -1
- package/dist/environment/types.d.ts +17 -9
- package/dist/environment/types.d.ts.map +1 -1
- package/dist/environment/update.d.ts +0 -25
- package/dist/environment/update.d.ts.map +1 -1
- package/dist/environment/update.js +74 -67
- package/dist/environment/update.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -3
- package/resources/3DScene/capeHill.hdr +0 -0
- package/resources/3DScene/defaultGround.jpg +0 -0
- package/resources/3DScene/environmentSpecular.env +0 -0
- package/resources/3DScene/flare.png +0 -0
- package/resources/3DScene/geometry1.png +0 -0
- package/resources/3DScene/geometry10.png +0 -0
- package/resources/3DScene/geometry11.png +0 -0
- package/resources/3DScene/geometry12.png +0 -0
- package/resources/3DScene/geometry13.png +0 -0
- package/resources/3DScene/geometry2.png +0 -0
- package/resources/3DScene/geometry3.png +0 -0
- package/resources/3DScene/geometry4.png +0 -0
- package/resources/3DScene/geometry5.png +0 -0
- package/resources/3DScene/geometry6.png +0 -0
- package/resources/3DScene/geometry7.png +0 -0
- package/resources/3DScene/geometry8.png +0 -0
- package/resources/3DScene/geometry9.png +0 -0
- package/resources/3DScene/lilienstein.hdr +0 -0
- package/resources/3DScene/sky.hdr +0 -0
- package/resources/3DScene/studio.env +0 -0
- package/resources/3DScene/wastelandCloudsPureSky.hdr +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/environment/plan.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpG,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B9G;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;CAAyC,CAAC;AAEhE,sEAAsE;AACtE,eAAO,MAAM,WAAW,EAAE,MAAwB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,iBAAiB,EAAE,CAG7E,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAAiE,CAAC;AAEjH,8DAA8D;AAC9D,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/environment/plan.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpG,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B9G;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;CAAyC,CAAC;AAEhE,sEAAsE;AACtE,eAAO,MAAM,WAAW,EAAE,MAAwB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,iBAAiB,EAAE,CAG7E,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAAiE,CAAC;AAEjH,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAmD,CAAC;AAEzF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,EAA2B,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAGrG;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,GAAG;IAAE,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAAC,CAkBrM;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAwDnK"}
|
package/dist/environment/plan.js
CHANGED
|
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.trailingModules = exports.autoAddedModules = exports.optionalModules = exports.optionalModulesByEdition = exports.defaultPort = exports.portRange = void 0;
|
|
37
37
|
exports.validateTarget = validateTarget;
|
|
38
38
|
exports.dependencyModules = dependencyModules;
|
|
39
39
|
exports.plannedModules = plannedModules;
|
|
40
|
+
exports.deployableModules = deployableModules;
|
|
40
41
|
exports.validateEnvironmentOptions = validateEnvironmentOptions;
|
|
41
42
|
exports.buildEnvironmentPlan = buildEnvironmentPlan;
|
|
42
43
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -105,7 +106,18 @@ exports.optionalModulesByEdition = {
|
|
|
105
106
|
/** Every selectable optional module, in the order errors and the UI list them. */
|
|
106
107
|
exports.optionalModules = [...new Set(Object.values(exports.optionalModulesByEdition).flat())];
|
|
107
108
|
/** Components every environment contains, selected or not. */
|
|
108
|
-
exports.
|
|
109
|
+
exports.autoAddedModules = ['server', 'monitoring', 'common', 'analysis'];
|
|
110
|
+
/**
|
|
111
|
+
* Built-in modules deployed **after** every other module, in this order.
|
|
112
|
+
*
|
|
113
|
+
* `dashboard-resource` ships the 3D scene and map assets the Server serves from
|
|
114
|
+
* its web root. It is built in and invisible: no `--modules` value can select,
|
|
115
|
+
* add or remove it, it is never an optional module and it has no local source.
|
|
116
|
+
* It is only deployed when the environment's major publishes it — a major
|
|
117
|
+
* without a version pointer (9.1 has no `wyn-dashboard-resource` line) simply
|
|
118
|
+
* does not get it, and the plan says so in one warning.
|
|
119
|
+
*/
|
|
120
|
+
exports.trailingModules = ['dashboard-resource'];
|
|
109
121
|
/**
|
|
110
122
|
* Modules a selection pulls in on its own, because the selected module cannot
|
|
111
123
|
* work without them — smart documents requires the collaboration service.
|
|
@@ -114,13 +126,26 @@ function dependencyModules(selected) {
|
|
|
114
126
|
return selected.includes('documents') ? ['collaboration'] : [];
|
|
115
127
|
}
|
|
116
128
|
/**
|
|
117
|
-
* The complete module
|
|
118
|
-
*
|
|
119
|
-
* builds the artifacts from this and `builder.ts` re-derives it to
|
|
120
|
-
* untrusted plan, so the two can never disagree.
|
|
129
|
+
* The complete module order of a plan: core components, automatically added
|
|
130
|
+
* dependencies, what the caller selected, and the built-in trailing modules.
|
|
131
|
+
* `plan.ts` builds the artifacts from this and `builder.ts` re-derives it to
|
|
132
|
+
* validate an untrusted plan, so the two can never disagree.
|
|
133
|
+
*
|
|
134
|
+
* A trailing module is only part of a plan that really deploys it: the caller
|
|
135
|
+
* filters the returned list against the module's availability for the major.
|
|
121
136
|
*/
|
|
122
137
|
function plannedModules(selected) {
|
|
123
|
-
return [...exports.
|
|
138
|
+
return [...exports.autoAddedModules, ...dependencyModules(selected), ...selected, ...exports.trailingModules];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The modules of `plannedModules(selected)` this environment really deploys:
|
|
142
|
+
* a built-in trailing module that the major publishes no pointer for is left out
|
|
143
|
+
* of both the artifact list and the recorded automatically added modules, so a
|
|
144
|
+
* 9.1 plan looks exactly like it did before the module existed.
|
|
145
|
+
*/
|
|
146
|
+
function deployableModules(selected, available) {
|
|
147
|
+
const published = new Set(available);
|
|
148
|
+
return plannedModules(selected).filter(module => !exports.trailingModules.includes(module) || published.has(module));
|
|
124
149
|
}
|
|
125
150
|
async function validateEnvironmentOptions(options) {
|
|
126
151
|
if (!options.root || !options.major || !/^(9\.1(?:-[A-Za-z0-9][A-Za-z0-9._-]*)?|dev)$/.test(options.major))
|
|
@@ -135,7 +160,10 @@ async function validateEnvironmentOptions(options) {
|
|
|
135
160
|
if (!Number.isInteger(port) || port < 1 || port > 65535)
|
|
136
161
|
throw new Error('Port must be an integer between 1 and 65535.');
|
|
137
162
|
const requestedModules = [...new Set((options.modules ?? []).flatMap(m => m.split(',')).map(m => m.trim()).filter(Boolean))];
|
|
138
|
-
|
|
163
|
+
// The built-in parts of an environment are accepted-and-ignored in `--modules`
|
|
164
|
+
// exactly like the core components: naming them never selects, adds or removes
|
|
165
|
+
// anything. `dashboard-resource` is deployed by the plan itself.
|
|
166
|
+
const modules = requestedModules.filter(m => !['server', 'account', 'dataset', 'analysis', 'cot-worker', 'common', 'monitoring', ...exports.trailingModules].includes(m)).sort();
|
|
139
167
|
if (modules.some(m => !exports.optionalModules.includes(m)))
|
|
140
168
|
throw new Error(`Select optional modules: ${exports.optionalModules.join(', ')}. Wyn core server, account, dataset, analysis model and cot worker are always included.`);
|
|
141
169
|
const unsupported = modules.filter(m => !exports.optionalModulesByEdition[edition].includes(m));
|
|
@@ -147,8 +175,32 @@ async function validateEnvironmentOptions(options) {
|
|
|
147
175
|
async function buildEnvironmentPlan(options, client, onProgress) {
|
|
148
176
|
onProgress?.('Validating environment options and target directory');
|
|
149
177
|
const normalized = await validateEnvironmentOptions(options);
|
|
150
|
-
const modules = plannedModules(normalized.modules);
|
|
151
178
|
const selected = new Set(normalized.modules);
|
|
179
|
+
const warnings = ['No services are registered or started.', 'Wyn core server, account, dataset, analysis model and cot worker are always included.', 'License, sample data, bootstrap data and optional language/styles-cache archives are not provisioned.'];
|
|
180
|
+
// Availability is per major and only checked for the built-in trailing modules:
|
|
181
|
+
// a major that publishes no version pointer for one (9.1 has no
|
|
182
|
+
// `wyn-dashboard-resource` line) does not get it, and the plan says so once.
|
|
183
|
+
// The probe runs before the artifact loop so the plan lists — and counts —
|
|
184
|
+
// only the modules this environment really deploys. A pointer that exists but
|
|
185
|
+
// cannot be resolved (an invalid version, a missing or ambiguous ZIP) stays a
|
|
186
|
+
// hard error in the loop below, exactly like every other module.
|
|
187
|
+
const resolved = new Map();
|
|
188
|
+
for (const module of exports.trailingModules) {
|
|
189
|
+
const entry = catalog_1.catalog[module];
|
|
190
|
+
let pointer;
|
|
191
|
+
try {
|
|
192
|
+
pointer = await client.getLatestVersion(entry.plugin, normalized.major);
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
warnings.push(`${entry.plugin} is not published for major ${normalized.major}; 3D scene and map resources were not deployed.`);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(pointer.version))
|
|
199
|
+
throw new Error(`Unable to resolve artifacts for ${entry.plugin}/${normalized.major}.`);
|
|
200
|
+
resolved.set(module, pointer.version);
|
|
201
|
+
onProgress?.(`${entry.plugin} is published for major ${normalized.major}; it will be deployed last`);
|
|
202
|
+
}
|
|
203
|
+
const modules = deployableModules(normalized.modules, [...resolved.keys()]);
|
|
152
204
|
const autoAddedModules = modules.filter(module => !selected.has(module));
|
|
153
205
|
const artifacts = [];
|
|
154
206
|
for (const [index, module] of modules.entries()) {
|
|
@@ -157,7 +209,7 @@ async function buildEnvironmentPlan(options, client, onProgress) {
|
|
|
157
209
|
let version;
|
|
158
210
|
let files;
|
|
159
211
|
try {
|
|
160
|
-
version = (await client.getLatestVersion(entry.plugin, normalized.major)).version;
|
|
212
|
+
version = resolved.get(module) ?? (await client.getLatestVersion(entry.plugin, normalized.major)).version;
|
|
161
213
|
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(version))
|
|
162
214
|
throw new Error('Invalid resolved version');
|
|
163
215
|
files = await client.listArtifacts(entry.plugin, version);
|
|
@@ -179,7 +231,7 @@ async function buildEnvironmentPlan(options, client, onProgress) {
|
|
|
179
231
|
return {
|
|
180
232
|
root: normalized.root, major: normalized.major, schema: 'pending', edition: normalized.edition, profile: normalized.profile, port: normalized.port,
|
|
181
233
|
selectedModules: normalized.modules, autoAddedModules, artifacts,
|
|
182
|
-
warnings
|
|
234
|
+
warnings,
|
|
183
235
|
requirements: ['Windows for execution.', '.NET runtime requirements are discovered from downloaded runtimeconfig files.', 'A valid license and database initialization may be required before startup.'],
|
|
184
236
|
};
|
|
185
237
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/environment/plan.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wCA6BC;
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/environment/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EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClK,CAAC;IACD,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI;QAClJ,eAAe,EAAE,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS;QAChE,QAAQ;QACR,YAAY,EAAE,CAAC,wBAAwB,EAAE,+EAA+E,EAAE,6EAA6E,CAAC;KACzM,CAAC;AACJ,CAAC"}
|
|
@@ -16,11 +16,26 @@ export interface LayoutMapping {
|
|
|
16
16
|
/**
|
|
17
17
|
* .NET assemblies this mapping must contain. Empty for a `service` mapping:
|
|
18
18
|
* an out-of-process native service that ships no managed assembly and is
|
|
19
|
-
* loaded by the Server from its `<Services>` declaration alone.
|
|
19
|
+
* loaded by the Server from its `<Services>` declaration alone. Empty for a
|
|
20
|
+
* `resource` mapping too: it is a static file tree the Server only serves.
|
|
20
21
|
*/
|
|
21
22
|
assemblies: string[];
|
|
22
|
-
|
|
23
|
+
/**
|
|
24
|
+
* `resource` is a static tree deployed into the environment's web root for the
|
|
25
|
+
* Server to serve (the built-in `dashboard-resource` module's 3D scene and map
|
|
26
|
+
* assets). It carries no assembly, needs no `.runtimeconfig.json`, and adds
|
|
27
|
+
* nothing to `conf/Wyn.conf`.
|
|
28
|
+
*/
|
|
29
|
+
role: 'plugin' | 'worker' | 'server' | 'monitor' | 'service' | 'resource';
|
|
23
30
|
service?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Edition this mapping belongs to. A mapping without one is deployed for every
|
|
33
|
+
* edition; a tagged mapping is deployed **only** when the environment has that
|
|
34
|
+
* edition, and is never required, copied or referenced otherwise — which is how
|
|
35
|
+
* `map-cn` and `map-en` both land in `Server/wwwroot/map` without one edition
|
|
36
|
+
* ever needing the other's directory.
|
|
37
|
+
*/
|
|
38
|
+
edition?: 'cn' | 'en';
|
|
24
39
|
}
|
|
25
40
|
export interface EnvironmentArtifact {
|
|
26
41
|
module: string;
|
|
@@ -67,12 +82,5 @@ export interface EnvironmentDependencies {
|
|
|
67
82
|
id: string;
|
|
68
83
|
name: string;
|
|
69
84
|
};
|
|
70
|
-
/**
|
|
71
|
-
* Root directory of the resource trees bundled with this package, for
|
|
72
|
-
* `create-env`'s layout of `resources/<name>` into the environment. Injectable
|
|
73
|
-
* so a test can point at a fixture tree; the default is the `resources`
|
|
74
|
-
* directory beside the installed package.
|
|
75
|
-
*/
|
|
76
|
-
bundledResourcesDirectory?: string;
|
|
77
85
|
}
|
|
78
86
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/environment/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,CAAC;AAClH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AACD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,E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,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC"}
|
|
@@ -31,21 +31,6 @@ export interface ModuleChange {
|
|
|
31
31
|
copiedDirectories: string[];
|
|
32
32
|
removedDirectories: string[];
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
35
|
-
* What an update did (or, in a dry run, would do) to one bundled resource tree.
|
|
36
|
-
*
|
|
37
|
-
* `added` counts files the environment did not have yet and `updated` counts
|
|
38
|
-
* files whose destination content differed and was refreshed; `files` is the size
|
|
39
|
-
* of the packaged tree, exactly as the lock manifest records it.
|
|
40
|
-
*/
|
|
41
|
-
export interface ResourceChange {
|
|
42
|
-
name: string;
|
|
43
|
-
source: string;
|
|
44
|
-
destination: string;
|
|
45
|
-
files: number;
|
|
46
|
-
added: number;
|
|
47
|
-
updated: number;
|
|
48
|
-
}
|
|
49
34
|
export interface UpdateResult {
|
|
50
35
|
name: string;
|
|
51
36
|
root: string;
|
|
@@ -58,21 +43,12 @@ export interface UpdateResult {
|
|
|
58
43
|
restartRequired: boolean;
|
|
59
44
|
warnings: string[];
|
|
60
45
|
localTargets: LocalTarget[];
|
|
61
|
-
resource: ResourceChange;
|
|
62
46
|
}
|
|
63
47
|
export interface UpdateDependencies {
|
|
64
48
|
registry?: EnvironmentRegistry;
|
|
65
49
|
processes?: ProcessBackend;
|
|
66
50
|
platform?: NodeJS.Platform;
|
|
67
51
|
onProgress?: EnvironmentProgress;
|
|
68
|
-
/**
|
|
69
|
-
* Root directory of the resource trees bundled with this package, for
|
|
70
|
-
* `update-env`'s layout of `resources/<name>` into an existing environment.
|
|
71
|
-
* Injectable so a test can point at a fixture tree; the default is the
|
|
72
|
-
* `resources` directory beside the installed package (the same seam
|
|
73
|
-
* `EnvironmentDependencies.bundledResourcesDirectory` gives `create-env`).
|
|
74
|
-
*/
|
|
75
|
-
bundledResourcesDirectory?: string;
|
|
76
52
|
}
|
|
77
53
|
/**
|
|
78
54
|
* One `<Server><Plugins>` or `<Server><PluginWorkers>` entry: where it is
|
|
@@ -127,7 +103,6 @@ export declare class EnvironmentUpdater {
|
|
|
127
103
|
readonly registry: EnvironmentRegistry;
|
|
128
104
|
private readonly processes;
|
|
129
105
|
private readonly platform;
|
|
130
|
-
private readonly bundledResources;
|
|
131
106
|
private readonly onProgress?;
|
|
132
107
|
constructor(dependencies?: UpdateDependencies);
|
|
133
108
|
update(name: string, specs: (ModuleUpdateSpec | string)[], clientFactory: () => EnvironmentClient, options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/environment/update.ts"],"names":[],"mappings":"AASA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAyB,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAoC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/environment/update.ts"],"names":[],"mappings":"AASA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAyB,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAoC,MAAM,SAAS,CAAC;AAUnG,kGAAkG;AAClG,eAAO,MAAM,gBAAgB,UAA8B,CAAC;AAmD5D,MAAM,WAAW,gBAAgB;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;AAC7G,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAA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C,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAarE;AA+DD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAoDvI;AAoSD;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAKjB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAJzC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAsB;gBACrB,YAAY,GAAE,kBAAuB;IAM5D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,gBAAgB,GAAG,MAAM,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,iBAAiB,EAAE,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,mBAAmB,CAAA;KAAO,GAAG,OAAO,CAAC,YAAY,CAAC;CAuUtM"}
|
|
@@ -48,7 +48,6 @@ const registry_1 = require("./registry");
|
|
|
48
48
|
const validate_1 = require("./validate");
|
|
49
49
|
const process_1 = require("./process");
|
|
50
50
|
const posix_process_1 = require("./posix-process");
|
|
51
|
-
const package_resource_1 = require("./package-resource");
|
|
52
51
|
const atomic_1 = require("../utils/atomic");
|
|
53
52
|
const local_path_1 = require("../utils/local-path");
|
|
54
53
|
/** Same parser options as the creation path, so a rewrite round-trips identically. */
|
|
@@ -95,6 +94,12 @@ const excludedCopyNames = (mapping) => mapping.role === 'server' ? [...serverOwn
|
|
|
95
94
|
*/
|
|
96
95
|
const selectableModules = () => new Set([...new Set(Object.values(plan_1.optionalModulesByEdition).flat())]);
|
|
97
96
|
const installationDirectory = (root, destination) => path.join(root, ...destination.split('/'));
|
|
97
|
+
/**
|
|
98
|
+
* The edition an environment deploys. The registry records a free string and
|
|
99
|
+
* only `en` is special everywhere else in this module, so anything else counts
|
|
100
|
+
* as `cn`, exactly like the edition gate below does.
|
|
101
|
+
*/
|
|
102
|
+
const editionOf = (entry) => entry.edition === 'en' ? 'en' : 'cn';
|
|
98
103
|
function validateUpdatableModule(module) {
|
|
99
104
|
if (Object.prototype.hasOwnProperty.call(catalog_1.catalog, module))
|
|
100
105
|
return;
|
|
@@ -382,10 +387,9 @@ async function readManifest(root) {
|
|
|
382
387
|
}
|
|
383
388
|
if (manifest.selectedModules !== undefined && (!Array.isArray(manifest.selectedModules) || manifest.selectedModules.some(module => typeof module !== 'string')))
|
|
384
389
|
throw new Error('Environment manifest is unreadable.');
|
|
385
|
-
//
|
|
386
|
-
//
|
|
387
|
-
|
|
388
|
-
throw new Error('Environment manifest is unreadable.');
|
|
390
|
+
// A stale `resources` key written by an older version is ignored here and
|
|
391
|
+
// dropped when the manifest is rewritten: the key belongs to the removed
|
|
392
|
+
// packaged-resource feature, not to the environment's configuration.
|
|
389
393
|
if (manifest.moduleSources !== undefined && (!manifest.moduleSources || typeof manifest.moduleSources !== 'object' || Array.isArray(manifest.moduleSources)))
|
|
390
394
|
throw new Error('Environment manifest is unreadable.');
|
|
391
395
|
for (const source of Object.values(manifest.moduleSources ?? {})) {
|
|
@@ -454,7 +458,7 @@ async function resolveRemoteArtifact(client, entry, spec) {
|
|
|
454
458
|
return { module, plugin: source.plugin, version, name, path: remotePath, mappings: source.mappings.map(mapping => ({ ...mapping, assemblies: [...mapping.assemblies] })) };
|
|
455
459
|
}
|
|
456
460
|
/** Download, hash, extract and verify one resolved artifact inside the staging workspace. */
|
|
457
|
-
async function stageRemoteArtifact(client, artifact, workspace, onProgress) {
|
|
461
|
+
async function stageRemoteArtifact(client, artifact, edition, workspace, onProgress) {
|
|
458
462
|
const label = `[${artifact.module}] ${artifact.plugin}/${artifact.version}/${artifact.name}`;
|
|
459
463
|
const download = path.join(workspace, 'download', artifact.module);
|
|
460
464
|
const expanded = path.join(workspace, `expanded-${artifact.module}`);
|
|
@@ -469,10 +473,16 @@ async function stageRemoteArtifact(client, artifact, workspace, onProgress) {
|
|
|
469
473
|
onProgress?.(`${label}: Extracting and validating ZIP`);
|
|
470
474
|
await (0, archive_1.extractArchive)(archive, expanded);
|
|
471
475
|
const assemblies = new Map();
|
|
472
|
-
|
|
476
|
+
// A mapping of the other edition is never required: its source directory
|
|
477
|
+
// does not even have to be in the archive.
|
|
478
|
+
for (const mapping of (0, catalog_1.editionMappings)(artifact.mappings, edition)) {
|
|
473
479
|
const source = path.join(expanded, mapping.source);
|
|
474
480
|
if (!(await fs.lstat(source)).isDirectory())
|
|
475
481
|
throw new Error('Required source directory missing.');
|
|
482
|
+
// A `resource` mapping is a static tree with no assembly to verify and no
|
|
483
|
+
// runtimeconfig to read; the Server only serves it.
|
|
484
|
+
if (mapping.role === 'resource')
|
|
485
|
+
continue;
|
|
476
486
|
if (mapping.role === 'service' && mapping.assemblies.length === 0)
|
|
477
487
|
continue;
|
|
478
488
|
const present = [];
|
|
@@ -616,6 +626,12 @@ function mappingForAssembly(module, assembly) {
|
|
|
616
626
|
* explicitly, for a build whose file name matches no assembly at all.
|
|
617
627
|
*/
|
|
618
628
|
async function resolveLocalSource(entry, module, assembly, input) {
|
|
629
|
+
// The built-in resource module is never a developer-build target: it ships a
|
|
630
|
+
// static asset tree that no local DLL could stand in for, so a local source is
|
|
631
|
+
// refused on its own terms before any path is even looked at. Remote specs
|
|
632
|
+
// (latest, pinned and `all`) keep working.
|
|
633
|
+
if (plan_1.trailingModules.includes(module))
|
|
634
|
+
throw new Error(`Module ${module} is built in and has no local source: it ships the 3D scene and map assets and is always deployed from its published artifact. Refresh it from the cloud (\`${module}\`, \`${module}:<version>\` or \`all\`).`);
|
|
619
635
|
const mappings = localMappings(module);
|
|
620
636
|
// The Server, Monitor and collaboration deployments are whole services, not a
|
|
621
637
|
// plugin the Server loads: a developer build has no place to point the
|
|
@@ -705,14 +721,12 @@ class EnvironmentUpdater {
|
|
|
705
721
|
registry;
|
|
706
722
|
processes;
|
|
707
723
|
platform;
|
|
708
|
-
bundledResources;
|
|
709
724
|
onProgress;
|
|
710
725
|
constructor(dependencies = {}) {
|
|
711
726
|
this.dependencies = dependencies;
|
|
712
727
|
this.registry = dependencies.registry ?? new registry_1.EnvironmentRegistry();
|
|
713
728
|
this.processes = dependencies.processes ?? (process.platform === 'win32' ? new process_1.WindowsProcessBackend() : new posix_process_1.PosixProcessBackend());
|
|
714
729
|
this.platform = dependencies.platform ?? process.platform;
|
|
715
|
-
this.bundledResources = dependencies.bundledResourcesDirectory ?? (0, package_resource_1.bundledResourcesDirectory)();
|
|
716
730
|
this.onProgress = dependencies.onProgress;
|
|
717
731
|
}
|
|
718
732
|
async update(name, specs, clientFactory, options = {}) {
|
|
@@ -720,9 +734,8 @@ class EnvironmentUpdater {
|
|
|
720
734
|
const onProgress = options.onProgress ?? this.onProgress;
|
|
721
735
|
onProgress?.('Validating module specs');
|
|
722
736
|
let parsed = normalizeModuleSpecs(specs);
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
// them without touching a single module.
|
|
737
|
+
if (!parsed.length)
|
|
738
|
+
throw new Error('At least one module spec is required: pass `all` or one or more module names (module, module:<version> or module=<local path>).');
|
|
726
739
|
const entry = await this.registry.get(name);
|
|
727
740
|
onProgress?.(`Validating environment ${entry.name} at ${entry.root}`);
|
|
728
741
|
await (0, validate_1.validateEnvironmentRoot)(entry, this.registry.directory);
|
|
@@ -766,6 +779,22 @@ class EnvironmentUpdater {
|
|
|
766
779
|
localOverrides.set(spec.module, targets);
|
|
767
780
|
}
|
|
768
781
|
const remote = parsed.filter(spec => spec.localPath === undefined);
|
|
782
|
+
// The built-in resource modules deploy their trees *inside* the Server
|
|
783
|
+
// directory, and a Server refresh replaces that whole directory. An
|
|
784
|
+
// environment that has such a module therefore re-deploys it from its own
|
|
785
|
+
// artifact whenever the Server is refreshed in the same call: a remote-only
|
|
786
|
+
// module has no local copy to restore the trees from.
|
|
787
|
+
const autoRefreshed = [];
|
|
788
|
+
if (remote.some(spec => spec.module === 'server')) {
|
|
789
|
+
for (const module of plan_1.trailingModules) {
|
|
790
|
+
if (!installed.has(module) || parsed.some(spec => spec.module === module))
|
|
791
|
+
continue;
|
|
792
|
+
parsed.push({ module });
|
|
793
|
+
remote.push({ module });
|
|
794
|
+
autoRefreshed.push(module);
|
|
795
|
+
onProgress?.(`${module} is refreshed with the Server package: its trees deploy inside the Server directory`);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
769
798
|
// Smart documents cannot run without the collaboration service, which
|
|
770
799
|
// create-env deploys and declares in the Server configuration alongside
|
|
771
800
|
// documents. Installing documents into an environment with no collaboration
|
|
@@ -779,26 +808,6 @@ class EnvironmentUpdater {
|
|
|
779
808
|
throw new Error(`Cannot update modules from a remote source while ${entry.name} is ${state}: deployed files may be in use. Run \`afm env stop ${entry.name}\` first.`);
|
|
780
809
|
if (!remote.length && state !== 'ready' && state !== 'stopped' && state !== 'running')
|
|
781
810
|
throw new Error(`Cannot update modules while ${entry.name} is ${state}: the runtime identity must be verified before its files are changed. Run \`afm env stop ${entry.name}\` first.`);
|
|
782
|
-
// The packaged 3D scene assets belong to every environment, not only to one
|
|
783
|
-
// that create-env assembled: the plan below finds the files an environment is
|
|
784
|
-
// still missing (or that differ) and the apply writes them with the rest of
|
|
785
|
-
// the update. Planning touches nothing and runs before any download or write,
|
|
786
|
-
// so an incomplete installation fails loudly with the path it expected and
|
|
787
|
-
// leaves the environment exactly as it was.
|
|
788
|
-
//
|
|
789
|
-
// The assets live at `Server/wwwroot/3DScene`, so refreshing the server
|
|
790
|
-
// module removes the whole tree they are in. Plan every packaged file as
|
|
791
|
-
// missing in that case: comparing against the content that is about to be
|
|
792
|
-
// deleted would report every file identical and lay nothing out at all.
|
|
793
|
-
const refreshesServer = remote.some(spec => spec.module === 'server');
|
|
794
|
-
const resourceSource = (0, package_resource_1.bundledResourceDirectory)(package_resource_1.sceneResourceName, this.bundledResources);
|
|
795
|
-
const resourceDestination = path.join(entry.root, ...package_resource_1.sceneResourceDestination.split('/'));
|
|
796
|
-
onProgress?.(`Checking bundled 3D scene resources in ${package_resource_1.sceneResourceDestination}`);
|
|
797
|
-
const resourcePlan = await (0, package_resource_1.planBundledResource)(resourceSource, resourceDestination, refreshesServer);
|
|
798
|
-
const resourceWrites = resourcePlan.added + resourcePlan.updated;
|
|
799
|
-
const resource = { name: package_resource_1.sceneResourceName, source: resourceSource, destination: package_resource_1.sceneResourceDestination, files: resourcePlan.files.length, added: resourcePlan.added, updated: resourcePlan.updated };
|
|
800
|
-
const resourceSummary = `${resourcePlan.files.length - resourceWrites} identical, ${resourcePlan.added} missing, ${resourcePlan.updated} different`;
|
|
801
|
-
onProgress?.(`Bundled 3D scene resources in ${package_resource_1.sceneResourceDestination}: ${dryRun ? 'dry run; ' : ''}${resourceSummary}`);
|
|
802
811
|
const downloads = [...(manifest.downloads ?? [])];
|
|
803
812
|
const selectedModules = stringListOrUndefined(manifest.selectedModules);
|
|
804
813
|
const autoAddedModules = stringListOrUndefined(manifest.autoAddedModules);
|
|
@@ -811,7 +820,7 @@ class EnvironmentUpdater {
|
|
|
811
820
|
// runtimeconfig files, so an update replaces the entries of the modules it
|
|
812
821
|
// refreshes and leaves every other module's alone.
|
|
813
822
|
let requirements = Array.isArray(manifest.requirements) ? manifest.requirements.filter((line) => typeof line === 'string') : [];
|
|
814
|
-
const workspace = !dryRun &&
|
|
823
|
+
const workspace = !dryRun && remote.length > 0 ? await fs.mkdtemp(path.join(path.dirname(entry.root), '.afm-env-')) : undefined;
|
|
815
824
|
const warnings = [];
|
|
816
825
|
try {
|
|
817
826
|
const resolved = new Map();
|
|
@@ -824,7 +833,7 @@ class EnvironmentUpdater {
|
|
|
824
833
|
}
|
|
825
834
|
if (!dryRun)
|
|
826
835
|
for (const spec of remote)
|
|
827
|
-
staged.set(spec.module, await stageRemoteArtifact(client, resolved.get(spec.module), workspace, onProgress));
|
|
836
|
+
staged.set(spec.module, await stageRemoteArtifact(client, resolved.get(spec.module), editionOf(entry), workspace, onProgress));
|
|
828
837
|
}
|
|
829
838
|
const configured = await fs.readFile(path.join(entry.root, 'conf', 'Wyn.conf'), 'utf8');
|
|
830
839
|
// A Server or Monitor package is only usable when it still serves the
|
|
@@ -846,7 +855,12 @@ class EnvironmentUpdater {
|
|
|
846
855
|
}
|
|
847
856
|
const plans = [];
|
|
848
857
|
// A module may carry several local specs: plan it once, for all its targets.
|
|
849
|
-
|
|
858
|
+
// The built-in trailing modules are planned last, in the same order
|
|
859
|
+
// `create-env` assembles: their trees live inside other modules'
|
|
860
|
+
// directories, so a Server replacement must not wipe them again.
|
|
861
|
+
const planOrder = [...new Set(parsed.map(spec => spec.module))]
|
|
862
|
+
.sort((left, right) => Number(plan_1.trailingModules.includes(left)) - Number(plan_1.trailingModules.includes(right)));
|
|
863
|
+
for (const module of planOrder) {
|
|
850
864
|
const artifact = artifacts.find(candidate => candidate.module === module);
|
|
851
865
|
const previous = moduleSources[module] ? { local: moduleSources[module].path } : { version: artifact?.version };
|
|
852
866
|
const override = localOverrides.get(module);
|
|
@@ -885,8 +899,12 @@ class EnvironmentUpdater {
|
|
|
885
899
|
const entries = [];
|
|
886
900
|
let configurationAssets;
|
|
887
901
|
let configurationLink;
|
|
888
|
-
|
|
902
|
+
// Only the mappings this environment's edition deploys: the other
|
|
903
|
+
// edition's directory is never removed, copied or referenced.
|
|
904
|
+
for (const mapping of (0, catalog_1.editionMappings)(remoteArtifact.mappings, editionOf(entry))) {
|
|
889
905
|
const destination = installationDirectory(entry.root, mapping.destination);
|
|
906
|
+
// A `resource` directory the module already deployed is replaced, never
|
|
907
|
+
// merged, and it contributes no plugin, worker, service or runtime entry.
|
|
890
908
|
if (await exists(destination)) {
|
|
891
909
|
removals.push(destination);
|
|
892
910
|
removedDirectories.push(mapping.destination);
|
|
@@ -903,6 +921,8 @@ class EnvironmentUpdater {
|
|
|
903
921
|
if (stagedArtifact)
|
|
904
922
|
copies.push({ source: path.join(stagedArtifact.expanded, mapping.source), destination, exclude: excludedCopyNames(mapping) });
|
|
905
923
|
copiedDirectories.push(mapping.destination);
|
|
924
|
+
if (mapping.role === 'resource')
|
|
925
|
+
continue;
|
|
906
926
|
// A native out-of-process service has no assembly and is declared as an
|
|
907
927
|
// empty node: the Server loads it from that entry and supplies the rest.
|
|
908
928
|
if (mapping.role === 'service') {
|
|
@@ -975,9 +995,10 @@ class EnvironmentUpdater {
|
|
|
975
995
|
nextDownloads[downloadIndex] = download;
|
|
976
996
|
// The requirements the old artifact needed are gone with it: re-read
|
|
977
997
|
// the ones the new package actually declares, per deployed mapping.
|
|
998
|
+
// A resource mapping is a static tree: it declares none.
|
|
978
999
|
requirements = requirements.filter(line => !line.endsWith(` (${plan.module})`));
|
|
979
|
-
for (const mapping of plan.artifact.mappings) {
|
|
980
|
-
if (mapping.role === 'service')
|
|
1000
|
+
for (const mapping of (0, catalog_1.editionMappings)(plan.artifact.mappings, editionOf(entry))) {
|
|
1001
|
+
if (mapping.role === 'service' || mapping.role === 'resource')
|
|
981
1002
|
continue;
|
|
982
1003
|
for (const framework of await (0, builder_1.runtimeRequirements)(path.join(plan.staged.expanded, mapping.source))) {
|
|
983
1004
|
requirements.push(`${framework.name} ${framework.version} (${plan.module})`);
|
|
@@ -1019,18 +1040,9 @@ class EnvironmentUpdater {
|
|
|
1019
1040
|
delete nextManifest.moduleSources;
|
|
1020
1041
|
if (selectedModules)
|
|
1021
1042
|
nextManifest.selectedModules = selectedModules;
|
|
1022
|
-
//
|
|
1023
|
-
//
|
|
1024
|
-
|
|
1025
|
-
// the durable four-field description.
|
|
1026
|
-
const resources = [...(manifest.resources ?? [])];
|
|
1027
|
-
const recorded = resources.findIndex(candidate => candidate.name === package_resource_1.sceneResourceName);
|
|
1028
|
-
const record = { name: package_resource_1.sceneResourceName, source: resource.source, destination: resource.destination, files: resource.files };
|
|
1029
|
-
if (recorded < 0)
|
|
1030
|
-
resources.push(record);
|
|
1031
|
-
else
|
|
1032
|
-
resources[recorded] = { ...resources[recorded], ...record };
|
|
1033
|
-
nextManifest.resources = resources;
|
|
1043
|
+
// A stale `resources` key from an older manifest is dropped here: the
|
|
1044
|
+
// packaged-resource feature is gone and nothing records it any more.
|
|
1045
|
+
delete nextManifest.resources;
|
|
1034
1046
|
const modules = [...new Set([...entry.modules, ...plans.filter(plan => !installed.has(plan.module) && selectable.has(plan.module)).map(plan => plan.module)])].sort();
|
|
1035
1047
|
const localModules = Object.keys(moduleSources).sort();
|
|
1036
1048
|
if (state === 'running')
|
|
@@ -1046,6 +1058,8 @@ class EnvironmentUpdater {
|
|
|
1046
1058
|
if (parsed.some(spec => spec.module === 'documents') && !parsed.some(spec => spec.module === 'collaboration')) {
|
|
1047
1059
|
warnings.push('documents was refreshed without collaboration; the smart documents plugin may expect the deployed collaboration service version, so refresh collaboration too.');
|
|
1048
1060
|
}
|
|
1061
|
+
if (autoRefreshed.length)
|
|
1062
|
+
warnings.push(`${autoRefreshed.join(', ')} was refreshed with the Server package: its trees live inside the Server directory and would otherwise be lost.`);
|
|
1049
1063
|
if (!dryRun) {
|
|
1050
1064
|
for (const plan of plans) {
|
|
1051
1065
|
// Take the environment-owned settings aside first, and drop the Monitor
|
|
@@ -1075,20 +1089,13 @@ class EnvironmentUpdater {
|
|
|
1075
1089
|
if (plan.configurationLink)
|
|
1076
1090
|
await fs.symlink(path.join(entry.root, 'conf'), plan.configurationLink, 'junction');
|
|
1077
1091
|
}
|
|
1078
|
-
//
|
|
1079
|
-
//
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
if (applied.added.length !== resourcePlan.added || applied.updated.length !== resourcePlan.updated)
|
|
1086
|
-
throw new Error('Bundled resource layout did not match its plan.');
|
|
1087
|
-
}
|
|
1088
|
-
// A resource-only update (no module spec) leaves the Server configuration
|
|
1089
|
-
// exactly as it is: the assets need no plugin, worker or service entry.
|
|
1090
|
-
onProgress?.(plans.length ? 'Writing configuration, manifest and registry record' : 'Writing manifest and registry record');
|
|
1091
|
-
if (plans.length)
|
|
1092
|
+
// Only a plan that really contributes something to the configuration
|
|
1093
|
+
// rewrites it: the built-in dashboard-resource module adds no plugin,
|
|
1094
|
+
// worker or service entry, so refreshing it alone leaves `conf/Wyn.conf`
|
|
1095
|
+
// exactly as it is instead of round-tripping it through the XML builder.
|
|
1096
|
+
const configurationChanged = plans.some(plan => plan.entries.length > 0 || plan.configurationAssets !== undefined || plan.configurationLink !== undefined);
|
|
1097
|
+
onProgress?.(configurationChanged ? 'Writing configuration, manifest and registry record' : 'Writing manifest and registry record');
|
|
1098
|
+
if (configurationChanged)
|
|
1092
1099
|
await writeAtomic(path.join(entry.root, 'conf', 'Wyn.conf'), configuration);
|
|
1093
1100
|
await writeJsonAtomic(path.join(entry.root, 'environment.lock.json'), nextManifest);
|
|
1094
1101
|
await this.registry.update(entries => {
|
|
@@ -1104,10 +1111,10 @@ class EnvironmentUpdater {
|
|
|
1104
1111
|
delete entries[index].localModules;
|
|
1105
1112
|
});
|
|
1106
1113
|
}
|
|
1107
|
-
const restartRequired = !dryRun &&
|
|
1114
|
+
const restartRequired = !dryRun && changes.length > 0;
|
|
1108
1115
|
if (restartRequired)
|
|
1109
|
-
onProgress?.(`${entry.name}:
|
|
1110
|
-
return { name: entry.name, root: entry.root, dryRun, changes, skipped, restartRequired, warnings, localTargets: plans.flatMap(plan => plan.local ?? [])
|
|
1116
|
+
onProgress?.(`${entry.name}: modules updated; restart the environment to load the change (no service was started).`);
|
|
1117
|
+
return { name: entry.name, root: entry.root, dryRun, changes, skipped, restartRequired, warnings, localTargets: plans.flatMap(plan => plan.local ?? []) };
|
|
1111
1118
|
}
|
|
1112
1119
|
finally {
|
|
1113
1120
|
if (workspace)
|