@esri/solution-creator 6.4.0-next.20250930 → 6.4.0-next.20251001
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.
|
@@ -347,34 +347,36 @@ async function _postProcessTaskResource(templates, resourceItemFiles, templateDi
|
|
|
347
347
|
const resourcePromises = taskKeys.map((k) => {
|
|
348
348
|
return (0, solution_common_1.request)((0, solution_common_1.generateSourceResourceUrl)(`${templateDictionary.portalBaseUrl}/sharing/rest`, taskResources[k].itemId, taskResources[k].filename), requestOptions);
|
|
349
349
|
});
|
|
350
|
-
await Promise.all(resourcePromises).then(async (
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
file.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
t.
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
350
|
+
await Promise.all(resourcePromises).then(async (resources) => {
|
|
351
|
+
resources.forEach((r) => {
|
|
352
|
+
let resourceString = JSON.stringify(r);
|
|
353
|
+
// replace urls first
|
|
354
|
+
orderedUrls.forEach((url) => {
|
|
355
|
+
// TypeScript for es2015 doesn't have a definition for `replaceAll`
|
|
356
|
+
resourceString = resourceString.replaceAll(url, urlVarHash[url]);
|
|
357
|
+
});
|
|
358
|
+
// replace any item ids that aren't already variables
|
|
359
|
+
Object.keys(itemIds).forEach((k) => {
|
|
360
|
+
let pattern = new RegExp(`(?<!\\{\\{)${k}`, "g");
|
|
361
|
+
// TypeScript for es2015 doesn't have a definition for `replaceAll`
|
|
362
|
+
resourceString = resourceString.replaceAll(pattern, itemIds[k]);
|
|
363
|
+
});
|
|
364
|
+
// all urls and item ids should now be replaced with variables that contain the item ids
|
|
365
|
+
// we need to add any ids that are not currently marked as dependencies to the webmap dependencies and update the resource
|
|
366
|
+
const ids = (0, solution_common_1.uniqueStringList)(resourceString.match((0, solution_common_1.getAgoIdRegEx)()));
|
|
367
|
+
resourceItemFiles = resourceItemFiles.map((file) => {
|
|
368
|
+
if (file.filename === taskConfigName) {
|
|
369
|
+
file.file = (0, solution_common_1.jsonToFile)(JSON.parse(resourceString), file.filename);
|
|
370
|
+
// add any ids that we found to the source webmap
|
|
371
|
+
templates.some((t) => {
|
|
372
|
+
if (t.itemId === file.itemId) {
|
|
373
|
+
t.dependencies = [...new Set([...t.dependencies, ...ids])];
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
return file;
|
|
379
|
+
});
|
|
378
380
|
});
|
|
379
381
|
});
|
|
380
382
|
return Promise.resolve(resourceItemFiles);
|
|
@@ -337,34 +337,36 @@ export async function _postProcessTaskResource(templates, resourceItemFiles, tem
|
|
|
337
337
|
const resourcePromises = taskKeys.map((k) => {
|
|
338
338
|
return request(generateSourceResourceUrl(`${templateDictionary.portalBaseUrl}/sharing/rest`, taskResources[k].itemId, taskResources[k].filename), requestOptions);
|
|
339
339
|
});
|
|
340
|
-
await Promise.all(resourcePromises).then(async (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
file.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
t.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
340
|
+
await Promise.all(resourcePromises).then(async (resources) => {
|
|
341
|
+
resources.forEach((r) => {
|
|
342
|
+
let resourceString = JSON.stringify(r);
|
|
343
|
+
// replace urls first
|
|
344
|
+
orderedUrls.forEach((url) => {
|
|
345
|
+
// TypeScript for es2015 doesn't have a definition for `replaceAll`
|
|
346
|
+
resourceString = resourceString.replaceAll(url, urlVarHash[url]);
|
|
347
|
+
});
|
|
348
|
+
// replace any item ids that aren't already variables
|
|
349
|
+
Object.keys(itemIds).forEach((k) => {
|
|
350
|
+
let pattern = new RegExp(`(?<!\\{\\{)${k}`, "g");
|
|
351
|
+
// TypeScript for es2015 doesn't have a definition for `replaceAll`
|
|
352
|
+
resourceString = resourceString.replaceAll(pattern, itemIds[k]);
|
|
353
|
+
});
|
|
354
|
+
// all urls and item ids should now be replaced with variables that contain the item ids
|
|
355
|
+
// we need to add any ids that are not currently marked as dependencies to the webmap dependencies and update the resource
|
|
356
|
+
const ids = uniqueStringList(resourceString.match(getAgoIdRegEx()));
|
|
357
|
+
resourceItemFiles = resourceItemFiles.map((file) => {
|
|
358
|
+
if (file.filename === taskConfigName) {
|
|
359
|
+
file.file = jsonToFile(JSON.parse(resourceString), file.filename);
|
|
360
|
+
// add any ids that we found to the source webmap
|
|
361
|
+
templates.some((t) => {
|
|
362
|
+
if (t.itemId === file.itemId) {
|
|
363
|
+
t.dependencies = [...new Set([...t.dependencies, ...ids])];
|
|
364
|
+
return true;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
return file;
|
|
369
|
+
});
|
|
368
370
|
});
|
|
369
371
|
});
|
|
370
372
|
return Promise.resolve(resourceItemFiles);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/solution-creator",
|
|
3
|
-
"version": "6.4.0-next.
|
|
3
|
+
"version": "6.4.0-next.20251001",
|
|
4
4
|
"description": "Manages the creation of a Solution item for @esri/solution.js.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@esri/hub-common": "^17.0.2",
|
|
28
|
-
"@esri/solution-common": "^6.4.0-next.
|
|
29
|
-
"@esri/solution-feature-layer": "^6.4.0-next.
|
|
30
|
-
"@esri/solution-file": "^6.4.0-next.
|
|
31
|
-
"@esri/solution-form": "^6.4.0-next.
|
|
32
|
-
"@esri/solution-group": "^6.4.0-next.
|
|
33
|
-
"@esri/solution-hub-types": "^6.4.0-next.
|
|
34
|
-
"@esri/solution-simple-types": "^6.4.0-next.
|
|
35
|
-
"@esri/solution-storymap": "^6.4.0-next.
|
|
36
|
-
"@esri/solution-velocity": "^6.4.0-next.
|
|
37
|
-
"@esri/solution-web-experience": "^6.4.0-next.
|
|
38
|
-
"@esri/solution-web-tool": "^6.4.0-next.
|
|
39
|
-
"@esri/solution-workflow": "^6.4.0-next.
|
|
28
|
+
"@esri/solution-common": "^6.4.0-next.20251001",
|
|
29
|
+
"@esri/solution-feature-layer": "^6.4.0-next.20251001",
|
|
30
|
+
"@esri/solution-file": "^6.4.0-next.20251001",
|
|
31
|
+
"@esri/solution-form": "^6.4.0-next.20251001",
|
|
32
|
+
"@esri/solution-group": "^6.4.0-next.20251001",
|
|
33
|
+
"@esri/solution-hub-types": "^6.4.0-next.20251001",
|
|
34
|
+
"@esri/solution-simple-types": "^6.4.0-next.20251001",
|
|
35
|
+
"@esri/solution-storymap": "^6.4.0-next.20251001",
|
|
36
|
+
"@esri/solution-velocity": "^6.4.0-next.20251001",
|
|
37
|
+
"@esri/solution-web-experience": "^6.4.0-next.20251001",
|
|
38
|
+
"@esri/solution-web-tool": "^6.4.0-next.20251001",
|
|
39
|
+
"@esri/solution-workflow": "^6.4.0-next.20251001",
|
|
40
40
|
"tslib": "1.14.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"esri",
|
|
92
92
|
"ES6"
|
|
93
93
|
],
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "eafd90493d46f86f6ed435c36edef7e697352f93"
|
|
95
95
|
}
|