@toolsplus/nx-forge 2.0.1 → 2.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/README.md +19 -12
- package/executors.json +5 -1
- package/package.json +1 -1
- package/src/executors/build/executor.js +2 -1
- 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/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 +2 -0
- package/src/generators/application/lib/add-project.js.map +1 -1
- 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/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/README.md
CHANGED
|
@@ -127,31 +127,38 @@ 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 go to `dist/apps/<forge-app-name>` and run the following command
|
|
149
|
+
|
|
150
|
+
forge install
|
|
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
|
|
|
158
|
+
### Register
|
|
159
|
+
|
|
160
|
+
Run `nx register <forge-app-name>` to register the Forge app with the Forge platform.
|
|
161
|
+
|
|
155
162
|
### Build
|
|
156
163
|
|
|
157
164
|
Run `nx build <forge-app-name>` to build the project. The build artifacts will be stored in the `dist/` directory.
|
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",
|
|
@@ -16,6 +21,5 @@
|
|
|
16
21
|
"schema": "./src/executors/tunnel/schema.json",
|
|
17
22
|
"description": "tunnel executor"
|
|
18
23
|
}
|
|
19
|
-
|
|
20
24
|
}
|
|
21
25
|
}
|
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");
|
|
@@ -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,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;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,WAAW,EACnB,OAAO,CAAC,YAAY,EACpB,iBAAiB,EACjB,OAAO,CACR,CAAC;QAEF,eAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACtC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;;CACH;AAvCD,8BAuCC"}
|
|
@@ -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,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": "",
|
|
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,6 +2,7 @@
|
|
|
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");
|
|
@@ -17,6 +18,7 @@ function addProject(tree, options) {
|
|
|
17
18
|
targets: {},
|
|
18
19
|
tags: options.parsedTags,
|
|
19
20
|
};
|
|
21
|
+
project.targets.register = (0, get_register_config_1.getRegisterConfig)(project, options);
|
|
20
22
|
project.targets.build = (0, get_build_config_1.getBuildConfig)(project, options);
|
|
21
23
|
project.targets.serve = (0, get_serve_config_1.getServeConfig)(project, options);
|
|
22
24
|
project.targets.deploy = (0, get_deploy_config_1.getDeployConfig)(project, options);
|
|
@@ -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;AAEpD;;;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,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;IAE3D,IAAA,gCAAuB,EACrB,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,OAAO,EACP,OAAO,CAAC,gBAAgB,CACzB,CAAC;AACJ,CAAC;
|
|
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;AAEpD;;;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,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;IAE3D,IAAA,gCAAuB,EACrB,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,OAAO,EACP,OAAO,CAAC,gBAAgB,CACzB,CAAC;AACJ,CAAC;AApBD,gCAoBC"}
|
|
@@ -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"}
|
|
@@ -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"}
|