@toolsplus/nx-forge 2.0.1 → 2.2.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 +23 -15
- package/executors.json +10 -1
- package/package.json +1 -1
- package/src/executors/build/executor.js +3 -2
- package/src/executors/build/executor.js.map +1 -1
- package/src/executors/deploy/executor.js +3 -20
- package/src/executors/deploy/executor.js.map +1 -1
- package/src/executors/install/executor.d.ts +4 -0
- package/src/executors/install/executor.js +30 -0
- package/src/executors/install/executor.js.map +1 -0
- package/src/executors/install/schema.d.ts +10 -0
- package/src/executors/install/schema.json +66 -0
- package/src/executors/register/executor.d.ts +5 -0
- package/src/executors/register/executor.js +36 -0
- package/src/executors/register/executor.js.map +1 -0
- package/src/executors/register/lib/normalize-options.d.ts +2 -0
- package/src/executors/register/lib/normalize-options.js +11 -0
- package/src/executors/register/lib/normalize-options.js.map +1 -0
- package/src/executors/register/lib/patch-manifest-yml.d.ts +8 -0
- package/src/executors/register/lib/patch-manifest-yml.js +32 -0
- package/src/executors/register/lib/patch-manifest-yml.js.map +1 -0
- package/src/executors/register/schema.d.ts +13 -0
- package/src/executors/register/schema.json +31 -0
- package/src/generators/application/generator.js +1 -2
- package/src/generators/application/generator.js.map +1 -1
- package/src/generators/application/lib/add-project.js +5 -0
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/application/lib/get-install-config.d.ts +3 -0
- package/src/generators/application/lib/get-install-config.js +14 -0
- package/src/generators/application/lib/get-install-config.js.map +1 -0
- package/src/generators/application/lib/get-register-config.d.ts +3 -0
- package/src/generators/application/lib/get-register-config.js +14 -0
- package/src/generators/application/lib/get-register-config.js.map +1 -0
- package/src/generators/application/schema.d.ts +3 -1
- package/src/utils/forge/async-commands.d.ts +10 -0
- package/src/utils/forge/async-commands.js +34 -0
- package/src/utils/forge/async-commands.js.map +1 -0
- package/src/utils/forge/load-manifest-yml.js +4 -2
- package/src/utils/forge/load-manifest-yml.js.map +1 -1
package/README.md
CHANGED
|
@@ -127,41 +127,49 @@ Finally, update the `apps/<forge-app-name>/project.json` file in the generated F
|
|
|
127
127
|
|
|
128
128
|
This tells Nx that each time we build our Forge app, it needs to build the Custom UI project first.
|
|
129
129
|
|
|
130
|
-
### Initial build and
|
|
130
|
+
### Initial build, registration, deployment and installation
|
|
131
131
|
|
|
132
132
|
Before you can deploy the Forge app it needs to be registered with the Forge platform. To do this, initially build the Forge app using
|
|
133
133
|
|
|
134
134
|
nx build <forge-app-name>
|
|
135
135
|
|
|
136
|
-
Once that's finished,
|
|
136
|
+
Once that's finished, run
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
forge register
|
|
140
|
-
forge deploy
|
|
141
|
-
forge install
|
|
142
|
-
```
|
|
138
|
+
nx register <forge-app-name>
|
|
143
139
|
|
|
144
|
-
|
|
140
|
+
This will use `<forge-app-name>` by default as the app name on the Forge platform. If you would like to use a different name add the app name flag as follows: `--appName="My Forge App"`.
|
|
145
141
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
Then run
|
|
143
|
+
|
|
144
|
+
nx deploy <forge-app-name>
|
|
145
|
+
|
|
146
|
+
to deploy the Forge app to the default development environment.
|
|
147
|
+
|
|
148
|
+
Finally, install the app in any of your sites with the following command
|
|
149
|
+
|
|
150
|
+
nx install <forge-app-name>
|
|
151
|
+
|
|
152
|
+
The Forge app is now registered, deployed and installed with the Forge platform.
|
|
150
153
|
|
|
151
154
|
That's it for the setup steps. You can now generate additional Custom UI resources, generate shared Nx libraries to keep shared app logic and depend on it in one or more Forge apps.
|
|
152
155
|
|
|
153
156
|
## Using the Nx Forge plugin
|
|
154
157
|
|
|
155
|
-
|
|
158
|
+
For any of the plugin targets below append `--help` or `-h` to explore all available options.
|
|
156
159
|
|
|
160
|
+
### Register
|
|
161
|
+
Run `nx register <forge-app-name>` to register the Forge app with the Forge platform.
|
|
162
|
+
|
|
163
|
+
### Build
|
|
157
164
|
Run `nx build <forge-app-name>` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
158
165
|
|
|
159
166
|
### Deploy
|
|
160
|
-
|
|
161
167
|
Run `nx deploy <forge-app-name>` to deploy the project. The build artifacts will be deployed using the Forge CLI deploy command.
|
|
162
168
|
|
|
163
|
-
###
|
|
169
|
+
### Install
|
|
170
|
+
Run `nx install <forge-app-name>` to install the Forge app. The CLI will prompt for site, product if they are not provided as parameters.
|
|
164
171
|
|
|
172
|
+
### Tunnel (experimental)
|
|
165
173
|
Run `nx serve <forge-app-name>` to serve the project. This will start the `serve` target for all Custom 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.
|
|
166
174
|
|
|
167
175
|
## Further help on how to develop with Nx
|
package/executors.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"executors": {
|
|
4
|
+
"register": {
|
|
5
|
+
"implementation": "./src/executors/register/executor",
|
|
6
|
+
"schema": "./src/executors/register/schema.json",
|
|
7
|
+
"description": "register executor"
|
|
8
|
+
},
|
|
4
9
|
"build": {
|
|
5
10
|
"implementation": "./src/executors/build/executor",
|
|
6
11
|
"schema": "./src/executors/build/schema.json",
|
|
@@ -15,7 +20,11 @@
|
|
|
15
20
|
"implementation": "./src/executors/tunnel/executor",
|
|
16
21
|
"schema": "./src/executors/tunnel/schema.json",
|
|
17
22
|
"description": "tunnel executor"
|
|
23
|
+
},
|
|
24
|
+
"install": {
|
|
25
|
+
"implementation": "./src/executors/install/executor",
|
|
26
|
+
"schema": "./src/executors/install/schema.json",
|
|
27
|
+
"description": "install executor"
|
|
18
28
|
}
|
|
19
|
-
|
|
20
29
|
}
|
|
21
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
5
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
5
6
|
const process_custom_ui_dependencies_1 = require("./lib/process-custom-ui-dependencies");
|
|
6
7
|
const patch_manifest_yml_1 = require("./lib/patch-manifest-yml");
|
|
@@ -10,7 +11,7 @@ const copy_forge_app_assets_1 = require("./lib/copy-forge-app-assets");
|
|
|
10
11
|
function runExecutor(rawOptions, context) {
|
|
11
12
|
var _a, e_1, _b, _c;
|
|
12
13
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
const { root, sourceRoot } = context.
|
|
14
|
+
const { root, sourceRoot } = context.projectsConfigurations.projects[context.projectName];
|
|
14
15
|
if (!sourceRoot) {
|
|
15
16
|
throw new Error(`${context.projectName} does not have a sourceRoot.`);
|
|
16
17
|
}
|
|
@@ -45,7 +46,7 @@ function runExecutor(rawOptions, context) {
|
|
|
45
46
|
const customUIResources = yield (0, process_custom_ui_dependencies_1.processCustomUIDependencies)(options, context);
|
|
46
47
|
yield (0, patch_manifest_yml_1.patchManifestYml)(options);
|
|
47
48
|
(0, generate_package_json_1.generatePackageJson)(context.projectName, context.projectGraph, customUIResources, options);
|
|
48
|
-
|
|
49
|
+
devkit_1.logger.info('Executor ran for build');
|
|
49
50
|
return {
|
|
50
51
|
success: true,
|
|
51
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/build/executor.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/build/executor.ts"],"names":[],"mappings":";;;AACA,uCAAoC;AAEpC,+DAA2D;AAC3D,yFAAmF;AACnF,iEAA4D;AAC5D,uEAAkE;AAClE,2DAAuD;AACvD,uEAAiE;AAEjE,SAA8B,WAAW,CACvC,UAAgC,EAChC,OAAwB;;;QAExB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,sBAAuB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAC,CAAC;QAEjE,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,8BAA8B,CAAC,CAAC;SACvE;QAED,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,wBAAwB,CAAC,CAAC;SACjE;QAED,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAC7E,MAAM,WAAW,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;YAErD,KAA2B,eAAA,gBAAA,sBAAA,WAAW,CAAA,iBAAA;gBAAX,2BAAW;gBAAX,WAAW;;oBAA3B,MAAM,MAAM,KAAA,CAAA;oBACrB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;wBACnB,MAAM,IAAI,KAAK,CACb,uCAAuC,OAAO,CAAC,WAAW,GAAG,CAC9D,CAAC;qBACH;;;;;aACF;;;;;;;;;QAED,IAAA,0CAAkB,EAAC,OAAO,CAAC,CAAC;QAC5B,MAAM,iBAAiB,GAAG,MAAM,IAAA,4DAA2B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9E,MAAM,IAAA,qCAAgB,EAAC,OAAO,CAAC,CAAC;QAChC,IAAA,2CAAmB,EACjB,OAAO,CAAC,WAAY,EACpB,OAAO,CAAC,YAAa,EACrB,iBAAiB,EACjB,OAAO,CACR,CAAC;QAEF,eAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACtC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;;CACH;AAxCD,8BAwCC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const child_process_1 = require("child_process");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const async_commands_1 = require("../../utils/forge/async-commands");
|
|
6
6
|
function runExecutor(options) {
|
|
7
7
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
8
|
const args = [
|
|
@@ -12,26 +12,9 @@ function runExecutor(options) {
|
|
|
12
12
|
...(options.verify === false ? ['--no-verify'] : []),
|
|
13
13
|
...(options.interactive === false ? ['--non-interactive'] : []),
|
|
14
14
|
];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// https://2ality.com/2018/05/child-process-streams.html#running-commands-in-child-processes
|
|
18
|
-
const deploymentProcess = (0, child_process_1.spawn)('forge', args, {
|
|
15
|
+
devkit_1.logger.log(`Running: forge ${args.join(' ')}`);
|
|
16
|
+
yield (0, async_commands_1.runForgeCommandAsync)(args, {
|
|
19
17
|
cwd: options.outputPath,
|
|
20
|
-
stdio: [process.stdin, process.stdout, process.stderr],
|
|
21
|
-
});
|
|
22
|
-
// https://2ality.com/2018/05/child-process-streams.html#waiting-for-a-child-process-to-exit-via-a-promise
|
|
23
|
-
yield new Promise((resolve, reject) => {
|
|
24
|
-
deploymentProcess.once('exit', (code) => {
|
|
25
|
-
if (code === 0) {
|
|
26
|
-
resolve(undefined);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
reject(new Error('Exit with error code: ' + code));
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
deploymentProcess.once('error', (err) => {
|
|
33
|
-
reject(err);
|
|
34
|
-
});
|
|
35
18
|
});
|
|
36
19
|
devkit_1.logger.log('✅ Forge app deployed');
|
|
37
20
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/deploy/executor.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/deploy/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC,qEAAwE;AAExE,SAA8B,WAAW,CAAC,OAA8B;;QACtE,MAAM,IAAI,GAAG;YACX,QAAQ;YACR,iBAAiB,OAAO,CAAC,WAAW,EAAE;YACtC,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAChE,CAAC;QAEF,eAAM,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE/C,MAAM,IAAA,qCAAoB,EAAC,IAAI,EAAE;YAC/B,GAAG,EAAE,OAAO,CAAC,UAAU;SACxB,CAAC,CAAC;QAEH,eAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACnC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;CAAA;AAnBD,8BAmBC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const async_commands_1 = require("../../utils/forge/async-commands");
|
|
6
|
+
function runExecutor(options) {
|
|
7
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
// https://developer.atlassian.com/platform/forge/cli-reference/install/
|
|
9
|
+
const args = [
|
|
10
|
+
'install',
|
|
11
|
+
`--site=${options.site}`,
|
|
12
|
+
`--product=${options.product}`,
|
|
13
|
+
`--environment=${options.environment}`,
|
|
14
|
+
...(options.upgrade === true ? ['--upgrade'] : []),
|
|
15
|
+
...(options.confirmScopes === true ? ['--confirm-scopes'] : []),
|
|
16
|
+
...(options.interactive === false ? ['--non-interactive'] : []),
|
|
17
|
+
...(options.verbose === true ? ['--verbose'] : []),
|
|
18
|
+
];
|
|
19
|
+
devkit_1.logger.log(`Running: forge ${args.join(' ')}`);
|
|
20
|
+
yield (0, async_commands_1.runForgeCommandAsync)(args, {
|
|
21
|
+
cwd: options.outputPath,
|
|
22
|
+
});
|
|
23
|
+
devkit_1.logger.info('✅ Forge app installed');
|
|
24
|
+
return {
|
|
25
|
+
success: true,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.default = runExecutor;
|
|
30
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/install/executor.ts"],"names":[],"mappings":";;;AACA,uCAAoC;AACpC,qEAAwE;AAExE,SAA8B,WAAW,CAAC,OAA+B;;QACvE,wEAAwE;QACxE,MAAM,IAAI,GAAG;YACX,SAAS;YACT,UAAU,OAAO,CAAC,IAAI,EAAE;YACxB,aAAa,OAAO,CAAC,OAAO,EAAE;YAC9B,iBAAiB,OAAO,CAAC,WAAW,EAAE;YACtC,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC;QAEF,eAAM,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE/C,MAAM,IAAA,qCAAoB,EAAC,IAAI,EAAE;YAC/B,GAAG,EAAE,OAAO,CAAC,UAAU;SACxB,CAAC,CAAC;QAEH,eAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAErC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;CAAA;AAxBD,8BAwBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InstallExecutorOptions {
|
|
2
|
+
outputPath: string;
|
|
3
|
+
site: string;
|
|
4
|
+
product: 'jira' | 'confluence' | 'compass';
|
|
5
|
+
environment: 'development' | 'staging' | 'production';
|
|
6
|
+
upgrade: boolean;
|
|
7
|
+
confirmScopes: boolean;
|
|
8
|
+
interactive: boolean;
|
|
9
|
+
verbose: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Forge application install target",
|
|
5
|
+
"description": "Manage app installations",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"outputPath": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The output path of the Forge app files.",
|
|
11
|
+
"visible": false
|
|
12
|
+
},
|
|
13
|
+
"site": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Atlassian site URL (example.atlassian.net)",
|
|
16
|
+
"alias": "s"
|
|
17
|
+
},
|
|
18
|
+
"product": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Atlassian product: jira, confluence, compass",
|
|
21
|
+
"enum": [
|
|
22
|
+
"jira",
|
|
23
|
+
"confluence",
|
|
24
|
+
"compass"
|
|
25
|
+
],
|
|
26
|
+
"alias": "p"
|
|
27
|
+
},
|
|
28
|
+
"environment": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": [
|
|
31
|
+
"development",
|
|
32
|
+
"staging",
|
|
33
|
+
"production"
|
|
34
|
+
],
|
|
35
|
+
"description": "Environment to install to: development, staging, production.",
|
|
36
|
+
"alias": "e",
|
|
37
|
+
"default": "development"
|
|
38
|
+
},
|
|
39
|
+
"upgrade": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"description": "Upgrade an existing installation.",
|
|
42
|
+
"default": false
|
|
43
|
+
},
|
|
44
|
+
"confirmScopes": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Skip confirmation of scopes for the app before installing or upgrading the app.",
|
|
47
|
+
"default": false
|
|
48
|
+
},
|
|
49
|
+
"interactive": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Run installation with or without input prompts.",
|
|
52
|
+
"default": true
|
|
53
|
+
},
|
|
54
|
+
"verbose": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"description": "Run installation in verbose mode.",
|
|
57
|
+
"alias": "v",
|
|
58
|
+
"default": false
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": [
|
|
62
|
+
"outputPath",
|
|
63
|
+
"site",
|
|
64
|
+
"product"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const normalize_options_1 = require("./lib/normalize-options");
|
|
6
|
+
const patch_manifest_yml_1 = require("./lib/patch-manifest-yml");
|
|
7
|
+
const async_commands_1 = require("../../utils/forge/async-commands");
|
|
8
|
+
function runExecutor(rawOptions, context) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const { root, sourceRoot } = context.workspace.projects[context.projectName];
|
|
11
|
+
if (!sourceRoot) {
|
|
12
|
+
throw new Error(`${context.projectName} does not have a sourceRoot.`);
|
|
13
|
+
}
|
|
14
|
+
if (!root) {
|
|
15
|
+
throw new Error(`${context.projectName} does not have a root.`);
|
|
16
|
+
}
|
|
17
|
+
const options = (0, normalize_options_1.normalizeOptions)(rawOptions, context.root, sourceRoot, root);
|
|
18
|
+
// https://developer.atlassian.com/platform/forge/cli-reference/register/
|
|
19
|
+
const args = [
|
|
20
|
+
'register',
|
|
21
|
+
...(options.verbose === true ? ['--verbose'] : []),
|
|
22
|
+
options.appName,
|
|
23
|
+
];
|
|
24
|
+
devkit_1.logger.log(`Running: forge ${args.join(' ')}`);
|
|
25
|
+
yield (0, async_commands_1.runForgeCommandAsync)(args, {
|
|
26
|
+
cwd: options.outputPath,
|
|
27
|
+
});
|
|
28
|
+
yield (0, patch_manifest_yml_1.patchManifestYml)(options);
|
|
29
|
+
devkit_1.logger.info('✅ Forge app registered');
|
|
30
|
+
return {
|
|
31
|
+
success: true,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
exports.default = runExecutor;
|
|
36
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/register/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,+DAA2D;AAC3D,iEAA4D;AAC5D,qEAAwE;AAExE,SAA8B,WAAW,CACvC,UAAmC,EACnC,OAAwB;;QAExB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAE7E,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,8BAA8B,CAAC,CAAC;SACvE;QAED,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,wBAAwB,CAAC,CAAC;SACjE;QAED,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAE7E,yEAAyE;QACzE,MAAM,IAAI,GAAG;YACX,UAAU;YACV,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,OAAO,CAAC,OAAO;SAChB,CAAC;QAEF,eAAM,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE/C,MAAM,IAAA,qCAAoB,EAAC,IAAI,EAAE;YAC/B,GAAG,EAAE,OAAO,CAAC,UAAU;SACxB,CAAC,CAAC;QAEH,MAAM,IAAA,qCAAgB,EAAC,OAAO,CAAC,CAAC;QAEhC,eAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAEtC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;CAAA;AApCD,8BAoCC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
function normalizeOptions(options, root, sourceRoot, projectRoot) {
|
|
6
|
+
return Object.assign(Object.assign({}, options), { root,
|
|
7
|
+
sourceRoot,
|
|
8
|
+
projectRoot, outputPath: (0, path_1.resolve)(root, options.outputPath) });
|
|
9
|
+
}
|
|
10
|
+
exports.normalizeOptions = normalizeOptions;
|
|
11
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/register/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAG/B,SAAgB,gBAAgB,CAC9B,OAAgC,EAChC,IAAY,EACZ,UAAkB,EAClB,WAAmB;IAEnB,uCACK,OAAO,KACV,IAAI;QACJ,UAAU;QACV,WAAW,EACX,UAAU,EAAE,IAAA,cAAO,EAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAC7C;AACJ,CAAC;AAbD,4CAaC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NormalizedOptions } from '../schema';
|
|
2
|
+
/**
|
|
3
|
+
* Copies the Forge app id generated by `forge register` from the manifest.yml in the output path to
|
|
4
|
+
* the project manifest.yml in the project root directory.
|
|
5
|
+
*
|
|
6
|
+
* @param options Executor options
|
|
7
|
+
*/
|
|
8
|
+
export declare function patchManifestYml(options: NormalizedOptions): Promise<void>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patchManifestYml = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const js_yaml_1 = require("js-yaml");
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
8
|
+
const load_manifest_yml_1 = require("../../../utils/forge/load-manifest-yml");
|
|
9
|
+
/**
|
|
10
|
+
* Copies the Forge app id generated by `forge register` from the manifest.yml in the output path to
|
|
11
|
+
* the project manifest.yml in the project root directory.
|
|
12
|
+
*
|
|
13
|
+
* @param options Executor options
|
|
14
|
+
*/
|
|
15
|
+
function patchManifestYml(options) {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const outputManifestPath = (0, devkit_1.joinPathFragments)(options.outputPath, 'manifest.yml');
|
|
18
|
+
const outputManifestSchema = yield (0, load_manifest_yml_1.loadManifestYml)(outputManifestPath);
|
|
19
|
+
const appId = outputManifestSchema.app.id;
|
|
20
|
+
const projectManifestPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'manifest.yml');
|
|
21
|
+
const projectManifestSchema = yield (0, load_manifest_yml_1.loadManifestYml)(projectManifestPath);
|
|
22
|
+
devkit_1.logger.info(`Patching project manifest ${projectManifestPath} with app id ${appId}...`);
|
|
23
|
+
const patchedProjectManifest = Object.assign(Object.assign({}, projectManifestSchema), { app: Object.assign(Object.assign({}, projectManifestSchema.app), { id: appId }) });
|
|
24
|
+
const patchedProjectManifestContent = (0, js_yaml_1.dump)(patchedProjectManifest, {});
|
|
25
|
+
(0, fs_1.writeFileSync)(projectManifestPath, patchedProjectManifestContent, {
|
|
26
|
+
encoding: 'utf8',
|
|
27
|
+
});
|
|
28
|
+
devkit_1.logger.info(`Done patching ${projectManifestPath}.`);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.patchManifestYml = patchManifestYml;
|
|
32
|
+
//# sourceMappingURL=patch-manifest-yml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/register/lib/patch-manifest-yml.ts"],"names":[],"mappings":";;;;AAAA,2BAAmC;AACnC,qCAA+B;AAC/B,uCAAuD;AAEvD,8EAAyE;AAEzE;;;;;GAKG;AACH,SAAsB,gBAAgB,CAAC,OAA0B;;QAC/D,MAAM,kBAAkB,GAAG,IAAA,0BAAiB,EAC1C,OAAO,CAAC,UAAU,EAClB,cAAc,CACf,CAAC;QACF,MAAM,oBAAoB,GAAG,MAAM,IAAA,mCAAe,EAAC,kBAAkB,CAAC,CAAC;QAEvE,MAAM,KAAK,GAAW,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;QAElD,MAAM,mBAAmB,GAAG,IAAA,0BAAiB,EAC3C,OAAO,CAAC,WAAW,EACnB,cAAc,CACf,CAAC;QACF,MAAM,qBAAqB,GAAG,MAAM,IAAA,mCAAe,EAAC,mBAAmB,CAAC,CAAC;QAEzE,eAAM,CAAC,IAAI,CACT,6BAA6B,mBAAmB,gBAAgB,KAAK,KAAK,CAC3E,CAAC;QACF,MAAM,sBAAsB,mCACvB,qBAAqB,KACxB,GAAG,kCACE,qBAAqB,CAAC,GAAG,KAC5B,EAAE,EAAE,KAAK,MAEZ,CAAC;QAEF,MAAM,6BAA6B,GAAG,IAAA,cAAI,EAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;QACvE,IAAA,kBAAa,EAAC,mBAAmB,EAAE,6BAA6B,EAAE;YAChE,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;QAEH,eAAM,CAAC,IAAI,CAAC,iBAAiB,mBAAmB,GAAG,CAAC,CAAC;IACvD,CAAC;CAAA;AAhCD,4CAgCC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RegisterExecutorOptions {
|
|
2
|
+
outputPath: string;
|
|
3
|
+
|
|
4
|
+
appName: string;
|
|
5
|
+
verbose: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface NormalizedOptions extends RegisterExecutorOptions {
|
|
9
|
+
root: string;
|
|
10
|
+
sourceRoot: string;
|
|
11
|
+
projectRoot: string;
|
|
12
|
+
outputPath: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Forge application register target",
|
|
5
|
+
"description": "Register an app you didn't create so you can run commands for it",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"outputPath": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The output path of the Forge app files.",
|
|
11
|
+
"visible": false
|
|
12
|
+
},
|
|
13
|
+
"appName": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Name of the app on the Forge platform. The app name can include dashes, spaces, and underscores. Defaults to the project name",
|
|
16
|
+
"$default": {
|
|
17
|
+
"$source": "projectName"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"verbose": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "Run registration in verbose mode.",
|
|
23
|
+
"alias": "v",
|
|
24
|
+
"default": false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"outputPath",
|
|
29
|
+
"appName"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const run_tasks_in_serial_1 = require("@nx/workspace/src/utilities/run-tasks-in-serial");
|
|
6
5
|
const linter_1 = require("@nx/linter");
|
|
7
6
|
const jest_1 = require("@nx/jest");
|
|
8
7
|
const generator_1 = require("../init/generator");
|
|
@@ -51,7 +50,7 @@ function default_1(tree, rawOptions) {
|
|
|
51
50
|
if (!options.skipFormat) {
|
|
52
51
|
yield (0, devkit_1.formatFiles)(tree);
|
|
53
52
|
}
|
|
54
|
-
return (0,
|
|
53
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
55
54
|
});
|
|
56
55
|
}
|
|
57
56
|
exports.default = default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/generators/application/generator.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/generators/application/generator.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AACpB,uCAA0D;AAC1D,mCAAgD;AAChD,iDAA8C;AAE9C,+BAAkE;AAElE,mBACE,IAAU,EACV,UAAuC;;QAEvC,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAEnD,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAa,EAAC,IAAI,EAAE;YACzC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAErB,IAAA,iBAAW,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3B,IAAA,gBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,IAAI,EAAE;YAClC,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAoB,EAAC,IAAI,EAAE;gBAChD,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,aAAa,EAAE;oBACb,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC;iBAC/D;gBACD,kBAAkB,EAAE;oBAClB,GAAG,OAAO,CAAC,cAAc,SAAS,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;iBAC7D;gBACD,UAAU,EAAE,IAAI;gBAChB,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;aACzD,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACtB;QAED,IAAI,OAAO,CAAC,cAAc,KAAK,MAAM,EAAE;YACrC,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAoB,EAAC,IAAI,EAAE;gBAChD,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,SAAS,EAAE,MAAM;gBACjB,eAAe,EAAE,IAAI;gBACrB,UAAU,EAAE,OAAO,CAAC,EAAE;gBACtB,QAAQ,EAAE,KAAK;gBACf,eAAe,EAAE,MAAM;gBACvB,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACtB;QAED,IAAI,OAAO,CAAC,EAAE,EAAE;YACd,IAAA,4BAAmB,EAAC,IAAI,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;SACpE;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAtDD,4BAsDC"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProject = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const get_register_config_1 = require("./get-register-config");
|
|
5
6
|
const get_build_config_1 = require("./get-build-config");
|
|
6
7
|
const get_deploy_config_1 = require("./get-deploy-config");
|
|
7
8
|
const get_serve_config_1 = require("./get-serve-config");
|
|
9
|
+
const get_install_config_1 = require("./get-install-config");
|
|
8
10
|
/**
|
|
9
11
|
* Generate the new Forge app project in the workspace and configure
|
|
10
12
|
* available targets.
|
|
@@ -17,9 +19,12 @@ function addProject(tree, options) {
|
|
|
17
19
|
targets: {},
|
|
18
20
|
tags: options.parsedTags,
|
|
19
21
|
};
|
|
22
|
+
project.targets = {};
|
|
23
|
+
project.targets.register = (0, get_register_config_1.getRegisterConfig)(project, options);
|
|
20
24
|
project.targets.build = (0, get_build_config_1.getBuildConfig)(project, options);
|
|
21
25
|
project.targets.serve = (0, get_serve_config_1.getServeConfig)(project, options);
|
|
22
26
|
project.targets.deploy = (0, get_deploy_config_1.getDeployConfig)(project, options);
|
|
27
|
+
project.targets.install = (0, get_install_config_1.getInstallConfig)(project, options);
|
|
23
28
|
(0, devkit_1.addProjectConfiguration)(tree, options.name, project, options.standaloneConfig);
|
|
24
29
|
}
|
|
25
30
|
exports.addProject = addProject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAEpB,yDAAoD;AACpD,2DAAsD;AACtD,yDAAoD;
|
|
1
|
+
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAEpB,+DAA0D;AAC1D,yDAAoD;AACpD,2DAAsD;AACtD,yDAAoD;AACpD,6DAAwD;AAExD;;;GAGG;AACH,SAAgB,UAAU,CAAC,IAAU,EAAE,OAA0B;IAC/D,MAAM,OAAO,GAAyB;QACpC,IAAI,EAAE,OAAO,CAAC,cAAc;QAC5B,UAAU,EAAE,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC;QAC5D,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,OAAO,CAAC,UAAU;KACzB,CAAC;IAEF,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;IACrB,OAAO,CAAC,OAAO,CAAC,QAAQ,GAAG,IAAA,uCAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,IAAA,iCAAc,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,IAAA,iCAAc,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,IAAA,mCAAe,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,OAAO,CAAC,OAAO,CAAC,OAAO,GAAG,IAAA,qCAAgB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE7D,IAAA,gCAAuB,EACrB,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,OAAO,EACP,OAAO,CAAC,gBAAgB,CACzB,CAAC;AACJ,CAAC;AAtBD,gCAsBC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInstallConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function getInstallConfig(project, options) {
|
|
6
|
+
return {
|
|
7
|
+
executor: '@toolsplus/nx-forge:install',
|
|
8
|
+
options: {
|
|
9
|
+
outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.getInstallConfig = getInstallConfig;
|
|
14
|
+
//# sourceMappingURL=get-install-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-install-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-install-config.ts"],"names":[],"mappings":";;;AACA,uCAIoB;AAEpB,SAAgB,gBAAgB,CAC9B,OAA6B,EAC7B,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,6BAA6B;QACvC,OAAO,EAAE;YACP,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;KACF,CAAC;AACJ,CAAC;AAVD,4CAUC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRegisterConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function getRegisterConfig(project, options) {
|
|
6
|
+
return {
|
|
7
|
+
executor: '@toolsplus/nx-forge:register',
|
|
8
|
+
options: {
|
|
9
|
+
outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.getRegisterConfig = getRegisterConfig;
|
|
14
|
+
//# sourceMappingURL=get-register-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-register-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-register-config.ts"],"names":[],"mappings":";;;AAAA,uCAIoB;AAGpB,SAAgB,iBAAiB,CAC/B,OAA6B,EAC7B,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,8BAA8B;QACxC,OAAO,EAAE;YACP,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;KACF,CAAC;AACJ,CAAC;AAVD,8CAUC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Linter } from '@nx/linter';
|
|
2
|
+
|
|
1
3
|
export interface ApplicationGeneratorOptions {
|
|
2
4
|
name: string;
|
|
3
5
|
directory?: string;
|
|
@@ -13,7 +15,7 @@ export interface ApplicationGeneratorOptions {
|
|
|
13
15
|
|
|
14
16
|
interface NormalizedOptions extends ApplicationGeneratorOptions {
|
|
15
17
|
appProjectRoot: string;
|
|
16
|
-
linter:
|
|
18
|
+
linter: Linter;
|
|
17
19
|
unitTestRunner: UnitTestRunner;
|
|
18
20
|
parsedTags: string[];
|
|
19
21
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs the given Forge CLI command asynchronously.
|
|
3
|
+
*
|
|
4
|
+
* @param args List of string arguments passed to the forge command, e.g. ['lint'], ['version'], or ['deploy', '--verbose']
|
|
5
|
+
* @param opts Execution options
|
|
6
|
+
*/
|
|
7
|
+
export declare const runForgeCommandAsync: (args: string[], opts?: {
|
|
8
|
+
env?: NodeJS.ProcessEnv;
|
|
9
|
+
cwd?: string;
|
|
10
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runForgeCommandAsync = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
/**
|
|
7
|
+
* Runs the given Forge CLI command asynchronously.
|
|
8
|
+
*
|
|
9
|
+
* @param args List of string arguments passed to the forge command, e.g. ['lint'], ['version'], or ['deploy', '--verbose']
|
|
10
|
+
* @param opts Execution options
|
|
11
|
+
*/
|
|
12
|
+
const runForgeCommandAsync = (args, opts = {}) => {
|
|
13
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
14
|
+
const cliProcess = (0, child_process_1.spawn)(pmc.exec, ['forge', ...args], {
|
|
15
|
+
cwd: opts.cwd,
|
|
16
|
+
env: Object.assign(Object.assign({}, process.env), opts.env),
|
|
17
|
+
stdio: [process.stdin, process.stdout, process.stderr],
|
|
18
|
+
});
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
cliProcess.once('exit', (code) => {
|
|
21
|
+
if (code === 0) {
|
|
22
|
+
resolve(undefined);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
reject(new Error('Exit with error code: ' + code));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
cliProcess.once('error', (err) => {
|
|
29
|
+
reject(err);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.runForgeCommandAsync = runForgeCommandAsync;
|
|
34
|
+
//# sourceMappingURL=async-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-commands.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/utils/forge/async-commands.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AACtC,uCAAsD;AAEtD;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAClC,IAAc,EACd,OAAkD,EAAE,EACrC,EAAE;IACjB,MAAM,GAAG,GAAG,IAAA,iCAAwB,GAAE,CAAC;IACvC,MAAM,UAAU,GAAG,IAAA,qBAAK,EAAC,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE;QACrD,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,kCAAO,OAAO,CAAC,GAAG,GAAK,IAAI,CAAC,GAAG,CAAE;QACpC,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;KACvD,CAAC,CAAC;IACH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;YACvC,IAAI,IAAI,KAAK,CAAC,EAAE;gBACd,OAAO,CAAC,SAAS,CAAC,CAAC;aACpB;iBAAM;gBACL,MAAM,CAAC,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC,CAAC;aACpD;QACH,CAAC,CAAC,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YACtC,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAtBW,QAAA,oBAAoB,wBAsB/B"}
|
|
@@ -7,8 +7,10 @@ const FULL_SCHEMA = require("@forge/manifest/out/schema/manifest-schema.json");
|
|
|
7
7
|
function loadManifestYml(manifestPath) {
|
|
8
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
9
|
const { manifestObject, success: isManifestParseSuccess, errors, } = yield new ManifestYmlValidator().process(manifestPath);
|
|
10
|
-
if (!isManifestParseSuccess
|
|
11
|
-
|
|
10
|
+
if (!isManifestParseSuccess ||
|
|
11
|
+
!manifestObject ||
|
|
12
|
+
!manifestObject.typedContent) {
|
|
13
|
+
throw new Error(`Failed to parse manifest.yml (${manifestPath}): ${(errors || [])
|
|
12
14
|
.map((e) => e.message)
|
|
13
15
|
.join('\n')}`);
|
|
14
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-manifest-yml.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/utils/forge/load-manifest-yml.ts"],"names":[],"mappings":";;;;AAAA,8CAMyB;AACzB,+EAA+E;AAE/E,SAAsB,eAAe,CACnC,YAAoB;;QAEpB,MAAM,EACJ,cAAc,EACd,OAAO,EAAE,sBAAsB,EAC/B,MAAM,GACP,GAAG,MAAM,IAAI,oBAAoB,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAE3D,
|
|
1
|
+
{"version":3,"file":"load-manifest-yml.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/utils/forge/load-manifest-yml.ts"],"names":[],"mappings":";;;;AAAA,8CAMyB;AACzB,+EAA+E;AAE/E,SAAsB,eAAe,CACnC,YAAoB;;QAEpB,MAAM,EACJ,cAAc,EACd,OAAO,EAAE,sBAAsB,EAC/B,MAAM,GACP,GAAG,MAAM,IAAI,oBAAoB,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAE3D,IACE,CAAC,sBAAsB;YACvB,CAAC,cAAc;YACf,CAAC,cAAc,CAAC,YAAY,EAC5B;YACA,MAAM,IAAI,KAAK,CACb,iCAAiC,YAAY,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;iBAC9D,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;iBACrB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;SACH;QAED,MAAM,cAAc,GAAmB,cAAc,CAAC,YAAY,CAAC;QAEnE,IAAI,CAAC,cAAc,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;SACtE;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CAAA;AA5BD,0CA4BC;AAED,MAAM,oBAAqB,SAAQ,sCAA2C;IAC5E;QACE,KAAK,CAAC;YACJ,IAAI,wBAAa,EAAE;YACnB,IAAI,wBAAa,EAAE;YACnB,IAAI,0BAAe,CAAC,WAAW,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;CACF"}
|