@toolsplus/nx-forge 1.0.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 +11 -0
- package/executors.json +15 -0
- package/generators.json +20 -0
- package/package.json +18 -0
- package/src/executors/build/executor.d.ts +5 -0
- package/src/executors/build/executor.js +47 -0
- package/src/executors/build/executor.js.map +1 -0
- package/src/executors/build/lib/compile-typescript.d.ts +6 -0
- package/src/executors/build/lib/compile-typescript.js +22 -0
- package/src/executors/build/lib/compile-typescript.js.map +1 -0
- package/src/executors/build/lib/copy-forge-app-files.d.ts +2 -0
- package/src/executors/build/lib/copy-forge-app-files.js +20 -0
- package/src/executors/build/lib/copy-forge-app-files.js.map +1 -0
- package/src/executors/build/lib/generate-package-json.d.ts +11 -0
- package/src/executors/build/lib/generate-package-json.js +22 -0
- package/src/executors/build/lib/generate-package-json.js.map +1 -0
- package/src/executors/build/lib/load-manifest-yml.d.ts +2 -0
- package/src/executors/build/lib/load-manifest-yml.js +29 -0
- package/src/executors/build/lib/load-manifest-yml.js.map +1 -0
- package/src/executors/build/lib/normalize-options.d.ts +2 -0
- package/src/executors/build/lib/normalize-options.js +12 -0
- package/src/executors/build/lib/normalize-options.js.map +1 -0
- package/src/executors/build/lib/patch-manifest-yml.d.ts +10 -0
- package/src/executors/build/lib/patch-manifest-yml.js +30 -0
- package/src/executors/build/lib/patch-manifest-yml.js.map +1 -0
- package/src/executors/build/lib/process-custom-ui-dependencies.d.ts +16 -0
- package/src/executors/build/lib/process-custom-ui-dependencies.js +49 -0
- package/src/executors/build/lib/process-custom-ui-dependencies.js.map +1 -0
- package/src/executors/build/schema.d.ts +14 -0
- package/src/executors/build/schema.json +23 -0
- package/src/executors/deploy/executor.d.ts +4 -0
- package/src/executors/deploy/executor.js +46 -0
- package/src/executors/deploy/executor.js.map +1 -0
- package/src/executors/deploy/schema.d.ts +7 -0
- package/src/executors/deploy/schema.json +38 -0
- package/src/generators/application/files/README.md +35 -0
- package/src/generators/application/files/manifest.yml +6 -0
- package/src/generators/application/files/package.json +6 -0
- package/src/generators/application/files/src/index.ts__tmpl__ +6 -0
- package/src/generators/application/files/tsconfig.app.json +18 -0
- package/src/generators/application/files/tsconfig.json +10 -0
- package/src/generators/application/generator.d.ts +3 -0
- package/src/generators/application/generator.js +58 -0
- package/src/generators/application/generator.js.map +1 -0
- package/src/generators/application/lib/add-project.d.ts +7 -0
- package/src/generators/application/lib/add-project.js +31 -0
- package/src/generators/application/lib/add-project.js.map +1 -0
- package/src/generators/application/lib/create-files.d.ts +3 -0
- package/src/generators/application/lib/create-files.js +19 -0
- package/src/generators/application/lib/create-files.js.map +1 -0
- package/src/generators/application/lib/get-build-config.d.ts +3 -0
- package/src/generators/application/lib/get-build-config.js +15 -0
- package/src/generators/application/lib/get-build-config.js.map +1 -0
- package/src/generators/application/lib/get-deploy-config.d.ts +3 -0
- package/src/generators/application/lib/get-deploy-config.js +14 -0
- package/src/generators/application/lib/get-deploy-config.js.map +1 -0
- package/src/generators/application/lib/get-serve-config.d.ts +3 -0
- package/src/generators/application/lib/get-serve-config.js +23 -0
- package/src/generators/application/lib/get-serve-config.js.map +1 -0
- package/src/generators/application/lib/index.d.ts +3 -0
- package/src/generators/application/lib/index.js +7 -0
- package/src/generators/application/lib/index.js.map +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +3 -0
- package/src/generators/application/lib/normalize-options.js +19 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/schema.d.ts +19 -0
- package/src/generators/application/schema.json +66 -0
- package/src/generators/init/generator.d.ts +3 -0
- package/src/generators/init/generator.js +22 -0
- package/src/generators/init/generator.js.map +1 -0
- package/src/generators/init/lib/add-dependencies.d.ts +2 -0
- package/src/generators/init/lib/add-dependencies.js +15 -0
- package/src/generators/init/lib/add-dependencies.js.map +1 -0
- package/src/generators/init/lib/index.d.ts +2 -0
- package/src/generators/init/lib/index.js +6 -0
- package/src/generators/init/lib/index.js.map +1 -0
- package/src/generators/init/lib/normalize-options.d.ts +2 -0
- package/src/generators/init/lib/normalize-options.js +9 -0
- package/src/generators/init/lib/normalize-options.js.map +1 -0
- package/src/generators/init/schema.d.ts +4 -0
- package/src/generators/init/schema.json +22 -0
- package/src/index.d.ts +0 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -0
- package/src/utils/versions.d.ts +3 -0
- package/src/utils/versions.js +7 -0
- package/src/utils/versions.js.map +1 -0
package/README.md
ADDED
package/executors.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"executors": {
|
|
4
|
+
"build": {
|
|
5
|
+
"implementation": "./src/executors/build/executor",
|
|
6
|
+
"schema": "./src/executors/build/schema.json",
|
|
7
|
+
"description": "build executor"
|
|
8
|
+
},
|
|
9
|
+
"deploy": {
|
|
10
|
+
"implementation": "./src/executors/deploy/executor",
|
|
11
|
+
"schema": "./src/executors/deploy/schema.json",
|
|
12
|
+
"description": "deploy executor"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/generators.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"name": "forge",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"generators": {
|
|
6
|
+
"application": {
|
|
7
|
+
"factory": "./src/generators/application/generator",
|
|
8
|
+
"schema": "./src/generators/application/schema.json",
|
|
9
|
+
"description": "Create a Atlassian Forge application.",
|
|
10
|
+
"x-type": "application",
|
|
11
|
+
"aliases": ["app"]
|
|
12
|
+
},
|
|
13
|
+
"init": {
|
|
14
|
+
"factory": "./src/generators/init/generator",
|
|
15
|
+
"schema": "./src/generators/init/schema.json",
|
|
16
|
+
"description": "Initialize the @toolsplus/nx-forge plugin.",
|
|
17
|
+
"hidden": true
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toolsplus/nx-forge",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Atlassian Forge plugin for Nx",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"generators": "./generators.json",
|
|
7
|
+
"executors": "./executors.json",
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@nrwl/js": "^13.9.4",
|
|
10
|
+
"@nrwl/workspace": "^13.9.4"
|
|
11
|
+
},
|
|
12
|
+
"typings": "./src/index.d.ts",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"fs-extra": "^10.0.1",
|
|
15
|
+
"@forge/manifest": "^3.4.0",
|
|
16
|
+
"js-yaml": "^4.1.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const normalize_options_1 = require("./lib/normalize-options");
|
|
5
|
+
const process_custom_ui_dependencies_1 = require("./lib/process-custom-ui-dependencies");
|
|
6
|
+
const patch_manifest_yml_1 = require("./lib/patch-manifest-yml");
|
|
7
|
+
const compile_typescript_1 = require("./lib/compile-typescript");
|
|
8
|
+
const generate_package_json_1 = require("./lib/generate-package-json");
|
|
9
|
+
const project_graph_1 = require("@nrwl/workspace/src/core/project-graph");
|
|
10
|
+
function runExecutor(rawOptions, context) {
|
|
11
|
+
var e_1, _a;
|
|
12
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
13
|
+
const { root, sourceRoot } = context.workspace.projects[context.projectName];
|
|
14
|
+
if (!sourceRoot) {
|
|
15
|
+
throw new Error(`${context.projectName} does not have a sourceRoot.`);
|
|
16
|
+
}
|
|
17
|
+
if (!root) {
|
|
18
|
+
throw new Error(`${context.projectName} does not have a root.`);
|
|
19
|
+
}
|
|
20
|
+
const options = (0, normalize_options_1.normalizeOptions)(rawOptions, context.root, sourceRoot, root);
|
|
21
|
+
const compilation = (0, compile_typescript_1.compileTypescript)(options, context);
|
|
22
|
+
try {
|
|
23
|
+
for (var compilation_1 = (0, tslib_1.__asyncValues)(compilation), compilation_1_1; compilation_1_1 = yield compilation_1.next(), !compilation_1_1.done;) {
|
|
24
|
+
const result = compilation_1_1.value;
|
|
25
|
+
if (!result.success) {
|
|
26
|
+
throw new Error(`Failed to compile Typescript files for project ${context.projectName}.`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
31
|
+
finally {
|
|
32
|
+
try {
|
|
33
|
+
if (compilation_1_1 && !compilation_1_1.done && (_a = compilation_1.return)) yield _a.call(compilation_1);
|
|
34
|
+
}
|
|
35
|
+
finally { if (e_1) throw e_1.error; }
|
|
36
|
+
}
|
|
37
|
+
(0, process_custom_ui_dependencies_1.processCustomUIDependencies)(options, context);
|
|
38
|
+
(0, patch_manifest_yml_1.patchManifestYml)(options);
|
|
39
|
+
(0, generate_package_json_1.generatePackageJson)(context.projectName, (0, project_graph_1.readCachedProjectGraph)(), options);
|
|
40
|
+
console.log('Executor ran for build');
|
|
41
|
+
return {
|
|
42
|
+
success: true,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exports.default = runExecutor;
|
|
47
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/build/executor.ts"],"names":[],"mappings":";;;AAEA,+DAA2D;AAC3D,yFAAmF;AACnF,iEAA4D;AAC5D,iEAA6D;AAC7D,uEAAkE;AAClE,0EAAgF;AAEhF,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,sCAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;YAExD,KAA2B,IAAA,gBAAA,2BAAA,WAAW,CAAA,iBAAA;gBAA3B,MAAM,MAAM,wBAAA,CAAA;gBACrB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;oBACnB,MAAM,IAAI,KAAK,CACb,kDAAkD,OAAO,CAAC,WAAW,GAAG,CACzE,CAAC;iBACH;aACF;;;;;;;;;QAED,IAAA,4DAA2B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAA,qCAAgB,EAAC,OAAO,CAAC,CAAC;QAC1B,IAAA,2CAAmB,EAAC,OAAO,CAAC,WAAW,EAAE,IAAA,sCAAsB,GAAE,EAAE,OAAO,CAAC,CAAC;QAE5E,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACtC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;;CACH;AAjCD,8BAiCC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compileTypescript = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const tsc_impl_1 = require("@nrwl/js/src/executors/tsc/tsc.impl");
|
|
6
|
+
function compileTypescript(options, context) {
|
|
7
|
+
const tscOptions = {
|
|
8
|
+
outputPath: (0, devkit_1.joinPathFragments)('dist', options.projectRoot),
|
|
9
|
+
tsConfig: `${options.projectRoot}/tsconfig.app.json`,
|
|
10
|
+
updateBuildableProjectDepsInPackageJson: false,
|
|
11
|
+
main: `${options.projectRoot}/src/index.ts`,
|
|
12
|
+
assets: [
|
|
13
|
+
`${options.projectRoot}/*.md`,
|
|
14
|
+
`${options.projectRoot}/manifest.yml`,
|
|
15
|
+
],
|
|
16
|
+
watch: options.watch,
|
|
17
|
+
transformers: [],
|
|
18
|
+
};
|
|
19
|
+
return (0, tsc_impl_1.tscExecutor)(tscOptions, context);
|
|
20
|
+
}
|
|
21
|
+
exports.compileTypescript = compileTypescript;
|
|
22
|
+
//# sourceMappingURL=compile-typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-typescript.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/compile-typescript.ts"],"names":[],"mappings":";;;AAAA,yCAAkE;AAElE,kEAAkE;AAGlE,SAAgB,iBAAiB,CAC/B,OAA0B,EAC1B,OAAwB;IAKxB,MAAM,UAAU,GAAuB;QACrC,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC;QAC1D,QAAQ,EAAE,GAAG,OAAO,CAAC,WAAW,oBAAoB;QACpD,uCAAuC,EAAE,KAAK;QAC9C,IAAI,EAAE,GAAG,OAAO,CAAC,WAAW,eAAe;QAC3C,MAAM,EAAE;YACN,GAAG,OAAO,CAAC,WAAW,OAAO;YAC7B,GAAG,OAAO,CAAC,WAAW,eAAe;SACtC;QACD,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,OAAO,IAAA,sBAAW,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AArBD,8CAqBC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyForgeAppFiles = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const fs_extra_1 = require("fs-extra");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
8
|
+
const fileutils_1 = require("@nrwl/workspace/src/utilities/fileutils");
|
|
9
|
+
function copyForgeAppFiles(options) {
|
|
10
|
+
devkit_1.logger.info('Copying Forge app files...');
|
|
11
|
+
if (!(0, fileutils_1.directoryExists)(options.outputPath)) {
|
|
12
|
+
(0, fs_1.mkdirSync)(options.outputPath, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
(0, fs_1.copyFileSync)((0, path_1.join)(options.root, options.projectRoot, 'manifest.yml'), (0, path_1.join)(options.outputPath, 'manifest.yml'));
|
|
15
|
+
(0, fs_1.copyFileSync)((0, path_1.join)(options.root, options.projectRoot, 'tsconfig.json'), (0, path_1.join)(options.outputPath, 'tsconfig.json'));
|
|
16
|
+
(0, fs_extra_1.copySync)((0, path_1.join)(options.root, options.sourceRoot), (0, path_1.join)(options.outputPath, 'src'), { recursive: true });
|
|
17
|
+
devkit_1.logger.info('Done copying Forge app files.');
|
|
18
|
+
}
|
|
19
|
+
exports.copyForgeAppFiles = copyForgeAppFiles;
|
|
20
|
+
//# sourceMappingURL=copy-forge-app-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-forge-app-files.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/copy-forge-app-files.ts"],"names":[],"mappings":";;;AAAA,2BAA6C;AAC7C,uCAAoC;AACpC,+BAA4B;AAC5B,yCAAsC;AACtC,uEAA0E;AAG1E,SAAgB,iBAAiB,CAAC,OAA0B;IAC1D,eAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAE1C,IAAI,CAAC,IAAA,2BAAe,EAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACxC,IAAA,cAAS,EAAC,OAAO,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACpD;IAED,IAAA,iBAAY,EACV,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,EACvD,IAAA,WAAI,EAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CACzC,CAAC;IACF,IAAA,iBAAY,EACV,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,EACxD,IAAA,WAAI,EAAC,OAAO,CAAC,UAAU,EAAE,eAAe,CAAC,CAC1C,CAAC;IACF,IAAA,mBAAQ,EACN,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,EACtC,IAAA,WAAI,EAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAC/B,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;IAEF,eAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAC/C,CAAC;AAtBD,8CAsBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProjectGraph } from '@nrwl/devkit';
|
|
2
|
+
import { NormalizedOptions } from '../schema';
|
|
3
|
+
/**
|
|
4
|
+
* Merges the existing package.json details with a generated package.json that includes
|
|
5
|
+
* all required dependencies.
|
|
6
|
+
*
|
|
7
|
+
* @param projectName Name of the project
|
|
8
|
+
* @param graph Graph associated with the project
|
|
9
|
+
* @param options Builder options
|
|
10
|
+
*/
|
|
11
|
+
export declare function generatePackageJson(projectName: string, graph: ProjectGraph, options: NormalizedOptions): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePackageJson = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const create_package_json_1 = require("@nrwl/workspace/src/utilities/create-package-json");
|
|
6
|
+
/**
|
|
7
|
+
* Merges the existing package.json details with a generated package.json that includes
|
|
8
|
+
* all required dependencies.
|
|
9
|
+
*
|
|
10
|
+
* @param projectName Name of the project
|
|
11
|
+
* @param graph Graph associated with the project
|
|
12
|
+
* @param options Builder options
|
|
13
|
+
*/
|
|
14
|
+
function generatePackageJson(projectName, graph, options) {
|
|
15
|
+
var _a;
|
|
16
|
+
const packageJson = (0, create_package_json_1.createPackageJson)(projectName, graph, options);
|
|
17
|
+
packageJson.main = (_a = packageJson.main) !== null && _a !== void 0 ? _a : options.outputFileName;
|
|
18
|
+
delete packageJson.devDependencies;
|
|
19
|
+
(0, devkit_1.writeJsonFile)(`${options.outputPath}/package.json`, packageJson);
|
|
20
|
+
}
|
|
21
|
+
exports.generatePackageJson = generatePackageJson;
|
|
22
|
+
//# sourceMappingURL=generate-package-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-package-json.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/generate-package-json.ts"],"names":[],"mappings":";;;AACA,yCAA6C;AAC7C,2FAAsF;AAGtF;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CACjC,WAAmB,EACnB,KAAmB,EACnB,OAA0B;;IAE1B,MAAM,WAAW,GAAG,IAAA,uCAAiB,EAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,WAAW,CAAC,IAAI,GAAG,MAAA,WAAW,CAAC,IAAI,mCAAI,OAAO,CAAC,cAAc,CAAC;IAC9D,OAAO,WAAW,CAAC,eAAe,CAAC;IACnC,IAAA,sBAAa,EAAC,GAAG,OAAO,CAAC,UAAU,eAAe,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC;AATD,kDASC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadManifestYml = void 0;
|
|
4
|
+
const manifest_1 = require("@forge/manifest");
|
|
5
|
+
const FULL_SCHEMA = require("@forge/manifest/out/schema/manifest-schema.json");
|
|
6
|
+
function loadManifestYml(manifestPath) {
|
|
7
|
+
const { manifestObject, success: isManifestParseSuccess, errors, } = new ManifestYmlValidator().process(manifestPath);
|
|
8
|
+
if (!isManifestParseSuccess) {
|
|
9
|
+
throw new Error(`Failed to parse manifest.yml (${manifestPath}): ${errors
|
|
10
|
+
.map((e) => e.message)
|
|
11
|
+
.join('\n')}`);
|
|
12
|
+
}
|
|
13
|
+
const manifestSchema = manifestObject.typedContent;
|
|
14
|
+
if (!manifestSchema) {
|
|
15
|
+
throw new Error('Manifest parse result did not return any content.');
|
|
16
|
+
}
|
|
17
|
+
return manifestSchema;
|
|
18
|
+
}
|
|
19
|
+
exports.loadManifestYml = loadManifestYml;
|
|
20
|
+
class ManifestYmlValidator extends manifest_1.AbstractValidationProcessor {
|
|
21
|
+
constructor() {
|
|
22
|
+
super([
|
|
23
|
+
new manifest_1.FileValidator(),
|
|
24
|
+
new manifest_1.YamlValidator(),
|
|
25
|
+
new manifest_1.SchemaValidator(FULL_SCHEMA),
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=load-manifest-yml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/load-manifest-yml.ts"],"names":[],"mappings":";;;AAAA,8CAMyB;AACzB,+EAA+E;AAE/E,SAAgB,eAAe,CAAC,YAAoB;IAClD,MAAM,EACJ,cAAc,EACd,OAAO,EAAE,sBAAsB,EAC/B,MAAM,GACP,GAAG,IAAI,oBAAoB,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAErD,IAAI,CAAC,sBAAsB,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,iCAAiC,YAAY,MAAM,MAAM;aACtD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;aACrB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;KACH;IAED,MAAM,cAAc,GAAmB,cAAc,CAAC,YAAY,CAAC;IAEnE,IAAI,CAAC,cAAc,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAtBD,0CAsBC;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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
var _a, _b;
|
|
7
|
+
return Object.assign(Object.assign({}, options), { root,
|
|
8
|
+
sourceRoot,
|
|
9
|
+
projectRoot, customUIPath: (_a = options.customUIPath) !== null && _a !== void 0 ? _a : 'customUI', outputPath: (0, path_1.resolve)(root, options.outputPath), outputFileName: 'index.js', watch: (_b = options.watch) !== null && _b !== void 0 ? _b : false });
|
|
10
|
+
}
|
|
11
|
+
exports.normalizeOptions = normalizeOptions;
|
|
12
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAG/B,SAAgB,gBAAgB,CAC9B,OAA6B,EAC7B,IAAY,EACZ,UAAkB,EAClB,WAAmB;;IAEnB,uCACK,OAAO,KACV,IAAI;QACJ,UAAU;QACV,WAAW,EACX,YAAY,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU,EAChD,UAAU,EAAE,IAAA,cAAO,EAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,EAC7C,cAAc,EAAE,UAAU,EAC1B,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,KAAK,IAC7B;AACJ,CAAC;AAhBD,4CAgBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NormalizedOptions } from '../schema';
|
|
2
|
+
/**
|
|
3
|
+
* Patches the output manifest.yml file to replace resource path parameters to point to the actual Custom UI build
|
|
4
|
+
* artifacts instead of the Nx project reference.
|
|
5
|
+
*
|
|
6
|
+
* This assumes that Custom UI artifacts have already been copied to the output directory in a previous step.
|
|
7
|
+
*
|
|
8
|
+
* @param options Executor options
|
|
9
|
+
*/
|
|
10
|
+
export declare function patchManifestYml(options: NormalizedOptions): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patchManifestYml = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const js_yaml_1 = require("js-yaml");
|
|
6
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
+
const load_manifest_yml_1 = require("./load-manifest-yml");
|
|
8
|
+
/**
|
|
9
|
+
* Patches the output manifest.yml file to replace resource path parameters to point to the actual Custom UI build
|
|
10
|
+
* artifacts instead of the Nx project reference.
|
|
11
|
+
*
|
|
12
|
+
* This assumes that Custom UI artifacts have already been copied to the output directory in a previous step.
|
|
13
|
+
*
|
|
14
|
+
* @param options Executor options
|
|
15
|
+
*/
|
|
16
|
+
function patchManifestYml(options) {
|
|
17
|
+
const manifestPath = (0, devkit_1.joinPathFragments)(options.outputPath, 'manifest.yml');
|
|
18
|
+
devkit_1.logger.info(`Patching ${manifestPath}...`);
|
|
19
|
+
const manifestSchema = (0, load_manifest_yml_1.loadManifestYml)(manifestPath);
|
|
20
|
+
const resources = manifestSchema.resources || [];
|
|
21
|
+
const patchedManifest = Object.assign(Object.assign({}, manifestSchema), { resources: resources.map((r) => patchResource(options.customUIPath, r)) });
|
|
22
|
+
const patchedManifestContent = (0, js_yaml_1.dump)(patchedManifest, {});
|
|
23
|
+
(0, fs_1.writeFileSync)(manifestPath, patchedManifestContent, { encoding: 'utf8' });
|
|
24
|
+
devkit_1.logger.info(`Done patching ${manifestPath}.`);
|
|
25
|
+
}
|
|
26
|
+
exports.patchManifestYml = patchManifestYml;
|
|
27
|
+
function patchResource(customUIPath, resource) {
|
|
28
|
+
return Object.assign(Object.assign({}, resource), { path: `${customUIPath}/${resource.path}` });
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=patch-manifest-yml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-manifest-yml.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/patch-manifest-yml.ts"],"names":[],"mappings":";;;AAAA,2BAAmC;AACnC,qCAA+B;AAC/B,yCAAyD;AAIzD,2DAAsD;AAEtD;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,OAA0B;IACzD,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAE3E,eAAM,CAAC,IAAI,CAAC,YAAY,YAAY,KAAK,CAAC,CAAC;IAE3C,MAAM,cAAc,GAAG,IAAA,mCAAe,EAAC,YAAY,CAAC,CAAC;IAErD,MAAM,SAAS,GAAc,cAAc,CAAC,SAAS,IAAI,EAAE,CAAC;IAC5D,MAAM,eAAe,mCAChB,cAAc,KACjB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,GACxE,CAAC;IAEF,MAAM,sBAAsB,GAAG,IAAA,cAAI,EAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACzD,IAAA,kBAAa,EAAC,YAAY,EAAE,sBAAsB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAE1E,eAAM,CAAC,IAAI,CAAC,iBAAiB,YAAY,GAAG,CAAC,CAAC;AAChD,CAAC;AAjBD,4CAiBC;AAED,SAAS,aAAa,CACpB,YAAoB,EACpB,QAA+B;IAE/B,uCACK,QAAQ,KACX,IAAI,EAAE,GAAG,YAAY,IAAI,QAAQ,CAAC,IAAI,EAAE,IACxC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { Resources } from '@forge/manifest';
|
|
3
|
+
import { NormalizedOptions } from '../schema';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies that Custom UI projects are correctly linked to the Nx Forge app and copies build artifacts into the app's
|
|
6
|
+
* output directory.
|
|
7
|
+
*
|
|
8
|
+
* In particular this will make sure that each resource listed in the manifest.yml has its path configured to point to
|
|
9
|
+
* a Nx project in this workspace. Additionally, this will ensure that each specified Custom UI project is listed as an
|
|
10
|
+
* implicit dependency of the project. This requirement ensures that Custom UI dependencies are being built before the
|
|
11
|
+
* Forge app is being built.
|
|
12
|
+
*
|
|
13
|
+
* @param options Executor options
|
|
14
|
+
* @param context Executor context
|
|
15
|
+
*/
|
|
16
|
+
export declare function processCustomUIDependencies(options: NormalizedOptions, context: ExecutorContext): Resources;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processCustomUIDependencies = void 0;
|
|
4
|
+
const fs_extra_1 = require("fs-extra");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
+
const load_manifest_yml_1 = require("./load-manifest-yml");
|
|
8
|
+
/**
|
|
9
|
+
* Verifies that Custom UI projects are correctly linked to the Nx Forge app and copies build artifacts into the app's
|
|
10
|
+
* output directory.
|
|
11
|
+
*
|
|
12
|
+
* In particular this will make sure that each resource listed in the manifest.yml has its path configured to point to
|
|
13
|
+
* a Nx project in this workspace. Additionally, this will ensure that each specified Custom UI project is listed as an
|
|
14
|
+
* implicit dependency of the project. This requirement ensures that Custom UI dependencies are being built before the
|
|
15
|
+
* Forge app is being built.
|
|
16
|
+
*
|
|
17
|
+
* @param options Executor options
|
|
18
|
+
* @param context Executor context
|
|
19
|
+
*/
|
|
20
|
+
function processCustomUIDependencies(options, context) {
|
|
21
|
+
const manifestPath = (0, devkit_1.joinPathFragments)(context.root, 'apps', context.projectName, 'manifest.yml');
|
|
22
|
+
const manifestSchema = (0, load_manifest_yml_1.loadManifestYml)(manifestPath);
|
|
23
|
+
const resources = manifestSchema.resources || [];
|
|
24
|
+
resources.forEach((r) => verifyAndCopyCustomUIDependency(r, context, options));
|
|
25
|
+
return resources;
|
|
26
|
+
}
|
|
27
|
+
exports.processCustomUIDependencies = processCustomUIDependencies;
|
|
28
|
+
const verifyAndCopyCustomUIDependency = (resource, context, options) => {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
const customUIProjectName = resource.path;
|
|
31
|
+
const customUIProjectConfiguration = context.workspace.projects[customUIProjectName];
|
|
32
|
+
if (!customUIProjectConfiguration) {
|
|
33
|
+
throw new Error(`Nx workspace is missing project for CustomUI path ${customUIProjectName}. Make sure the Custom UI resource path references a project in your Nx workspace.`);
|
|
34
|
+
}
|
|
35
|
+
if (!((_a = context.workspace.projects[context.projectName].implicitDependencies) === null || _a === void 0 ? void 0 : _a.includes(customUIProjectName))) {
|
|
36
|
+
throw new Error(`Project ${customUIProjectName} is configured as Forge Custom UI resource but not listed as implicit dependency of the Forge project (${context.projectName}). Add ${customUIProjectName} to the 'implicitDependencies' array in this project's 'project.json', or remove the Custom UI resource from the app's manifest.yml.`);
|
|
37
|
+
}
|
|
38
|
+
const customUIBuildTargetOutputPath = (_c = (_b = customUIProjectConfiguration.targets['build']) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.outputPath;
|
|
39
|
+
const absoluteCustomUIBuildTargetOutputPath = (0, devkit_1.joinPathFragments)(context.root, customUIBuildTargetOutputPath);
|
|
40
|
+
if (!customUIBuildTargetOutputPath ||
|
|
41
|
+
!(0, fs_1.existsSync)(absoluteCustomUIBuildTargetOutputPath) ||
|
|
42
|
+
(0, fs_1.readdirSync)(absoluteCustomUIBuildTargetOutputPath).length === 0) {
|
|
43
|
+
throw new Error(`Project ${customUIProjectName} is missing build artifacts. Make sure the project produces Custom UI compatible build artifacts.`);
|
|
44
|
+
}
|
|
45
|
+
devkit_1.logger.info(`Copying ${customUIProjectName} Custom UI build artifacts...`);
|
|
46
|
+
(0, fs_extra_1.copySync)(absoluteCustomUIBuildTargetOutputPath, (0, devkit_1.joinPathFragments)(options.outputPath, options.customUIPath, customUIProjectName), { recursive: true });
|
|
47
|
+
devkit_1.logger.info(`Done copying ${customUIProjectName} Custom UI build artifacts.`);
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=process-custom-ui-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-custom-ui-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/build/lib/process-custom-ui-dependencies.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AACpC,2BAA6C;AAE7C,yCAAyD;AAIzD,2DAAsD;AAEtD;;;;;;;;;;;GAWG;AACH,SAAgB,2BAA2B,CACzC,OAA0B,EAC1B,OAAwB;IAExB,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,IAAI,EACZ,MAAM,EACN,OAAO,CAAC,WAAW,EACnB,cAAc,CACf,CAAC;IACF,MAAM,cAAc,GAAG,IAAA,mCAAe,EAAC,YAAY,CAAC,CAAC;IACrD,MAAM,SAAS,GAAc,cAAc,CAAC,SAAS,IAAI,EAAE,CAAC;IAE5D,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACtB,+BAA+B,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CACrD,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAlBD,kEAkBC;AAED,MAAM,+BAA+B,GAAG,CACtC,QAA+B,EAC/B,OAAwB,EACxB,OAA0B,EACpB,EAAE;;IACR,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC;IAE1C,MAAM,4BAA4B,GAChC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAElD,IAAI,CAAC,4BAA4B,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,qDAAqD,mBAAmB,oFAAoF,CAC7J,CAAC;KACH;IAED,IACE,CAAC,CAAA,MAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CACzB,OAAO,CAAC,WAAW,CACpB,CAAC,oBAAoB,0CAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAA,EACrD;QACA,MAAM,IAAI,KAAK,CACb,WAAW,mBAAmB,0GAA0G,OAAO,CAAC,WAAW,UAAU,mBAAmB,sIAAsI,CAC/T,CAAC;KACH;IAED,MAAM,6BAA6B,GACjC,MAAA,MAAA,4BAA4B,CAAC,OAAO,CAAC,OAAO,CAAC,0CAAE,OAAO,0CAAE,UAAU,CAAC;IACrE,MAAM,qCAAqC,GAAG,IAAA,0BAAiB,EAC7D,OAAO,CAAC,IAAI,EACZ,6BAA6B,CAC9B,CAAC;IAEF,IACE,CAAC,6BAA6B;QAC9B,CAAC,IAAA,eAAU,EAAC,qCAAqC,CAAC;QAClD,IAAA,gBAAW,EAAC,qCAAqC,CAAC,CAAC,MAAM,KAAK,CAAC,EAC/D;QACA,MAAM,IAAI,KAAK,CACb,WAAW,mBAAmB,mGAAmG,CAClI,CAAC;KACH;IAED,eAAM,CAAC,IAAI,CAAC,WAAW,mBAAmB,+BAA+B,CAAC,CAAC;IAC3E,IAAA,mBAAQ,EACN,qCAAqC,EACrC,IAAA,0BAAiB,EACf,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,YAAY,EACpB,mBAAmB,CACpB,EACD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;IACF,eAAM,CAAC,IAAI,CAAC,gBAAgB,mBAAmB,6BAA6B,CAAC,CAAC;AAChF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface BuildExecutorOptions {
|
|
2
|
+
customUIPath?: string;
|
|
3
|
+
outputPath: string;
|
|
4
|
+
watch: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface NormalizedOptions extends BuildExecutorOptions {
|
|
8
|
+
root: string;
|
|
9
|
+
sourceRoot: string;
|
|
10
|
+
projectRoot: string;
|
|
11
|
+
customUIPath: string;
|
|
12
|
+
outputPath: string;
|
|
13
|
+
outputFileName: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"title": "Forge application build target",
|
|
5
|
+
"description": "Forge application build target options for Build Facade",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"outputPath": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Output path of the generated files."
|
|
11
|
+
},
|
|
12
|
+
"customUIPath": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Custom UI output path relative to the outputPath."
|
|
15
|
+
},
|
|
16
|
+
"watch": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"description": "Enable re-building when files change.",
|
|
19
|
+
"default": false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": ["outputPath"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
function runExecutor(options) {
|
|
7
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
8
|
+
const args = [
|
|
9
|
+
'deploy',
|
|
10
|
+
`--environment=${options.environment}`,
|
|
11
|
+
...(options.verbose === true ? ['--verbose'] : []),
|
|
12
|
+
...(options.verify === false ? ['--no-verify'] : []),
|
|
13
|
+
...(options.interactive === false ? ['--non-interactive'] : []),
|
|
14
|
+
];
|
|
15
|
+
const command = `forge deploy ${args.join(' ')}`;
|
|
16
|
+
devkit_1.logger.log(`Running: ${command}`);
|
|
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, {
|
|
19
|
+
cwd: options.outputPath,
|
|
20
|
+
stdio: [process.stdin, process.stdout, process.stderr],
|
|
21
|
+
});
|
|
22
|
+
yield onExit(deploymentProcess);
|
|
23
|
+
devkit_1.logger.log('✅ Forge app deployed');
|
|
24
|
+
return {
|
|
25
|
+
success: true,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.default = runExecutor;
|
|
30
|
+
// https://2ality.com/2018/05/child-process-streams.html#waiting-for-a-child-process-to-exit-via-a-promise
|
|
31
|
+
function onExit(childProcess) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
childProcess.once('exit', (code) => {
|
|
34
|
+
if (code === 0) {
|
|
35
|
+
resolve(undefined);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
reject(new Error('Exit with error code: ' + code));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
childProcess.once('error', (err) => {
|
|
42
|
+
reject(err);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/executors/deploy/executor.ts"],"names":[],"mappings":";;;AAAA,iDAAoD;AACpD,yCAAsC;AAGtC,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,MAAM,OAAO,GAAG,gBAAgB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,eAAM,CAAC,GAAG,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;QAElC,4FAA4F;QAC5F,MAAM,iBAAiB,GAAG,IAAA,qBAAK,EAAC,OAAO,EAAE,IAAI,EAAE;YAC7C,GAAG,EAAE,OAAO,CAAC,UAAU;YACvB,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;SACvD,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAEhC,eAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACnC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;CAAA;AAvBD,8BAuBC;AAED,0GAA0G;AAC1G,SAAS,MAAM,CAAC,YAA0B;IACxC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;YACzC,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,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YACxC,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"title": "Forge application deploy target",
|
|
5
|
+
"description": "Forge application deploy target",
|
|
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
|
+
"environment": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": ["development", "staging", "production"],
|
|
16
|
+
"description": "Environment to deploy to: development, staging, production.",
|
|
17
|
+
"alias": "e",
|
|
18
|
+
"default": "development"
|
|
19
|
+
},
|
|
20
|
+
"verify": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "Run pre-deployment checks.",
|
|
23
|
+
"default": true
|
|
24
|
+
},
|
|
25
|
+
"interactive": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"description": "Run deployment with or without input prompts.",
|
|
28
|
+
"default": true
|
|
29
|
+
},
|
|
30
|
+
"verbose": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "Run deployment in verbose mode.",
|
|
33
|
+
"alias": "v",
|
|
34
|
+
"default": false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"required": ["outputPath"]
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# <%= name %>
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
Before you can start using this app with Forge make sure to initially build the app using
|
|
6
|
+
|
|
7
|
+
nx build <%= name %>
|
|
8
|
+
|
|
9
|
+
After that, proceed with the initial registration of the app with the Forge platform by running the following commands from the dist directory:
|
|
10
|
+
|
|
11
|
+
forge register
|
|
12
|
+
forge deploy
|
|
13
|
+
forge install
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
This will initially register the app with the Forge platform, deploy the code and finally install the app on any of your Atlassian applications.
|
|
17
|
+
|
|
18
|
+
## Dev loop
|
|
19
|
+
|
|
20
|
+
When the app code changes, the updated code has to rebuilt by calling
|
|
21
|
+
|
|
22
|
+
nx build <%= name %>
|
|
23
|
+
|
|
24
|
+
and re-deployed to the Forge platform using
|
|
25
|
+
|
|
26
|
+
forge deploy
|
|
27
|
+
|
|
28
|
+
If the app's `manifest.yml` changed, you may have to upgrade an existing installation by running
|
|
29
|
+
|
|
30
|
+
forge install --upgrade
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|