@toolsplus/nx-forge 3.0.0 → 3.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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/executors/build/lib/process-custom-ui-dependencies.d.ts +2 -6
  3. package/src/executors/build/lib/process-custom-ui-dependencies.js +2 -6
  4. package/src/executors/build/lib/process-custom-ui-dependencies.js.map +1 -1
  5. package/src/generators/application/lib/add-project.js +14 -10
  6. package/src/generators/application/lib/add-project.js.map +1 -1
  7. package/src/graph/create-dependencies.d.ts +2 -0
  8. package/src/graph/create-dependencies.js +60 -0
  9. package/src/graph/create-dependencies.js.map +1 -0
  10. package/src/graph/create-nodes.d.ts +2 -0
  11. package/src/graph/create-nodes.js +40 -0
  12. package/src/graph/create-nodes.js.map +1 -0
  13. package/src/index.js +4 -0
  14. package/src/index.js.map +1 -1
  15. package/src/shared/targets/get-build-config.d.ts +7 -0
  16. package/src/shared/targets/get-build-config.js +15 -0
  17. package/src/shared/targets/get-build-config.js.map +1 -0
  18. package/src/shared/targets/get-deploy-config.d.ts +6 -0
  19. package/src/{generators/application/lib → shared/targets}/get-deploy-config.js +2 -3
  20. package/src/shared/targets/get-deploy-config.js.map +1 -0
  21. package/src/shared/targets/get-install-config.d.ts +6 -0
  22. package/src/{generators/application/lib → shared/targets}/get-install-config.js +2 -3
  23. package/src/shared/targets/get-install-config.js.map +1 -0
  24. package/src/shared/targets/get-register-config.d.ts +6 -0
  25. package/src/{generators/application/lib → shared/targets}/get-register-config.js +2 -3
  26. package/src/shared/targets/get-register-config.js.map +1 -0
  27. package/src/shared/targets/get-serve-config.d.ts +6 -0
  28. package/src/{generators/application/lib → shared/targets}/get-serve-config.js +2 -3
  29. package/src/shared/targets/get-serve-config.js.map +1 -0
  30. package/src/generators/application/lib/get-build-config.d.ts +0 -3
  31. package/src/generators/application/lib/get-build-config.js +0 -16
  32. package/src/generators/application/lib/get-build-config.js.map +0 -1
  33. package/src/generators/application/lib/get-deploy-config.d.ts +0 -3
  34. package/src/generators/application/lib/get-deploy-config.js.map +0 -1
  35. package/src/generators/application/lib/get-install-config.d.ts +0 -3
  36. package/src/generators/application/lib/get-install-config.js.map +0 -1
  37. package/src/generators/application/lib/get-register-config.d.ts +0 -3
  38. package/src/generators/application/lib/get-register-config.js.map +0 -1
  39. package/src/generators/application/lib/get-serve-config.d.ts +0 -3
  40. package/src/generators/application/lib/get-serve-config.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolsplus/nx-forge",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Atlassian Forge plugin for Nx",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -3,12 +3,8 @@ import { Resources } from '@forge/manifest';
3
3
  import { NormalizedOptions } from '../schema';
