@toolsplus/nx-forge 1.4.0 → 2.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 +14 -9
- package/executors.json +6 -0
- package/package.json +8 -9
- package/src/executors/build/executor.d.ts +1 -1
- package/src/executors/build/executor.js +14 -24
- package/src/executors/build/executor.js.map +1 -1
- package/src/executors/build/lib/compile-webpack.d.ts +3 -2
- package/src/executors/build/lib/compile-webpack.js +4 -3
- package/src/executors/build/lib/compile-webpack.js.map +1 -1
- package/src/executors/build/lib/copy-forge-app-assets.js +2 -2
- package/src/executors/build/lib/copy-forge-app-assets.js.map +1 -1
- package/src/executors/build/lib/generate-package-json.d.ts +1 -1
- package/src/executors/build/lib/generate-package-json.js +1 -1
- package/src/executors/build/lib/generate-package-json.js.map +1 -1
- package/src/executors/build/lib/patch-manifest-yml.js +2 -2
- package/src/executors/build/lib/patch-manifest-yml.js.map +1 -1
- package/src/executors/build/lib/process-custom-ui-dependencies.d.ts +1 -1
- package/src/executors/build/lib/process-custom-ui-dependencies.js +5 -4
- package/src/executors/build/lib/process-custom-ui-dependencies.js.map +1 -1
- package/src/executors/build/schema.json +3 -2
- package/src/executors/deploy/executor.js +15 -18
- package/src/executors/deploy/executor.js.map +1 -1
- package/src/executors/deploy/schema.json +8 -3
- package/src/executors/tunnel/executor.d.ts +14 -0
- package/src/executors/tunnel/executor.js +74 -0
- package/src/executors/tunnel/executor.js.map +1 -0
- package/src/executors/tunnel/lib/extract-custom-ui-projects.d.ts +11 -0
- package/src/executors/tunnel/lib/extract-custom-ui-projects.js +63 -0
- package/src/executors/tunnel/lib/extract-custom-ui-projects.js.map +1 -0
- package/src/executors/tunnel/lib/run-tunnel.d.ts +21 -0
- package/src/executors/tunnel/lib/run-tunnel.js +59 -0
- package/src/executors/tunnel/lib/run-tunnel.js.map +1 -0
- package/src/executors/tunnel/lib/wait-until-server-is-listening.d.ts +8 -0
- package/src/executors/tunnel/lib/wait-until-server-is-listening.js +52 -0
- package/src/executors/tunnel/lib/wait-until-server-is-listening.js.map +1 -0
- package/src/executors/tunnel/schema.d.ts +5 -0
- package/src/executors/tunnel/schema.json +30 -0
- package/src/generators/application/files/README.md +12 -2
- package/src/generators/application/generator.d.ts +1 -1
- package/src/generators/application/generator.js +5 -5
- package/src/generators/application/generator.js.map +1 -1
- package/src/generators/application/lib/add-project.d.ts +1 -1
- package/src/generators/application/lib/add-project.js +1 -6
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/application/lib/create-files.d.ts +1 -1
- package/src/generators/application/lib/create-files.js +3 -3
- package/src/generators/application/lib/create-files.js.map +1 -1
- package/src/generators/application/lib/get-build-config.d.ts +1 -1
- package/src/generators/application/lib/get-build-config.js +1 -1
- package/src/generators/application/lib/get-build-config.js.map +1 -1
- package/src/generators/application/lib/get-deploy-config.d.ts +1 -1
- package/src/generators/application/lib/get-deploy-config.js +1 -1
- package/src/generators/application/lib/get-deploy-config.js.map +1 -1
- package/src/generators/application/lib/get-serve-config.d.ts +1 -1
- package/src/generators/application/lib/get-serve-config.js +3 -12
- package/src/generators/application/lib/get-serve-config.js.map +1 -1
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +2 -2
- package/src/generators/application/lib/normalize-options.js.map +1 -1
- package/src/generators/application/schema.json +11 -8
- package/src/generators/init/generator.d.ts +1 -1
- package/src/generators/init/generator.js +4 -7
- package/src/generators/init/generator.js.map +1 -1
- package/src/generators/init/lib/add-dependencies.d.ts +1 -1
- package/src/generators/init/lib/add-dependencies.js +1 -1
- package/src/generators/init/lib/add-dependencies.js.map +1 -1
- package/src/generators/init/schema.json +4 -2
- package/src/utils/forge/load-manifest-yml.js.map +1 -0
- package/src/executors/build/lib/load-manifest-yml.js.map +0 -1
- /package/src/{executors/build/lib → utils/forge}/load-manifest-yml.d.ts +0 -0
- /package/src/{executors/build/lib → utils/forge}/load-manifest-yml.js +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCustomUiProjects = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const load_manifest_yml_1 = require("../../../utils/forge/load-manifest-yml");
|
|
7
|
+
/**
|
|
8
|
+
* Extracts all configured Custom UI resources and their tunnel port for this Forge app.
|
|
9
|
+
*
|
|
10
|
+
* @param context Executor context for this call
|
|
11
|
+
* @returns Custom UI project names and the tunnel port on which they are required to serve their dev server.
|
|
12
|
+
*/
|
|
13
|
+
function getCustomUiProjects(context) {
|
|
14
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const projects = yield extractVerifiedCustomUiProjects(context);
|
|
16
|
+
return projects.map((p) => ({
|
|
17
|
+
projectName: p.path,
|
|
18
|
+
port: p.tunnel.port,
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.getCustomUiProjects = getCustomUiProjects;
|
|
23
|
+
/**
|
|
24
|
+
* Extracts all Custom UI projects from the manifest.yml
|
|
25
|
+
*
|
|
26
|
+
* This will assert that:
|
|
27
|
+
*
|
|
28
|
+
* - the Nx workspace has a project configured for each Custom UI project
|
|
29
|
+
* - each Custom UI project has a 'serve' target
|
|
30
|
+
* - each Custom UI project is listed as an implicit dependency of the Forge app
|
|
31
|
+
* - each Custom UI resource has a configured tunnel port in the Forge app's manifest.yml
|
|
32
|
+
*
|
|
33
|
+
* @param context Executor context for this call
|
|
34
|
+
* @returns All configured and verified Custom UI resources
|
|
35
|
+
*/
|
|
36
|
+
function extractVerifiedCustomUiProjects(context) {
|
|
37
|
+
var _a;
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const manifestPath = (0, devkit_1.joinPathFragments)(context.root, 'apps', context.projectName, 'manifest.yml');
|
|
40
|
+
const manifestSchema = yield (0, load_manifest_yml_1.loadManifestYml)(manifestPath);
|
|
41
|
+
const resources = (_a = manifestSchema.resources) !== null && _a !== void 0 ? _a : [];
|
|
42
|
+
return resources.map(verifyCustomUIDependency(context));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const verifyCustomUIDependency = (context) => (resource) => {
|
|
46
|
+
var _a;
|
|
47
|
+
const customUIProjectName = resource.path;
|
|
48
|
+
const customUIProjectConfiguration = context.workspace.projects[customUIProjectName];
|
|
49
|
+
if (!customUIProjectConfiguration) {
|
|
50
|
+
throw new Error(`Nx workspace is missing project for Custom UI path ${customUIProjectName}. Make sure the Custom UI resource path references a project in your Nx workspace.`);
|
|
51
|
+
}
|
|
52
|
+
if (!customUIProjectConfiguration.targets['serve']) {
|
|
53
|
+
throw new Error(`Custom UI project '${customUIProjectName}' targets is missing a 'serve' executor. Make sure the 'targets' property in the project's 'project.json' has a 'serve' executor configured.`);
|
|
54
|
+
}
|
|
55
|
+
if (!((_a = context.workspace.projects[context.projectName].implicitDependencies) === null || _a === void 0 ? void 0 : _a.includes(customUIProjectName))) {
|
|
56
|
+
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.`);
|
|
57
|
+
}
|
|
58
|
+
if (!resource.tunnel || !Number.isInteger(resource.tunnel.port)) {
|
|
59
|
+
throw new Error(`Custom UI resource with key ${resource.key} is missing tunnel port in manifest.yml. Follow the Forge docs on how to add a tunnel port to the Custom UI resource with key ${resource.key}: https://developer.atlassian.com/platform/forge/tunneling/#connecting-the-tunnel-to-your-own-dev-server`);
|
|
60
|
+
}
|
|
61
|
+
return resource;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=extract-custom-ui-projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-custom-ui-projects.js","sourceRoot":"","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IAAI,KAAK,CACb,sBAAsB,mBAAmB,8IAA8I,CACxL,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,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAC/D,MAAM,IAAI,KAAK,CACb,+BAA+B,QAAQ,CAAC,GAAG,iIAAiI,QAAQ,CAAC,GAAG,0GAA0G,CACnS,CAAC;KACH;IAED,OAAO,QAAkC,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { TunnelExecutorOptions } from '../schema';
|
|
3
|
+
/**
|
|
4
|
+
* Starts the `forge tunnel` process in the app's output directory. The execution of `forge tunnel` will be delayed
|
|
5
|
+
* until all configured Custom UI dev servers are listening on their configured tunnel port.
|
|
6
|
+
*
|
|
7
|
+
* This will set the `FORGE_TUNNEL_MOUNT_DIRECTORIES` env variable on the tunnel process to mount the Nx workspace
|
|
8
|
+
* root `node_modules` folder into the tunnel container. This makes sure that the Forge bundler running in the tunnel
|
|
9
|
+
* Docker container knows about installed npm dependencies.
|
|
10
|
+
*
|
|
11
|
+
* @param options Tunnel executor options
|
|
12
|
+
* @param context Executor context for this call
|
|
13
|
+
*/
|
|
14
|
+
export default function runTunnel(options: TunnelExecutorOptions & {
|
|
15
|
+
customUiProjectConfigs: {
|
|
16
|
+
projectName: string;
|
|
17
|
+
port: number;
|
|
18
|
+
}[];
|
|
19
|
+
}, context: ExecutorContext): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 path_1 = require("path");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const wait_until_server_is_listening_1 = require("./wait-until-server-is-listening");
|
|
8
|
+
/**
|
|
9
|
+
* Starts the `forge tunnel` process in the app's output directory. The execution of `forge tunnel` will be delayed
|
|
10
|
+
* until all configured Custom UI dev servers are listening on their configured tunnel port.
|
|
11
|
+
*
|
|
12
|
+
* This will set the `FORGE_TUNNEL_MOUNT_DIRECTORIES` env variable on the tunnel process to mount the Nx workspace
|
|
13
|
+
* root `node_modules` folder into the tunnel container. This makes sure that the Forge bundler running in the tunnel
|
|
14
|
+
* Docker container knows about installed npm dependencies.
|
|
15
|
+
*
|
|
16
|
+
* @param options Tunnel executor options
|
|
17
|
+
* @param context Executor context for this call
|
|
18
|
+
*/
|
|
19
|
+
function runTunnel(options, context) {
|
|
20
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
devkit_1.logger.info(`Wait for all Custom UI 'serve' targets to have started and servers are listening...`);
|
|
22
|
+
yield Promise.all(options.customUiProjectConfigs.map(({ port }) => (0, wait_until_server_is_listening_1.waitUntilServerIsListening)(port, context)));
|
|
23
|
+
devkit_1.logger.info(`All Custom UI 'serve' targets have started and servers are listening`);
|
|
24
|
+
const args = [
|
|
25
|
+
'tunnel',
|
|
26
|
+
...(options.verbose === true ? ['--verbose'] : []),
|
|
27
|
+
...(options.debug === true ? ['--debug'] : []),
|
|
28
|
+
];
|
|
29
|
+
const command = `forge ${args.join(' ')}`;
|
|
30
|
+
devkit_1.logger.log(`Running: ${command}`);
|
|
31
|
+
// https://2ality.com/2018/05/child-process-streams.html#running-commands-in-child-processes
|
|
32
|
+
const tunnelProcess = (0, child_process_1.spawn)('forge', args, {
|
|
33
|
+
cwd: options.outputPath,
|
|
34
|
+
env: Object.assign(Object.assign({}, process.env), {
|
|
35
|
+
// Mount the root node_modules folder into the tunnel container to avoid having to npm install in the dist directory
|
|
36
|
+
// https://github.com/toolsplus/forge-turbo/issues/1#issue-1451384347
|
|
37
|
+
FORGE_TUNNEL_MOUNT_DIRECTORIES: `${(0, path_1.join)(context.root, 'node_modules')}:/app/node_modules` }),
|
|
38
|
+
stdio: 'inherit',
|
|
39
|
+
});
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
tunnelProcess.once('exit', (code) => {
|
|
42
|
+
if (code === 0) {
|
|
43
|
+
devkit_1.logger.info('Exiting the forge tunnel process...');
|
|
44
|
+
resolve({
|
|
45
|
+
success: true,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
reject(new Error('Forge tunnel process terminated with error code: ' + code));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
tunnelProcess.once('error', (err) => {
|
|
53
|
+
reject(new Error('Forge tunnel process failed: ' + err));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.default = runTunnel;
|
|
59
|
+
//# sourceMappingURL=run-tunnel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-tunnel.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/tunnel/lib/run-tunnel.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AACrD,+BAA4B;AAC5B,iDAAsC;AAEtC,qFAA8E;AAE9E;;;;;;;;;;GAUG;AACH,SAA8B,SAAS,CACrC,OAKC,EACD,OAAwB;;QAExB,eAAM,CAAC,IAAI,CACT,qFAAqF,CACtF,CAAC;QAEF,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,IAA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,CAAC,CACtE,CAAC;iBACH;YACH,CAAC,CAAC,CAAC;YACH,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;gBACzC,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,GAAG,GAAG,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAhED,4BAgEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param port Port on which the server is listening
|
|
5
|
+
* @param context Executor context for this invocation
|
|
6
|
+
* @see https://github.com/nrwl/nx/blob/cded83b2c5bf3e4252c03d4dbcbb5b203b0faed0/packages/webpack/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.ts
|
|
7
|
+
*/
|
|
8
|
+
export declare function waitUntilServerIsListening(port: number, context: ExecutorContext): Promise<void>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitUntilServerIsListening = void 0;
|
|
4
|
+
const net = require("net");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param port Port on which the server is listening
|
|
9
|
+
* @param context Executor context for this invocation
|
|
10
|
+
* @see https://github.com/nrwl/nx/blob/cded83b2c5bf3e4252c03d4dbcbb5b203b0faed0/packages/webpack/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.ts
|
|
11
|
+
*/
|
|
12
|
+
function waitUntilServerIsListening(port, context) {
|
|
13
|
+
const allowedErrorCodes = ['ECONNREFUSED', 'ECONNRESET'];
|
|
14
|
+
const maxAttempts = 15;
|
|
15
|
+
let attempts = 0;
|
|
16
|
+
const client = new net.Socket();
|
|
17
|
+
const cleanup = () => {
|
|
18
|
+
client.removeAllListeners('connect');
|
|
19
|
+
client.removeAllListeners('error');
|
|
20
|
+
client.end();
|
|
21
|
+
client.destroy();
|
|
22
|
+
client.unref();
|
|
23
|
+
};
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
const listen = () => {
|
|
26
|
+
client.once('connect', () => {
|
|
27
|
+
cleanup();
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
client.on('error', (err) => {
|
|
31
|
+
if (attempts > maxAttempts ||
|
|
32
|
+
!allowedErrorCodes.includes(err['code'])) {
|
|
33
|
+
if (context.isVerbose) {
|
|
34
|
+
devkit_1.logger.error(`Could not wait for server to start on port ${port}: ${attempts > maxAttempts
|
|
35
|
+
? `Max attempts (${maxAttempts}) exceeded`
|
|
36
|
+
: `Server returned unexpected error code ${err['code']}`}`);
|
|
37
|
+
}
|
|
38
|
+
cleanup();
|
|
39
|
+
reject(err);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
attempts++;
|
|
43
|
+
setTimeout(listen, 1000 * attempts);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
client.connect({ port, host: 'localhost' });
|
|
47
|
+
};
|
|
48
|
+
listen();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.waitUntilServerIsListening = waitUntilServerIsListening;
|
|
52
|
+
//# sourceMappingURL=wait-until-server-is-listening.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait-until-server-is-listening.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/executors/tunnel/lib/wait-until-server-is-listening.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,uCAAqD;AAErD;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,IAAY,EACZ,OAAwB;IAExB,MAAM,iBAAiB,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,MAA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,CAAC;QACF,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AA/CD,gEA+CC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"$schema": "http://json-schema.org/schema",
|
|
5
|
+
"title": "Forge application serve target",
|
|
6
|
+
"description": "Forge application serve target",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"outputPath": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The output path of the Forge app files.",
|
|
12
|
+
"visible": false
|
|
13
|
+
},
|
|
14
|
+
"debug": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"description": "Run Forge tunnel in debug mode.",
|
|
17
|
+
"alias": "d",
|
|
18
|
+
"default": false
|
|
19
|
+
},
|
|
20
|
+
"verbose": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "Run Forge tunnel in verbose mode.",
|
|
23
|
+
"alias": "v",
|
|
24
|
+
"default": false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"outputPath"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -15,7 +15,15 @@ After that, proceed with the initial registration of the app with the Forge plat
|
|
|
15
15
|
|
|
16
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
17
|
|
|
18
|
-
##
|
|
18
|
+
## Tunnel-based dev loop
|
|
19
|
+
|
|
20
|
+
Before you tunnel a Forge app, make sure you have completed the prerequisites steps above. After that, run
|
|
21
|
+
|
|
22
|
+
nx serve <%= name %>
|
|
23
|
+
|
|
24
|
+
This will start the `serve` target for all Custom UI projects defined in the app `manifest.yml` on their specified tunnel port. After that, it will start a build process in watch mode for the Forge app itself, before ultimately, starting the `forge tunnel` process for the Forge app.
|
|
25
|
+
|
|
26
|
+
## Manual dev loop
|
|
19
27
|
|
|
20
28
|
When the app code changes, the updated code has to rebuilt by calling
|
|
21
29
|
|
|
@@ -23,12 +31,14 @@ When the app code changes, the updated code has to rebuilt by calling
|
|
|
23
31
|
|
|
24
32
|
and re-deployed to the Forge platform using
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
nx deploy <%= name %>
|
|
27
35
|
|
|
28
36
|
If the app's `manifest.yml` changed, you may have to upgrade an existing installation by running
|
|
29
37
|
|
|
30
38
|
forge install --upgrade
|
|
31
39
|
|
|
40
|
+
from within the dist directory.
|
|
41
|
+
|
|
32
42
|
|
|
33
43
|
|
|
34
44
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
import { ApplicationGeneratorOptions } from './schema';
|
|
3
3
|
export default function (tree: Tree, rawOptions: ApplicationGeneratorOptions): Promise<GeneratorCallback>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const devkit_1 = require("@
|
|
5
|
-
const run_tasks_in_serial_1 = require("@
|
|
6
|
-
const linter_1 = require("@
|
|
7
|
-
const jest_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const run_tasks_in_serial_1 = require("@nx/workspace/src/utilities/run-tasks-in-serial");
|
|
6
|
+
const linter_1 = require("@nx/linter");
|
|
7
|
+
const jest_1 = require("@nx/jest");
|
|
8
8
|
const generator_1 = require("../init/generator");
|
|
9
9
|
const lib_1 = require("./lib");
|
|
10
10
|
function default_1(tree, rawOptions) {
|
|
@@ -39,7 +39,7 @@ function default_1(tree, rawOptions) {
|
|
|
39
39
|
setupFile: 'none',
|
|
40
40
|
skipSerializers: true,
|
|
41
41
|
supportTsx: options.js,
|
|
42
|
-
|
|
42
|
+
compiler: 'tsc',
|
|
43
43
|
testEnvironment: 'node',
|
|
44
44
|
skipFormat: true,
|
|
45
45
|
});
|
|
@@ -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,uCAMoB;AACpB,yFAAmF;AACnF,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,sCAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAtDD,4BAsDC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProject = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const get_build_config_1 = require("./get-build-config");
|
|
6
6
|
const get_deploy_config_1 = require("./get-deploy-config");
|
|
7
7
|
const get_serve_config_1 = require("./get-serve-config");
|
|
@@ -21,11 +21,6 @@ function addProject(tree, options) {
|
|
|
21
21
|
project.targets.serve = (0, get_serve_config_1.getServeConfig)(project, options);
|
|
22
22
|
project.targets.deploy = (0, get_deploy_config_1.getDeployConfig)(project, options);
|
|
23
23
|
(0, devkit_1.addProjectConfiguration)(tree, options.name, project, options.standaloneConfig);
|
|
24
|
-
const workspace = (0, devkit_1.readWorkspaceConfiguration)(tree);
|
|
25
|
-
if (!workspace.defaultProject) {
|
|
26
|
-
workspace.defaultProject = options.name;
|
|
27
|
-
(0, devkit_1.updateWorkspaceConfiguration)(tree, workspace);
|
|
28
|
-
}
|
|
29
24
|
}
|
|
30
25
|
exports.addProject = addProject;
|
|
31
26
|
//# sourceMappingURL=add-project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AAAA,
|
|
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;AAnBD,gCAmBC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFiles = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
5
|
-
const
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const js_1 = require("@nx/js");
|
|
6
6
|
function createFiles(tree, options) {
|
|
7
7
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.appProjectRoot, {
|
|
8
8
|
tmpl: '',
|
|
9
9
|
name: options.name,
|
|
10
10
|
root: options.appProjectRoot,
|
|
11
11
|
offset: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
|
|
12
|
-
rootTsConfigPath: (0,
|
|
12
|
+
rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot),
|
|
13
13
|
});
|
|
14
14
|
if (options.js) {
|
|
15
15
|
(0, devkit_1.toJS)(tree);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AACA,uCAKoB;AACpB,+BAAuD;AAGvD,SAAgB,WAAW,CAAC,IAAU,EAAE,OAA0B;IAChE,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,EAC3C,OAAO,CAAC,cAAc,EACtB;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,cAAc;QAC5B,MAAM,EAAE,IAAA,uBAAc,EAAC,OAAO,CAAC,cAAc,CAAC;QAC9C,gBAAgB,EAAE,IAAA,kCAA6B,EAC7C,IAAI,EACJ,OAAO,CAAC,cAAc,CACvB;KACF,CACF,CAAC;IAEF,IAAI,OAAO,CAAC,EAAE,EAAE;QACd,IAAA,aAAI,EAAC,IAAI,CAAC,CAAC;KACZ;AACH,CAAC;AApBD,kCAoBC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NormalizedOptions } from '../schema';
|
|
2
|
-
import { ProjectConfiguration, TargetConfiguration } from '@
|
|
2
|
+
import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
|
|
3
3
|
export declare function getBuildConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBuildConfig = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function getBuildConfig(project, options) {
|
|
6
6
|
return {
|
|
7
7
|
executor: '@toolsplus/nx-forge:build',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-build-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-build-config.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"get-build-config.js","sourceRoot":"","sources":["../../../../../../../packages/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;SAC9D;KACF,CAAC;AACJ,CAAC;AAXD,wCAWC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NormalizedOptions } from '../schema';
|
|
2
|
-
import { ProjectConfiguration, TargetConfiguration } from '@
|
|
2
|
+
import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
|
|
3
3
|
export declare function getDeployConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDeployConfig = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function getDeployConfig(project, options) {
|
|
6
6
|
return {
|
|
7
7
|
executor: '@toolsplus/nx-forge:deploy',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-deploy-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-deploy-config.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"get-deploy-config.js","sourceRoot":"","sources":["../../../../../../../packages/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 +1,3 @@
|
|
|
1
1
|
import { NormalizedOptions } from '../schema';
|
|
2
|
-
import { ProjectConfiguration, TargetConfiguration } from '@
|
|
2
|
+
import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
|
|
3
3
|
export declare function getServeConfig(project: ProjectConfiguration, options: NormalizedOptions): TargetConfiguration;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getServeConfig = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function getServeConfig(project, options) {
|
|
6
6
|
return {
|
|
7
|
-
executor: '@
|
|
7
|
+
executor: '@toolsplus/nx-forge:tunnel',
|
|
8
8
|
options: {
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
command: `nx run ${options.name}:build --watch`,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
command: `forge tunnel`,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
cwd: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
|
|
18
|
-
parallel: true,
|
|
9
|
+
outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
|
|
19
10
|
},
|
|
20
11
|
};
|
|
21
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-serve-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-serve-config.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"get-serve-config.js","sourceRoot":"","sources":["../../../../../../../packages/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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Tree } from '@
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
2
|
import type { ApplicationGeneratorOptions, NormalizedOptions } from '../schema';
|
|
3
3
|
export declare function normalizeOptions(tree: Tree, options: ApplicationGeneratorOptions): NormalizedOptions;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
|
-
const linter_1 = require("@
|
|
5
|
-
const devkit_1 = require("@
|
|
4
|
+
const linter_1 = require("@nx/linter");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
function normalizeOptions(tree, options) {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const appDirectory = options.directory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC,uCAA0E;AAG1E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAoC;;IAEpC,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS;QACpC,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACxE,CAAC,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAEjC,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAExD,MAAM,cAAc,GAAG,IAAA,0BAAiB,EACtC,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC,OAAO,EAChC,YAAY,CACb,CAAC;IAEF,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI;QAC7B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,CAAC,CAAC,EAAE,CAAC;IAEP,uCACK,OAAO,KACV,IAAI,EAAE,IAAA,cAAK,EAAC,cAAc,CAAC,CAAC,QAAQ,EACpC,cAAc,EACd,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,eAAM,CAAC,MAAM,EACvC,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,MAAM,EAChD,UAAU,IACV;AACJ,CAAC;AA3BD,4CA2BC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
3
|
"$id": "NxForgeApplicationGenerator",
|
|
5
4
|
"title": "Nx Application Options Schema",
|
|
6
5
|
"type": "object",
|
|
@@ -27,13 +26,19 @@
|
|
|
27
26
|
"linter": {
|
|
28
27
|
"description": "Tool to use for running lint checks.",
|
|
29
28
|
"type": "string",
|
|
30
|
-
"enum": [
|
|
29
|
+
"enum": [
|
|
30
|
+
"eslint",
|
|
31
|
+
"none"
|
|
32
|
+
],
|
|
31
33
|
"default": "eslint"
|
|
32
34
|
},
|
|
33
35
|
"unitTestRunner": {
|
|
34
36
|
"description": "Test runner to use for unit tests.",
|
|
35
37
|
"type": "string",
|
|
36
|
-
"enum": [
|
|
38
|
+
"enum": [
|
|
39
|
+
"jest",
|
|
40
|
+
"none"
|
|
41
|
+
],
|
|
37
42
|
"default": "jest"
|
|
38
43
|
},
|
|
39
44
|
"tags": {
|
|
@@ -55,12 +60,10 @@
|
|
|
55
60
|
"type": "boolean",
|
|
56
61
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
57
62
|
"default": false
|
|
58
|
-
},
|
|
59
|
-
"standaloneConfig": {
|
|
60
|
-
"description": "Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json",
|
|
61
|
-
"type": "boolean"
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
"additionalProperties": false,
|
|
65
|
-
"required": [
|
|
66
|
+
"required": [
|
|
67
|
+
"name"
|
|
68
|
+
]
|
|
66
69
|
}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const devkit_1 = require("@
|
|
5
|
-
const set_default_collection_1 = require("@nrwl/workspace/src/utilities/set-default-collection");
|
|
6
|
-
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
5
|
const lib_1 = require("./lib");
|
|
8
|
-
const jest_1 = require("@
|
|
6
|
+
const jest_1 = require("@nx/jest");
|
|
9
7
|
function default_1(tree, rawOptions) {
|
|
10
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
9
|
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
12
|
-
(0,
|
|
13
|
-
const jestTask = (0, jest_1.jestInitGenerator)(tree, {});
|
|
10
|
+
const jestTask = yield (0, jest_1.jestInitGenerator)(tree, {});
|
|
14
11
|
const installPackagesTask = (0, lib_1.addDependencies)(tree);
|
|
15
12
|
if (!options.skipFormat) {
|
|
16
13
|
yield (0, devkit_1.formatFiles)(tree);
|
|
17
14
|
}
|
|
18
|
-
return (0,
|
|
15
|
+
return (0, devkit_1.runTasksInSerial)(jestTask, installPackagesTask);
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
18
|
exports.default = default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/generators/init/generator.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/generators/init/generator.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAEpB,+BAA0D;AAC1D,mCAA6C;AAE7C,mBACE,IAAU,EACV,UAA+B;;QAE/B,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAiB,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnD,MAAM,mBAAmB,GAAG,IAAA,qBAAe,EAAC,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACzD,CAAC;CAAA;AAbD,4BAaC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { GeneratorCallback, Tree } from '@
|
|
1
|
+
import type { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
export declare function addDependencies(tree: Tree): GeneratorCallback;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addDependencies = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("../../../utils/versions");
|
|
6
6
|
function addDependencies(tree) {
|
|
7
7
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {
|