@toolsplus/nx-forge 6.1.0-test-tunnel-ui-kit.1 → 6.1.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/package.json +2 -2
- package/src/executors/build/lib/copy-forge-app-assets.js +2 -13
- package/src/executors/build/lib/copy-forge-app-assets.js.map +1 -1
- package/src/executors/build/lib/process-resource-dependencies.js +16 -4
- package/src/executors/build/lib/process-resource-dependencies.js.map +1 -1
- package/src/executors/package/schema.json +1 -1
- package/src/executors/tunnel/executor.js +2 -12
- package/src/executors/tunnel/executor.js.map +1 -1
- package/src/executors/tunnel/lib/extract-custom-ui-projects.js +2 -2
- package/src/executors/tunnel/lib/extract-custom-ui-projects.js.map +1 -1
- package/src/generators/application/files/README.md +17 -9
- package/src/utils/util-fs.d.ts +6 -0
- package/src/utils/util-fs.js +18 -0
- package/src/utils/util-fs.js.map +1 -0
- package/src/executors/tunnel/lib/extract-ui-kit-projects.d.ts +0 -10
- package/src/executors/tunnel/lib/extract-ui-kit-projects.js +0 -52
- package/src/executors/tunnel/lib/extract-ui-kit-projects.js.map +0 -1
- package/src/executors/tunnel/lib/start-ui-kit-project-builds.d.ts +0 -6
- package/src/executors/tunnel/lib/start-ui-kit-project-builds.js +0 -28
- package/src/executors/tunnel/lib/start-ui-kit-project-builds.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolsplus/nx-forge",
|
|
3
|
-
"version": "6.1.0
|
|
3
|
+
"version": "6.1.0",
|
|
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": "^
|
|
10
|
+
"@forge/manifest": "^9.1.0",
|
|
11
11
|
"@nx/devkit": "20.3.1",
|
|
12
12
|
"@nx/eslint": "20.3.1",
|
|
13
13
|
"@nx/jest": "20.3.1",
|
|
@@ -4,22 +4,11 @@ exports.copyForgeAppAssets = copyForgeAppAssets;
|
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
|
|
8
|
-
* Check if a directory exists
|
|
9
|
-
* @param path Path to directory
|
|
10
|
-
*/
|
|
11
|
-
function directoryExists(path) {
|
|
12
|
-
try {
|
|
13
|
-
return (0, fs_1.statSync)(path).isDirectory();
|
|
14
|
-
}
|
|
15
|
-
catch (_a) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
7
|
+
const util_fs_1 = require("../../../utils/util-fs");
|
|
19
8
|
function copyForgeAppAssets(options) {
|
|
20
9
|
devkit_1.logger.info('Copying Forge app assets...');
|
|
21
10
|
const absoluteOutputPath = (0, path_1.resolve)(options.root, options.outputPath);
|
|
22
|
-
if (!directoryExists(absoluteOutputPath)) {
|
|
11
|
+
if (!(0, util_fs_1.directoryExists)(absoluteOutputPath)) {
|
|
23
12
|
(0, fs_1.mkdirSync)(absoluteOutputPath, { recursive: true });
|
|
24
13
|
}
|
|
25
14
|
// Copies the Forge app manifest file from the project root directory into the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-forge-app-assets.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/copy-forge-app-assets.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"copy-forge-app-assets.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/copy-forge-app-assets.ts"],"names":[],"mappings":";;AAQA,gDAiBC;AAzBD,2BAA6C;AAC7C,+BAAqC;AACrC,uCAAoC;AAEpC,oDAAyD;AAIzD,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,eAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAE3C,MAAM,kBAAkB,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAErE,IAAI,CAAC,IAAA,yBAAe,EAAC,kBAAkB,CAAC,EAAE,CAAC;QACzC,IAAA,cAAS,EAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,8EAA8E;IAC9E,0BAA0B;IAC1B,IAAA,iBAAY,EACV,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,EACvD,IAAA,WAAI,EAAC,kBAAkB,EAAE,cAAc,CAAC,CACzC,CAAC;IAEF,eAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -6,6 +6,7 @@ const fs_1 = require("fs");
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const manifest_yml_1 = require("../../../utils/forge/manifest-yml");
|
|
8
8
|
const util_manifest_1 = require("../../../shared/manifest/util-manifest");
|
|
9
|
+
const util_fs_1 = require("../../../utils/util-fs");
|
|
9
10
|
/**
|
|
10
11
|
* Verifies that UI resource projects are correctly linked to the Nx Forge app
|
|
11
12
|
* and copies build artifacts into the app's output directory. In particular,
|
|
@@ -24,9 +25,14 @@ async function processResourceDependencies(options, context) {
|
|
|
24
25
|
});
|
|
25
26
|
const resources = (_a = manifestSchema.resources) !== null && _a !== void 0 ? _a : [];
|
|
26
27
|
const uiResources = resources.filter((0, util_manifest_1.isResourceType)(manifestSchema, ['ui-kit', 'custom-ui']));
|
|
27
|
-
|
|
28
|
-
.
|
|
29
|
-
|
|
28
|
+
if (uiResources.length > 0) {
|
|
29
|
+
devkit_1.logger.info(`Detected the following UI resources in the manifest.yml:\n${uiResources
|
|
30
|
+
.map((r) => ` - ${r.key}`)
|
|
31
|
+
.join('\n')}`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
devkit_1.logger.info(`Plugin did not detected any UI resources in the manifest.yml`);
|
|
35
|
+
}
|
|
30
36
|
uiResources.forEach((r) => verifyAndCopyResourceDependency(r, context, options));
|
|
31
37
|
return uiResources;
|
|
32
38
|
}
|
|
@@ -76,7 +82,13 @@ const verifyAndCopyResourceDependency = (resource, context, options) => {
|
|
|
76
82
|
throw new Error(`Project ${resourceProjectName} has no build artifacts in output directory '${resourceBuildTargetOutputPath}'. Make sure the project produces compatible build artifacts.`);
|
|
77
83
|
}
|
|
78
84
|
devkit_1.logger.info(`Copying ${resource.key} (${resourceProjectName}) resource build artifacts...`);
|
|
79
|
-
|
|
85
|
+
const absoluteResourceOutputPath = (0, devkit_1.joinPathFragments)(options.root, options.outputPath, options.resourcePath, resourceProjectName);
|
|
86
|
+
if ((0, util_fs_1.directoryExists)(absoluteResourceOutputPath)) {
|
|
87
|
+
(0, fs_1.rmSync)(absoluteResourceOutputPath, { recursive: true });
|
|
88
|
+
}
|
|
89
|
+
(0, fs_extra_1.copySync)(absoluteResourceBuildTargetOutputPath, absoluteResourceOutputPath, {
|
|
90
|
+
recursive: true,
|
|
91
|
+
});
|
|
80
92
|
devkit_1.logger.info(`Done copying ${resource.key} (${resourceProjectName}) resource build artifacts.`);
|
|
81
93
|
};
|
|
82
94
|
//# 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":";;
|
|
1
|
+
{"version":3,"file":"process-resource-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/process-resource-dependencies.ts"],"names":[],"mappings":";;AAiCA,kEAgCC;AAjED,uCAAoC;AACpC,2BAAqD;AACrD,uCAMoB;AAIpB,oEAAoE;AACpE,0EAAwE;AACxE,oDAAyD;AASzD;;;;;;;;;GASG;A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
|
14
|
-
"description": "Path where resource files such as Custom UI
|
|
14
|
+
"description": "Path where resource files such as Custom UI output is placed relative to the outputPath."
|
|
15
15
|
},
|
|
16
16
|
"resourceOutputPathMap": {
|
|
17
17
|
"type": "object",
|
|
@@ -7,8 +7,6 @@ const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
|
7
7
|
const run_tunnel_1 = tslib_1.__importStar(require("./lib/run-tunnel"));
|
|
8
8
|
const extract_custom_ui_projects_1 = require("./lib/extract-custom-ui-projects");
|
|
9
9
|
const start_custom_uis_1 = require("./lib/start-custom-uis");
|
|
10
|
-
const start_ui_kit_project_builds_1 = require("./lib/start-ui-kit-project-builds");
|
|
11
|
-
const extract_ui_kit_projects_1 = require("./lib/extract-ui-kit-projects");
|
|
12
10
|
/**
|
|
13
11
|
* Forge tunnel executor that serves dependent Custom UI projects on the tunnel
|
|
14
12
|
* port configured in the manifest.yml.
|
|
@@ -37,9 +35,7 @@ async function runTunnelExecutor(options, context) {
|
|
|
37
35
|
}
|
|
38
36
|
// execute the tunnel target on the focused project
|
|
39
37
|
const forgeTunnelIter = promiseToIterator((0, run_tunnel_1.default)({ ...options, customUIProjectConfigs }, context));
|
|
40
|
-
const
|
|
41
|
-
const uiKitIters = await (0, start_ui_kit_project_builds_1.startUIKitProjectBuilds)(options.outputPath, uiKitProjects, context);
|
|
42
|
-
const combined = (0, async_iterable_1.combineAsyncIterables)(forgeAppBuildIter, ...customUIIters, forgeTunnelIter, ...uiKitIters);
|
|
38
|
+
const combined = (0, async_iterable_1.combineAsyncIterables)(forgeAppBuildIter, ...customUIIters, forgeTunnelIter);
|
|
43
39
|
try {
|
|
44
40
|
for await (const output of combined) {
|
|
45
41
|
if (!output.success)
|
|
@@ -52,13 +48,7 @@ async function runTunnelExecutor(options, context) {
|
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
50
|
catch (err) {
|
|
55
|
-
|
|
56
|
-
devkit_1.logger.error(`Failed to tunnel Forge app: ${JSON.stringify(err)}:
|
|
57
|
-
[\n${err.errors.map((e) => ` ${e.message}: ${e.stack}`).join('\n')}\n]`);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
devkit_1.logger.error(`Failed to tunnel Forge app: ${err}`);
|
|
61
|
-
}
|
|
51
|
+
devkit_1.logger.error(`Failed to tunnel Forge app: ${err}`);
|
|
62
52
|
return await combined.return({ success: false });
|
|
63
53
|
}
|
|
64
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/tunnel/executor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/executors/tunnel/executor.ts"],"names":[],"mappings":";;AAmBA,oCAmDC;;AAtED,uCAAkE;AAClE,wEAA4E;AAE5E,uEAA0E;AAC1E,iFAAuE;AACvE,6DAAwD;AAExD;;;;;;;;;;;GAWG;AACY,KAAK,UAAU,iBAAiB,CAC7C,OAA8B,EAC9B,OAAwB;;IAExB,MAAM,sBAAsB,GAAG,MAAM,IAAA,gDAAmB,EAAC,OAAO,CAAC,CAAC;IAElE,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAc,EAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAE5E,MAAM,iBAAiB,GAAG,MAAM,IAAA,oBAAW,EACzC,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,EACjD,EAAE,KAAK,EAAE,IAAI,EAAE,EACf,OAAO,CACR,CAAC;IAEF,MAAM,IAAA,oBAAW,EACf,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EACnD,EAAE,EACF,OAAO,CACR,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAA,OAAO,CAAC,gBAAgB,mCAAI,IAAI,CAAC;QAC1D,MAAM,IAAA,w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b,MAAM,MAAM,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -44,10 +44,10 @@ const verifyCustomUIDependency = (context) => (resource) => {
|
|
|
44
44
|
const customUIProjectName = resource.path;
|
|
45
45
|
const customUIProjectConfiguration = context.projectsConfigurations.projects[customUIProjectName];
|
|
46
46
|
if (!customUIProjectConfiguration) {
|
|
47
|
-
throw new Error(`Nx workspace is missing project for Custom UI
|
|
47
|
+
throw new Error(`Nx workspace is missing project for Custom UI path ${customUIProjectName}. Make sure the Custom UI resource path references a project in your Nx workspace.`);
|
|
48
48
|
}
|
|
49
49
|
if (!customUIProjectConfiguration.targets['serve']) {
|
|
50
|
-
throw new Error(`Custom UI project '${customUIProjectName}' targets
|
|
50
|
+
throw new Error(`Custom UI project '${customUIProjectName}' targets is missing a 'serve' executor. Make sure the the project has a 'serve' target inferred, or the 'targets' property in the project's 'project.json' has a 'serve' executor configured.`);
|
|
51
51
|
}
|
|
52
52
|
if (!resource.tunnel || !Number.isInteger(resource.tunnel.port)) {
|
|
53
53
|
throw new Error(`Custom UI resource with key ${resource.key} is missing tunnel port in manifest.yml. Follow the Forge docs on how to add a tunnel port to the Custom UI resource with key ${resource.key}: https://developer.atlassian.com/platform/forge/tunneling/#connecting-the-tunnel-to-your-own-dev-server`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-custom-ui-projects.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/tunnel/lib/extract-custom-ui-projects.ts"],"names":[],"mappings":";;AAcA,kDAQC;AAtBD,uCAAgE;AAGhE,oEAAoE;AACpE,0EAAwE;AAIxE;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAChE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1B,WAAW,EAAE,CAAC,CAAC,IAAI;QACnB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;KACpB,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;;;;GAWG;AACH,KAAK,UAAU,+BAA+B,CAC5C,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,GAAc,MAAA,cAAc,CAAC,SAAS,mCAAI,EAAE,CAAC;IAC5D,OAAO,SAAS;SACb,MAAM,CAAC,IAAA,8BAAc,EAAC,cAAc,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;SACrD,GAAG,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,wBAAwB,GAC5B,CAAC,OAAwB,EAAE,EAAE,CAC7B,CAAC,QAA+B,EAA0B,EAAE;IAC1D,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC;IAE1C,MAAM,4BAA4B,GAChC,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAE/D,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb
|
|
1
|
+
{"version":3,"file":"extract-custom-ui-projects.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/tunnel/lib/extract-custom-ui-projects.ts"],"names":[],"mappings":";;AAcA,kDAQC;AAtBD,uCAAgE;AAGhE,oEAAoE;AACpE,0EAAwE;AAIxE;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,+BAA+B,CAAC,OAAO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gMAAgM,CAC1O,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CACb,+BAA+B,QAAQ,CAAC,GAAG,iIAAiI,QAAQ,CAAC,GAAG,0GAA0G,CACnS,CAAC;IACJ,CAAC;IAED,OAAO,QAAkC,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
# <%= name %>
|
|
2
2
|
|
|
3
|
+
For the most up-to-date Nx Forge plugin documentation refer to https://toolsplus.github.io/nx-forge/
|
|
4
|
+
|
|
3
5
|
## Prerequisites
|
|
4
6
|
|
|
5
7
|
Before you can start using this app with Forge make sure to initially build the app using
|
|
6
8
|
|
|
7
9
|
nx build <%= name %>
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
and package it using
|
|
12
|
+
|
|
13
|
+
nx package <%= name %>
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
After that, proceed with the initial registration of the app with the Forge platform by running the following commands (from the workspace root):
|
|
16
|
+
|
|
17
|
+
nx register <%= name %>
|
|
18
|
+
nx deploy <%= name %>
|
|
19
|
+
nx install <%= name %> --site <my-atlassian-site.atlassian.net> --product jira --no-interactive
|
|
14
20
|
|
|
15
21
|
This will initially register the app with the Forge platform, deploy the code and finally install the app on any of your Atlassian applications.
|
|
16
22
|
|
|
@@ -18,9 +24,9 @@ This will initially register the app with the Forge platform, deploy the code an
|
|
|
18
24
|
|
|
19
25
|
Before you tunnel a Forge app, make sure you have completed the prerequisites steps above. After that, run
|
|
20
26
|
|
|
21
|
-
nx
|
|
27
|
+
nx tunnel <%= name %>
|
|
22
28
|
|
|
23
|
-
This will start the `
|
|
29
|
+
This will start the `tunnel` target for all UI projects defined in the app `manifest.yml` on their specified tunnel port. After that, it will start a build process in watch mode for the Forge app itself, before ultimately, starting the `forge tunnel` process for the Forge app.
|
|
24
30
|
|
|
25
31
|
## Manual dev loop
|
|
26
32
|
|
|
@@ -28,12 +34,14 @@ When the app code changes, the updated code has to rebuilt by calling
|
|
|
28
34
|
|
|
29
35
|
nx build <%= name %>
|
|
30
36
|
|
|
37
|
+
then re-packaged with
|
|
38
|
+
|
|
39
|
+
nx package <%= name %>
|
|
40
|
+
|
|
31
41
|
and re-deployed to the Forge platform using
|
|
32
42
|
|
|
33
43
|
nx deploy <%= name %>
|
|
34
44
|
|
|
35
45
|
If the app's `manifest.yml` changed, you may have to upgrade an existing installation by running
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
from within the dist directory.
|
|
47
|
+
nx install <%= name %> --site <my-atlassian-site.atlassian.net> --product jira --upgrade
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.directoryExists = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
/**
|
|
6
|
+
* Check if a directory exists
|
|
7
|
+
* @param path Path to directory
|
|
8
|
+
*/
|
|
9
|
+
const directoryExists = (path) => {
|
|
10
|
+
try {
|
|
11
|
+
return (0, fs_1.statSync)(path).isDirectory();
|
|
12
|
+
}
|
|
13
|
+
catch (_a) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.directoryExists = directoryExists;
|
|
18
|
+
//# sourceMappingURL=util-fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util-fs.js","sourceRoot":"","sources":["../../../../../packages/nx-forge/src/utils/util-fs.ts"],"names":[],"mappings":";;;AAAA,2BAAwC;AAExC;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,IAAc,EAAW,EAAE;IACzD,IAAI,CAAC;QACH,OAAO,IAAA,aAAQ,EAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AANW,QAAA,eAAe,mBAM1B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
/**
|
|
3
|
-
* Extracts all configured UI Kit resources for this Forge app.
|
|
4
|
-
*
|
|
5
|
-
* @param context Executor context for this call
|
|
6
|
-
* @returns UI Kit project names.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getUIKitProjects(context: ExecutorContext): Promise<{
|
|
9
|
-
projectName: string;
|
|
10
|
-
}[]>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUIKitProjects = getUIKitProjects;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const manifest_yml_1 = require("../../../utils/forge/manifest-yml");
|
|
6
|
-
const util_manifest_1 = require("../../../shared/manifest/util-manifest");
|
|
7
|
-
/**
|
|
8
|
-
* Extracts all configured UI Kit resources for this Forge app.
|
|
9
|
-
*
|
|
10
|
-
* @param context Executor context for this call
|
|
11
|
-
* @returns UI Kit project names.
|
|
12
|
-
*/
|
|
13
|
-
async function getUIKitProjects(context) {
|
|
14
|
-
const projects = await extractVerifiedUIKitProjects(context);
|
|
15
|
-
return projects.map((p) => ({
|
|
16
|
-
projectName: p.path,
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts all UI Kit projects from the manifest.yml
|
|
21
|
-
*
|
|
22
|
-
* This will assert that:
|
|
23
|
-
*
|
|
24
|
-
* - the Nx workspace has a project configured for each UI Kit project
|
|
25
|
-
* - each UI Kit project has a 'build' target
|
|
26
|
-
*
|
|
27
|
-
* @param context Executor context for this call
|
|
28
|
-
* @returns All configured and verified UI Kit resources
|
|
29
|
-
*/
|
|
30
|
-
async function extractVerifiedUIKitProjects(context) {
|
|
31
|
-
var _a;
|
|
32
|
-
const manifestPath = (0, devkit_1.joinPathFragments)(context.root, context.projectsConfigurations.projects[context.projectName].root, 'manifest.yml');
|
|
33
|
-
const manifestSchema = await (0, manifest_yml_1.readManifestYml)(manifestPath, {
|
|
34
|
-
interpolate: false,
|
|
35
|
-
});
|
|
36
|
-
const resources = (_a = manifestSchema.resources) !== null && _a !== void 0 ? _a : [];
|
|
37
|
-
return resources
|
|
38
|
-
.filter((0, util_manifest_1.isResourceType)(manifestSchema, ['ui-kit']))
|
|
39
|
-
.map(verifyUIKitDependency(context));
|
|
40
|
-
}
|
|
41
|
-
const verifyUIKitDependency = (context) => (resource) => {
|
|
42
|
-
const uiKitProjectName = resource.path;
|
|
43
|
-
const uiKitProjectConfiguration = context.projectsConfigurations.projects[uiKitProjectName];
|
|
44
|
-
if (!uiKitProjectConfiguration) {
|
|
45
|
-
throw new Error(`Nx workspace is missing project for UI Kit resource path ${uiKitProjectName}. Make sure the UI Kit resource path references a project in your Nx workspace.`);
|
|
46
|
-
}
|
|
47
|
-
if (!uiKitProjectConfiguration.targets['build']) {
|
|
48
|
-
throw new Error(`UI Kit project '${uiKitProjectName}' targets are missing a 'build' target. Make sure the the project has a 'build' target inferred, or the 'targets' property in the project's 'project.json' has a 'build' target configured.`);
|
|
49
|
-
}
|
|
50
|
-
return resource;
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=extract-ui-kit-projects.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-ui-kit-projects.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/tunnel/lib/extract-ui-kit-projects.ts"],"names":[],"mappings":";;AAYA,4CAOC;AAnBD,uCAAgE;AAGhE,oEAAoE;AACpE,0EAAwE;AAExE;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CACpC,OAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,4BAA4B,CAAC,OAAO,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CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startUIKitProjectBuilds = startUIKitProjectBuilds;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function startUIKitProjectBuilds(outputPath, uiKitProjects, context) {
|
|
6
|
-
var _a;
|
|
7
|
-
const forgeAppProjectConfiguration = context.projectsConfigurations.projects[context.projectName];
|
|
8
|
-
if (!forgeAppProjectConfiguration) {
|
|
9
|
-
throw new Error(`Failed to start UI Kit project builds: Nx workspace is missing project configuration for project ${context.projectName}.`);
|
|
10
|
-
}
|
|
11
|
-
const packageTargetConfiguration = forgeAppProjectConfiguration.targets['package'];
|
|
12
|
-
if (!packageTargetConfiguration) {
|
|
13
|
-
throw new Error(`Failed to start UI Kit project builds: Failed to read 'package' target configuration for project ${context.projectName}.`);
|
|
14
|
-
}
|
|
15
|
-
const resourcePath = (_a = packageTargetConfiguration.options.resourcePath) !== null && _a !== void 0 ? _a : 'resources';
|
|
16
|
-
const uiKitIters = [];
|
|
17
|
-
for (const { projectName } of uiKitProjects) {
|
|
18
|
-
uiKitIters.push(await (0, devkit_1.runExecutor)({
|
|
19
|
-
project: projectName,
|
|
20
|
-
target: 'build',
|
|
21
|
-
}, {
|
|
22
|
-
watch: true,
|
|
23
|
-
outputPath: (0, devkit_1.joinPathFragments)(context.root, outputPath, resourcePath, projectName),
|
|
24
|
-
}, context));
|
|
25
|
-
}
|
|
26
|
-
return uiKitIters;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=start-ui-kit-project-builds.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-ui-kit-project-builds.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/tunnel/lib/start-ui-kit-project-builds.ts"],"names":[],"mappings":";;AAQA,0DA+CC;AAvDD,uCAKoB;AAGb,KAAK,UAAU,uBAAuB,CAC3C,UAAkB,EAClB,aAAwC,EACxC,OAAwB;;IAExB,MAAM,4BAA4B,GAChC,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/D,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,oGAAoG,OAAO,CAAC,WAAW,GAAG,CAC3H,CAAC;IACJ,CAAC;IAED,MAAM,0BAA0B,GAC9B,4BAA4B,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClD,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,oGAAoG,OAAO,CAAC,WAAW,GAAG,CAC3H,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAChB,MAAA,0BAA0B,CAAC,OAAO,CAAC,YAAY,mCAAI,WAAW,CAAC;IAEjE,MAAM,UAAU,GAA0C,EAAE,CAAC;IAE7D,KAAK,MAAM,EAAE,WAAW,EAAE,IAAI,aAAa,EAAE,CAAC;QAC5C,UAAU,CAAC,IAAI,CACb,MAAM,IAAA,oBAAW,EACf;YACE,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,OAAO;SAChB,EACD;YACE,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,IAAA,0BAAiB,EAC3B,OAAO,CAAC,IAAI,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,CACZ;SACF,EACD,OAAO,CACR,CACF,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|