4
4
  /**
5
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.
6
+ * output directory. In particular, this will make sure that each resource listed in the manifest.yml has its path
7
+ * configured to point to a Nx project in this workspace.
12
8
  *
13
9
  * @param options Executor options
14
10
  * @param context Executor context
@@ -8,12 +8,8 @@ const devkit_1 = require("@nx/devkit");
8
8
  const manifest_yml_1 = require("../../../utils/forge/manifest-yml");
9
9
  /**
10
10
  * Verifies that Custom UI projects are correctly linked to the Nx Forge app and copies build artifacts into the app's
11
- * output directory.
12
- *
13
- * In particular this will make sure that each resource listed in the manifest.yml has its path configured to point to
14
- * a Nx project in this workspace. Additionally, this will ensure that each specified Custom UI project is listed as an
15
- * implicit dependency of the project. This requirement ensures that Custom UI dependencies are being built before the
16
- * Forge app is being built.
11
+ * output directory. In particular, this will make sure that each resource listed in the manifest.yml has its path
12
+ * configured to point to a Nx project in this workspace.
17
13
  *
18
14
  * @param options Executor options
19
15
  * @param context Executor context
@@ -1 +1 @@
1
- {"version":3,"file":"process-custom-ui-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/process-custom-ui-dependencies.ts"],"names":[],"mappings":";;;;AAAA,uCAAoC;AACpC,2BAA6C;AAE7C,uCAAuD;AAIvD,oEAAoE;AAEpE;;;;;;;;;;;GAWG;AACH,SAAsB,2BAA2B,CAC/C,OAA0B,EAC1B,OAAwB;;;QAExB,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,EACjE,cAAc,CACf,CAAC;QACF,MAAM,cAAc,GAAG,MAAM,IAAA,8BAAe,EAAC,YAAY,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,MAAA,cAAc,CAAC,SAAS,mCAAI,EAAE,CAAC;QAEjD,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACtB,+BAA+B,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CACrD,CAAC;QAEF,OAAO,SAAS,CAAC;;CAClB;AAjBD,kEAiBC;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,sBAAsB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAE/D,IAAI,CAAC,4BAA4B,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,sDAAsD,mBAAmB,oFAAoF,CAC9J,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,IAAI,EACZ,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"}
1
+ {"version":3,"file":"process-custom-ui-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/executors/build/lib/process-custom-ui-dependencies.ts"],"names":[],"mappings":";;;;AAAA,uCAAoC;AACpC,2BAA6C;AAE7C,uCAAuD;AAIvD,oEAAoE;AAEpE;;;;;;;GAOG;AACH,SAAsB,2BAA2B,CAC/C,OAA0B,EAC1B,OAAwB;;;QAExB,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,EACjE,cAAc,CACf,CAAC;QACF,MAAM,cAAc,GAAG,MAAM,IAAA,8BAAe,EAAC,YAAY,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,MAAA,cAAc,CAAC,SAAS,mCAAI,EAAE,CAAC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AChF,CAAC,CAAC"}
@@ -2,11 +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");
6
- const get_build_config_1 = require("./get-build-config");
7
- const get_deploy_config_1 = require("./get-deploy-config");
8
- const get_serve_config_1 = require("./get-serve-config");
9
- const get_install_config_1 = require("./get-install-config");
5
+ const get_register_config_1 = require("../../../shared/targets/get-register-config");
6
+ const get_build_config_1 = require("../../../shared/targets/get-build-config");
7
+ const get_deploy_config_1 = require("../../../shared/targets/get-deploy-config");
8
+ const get_serve_config_1 = require("../../../shared/targets/get-serve-config");
9
+ const get_install_config_1 = require("../../../shared/targets/get-install-config");
10
10
  /**
11
11
  * Generate the new Forge app project in the workspace and configure
12
12
  * available targets.
@@ -19,12 +19,16 @@ function addProject(tree, options) {
19
19
  targets: {},
20
20
  tags: options.parsedTags,
21
21
  };
22
+ const outputPath = (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot);
22
23
  project.targets = {};
23
- project.targets.register = (0, get_register_config_1.getRegisterConfig)(project, options);
24
- project.targets.build = (0, get_build_config_1.getBuildConfig)(project, options);
25
- project.targets.serve = (0, get_serve_config_1.getServeConfig)(project, options);
26
- project.targets.deploy = (0, get_deploy_config_1.getDeployConfig)(project, options);
27
- project.targets.install = (0, get_install_config_1.getInstallConfig)(project, options);
24
+ project.targets.register = (0, get_register_config_1.getRegisterConfig)({ outputPath });
25
+ project.targets.build = (0, get_build_config_1.getBuildConfig)({
26
+ outputPath,
27
+ webpackConfig: (0, devkit_1.joinPathFragments)(project.root, 'webpack.config.js'),
28
+ });
29
+ project.targets.serve = (0, get_serve_config_1.getServeConfig)({ outputPath });
30
+ project.targets.deploy = (0, get_deploy_config_1.getDeployConfig)({ outputPath });
31
+ project.targets.install = (0, get_install_config_1.getInstallConfig)({ outputPath });
28
32
  (0, devkit_1.addProjectConfiguration)(tree, options.name, project, options.standaloneConfig);
29
33
  }
30
34
  exports.addProject = addProject;
@@ -1 +1 @@
1
- {"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/nx-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"}
1
+ {"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/generators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1,2 @@
1
+ import { CreateDependencies } from '@nx/devkit';
2
+ export declare const createDependencies: CreateDependencies;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDependencies = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const manifest_yml_1 = require("../utils/forge/manifest-yml");
7
+ const getCustomUIDependencies = ([projectName, manifestFile], context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ const manifestSchema = yield (0, manifest_yml_1.readManifestYml)(manifestFile.file);
9
+ const customUIProjectNames = (0, manifest_yml_1.extractCustomUIProjectNames)(manifestSchema);
10
+ const getCustomUIStaticDependency = (customUIProjectName) => {
11
+ const customUIProjectConfiguration = context.projects[customUIProjectName];
12
+ if (!customUIProjectConfiguration) {
13
+ throw new Error(`Failed to find Custom UI project in Nx workspace: The Custom UI dependency to project ${customUIProjectName} declared in the Forge manifest.yml of project ${projectName} cannot be found. Make sure the Custom UI resource path references a project in your Nx workspace.`);
14
+ }
15
+ const projectConfiguration = context.projects[projectName];
16
+ if (!projectConfiguration) {
17
+ throw new Error(`Missing project configuration in Nx workspace for project ${projectName}`);
18
+ }
19
+ return {
20
+ sourceFile: manifestFile.file,
21
+ source: projectName,
22
+ target: customUIProjectName,
23
+ type: devkit_1.DependencyType.static,
24
+ };
25
+ };
26
+ return customUIProjectNames.reduce((acc, customUIProjectName) => {
27
+ return (manifestFile.deps || []).find(([source, target, type]) => type === 'static' &&
28
+ target === customUIProjectName &&
29
+ source === projectName)
30
+ ? acc // Dependency already exists, skip adding it again.
31
+ : [...acc, getCustomUIStaticDependency(customUIProjectName)];
32
+ }, []);
33
+ });
34
+ const createDependencies = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
+ var _a, e_1, _b, _c;
36
+ let dependencies = [];
37
+ for (const projectName in context.filesToProcess.projectFileMap) {
38
+ const changed = context.filesToProcess.projectFileMap[projectName];
39
+ try {
40
+ for (var _d = true, _e = (e_1 = void 0, tslib_1.__asyncValues(changed.filter((f) => f.file.endsWith('manifest.yml')))), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
41
+ _c = _f.value;
42
+ _d = false;
43
+ const manifestFile = _c;
44
+ devkit_1.logger.info(`[nx-forge] Processing ${projectName}:${manifestFile.file}`);
45
+ const customUIDependencies = yield getCustomUIDependencies([projectName, manifestFile], context);
46
+ dependencies = dependencies.concat(customUIDependencies);
47
+ }
48
+ }
49
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
50
+ finally {
51
+ try {
52
+ if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
53
+ }
54
+ finally { if (e_1) throw e_1.error; }
55
+ }
56
+ }
57
+ return dependencies;
58
+ });
59
+ exports.createDependencies = createDependencies;
60
+ //# sourceMappingURL=create-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dependencies.js","sourceRoot":"","sources":["../../../../../packages/nx-forge/src/graph/create-dependencies.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AACpB,8DAGqC;AAErC,MAAM,uBAAuB,GAAG,CAC9B,CAAC,WAAW,EAAE,YAAY,CAAqB,EAC/C,OAAkC,EACI,EAAE;IACxC,MAAM,cAAc,GAAG,MAAM,IAAA,8BAAe,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,oBAAoB,GAAG,IAAA,0CAA2B,EAAC,cAAc,CAAC,CAAC;IAEzE,MAAM,2BAA2B,GAAG,CAClC,mBAA2B,EACA,EAAE;QAC7B,MAAM,4BAA4B,GAAG,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAE3E,IAAI,CAAC,4BAA4B,EAAE;YACjC,MAAM,IAAI,KAAK,CACb,yFAAyF,mBAAmB,kDAAkD,WAAW,oGAAoG,CAC9Q,CAAC;SACH;QAED,MAAM,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAE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AC,IAAI,CAAC,yBAAyB,WAAW,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;gBACzE,MAAM,oBAAoB,GAAG,MAAM,uBAAuB,CACxD,CAAC,WAAW,EAAE,YAAY,CAAC,EAC3B,OAAO,CACR,CAAC;gBACF,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;aAC1D;;;;;;;;;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAA,CAAC;AArBW,QAAA,kBAAkB,sBAqB7B"}
@@ -0,0 +1,2 @@
1
+ import { CreateNodes } from '@nx/devkit';
2
+ export declare const createNodes: CreateNodes;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createNodes = void 0;
4
+ const path_1 = require("path");
5
+ const get_register_config_1 = require("../shared/targets/get-register-config");
6
+ const get_build_config_1 = require("../shared/targets/get-build-config");
7
+ const get_serve_config_1 = require("../shared/targets/get-serve-config");
8
+ const get_deploy_config_1 = require("../shared/targets/get-deploy-config");
9
+ const get_install_config_1 = require("../shared/targets/get-install-config");
10
+ const registerProjectTargets = (projectRoot) => {
11
+ const outputPath = projectRoot === '.'
12
+ ? `{projectRoot}/dist}`
13
+ : `{workspaceRoot}/dist/{projectRoot}`;
14
+ const targets = {};
15
+ targets.register = (0, get_register_config_1.getRegisterConfig)({ outputPath });
16
+ targets.build = (0, get_build_config_1.getBuildConfig)({
17
+ outputPath,
18
+ webpackConfig: `{projectRoot}/webpack.config.js}`,
19
+ });
20
+ targets.serve = (0, get_serve_config_1.getServeConfig)({ outputPath });
21
+ targets.deploy = (0, get_deploy_config_1.getDeployConfig)({ outputPath });
22
+ targets.install = (0, get_install_config_1.getInstallConfig)({ outputPath });
23
+ return targets;
24
+ };
25
+ exports.createNodes = [
26
+ `**/manifest.yml`,
27
+ (manifestFilePath) => {
28
+ const projectRoot = (0, path_1.dirname)(manifestFilePath);
29
+ return {
30
+ projects: {
31
+ [projectRoot]: {
32
+ root: projectRoot,
33
+ type: 'application',
34
+ targets: registerProjectTargets(projectRoot),
35
+ },
36
+ },
37
+ };
38
+ },
39
+ ];
40
+ //# sourceMappingURL=create-nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-nodes.js","sourceRoot":"","sources":["../../../../../packages/nx-forge/src/graph/create-nodes.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,+EAA0E;AAC1E,yEAAoE;AACpE,yEAAoE;AACpE,2EAAsE;AACtE,6EAAwE;AAExE,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAE,EAAE;IACrD,MAAM,UAAU,GACd,WAAW,KAAK,GAAG;QACjB,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,oCAAoC,CAAC;IAE3C,MAAM,OAAO,GAAwC,EAAE,CAAC;IAExD,OAAO,CAAC,QAAQ,GAAG,IAAA,uCAAiB,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,KAAK,GAAG,IAAA,iCAAc,EAAC;QAC7B,UAAU;QACV,aAAa,EAAE,kCAAkC;KAClD,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,GAAG,IAAA,iCAAc,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,MAAM,GAAG,IAAA,mCAAe,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,OAAO,GAAG,IAAA,qCAAgB,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAEnD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEW,QAAA,WAAW,GAAgB;IACtC,iBAAiB;IACjB,CAAC,gBAAgB,EAAE,EAAE;QACnB,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,gBAAgB,CAAC,CAAC;QAC9C,OAAO;YACL,QAAQ,EAAE;gBACR,CAAC,WAAW,CAAC,EAAE;oBACb,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,aAAa;oBACnB,OAAO,EAAE,sBAAsB,CAAC,WAAW,CAAC;iBAC7C;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
package/src/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ const create_nodes_1 = require("./graph/create-nodes");
3
+ const create_dependencies_1 = require("./graph/create-dependencies");
2
4
  const forge_project_graph_1 = require("./graph/forge-project-graph");
3
5
  const nxPlugin = {
4
6
  name: '@toolsplus/nx-forge',
7
+ createNodes: create_nodes_1.createNodes,
8
+ createDependencies: create_dependencies_1.createDependencies,
5
9
  processProjectGraph: forge_project_graph_1.processProjectGraph,
6
10
  };
7
11
  module.exports = nxPlugin;
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/nx-forge/src/index.ts"],"names":[],"mappings":";AACA,qEAAkE;AAElE,MAAM,QAAQ,GAAa;IACzB,IAAI,EAAE,qBAAqB;IAC3B,mBAAmB,EAAnB,yCAAmB;CACpB,CAAC;AAEF,iBAAS,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/nx-forge/src/index.ts"],"names":[],"mappings":";AACA,uDAAmD;AACnD,qEAAiE;AACjE,qEAAkE;AAElE,MAAM,QAAQ,GAAa;IACzB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAX,0BAAW;IACX,kBAAkB,EAAlB,wCAAkB;IAClB,mBAAmB,EAAnB,yCAAmB;CACpB,CAAC;AAEF,iBAAS,QAAQ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TargetConfiguration } from '@nx/devkit';
2
+ interface GetBuildConfigOptions {
3
+ outputPath: string;
4
+ webpackConfig: string;
5
+ }
6
+ export declare function getBuildConfig(options: GetBuildConfigOptions): TargetConfiguration;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBuildConfig = void 0;
4
+ function getBuildConfig(options) {
5
+ return {
6
+ executor: '@toolsplus/nx-forge:build',
7
+ outputs: ['{options.outputPath}'],
8
+ options: {
9
+ outputPath: options.outputPath,
10
+ webpackConfig: options.webpackConfig,
11
+ },
12
+ };
13
+ }
14
+ exports.getBuildConfig = getBuildConfig;
15
+ //# sourceMappingURL=get-build-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-build-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/shared/targets/get-build-config.ts"],"names":[],"mappings":";;;AAOA,SAAgB,cAAc,CAC5B,OAA8B;IAE9B,OAAO;QACL,QAAQ,EAAE,2BAA2B;QACrC,OAAO,EAAE,CAAC,sBAAsB,CAAC;QACjC,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC;KACF,CAAC;AACJ,CAAC;AAXD,wCAWC"}
@@ -0,0 +1,6 @@
1
+ import { TargetConfiguration } from '@nx/devkit';
2
+ interface GetDeployConfigOptions {
3
+ outputPath: string;
4
+ }
5
+ export declare function getDeployConfig(options: GetDeployConfigOptions): TargetConfiguration;
6
+ export {};
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDeployConfig = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- function getDeployConfig(project, options) {
4
+ function getDeployConfig(options) {
6
5
  return {
7
6
  executor: '@toolsplus/nx-forge:deploy',
8
7
  options: {
9
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
8
+ outputPath: options.outputPath,
10
9
  },
11
10
  };
12
11
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-deploy-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/shared/targets/get-deploy-config.ts"],"names":[],"mappings":";;;AAKA,SAAgB,eAAe,CAC7B,OAA+B;IAE/B,OAAO;QACL,QAAQ,EAAE,4BAA4B;QACtC,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,CAAC;AACJ,CAAC;AATD,0CASC"}
@@ -0,0 +1,6 @@
1
+ import { TargetConfiguration } from '@nx/devkit';
2
+ interface GetInstallConfigOptions {
3
+ outputPath: string;
4
+ }
5
+ export declare function getInstallConfig(options: GetInstallConfigOptions): TargetConfiguration;
6
+ export {};
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInstallConfig = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- function getInstallConfig(project, options) {
4
+ function getInstallConfig(options) {
6
5
  return {
7
6
  executor: '@toolsplus/nx-forge:install',
8
7
  options: {
9
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
8
+ outputPath: options.outputPath,
10
9
  },
11
10
  };
12
11
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-install-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/shared/targets/get-install-config.ts"],"names":[],"mappings":";;;AAMA,SAAgB,gBAAgB,CAC9B,OAAgC;IAEhC,OAAO;QACL,QAAQ,EAAE,6BAA6B;QACvC,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,CAAC;AACJ,CAAC;AATD,4CASC"}
@@ -0,0 +1,6 @@
1
+ import { TargetConfiguration } from '@nx/devkit';
2
+ interface GetRegisterConfigOptions {
3
+ outputPath: string;
4
+ }
5
+ export declare function getRegisterConfig(options: GetRegisterConfigOptions): TargetConfiguration;
6
+ export {};
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRegisterConfig = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- function getRegisterConfig(project, options) {
4
+ function getRegisterConfig(options) {
6
5
  return {
7
6
  executor: '@toolsplus/nx-forge:register',
8
7
  options: {
9
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
8
+ outputPath: options.outputPath,
10
9
  },
11
10
  };
12
11
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-register-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/shared/targets/get-register-config.ts"],"names":[],"mappings":";;;AAKA,SAAgB,iBAAiB,CAC/B,OAAiC;IAEjC,OAAO;QACL,QAAQ,EAAE,8BAA8B;QACxC,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,CAAC;AACJ,CAAC;AATD,8CASC"}
@@ -0,0 +1,6 @@
1
+ import { TargetConfiguration } from '@nx/devkit';
2
+ interface GetServeConfigOptions {
3
+ outputPath: string;
4
+ }
5
+ export declare function getServeConfig(options: GetServeConfigOptions): TargetConfiguration;
6
+ export {};
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getServeConfig = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- function getServeConfig(project, options) {
4
+ function getServeConfig(options) {
6
5
  return {
7
6
  executor: '@toolsplus/nx-forge:tunnel',
8
7
  options: {
9
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
8
+ outputPath: options.outputPath,
10
9
  },
11
10
  };
12
11
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-serve-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-forge/src/shared/targets/get-serve-config.ts"],"names":[],"mappings":";;;AAKA,SAAgB,cAAc,CAC5B,OAA8B;IAE9B,OAAO;QACL,QAAQ,EAAE,4BAA4B;QACtC,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,CAAC;AACJ,CAAC;AATD,wCASC"}
@@ -1,3 +0,0 @@
1
- import { NormalizedOptions } from '../schema';
2
- import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
3
- export declare function getBuildConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBuildConfig = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- function getBuildConfig(project, options) {
6
- return {
7
- executor: '@toolsplus/nx-forge:build',
8
- outputs: ['{options.outputPath}'],
9
- options: {
10
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
11
- webpackConfig: (0, devkit_1.joinPathFragments)(project.root, 'webpack.config.js'),
12
- },
13
- };
14
- }
15
- exports.getBuildConfig = getBuildConfig;
16
- //# sourceMappingURL=get-build-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-build-config.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/generators/application/lib/get-build-config.ts"],"names":[],"mappings":";;;AACA,uCAIoB;AAEpB,SAAgB,cAAc,CAC5B,OAA6B,EAC7B,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,2BAA2B;QACrC,OAAO,EAAE,CAAC,sBAAsB,CAAC;QACjC,OAAO,EAAE;YACP,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;YAC7D,aAAa,EAAE,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC;SACpE;KACF,CAAC;AACJ,CAAC;AAZD,wCAYC"}
@@ -1,3 +0,0 @@
1
- import { NormalizedOptions } from '../schema';
2
- import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
3
- export declare function getDeployConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-deploy-config.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/generators/application/lib/get-deploy-config.ts"],"names":[],"mappings":";;;AACA,uCAIoB;AAEpB,SAAgB,eAAe,CAC7B,OAA6B,EAC7B,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,4BAA4B;QACtC,OAAO,EAAE;YACP,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;KACF,CAAC;AACJ,CAAC;AAVD,0CAUC"}
@@ -1,3 +0,0 @@
1
- import { NormalizedOptions } from '../schema';
2
- import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
3
- export declare function getInstallConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-install-config.js","sourceRoot":"","sources":["../../../../../../../packages/nx-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"}
@@ -1,3 +0,0 @@
1
- import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
2
- import { NormalizedOptions } from '../schema';
3
- export declare function getRegisterConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-register-config.js","sourceRoot":"","sources":["../../../../../../../packages/nx-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 +0,0 @@
1
- import { NormalizedOptions } from '../schema';
2
- import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
3
- export declare function getServeConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-serve-config.js","sourceRoot":"","sources":["../../../../../../../packages/nx-forge/src/generators/application/lib/get-serve-config.ts"],"names":[],"mappings":";;;AACA,uCAIoB;AAEpB,SAAgB,cAAc,CAC5B,OAA6B,EAC7B,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,4BAA4B;QACtC,OAAO,EAAE;YACP,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;KACF,CAAC;AACJ,CAAC;AAVD,wCAUC"}