@toolsplus/nx-forge 6.0.1 → 6.0.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/package.json +3 -2
- package/src/executors/build/executor.js +24 -40
- package/src/executors/build/executor.js.map +1 -1
- package/src/executors/build/lib/normalize-options.js +9 -2
- package/src/executors/build/lib/normalize-options.js.map +1 -1
- package/src/executors/build/lib/patch-manifest-yml.js +33 -22
- package/src/executors/build/lib/patch-manifest-yml.js.map +1 -1
- package/src/executors/build/lib/process-resource-dependencies.js +14 -12
- package/src/executors/build/lib/process-resource-dependencies.js.map +1 -1
- package/src/executors/deploy/executor.js +24 -24
- package/src/executors/deploy/executor.js.map +1 -1
- package/src/executors/deploy/lib/transform-manifest-yml.js +5 -5
- package/src/executors/deploy/lib/transform-manifest-yml.js.map +1 -1
- package/src/executors/install/executor.js +19 -22
- package/src/executors/install/executor.js.map +1 -1
- package/src/executors/package/executor.js +31 -29
- package/src/executors/package/executor.js.map +1 -1
- package/src/executors/register/executor.js +23 -26
- package/src/executors/register/executor.js.map +1 -1
- package/src/executors/register/lib/normalize-options.js +6 -2
- package/src/executors/register/lib/normalize-options.js.map +1 -1
- package/src/executors/register/lib/patch-manifest-yml.js +16 -13
- package/src/executors/register/lib/patch-manifest-yml.js.map +1 -1
- package/src/executors/tunnel/executor.js +32 -49
- package/src/executors/tunnel/executor.js.map +1 -1
- package/src/executors/tunnel/lib/extract-custom-ui-projects.js +14 -19
- package/src/executors/tunnel/lib/extract-custom-ui-projects.js.map +1 -1
- package/src/executors/tunnel/lib/run-tunnel.js +72 -76
- package/src/executors/tunnel/lib/run-tunnel.js.map +1 -1
- package/src/executors/tunnel/lib/start-custom-uis.js +6 -9
- package/src/executors/tunnel/lib/start-custom-uis.js.map +1 -1
- package/src/generators/application/generator.js +84 -57
- package/src/generators/application/generator.js.map +1 -1
- package/src/generators/application/lib/add-project-dependencies.js +33 -32
- package/src/generators/application/lib/add-project-dependencies.js.map +1 -1
- package/src/generators/application/lib/normalize-options.js +26 -21
- package/src/generators/application/lib/normalize-options.js.map +1 -1
- package/src/generators/init/generator.js +16 -20
- package/src/generators/init/generator.js.map +1 -1
- package/src/graph/create-dependencies.js +11 -23
- package/src/graph/create-dependencies.js.map +1 -1
- package/src/migrations/update-2-3-0/remove-implicit-custom-ui-dependencies.js +15 -18
- package/src/migrations/update-2-3-0/remove-implicit-custom-ui-dependencies.js.map +1 -1
- package/src/migrations/update-2-3-0/utils/manifest.js +3 -3
- package/src/migrations/update-2-3-0/utils/manifest.js.map +1 -1
- package/src/migrations/update-3-0-0-webpack-config-setup/update-3-0-0-webpack-config-setup.js +15 -18
- package/src/migrations/update-3-0-0-webpack-config-setup/update-3-0-0-webpack-config-setup.js.map +1 -1
- package/src/shared/manifest/util-manifest.d.ts +18 -9
- package/src/shared/manifest/util-manifest.js +53 -37
- package/src/shared/manifest/util-manifest.js.map +1 -1
- package/src/utils/forge/async-commands.js +1 -1
- package/src/utils/forge/async-commands.js.map +1 -1
- package/src/utils/forge/manifest-yml.d.ts +3 -1
- package/src/utils/forge/manifest-yml.js +8 -7
- package/src/utils/forge/manifest-yml.js.map +1 -1
- package/src/utils/forge/yaml-validator.d.ts +19 -0
- package/src/utils/forge/yaml-validator.js +73 -0
- package/src/utils/forge/yaml-validator.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolsplus/nx-forge",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "Atlassian Forge plugin for Nx",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"generators": "./generators.json",
|
|
8
8
|
"executors": "./executors.json",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@forge/manifest": "^8.
|
|
10
|
+
"@forge/manifest": "^8.6.0",
|
|
11
11
|
"@nx/devkit": "20.3.1",
|
|
12
12
|
"@nx/eslint": "20.3.1",
|
|
13
13
|
"@nx/jest": "20.3.1",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@nx/webpack": "20.3.1",
|
|
16
16
|
"fs-extra": "^10.0.1",
|
|
17
17
|
"js-yaml": "^4.1.0",
|
|
18
|
+
"yaml": "*",
|
|
18
19
|
"jsonata": "^2.0.5",
|
|
19
20
|
"tslib": "^2.3.0"
|
|
20
21
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const node_fs_1 = require("node:fs");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
@@ -26,48 +25,33 @@ function fileExists(path) {
|
|
|
26
25
|
*
|
|
27
26
|
* @deprecated
|
|
28
27
|
*/
|
|
29
|
-
function runExecutor(rawOptions, context) {
|
|
30
|
-
|
|
31
|
-
var _a, e_1, _b, _c;
|
|
32
|
-
devkit_1.logger.warn(`The build executor is deprecated and will be removed in the next major nx-forge plugin release.
|
|
28
|
+
async function runExecutor(rawOptions, context) {
|
|
29
|
+
devkit_1.logger.warn(`The build executor is deprecated and will be removed in the next major nx-forge plugin release.
|
|
33
30
|
|
|
34
31
|
Use a default Nx 'webpack' or 'esbuild' executor to build, and the 'package' executor to assemble the Forge app.`);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_d = false;
|
|
49
|
-
const result = _c;
|
|
50
|
-
if (!result.success) {
|
|
51
|
-
throw new Error(`Failed to compile files for project ${context.projectName}.`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
56
|
-
finally {
|
|
57
|
-
try {
|
|
58
|
-
if (!_d && !_a && (_b = compilation_1.return)) yield _b.call(compilation_1);
|
|
59
|
-
}
|
|
60
|
-
finally { if (e_1) throw e_1.error; }
|
|
32
|
+
const { root, sourceRoot } = context.projectsConfigurations.projects[context.projectName];
|
|
33
|
+
if (!sourceRoot) {
|
|
34
|
+
throw new Error(`${context.projectName} does not have a sourceRoot.`);
|
|
35
|
+
}
|
|
36
|
+
if (!root) {
|
|
37
|
+
throw new Error(`${context.projectName} does not have a root.`);
|
|
38
|
+
}
|
|
39
|
+
const options = (0, normalize_options_1.normalizeOptions)(rawOptions, context.root, sourceRoot, root);
|
|
40
|
+
if (fileExists(`${options.projectRoot}/src/index.ts`)) {
|
|
41
|
+
const compilation = (0, compile_webpack_1.compileWebpack)(options, context);
|
|
42
|
+
for await (const result of compilation) {
|
|
43
|
+
if (!result.success) {
|
|
44
|
+
throw new Error(`Failed to compile files for project ${context.projectName}.`);
|
|
61
45
|
}
|
|
62
46
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
47
|
+
}
|
|
48
|
+
(0, copy_forge_app_assets_1.copyForgeAppAssets)(options);
|
|
49
|
+
const resources = await (0, process_resource_dependencies_1.processResourceDependencies)({ ...options, resourcePath: options.customUIPath }, context);
|
|
50
|
+
await (0, patch_manifest_yml_1.patchManifestYml)({ ...options, resourcePath: options.customUIPath });
|
|
51
|
+
(0, generate_package_json_1.generatePackageJson)(context.projectName, context.projectGraph, resources, options);
|
|
52
|
+
devkit_1.logger.info('Executor ran for build');
|
|
53
|
+
return {
|
|
54
|
+
success: true,
|
|
55
|
+
};
|
|
72
56
|
}
|
|
73
57
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/build/executor.ts"],"names":[],"mappings":";;AA2BA,8BAoDC
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/build/executor.ts"],"names":[],"mappings":";;AA2BA,8BAoDC;AA/ED,qCAA6C;AAE7C,uCAAoC;AAEpC,+DAA2D;AAC3D,uFAAkF;AAClF,iEAA4D;AAC5D,uEAAkE;AAClE,2DAAuD;AACvD,uEAAiE;AAEjE,SAAS,UAAU,CAAC,IAAc;IAChC,IAAI,CAAC;QACH,OAAO,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACY,KAAK,UAAU,WAAW,CACvC,UAAgC,EAChC,OAAwB;IAExB,eAAM,CAAC,IAAI,CACT;;qHAEiH,CAClH,CAAC;IAEF,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,8BAA8B,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,wBAAwB,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAE7E,IAAI,UAAU,CAAC,GAAG,OAAO,CAAC,WAAW,eAAe,CAAC,EAAE,CAAC;QACtD,MAAM,WAAW,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACrD,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CACb,uCAAuC,OAAO,CAAC,WAAW,GAAG,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAA,0CAAkB,EAAC,OAAO,CAAC,CAAC;IAE5B,MAAM,SAAS,GAAG,MAAM,IAAA,2DAA2B,EACjD,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,EAClD,OAAO,CACR,CAAC;IACF,MAAM,IAAA,qCAAgB,EAAC,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC3E,IAAA,2CAAmB,EACjB,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,YAAY,EACpB,SAAS,EACT,OAAO,CACR,CAAC;IAEF,eAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACtC,OAAO;QACL,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -3,8 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
function normalizeOptions(options, root, sourceRoot, projectRoot) {
|
|
5
5
|
var _a, _b, _c;
|
|
6
|
-
return
|
|
6
|
+
return {
|
|
7
|
+
...options,
|
|
8
|
+
root,
|
|
7
9
|
sourceRoot,
|
|
8
|
-
projectRoot,
|
|
10
|
+
projectRoot,
|
|
11
|
+
customUIPath: (_a = options.customUIPath) !== null && _a !== void 0 ? _a : 'customUI',
|
|
12
|
+
resourceOutputPathMap: (_b = options.resourceOutputPathMap) !== null && _b !== void 0 ? _b : {},
|
|
13
|
+
outputFileName: 'index.js',
|
|
14
|
+
watch: (_c = options.watch) !== null && _c !== void 0 ? _c : false,
|
|
15
|
+
};
|
|
9
16
|
}
|
|
10
17
|
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/normalize-options.ts"],"names":[],"mappings":";;AAEA,4CAgBC;AAhBD,SAAgB,gBAAgB,CAC9B,OAA6B,EAC7B,IAAY,EACZ,UAAkB,EAClB,WAAmB;;IAEnB,
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/normalize-options.ts"],"names":[],"mappings":";;AAEA,4CAgBC;AAhBD,SAAgB,gBAAgB,CAC9B,OAA6B,EAC7B,IAAY,EACZ,UAAkB,EAClB,WAAmB;;IAEnB,OAAO;QACL,GAAG,OAAO;QACV,IAAI;QACJ,UAAU;QACV,WAAW;QACX,YAAY,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU;QAChD,qBAAqB,EAAE,MAAA,OAAO,CAAC,qBAAqB,mCAAI,EAAE;QAC1D,cAAc,EAAE,UAAU;QAC1B,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,KAAK;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchManifestYml = patchManifestYml;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const path_1 = require("path");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const manifest_yml_1 = require("../../../utils/forge/manifest-yml");
|
|
@@ -17,44 +16,53 @@ const util_manifest_1 = require("../../../shared/manifest/util-manifest");
|
|
|
17
16
|
*
|
|
18
17
|
* @param options Executor options
|
|
19
18
|
*/
|
|
20
|
-
function patchManifestYml(options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const patchedManifest = patchManifestInternal(absoluteOutputPath, manifestSchema, options);
|
|
27
|
-
(0, manifest_yml_1.writeManifestYml)(manifestPath, patchedManifest);
|
|
28
|
-
devkit_1.logger.info(`Done patching ${manifestPath}.`);
|
|
19
|
+
async function patchManifestYml(options) {
|
|
20
|
+
const absoluteOutputPath = (0, path_1.resolve)(options.root, options.outputPath);
|
|
21
|
+
const manifestPath = (0, devkit_1.joinPathFragments)(absoluteOutputPath, 'manifest.yml');
|
|
22
|
+
devkit_1.logger.info(`Patching ${manifestPath}...`);
|
|
23
|
+
const manifestSchema = await (0, manifest_yml_1.readManifestYml)(manifestPath, {
|
|
24
|
+
interpolate: false,
|
|
29
25
|
});
|
|
26
|
+
const patchedManifest = patchManifestInternal(absoluteOutputPath, manifestSchema, options);
|
|
27
|
+
(0, manifest_yml_1.writeManifestYml)(manifestPath, patchedManifest);
|
|
28
|
+
devkit_1.logger.info(`Done patching ${manifestPath}.`);
|
|
30
29
|
}
|
|
31
30
|
function patchManifestInternal(absoluteOutputPath, manifestSchema, options) {
|
|
32
31
|
const resources = manifestSchema.resources || [];
|
|
33
32
|
const uiResources = resources.filter((0, util_manifest_1.isResourceType)(manifestSchema, ['ui-kit', 'custom-ui']));
|
|
34
|
-
const
|
|
33
|
+
const staticResources = resources.filter((0, util_manifest_1.isResourceType)(manifestSchema, ['static']));
|
|
35
34
|
// Integrity check: We want to be sure that we are not losing any resource
|
|
36
|
-
// definitions when separating them into UI and
|
|
35
|
+
// definitions when separating them into UI and static resources.
|
|
37
36
|
const resourceKeySet = new Set(resources.map((r) => r.key));
|
|
38
37
|
const uiResourcesKeySet = new Set(uiResources.map((r) => r.key));
|
|
39
|
-
const
|
|
40
|
-
const missingResourceKeys = [...resourceKeySet].filter((k) => !uiResourcesKeySet.has(k) && !
|
|
38
|
+
const staticResourcesKeySet = new Set(staticResources.map((r) => r.key));
|
|
39
|
+
const missingResourceKeys = [...resourceKeySet].filter((k) => !uiResourcesKeySet.has(k) && !staticResourcesKeySet.has(k));
|
|
41
40
|
if (missingResourceKeys.length > 0) {
|
|
42
41
|
devkit_1.logger.warn(`Failed to determine resource type for resource definitions with keys ${missingResourceKeys}.
|
|
43
42
|
|
|
44
43
|
This is most likely a plugin error and should be fixed. Please include the manifest.yml in the issue report.`);
|
|
45
44
|
}
|
|
46
45
|
if (!options.uiKit2Packaging) {
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
return {
|
|
47
|
+
...manifestSchema,
|
|
48
|
+
resources: [
|
|
49
|
+
...uiResources.map((resource) => ({
|
|
50
|
+
...resource,
|
|
51
|
+
path: `${options.resourcePath}/${resource.path}`,
|
|
52
|
+
})),
|
|
53
|
+
...staticResources,
|
|
54
|
+
],
|
|
55
|
+
};
|
|
51
56
|
}
|
|
52
57
|
else {
|
|
53
58
|
const resourceTypeIndex = (0, util_manifest_1.getResourceTypeIndex)(manifestSchema);
|
|
54
|
-
return
|
|
59
|
+
return {
|
|
60
|
+
...manifestSchema,
|
|
61
|
+
resources: [
|
|
55
62
|
...uiResources.map((r) => patchResource(options.resourcePath, r, absoluteOutputPath, resourceTypeIndex[r.key])),
|
|
56
|
-
...
|
|
57
|
-
]
|
|
63
|
+
...staticResources,
|
|
64
|
+
],
|
|
65
|
+
};
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
/**
|
|
@@ -101,6 +109,9 @@ function patchResource(resourcePath, resource, absoluteOutputPath, resourceType)
|
|
|
101
109
|
return resource;
|
|
102
110
|
}
|
|
103
111
|
const verifiedResourcePath = getVerifiedResourcePath(resourcePath, resourceType, resource, absoluteOutputPath);
|
|
104
|
-
return
|
|
112
|
+
return {
|
|
113
|
+
...resource,
|
|
114
|
+
path: verifiedResourcePath,
|
|
115
|
+
};
|
|
105
116
|
}
|
|
106
117
|
//# sourceMappingURL=patch-manifest-yml.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/patch-manifest-yml.ts"],"names":[],"mappings":";;AAkCA,
|
|
1
|
+
{"version":3,"file":"patch-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/patch-manifest-yml.ts"],"names":[],"mappings":";;AAkCA,4CAmBC;AArDD,+BAAqC;AACrC,uCAAuD;AAIvD,oEAG2C;AAC3C,2BAAgC;AAChC,0EAKgD;AAShD;;;;;;;;;GASG;AACI,KAAK,UAAU,gBAAgB,CAAC,OAAgB;IACrD,MAAM,kBAAkB,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrE,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;IAE3E,eAAM,CAAC,IAAI,CAAC,YAAY,YAAY,KAAK,CAAC,CAAC;IAE3C,MAAM,cAAc,GAAG,MAAM,IAAA,8BAAe,EAAC,YAAY,EAAE;QACzD,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,qBAAqB,CAC3C,kBAAkB,EAClB,cAAc,EACd,OAAO,CACR,CAAC;IAEF,IAAA,+BAAgB,EAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IAEhD,eAAM,CAAC,IAAI,CAAC,iBAAiB,YAAY,GAAG,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,qBAAqB,CAC5B,kBAA0B,EAC1B,cAA8B,EAC9B,OAAgB;IAEhB,MAAM,SAAS,GAAc,cAAc,CAAC,SAAS,IAAI,EAAE,CAAC;IAC5D,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAClC,IAAA,8BAAc,EAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CACxD,CAAC;IACF,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,CACtC,IAAA,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C,CAAC,CACvD,CAAC;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,GAAG,oBAAoB,IAAI,cAAc,EAAE,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,sCACE,QAAQ,CAAC,GACX,yCAAyC,oBAAoB,2EAA2E,wBAAwB,CAAC,IAAI,CACnK,GAAG,CACJ,GAAG,CACL,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CACpB,YAAoB,EACpB,QAA+B,EAC/B,kBAA0B,EAC1B,YAA2B;IAE3B,eAAM,CAAC,IAAI,CAAC,+BAA+B,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC;IAE/D,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,eAAM,CAAC,IAAI,CACT,sBAAsB,QAAQ,CAAC,GAAG,wDAAwD,CAC3F,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,oBAAoB,GAAG,uBAAuB,CAClD,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,kBAAkB,CACnB,CAAC;IAEF,OAAO;QACL,GAAG,QAAQ;QACX,IAAI,EAAE,oBAAoB;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processResourceDependencies = processResourceDependencies;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const fs_extra_1 = require("fs-extra");
|
|
6
5
|
const fs_1 = require("fs");
|
|
7
6
|
const devkit_1 = require("@nx/devkit");
|
|
@@ -17,16 +16,19 @@ const util_manifest_1 = require("../../../shared/manifest/util-manifest");
|
|
|
17
16
|
* @param options Executor options
|
|
18
17
|
* @param context Executor context
|
|
19
18
|
*/
|
|
20
|
-
function processResourceDependencies(options, context) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const resources = (_a = manifestSchema.resources) !== null && _a !== void 0 ? _a : [];
|
|
26
|
-
const uiResources = resources.filter((0, util_manifest_1.isResourceType)(manifestSchema, ['ui-kit', 'custom-ui']));
|
|
27
|
-
uiResources.forEach((r) => verifyAndCopyResourceDependency(r, context, options));
|
|
28
|
-
return uiResources;
|
|
19
|
+
async function processResourceDependencies(options, context) {
|
|
20
|
+
var _a;
|
|
21
|
+
const manifestPath = (0, devkit_1.joinPathFragments)(context.root, context.projectsConfigurations.projects[context.projectName].root, 'manifest.yml');
|
|
22
|
+
const manifestSchema = await (0, manifest_yml_1.readManifestYml)(manifestPath, {
|
|
23
|
+
interpolate: false,
|
|
29
24
|
});
|
|
25
|
+
const resources = (_a = manifestSchema.resources) !== null && _a !== void 0 ? _a : [];
|
|
26
|
+
const uiResources = resources.filter((0, util_manifest_1.isResourceType)(manifestSchema, ['ui-kit', 'custom-ui']));
|
|
27
|
+
devkit_1.logger.info(`Detected the following UI resources in the manifest.yml:\n${uiResources
|
|
28
|
+
.map((r) => ` - ${r.key}`)
|
|
29
|
+
.join('\n')}`);
|
|
30
|
+
uiResources.forEach((r) => verifyAndCopyResourceDependency(r, context, options));
|
|
31
|
+
return uiResources;
|
|
30
32
|
}
|
|
31
33
|
const getResourceOutputPath = (options, resourceProjectGraphNode, configurationName) => {
|
|
32
34
|
var _a, _b;
|
|
@@ -73,8 +75,8 @@ const verifyAndCopyResourceDependency = (resource, context, options) => {
|
|
|
73
75
|
(0, fs_1.readdirSync)(absoluteResourceBuildTargetOutputPath).length === 0) {
|
|
74
76
|
throw new Error(`Project ${resourceProjectName} has no build artifacts in output directory '${resourceBuildTargetOutputPath}'. Make sure the project produces compatible build artifacts.`);
|
|
75
77
|
}
|
|
76
|
-
devkit_1.logger.info(`Copying ${resourceProjectName} resource build artifacts...`);
|
|
78
|
+
devkit_1.logger.info(`Copying ${resource.key} (${resourceProjectName}) resource build artifacts...`);
|
|
77
79
|
(0, fs_extra_1.copySync)(absoluteResourceBuildTargetOutputPath, (0, devkit_1.joinPathFragments)(options.root, options.outputPath, options.resourcePath, resourceProjectName), { recursive: true });
|
|
78
|
-
devkit_1.logger.info(`Done copying ${resourceProjectName} resource build artifacts.`);
|
|
80
|
+
devkit_1.logger.info(`Done copying ${resource.key} (${resourceProjectName}) resource build artifacts.`);
|
|
79
81
|
};
|
|
80
82
|
//# sourceMappingURL=process-resource-dependencies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-resource-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/process-resource-dependencies.ts"],"names":[],"mappings":";;AAgCA,
|
|
1
|
+
{"version":3,"file":"process-resource-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/process-resource-dependencies.ts"],"names":[],"mappings":";;AAgCA,kEA4BC;AA5DD,uCAAoC;AACpC,2BAA6C;AAC7C,uCAMoB;AAIpB,oEAAoE;AACpE,0EAAwE;AASxE;;;;;;;;;GASG;AACI,KAAK,UAAU,2BAA2B,CAC/C,OAAgB,EAChB,OAAwB;;IAExB,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,EACjE,cAAc,CACf,CAAC;IACF,MAAM,cAAc,GAAG,MAAM,IAAA,8BAAe,EAAC,YAAY,EAAE;QACzD,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,MAAA,cAAc,CAAC,SAAS,mCAAI,EAAE,CAAC;IACjD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAClC,IAAA,8BAAc,EAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CACxD,CAAC;IAEF,eAAM,CAAC,IAAI,CACT,6DAA6D,WAAW;SACrE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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AClB,OAAO,CAAC,YAAY,EACpB,mBAAmB,CACpB,EACD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;IACF,eAAM,CAAC,IAAI,CACT,gBAAgB,QAAQ,CAAC,GAAG,KAAK,mBAAmB,6BAA6B,CAClF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const async_commands_1 = require("../../utils/forge/async-commands");
|
|
7
6
|
const transform_manifest_yml_1 = require("./lib/transform-manifest-yml");
|
|
8
7
|
const normalizeOptions = (options, context) => {
|
|
9
8
|
const isEnvironmentName = (c) => ['development', 'staging', 'production'].includes(c);
|
|
10
9
|
if (isEnvironmentName(context.configurationName)) {
|
|
11
|
-
return
|
|
10
|
+
return {
|
|
11
|
+
...options,
|
|
12
|
+
environment: context.configurationName,
|
|
13
|
+
};
|
|
12
14
|
}
|
|
13
15
|
else {
|
|
14
16
|
return options;
|
|
15
17
|
}
|
|
16
18
|
};
|
|
17
|
-
function runExecutor(rawOptions, context) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
cwd: options.outputPath,
|
|
34
|
-
});
|
|
35
|
-
devkit_1.logger.log('✅ Forge app deployed');
|
|
36
|
-
return {
|
|
37
|
-
success: true,
|
|
38
|
-
};
|
|
19
|
+
async function runExecutor(rawOptions, context) {
|
|
20
|
+
const options = normalizeOptions(rawOptions, context);
|
|
21
|
+
if (options.manifestTransform && options.manifestTransform !== '') {
|
|
22
|
+
devkit_1.logger.info(`Applying Forge manifest transformation ${context.configurationName ? `(${context.configurationName})` : ''}: ${options.manifestTransform}`);
|
|
23
|
+
await (0, transform_manifest_yml_1.transformManifestYml)(options, context);
|
|
24
|
+
}
|
|
25
|
+
const args = [
|
|
26
|
+
'deploy',
|
|
27
|
+
`--environment=${options.environment}`,
|
|
28
|
+
...(options.verbose === true ? ['--verbose'] : []),
|
|
29
|
+
...(options.verify === false ? ['--no-verify'] : []),
|
|
30
|
+
...(options.interactive === false ? ['--non-interactive'] : []),
|
|
31
|
+
];
|
|
32
|
+
devkit_1.logger.log(`Running: forge ${args.join(' ')}`);
|
|
33
|
+
await (0, async_commands_1.runForgeCommandAsync)(args, {
|
|
34
|
+
cwd: options.outputPath,
|
|
39
35
|
});
|
|
36
|
+
devkit_1.logger.log('✅ Forge app deployed');
|
|
37
|
+
return {
|
|
38
|
+
success: true,
|
|
39
|
+
};
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/deploy/executor.ts"],"names":[],"mappings":";;AAwBA,8BAiCC
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/deploy/executor.ts"],"names":[],"mappings":";;AAwBA,8BAiCC;AAzDD,uCAAqD;AAErD,qEAAwE;AACxE,yEAAoE;AAEpE,MAAM,gBAAgB,GAAG,CACvB,OAA8B,EAC9B,OAAwB,EACD,EAAE;IACzB,MAAM,iBAAiB,GAAG,CACxB,CAAS,EACkC,EAAE,CAC7C,CAAC,aAAa,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEvD,IAAI,iBAAiB,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACjD,OAAO;YACL,GAAG,OAAO;YACV,WAAW,EAAE,OAAO,CAAC,iBAAiB;SACv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,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsonata_1 = tslib_1.__importDefault(require("jsonata"));
|
|
6
6
|
const manifest_yml_1 = require("../../../utils/forge/manifest-yml");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const transformManifestYml = (options, context) =>
|
|
8
|
+
const transformManifestYml = async (options, context) => {
|
|
9
9
|
var _a;
|
|
10
10
|
let expression;
|
|
11
11
|
try {
|
|
@@ -15,7 +15,7 @@ const transformManifestYml = (options, context) => tslib_1.__awaiter(void 0, voi
|
|
|
15
15
|
throw new Error(`Failed to parse expression '${options.manifestTransform}': ${(_a = error.message) !== null && _a !== void 0 ? _a : JSON.stringify(error)}`);
|
|
16
16
|
}
|
|
17
17
|
const manifestPath = (0, devkit_1.joinPathFragments)(context.root, options.outputPath, 'manifest.yml');
|
|
18
|
-
const manifest =
|
|
18
|
+
const manifest = await (0, manifest_yml_1.readManifestYml)(manifestPath);
|
|
19
19
|
expression.registerFunction('env', (s) => {
|
|
20
20
|
if (process.env[s]) {
|
|
21
21
|
return process.env[s];
|
|
@@ -25,11 +25,11 @@ const transformManifestYml = (options, context) => tslib_1.__awaiter(void 0, voi
|
|
|
25
25
|
}
|
|
26
26
|
}, '<s:(s)>');
|
|
27
27
|
expression.registerFunction('envOrNull', (s) => process.env[s], '<s:(sl)>');
|
|
28
|
-
const transformedManifest =
|
|
28
|
+
const transformedManifest = await expression.evaluate(manifest);
|
|
29
29
|
if (options.verify) {
|
|
30
|
-
|
|
30
|
+
await (0, manifest_yml_1.validateManifestContent)(transformedManifest);
|
|
31
31
|
}
|
|
32
32
|
(0, manifest_yml_1.writeManifestYml)(manifestPath, transformedManifest);
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
exports.transformManifestYml = transformManifestYml;
|
|
35
35
|
//# sourceMappingURL=transform-manifest-yml.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/deploy/lib/transform-manifest-yml.ts"],"names":[],"mappings":";;;;AAAA,8DAA8C;AAE9C,oEAI2C;AAC3C,uCAAgE;AAOzD,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"transform-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/deploy/lib/transform-manifest-yml.ts"],"names":[],"mappings":";;;;AAAA,8DAA8C;AAE9C,oEAI2C;AAC3C,uCAAgE;AAOzD,MAAM,oBAAoB,GAAG,KAAK,EACvC,OAAgB,EAChB,OAAwB,EACxB,EAAE;;IACF,IAAI,UAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,UAAU,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,+BAA+B,OAAO,CAAC,iBAAiB,MACtD,MAAA,KAAK,CAAC,OAAO,mCAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CACvC,EAAE,CACH,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,UAAU,EAClB,cAAc,CACf,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAe,EAAC,YAAY,CAAC,CAAC;IAErD,UAAU,CAAC,gBAAgB,CACzB,KAAK,EACL,CAAC,CAAC,EAAE,EAAE;QACJ,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACnB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,EACD,SAAS,CACV,CAAC;IACF,UAAU,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAE5E,MAAM,mBAAmB,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEhE,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAA,sCAAuB,EAAC,mBAAmB,CAAC,CAAC;IACrD,CAAC;IAED,IAAA,+BAAgB,EAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;AACtD,CAAC,CAAC;AA3CW,QAAA,oBAAoB,wBA2C/B"}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const async_commands_1 = require("../../utils/forge/async-commands");
|
|
7
|
-
function runExecutor(options) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
cwd: options.outputPath,
|
|
23
|
-
});
|
|
24
|
-
devkit_1.logger.info('✅ Forge app installed');
|
|
25
|
-
return {
|
|
26
|
-
success: true,
|
|
27
|
-
};
|
|
6
|
+
async function runExecutor(options) {
|
|
7
|
+
// https://developer.atlassian.com/platform/forge/cli-reference/install/
|
|
8
|
+
const args = [
|
|
9
|
+
'install',
|
|
10
|
+
`--site=${options.site}`,
|
|
11
|
+
`--product=${options.product}`,
|
|
12
|
+
`--environment=${options.environment}`,
|
|
13
|
+
...(options.upgrade === true ? ['--upgrade'] : []),
|
|
14
|
+
...(options.confirmScopes === true ? ['--confirm-scopes'] : []),
|
|
15
|
+
...(options.interactive === false ? ['--non-interactive'] : []),
|
|
16
|
+
...(options.verbose === true ? ['--verbose'] : []),
|
|
17
|
+
];
|
|
18
|
+
devkit_1.logger.log(`Running: forge ${args.join(' ')}`);
|
|
19
|
+
await (0, async_commands_1.runForgeCommandAsync)(args, {
|
|
20
|
+
cwd: options.outputPath,
|
|
28
21
|
});
|
|
22
|
+
devkit_1.logger.info('✅ Forge app installed');
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
};
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/install/executor.ts"],"names":[],"mappings":";;AAIA,8BAwBC
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/install/executor.ts"],"names":[],"mappings":";;AAIA,8BAwBC;AA3BD,uCAAoC;AACpC,qEAAwE;AAEzD,KAAK,UAAU,WAAW,CAAC,OAA+B;IACvE,wEAAwE;IACxE,MAAM,IAAI,GAAG;QACX,SAAS;QACT,UAAU,OAAO,CAAC,IAAI,EAAE;QACxB,aAAa,OAAO,CAAC,OAAO,EAAE;QAC9B,iBAAiB,OAAO,CAAC,WAAW,EAAE;QACtC,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACnD,CAAC;IAEF,eAAM,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAE/C,MAAM,IAAA,qCAAoB,EAAC,IAAI,EAAE;QAC/B,GAAG,EAAE,OAAO,CAAC,UAAU;KACxB,CAAC,CAAC;IAEH,eAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAErC,OAAO;QACL,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
exports.default = runExecutor;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const process_resource_dependencies_1 = require("../build/lib/process-resource-dependencies");
|
|
8
7
|
const patch_manifest_yml_1 = require("../build/lib/patch-manifest-yml");
|
|
@@ -10,36 +9,39 @@ const generate_package_json_1 = require("./lib/generate-package-json");
|
|
|
10
9
|
const copy_forge_app_assets_1 = require("../build/lib/copy-forge-app-assets");
|
|
11
10
|
function normalizeOptions(options, root, sourceRoot, projectRoot) {
|
|
12
11
|
var _a, _b;
|
|
13
|
-
return
|
|
12
|
+
return {
|
|
13
|
+
...options,
|
|
14
|
+
root,
|
|
14
15
|
sourceRoot,
|
|
15
|
-
projectRoot,
|
|
16
|
+
projectRoot,
|
|
17
|
+
resourcePath: (_a = options.resourcePath) !== null && _a !== void 0 ? _a : 'resources',
|
|
18
|
+
resourceOutputPathMap: (_b = options.resourceOutputPathMap) !== null && _b !== void 0 ? _b : {},
|
|
19
|
+
};
|
|
16
20
|
}
|
|
17
|
-
function runExecutor(rawOptions, context) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
manifestResources: resources,
|
|
38
|
-
});
|
|
39
|
-
devkit_1.logger.info('Executor ran for package');
|
|
40
|
-
return {
|
|
41
|
-
success: true,
|
|
42
|
-
};
|
|
21
|
+
async function runExecutor(rawOptions, context) {
|
|
22
|
+
const { root, sourceRoot } = context.projectsConfigurations.projects[context.projectName];
|
|
23
|
+
if (!sourceRoot) {
|
|
24
|
+
throw new Error(`${context.projectName} does not have a sourceRoot.`);
|
|
25
|
+
}
|
|
26
|
+
if (!root) {
|
|
27
|
+
throw new Error(`${context.projectName} does not have a root.`);
|
|
28
|
+
}
|
|
29
|
+
const options = normalizeOptions(rawOptions, context.root, sourceRoot, root);
|
|
30
|
+
(0, copy_forge_app_assets_1.copyForgeAppAssets)(options);
|
|
31
|
+
const resources = await (0, process_resource_dependencies_1.processResourceDependencies)({ ...options, resourcePath: options.resourcePath }, context);
|
|
32
|
+
await (0, patch_manifest_yml_1.patchManifestYml)({ ...options, resourcePath: options.resourcePath });
|
|
33
|
+
(0, generate_package_json_1.generatePackageJson)({
|
|
34
|
+
root: options.root,
|
|
35
|
+
projectRoot: options.projectRoot,
|
|
36
|
+
outputPath: options.outputPath,
|
|
37
|
+
tsConfig: options.tsConfig,
|
|
38
|
+
projectName: context.projectName,
|
|
39
|
+
projectGraph: context.projectGraph,
|
|
40
|
+
manifestResources: resources,
|
|
43
41
|
});
|
|
42
|
+
devkit_1.logger.info('Executor ran for package');
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
};
|
|
44
46
|
}
|
|
45
47
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/package/executor.ts"],"names":[],"mappings":";;AAOA,4CAcC;AAED,8BAwCC
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/package/executor.ts"],"names":[],"mappings":";;AAOA,4CAcC;AAED,8BAwCC;AA/DD,uCAAqD;AAErD,8FAAyF;AACzF,wEAAmE;AACnE,uEAAkE;AAClE,8EAAwE;AAExE,SAAgB,gBAAgB,CAC9B,OAA8B,EAC9B,IAAY,EACZ,UAAkB,EAClB,WAAmB;;IAEnB,OAAO;QACL,GAAG,OAAO;QACV,IAAI;QACJ,UAAU;QACV,WAAW;QACX,YAAY,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,WAAW;QACjD,qBAAqB,EAAE,MAAA,OAAO,CAAC,qBAAqB,mCAAI,EAAE;KAC3D,CAAC;AACJ,CAAC;AAEc,KAAK,UAAU,WAAW,CACvC,UAAiC,EACjC,OAAwB;IAExB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,8BAA8B,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,wBAAwB,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAE7E,IAAA,0CAAkB,EAAC,OAAO,CAAC,CAAC;IAE5B,MAAM,SAAS,GAAG,MAAM,IAAA,2DAA2B,EACjD,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YA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