@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "<%= offset %>dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"target": "es2017",
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"lib": ["dom", "es2017"],
|
|
11
|
+
"types": ["node"],
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"jsx": "react",
|
|
14
|
+
"jsxFactory": "ForgeUI.createElement"
|
|
15
|
+
},
|
|
16
|
+
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
|
|
17
|
+
"include": ["**/*.ts"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
6
|
+
const linter_1 = require("@nrwl/linter");
|
|
7
|
+
const jest_1 = require("@nrwl/jest");
|
|
8
|
+
const generator_1 = require("../init/generator");
|
|
9
|
+
const lib_1 = require("./lib");
|
|
10
|
+
function default_1(tree, rawOptions) {
|
|
11
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
12
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
13
|
+
const tasks = [];
|
|
14
|
+
const initTask = yield (0, generator_1.default)(tree, {
|
|
15
|
+
unitTestRunner: options.unitTestRunner,
|
|
16
|
+
skipFormat: true,
|
|
17
|
+
});
|
|
18
|
+
tasks.push(initTask);
|
|
19
|
+
(0, lib_1.createFiles)(tree, options);
|
|
20
|
+
(0, lib_1.addProject)(tree, options);
|
|
21
|
+
if (options.linter !== linter_1.Linter.None) {
|
|
22
|
+
const lintTask = yield (0, linter_1.lintProjectGenerator)(tree, {
|
|
23
|
+
linter: options.linter,
|
|
24
|
+
project: options.name,
|
|
25
|
+
tsConfigPaths: [
|
|
26
|
+
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
27
|
+
],
|
|
28
|
+
eslintFilePatterns: [
|
|
29
|
+
`${options.appProjectRoot}/**/*.${options.js ? 'js' : 'ts'}`,
|
|
30
|
+
],
|
|
31
|
+
skipFormat: true,
|
|
32
|
+
setParserOptionsProject: options.setParserOptionsProject,
|
|
33
|
+
});
|
|
34
|
+
tasks.push(lintTask);
|
|
35
|
+
}
|
|
36
|
+
if (options.unitTestRunner === 'jest') {
|
|
37
|
+
const jestTask = yield (0, jest_1.jestProjectGenerator)(tree, {
|
|
38
|
+
project: options.name,
|
|
39
|
+
setupFile: 'none',
|
|
40
|
+
skipSerializers: true,
|
|
41
|
+
supportTsx: options.js,
|
|
42
|
+
babelJest: options.babelJest,
|
|
43
|
+
testEnvironment: 'node',
|
|
44
|
+
skipFormat: true,
|
|
45
|
+
});
|
|
46
|
+
tasks.push(jestTask);
|
|
47
|
+
}
|
|
48
|
+
if (options.js) {
|
|
49
|
+
(0, devkit_1.updateTsConfigsToJs)(tree, { projectRoot: options.appProjectRoot });
|
|
50
|
+
}
|
|
51
|
+
if (!options.skipFormat) {
|
|
52
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
53
|
+
}
|
|
54
|
+
return (0, run_tasks_in_serial_1.runTasksInSerial)(...tasks);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.default = default_1;
|
|
58
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/generators/application/generator.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,2FAAqF;AACrF,yCAA4D;AAC5D,qCAAkD;AAClD,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,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tree } from '@nrwl/devkit';
|
|
2
|
+
import { NormalizedOptions } from '../schema';
|
|
3
|
+
/**
|
|
4
|
+
* Generate the new Forge app project in the workspace and configure
|
|
5
|
+
* available targets.
|
|
6
|
+
*/
|
|
7
|
+
export declare function addProject(tree: Tree, options: NormalizedOptions): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addProject = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const get_build_config_1 = require("./get-build-config");
|
|
6
|
+
const get_deploy_config_1 = require("./get-deploy-config");
|
|
7
|
+
const get_serve_config_1 = require("./get-serve-config");
|
|
8
|
+
/**
|
|
9
|
+
* Generate the new Forge app project in the workspace and configure
|
|
10
|
+
* available targets.
|
|
11
|
+
*/
|
|
12
|
+
function addProject(tree, options) {
|
|
13
|
+
const project = {
|
|
14
|
+
root: options.appProjectRoot,
|
|
15
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src'),
|
|
16
|
+
projectType: 'application',
|
|
17
|
+
targets: {},
|
|
18
|
+
tags: options.parsedTags,
|
|
19
|
+
};
|
|
20
|
+
project.targets.build = (0, get_build_config_1.getBuildConfig)(project, options);
|
|
21
|
+
project.targets.serve = (0, get_serve_config_1.getServeConfig)(project, options);
|
|
22
|
+
project.targets.deploy = (0, get_deploy_config_1.getDeployConfig)(project, options);
|
|
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
|
+
}
|
|
30
|
+
exports.addProject = addProject;
|
|
31
|
+
//# sourceMappingURL=add-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AAAA,yCAOsB;AAEtB,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;IAEF,MAAM,SAAS,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;QAC7B,SAAS,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;QACxC,IAAA,qCAA4B,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KAC/C;AACH,CAAC;AA1BD,gCA0BC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFiles = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
|
|
6
|
+
function createFiles(tree, options) {
|
|
7
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.appProjectRoot, {
|
|
8
|
+
tmpl: '',
|
|
9
|
+
name: options.name,
|
|
10
|
+
root: options.appProjectRoot,
|
|
11
|
+
offset: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
|
|
12
|
+
rootTsConfigPath: (0, typescript_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot),
|
|
13
|
+
});
|
|
14
|
+
if (options.js) {
|
|
15
|
+
(0, devkit_1.toJS)(tree);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.createFiles = createFiles;
|
|
19
|
+
//# sourceMappingURL=create-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAEtB,yEAAyF;AAEzF,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,0CAA6B,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBuildConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/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
|
+
},
|
|
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/forge/src/generators/application/lib/get-build-config.ts"],"names":[],"mappings":";;;AAKA,yCAAiD;AAEjD,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeployConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function getDeployConfig(project, options) {
|
|
6
|
+
return {
|
|
7
|
+
executor: '@toolsplus/nx-forge:deploy',
|
|
8
|
+
options: {
|
|
9
|
+
outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.getDeployConfig = getDeployConfig;
|
|
14
|
+
//# sourceMappingURL=get-deploy-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-deploy-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-deploy-config.ts"],"names":[],"mappings":";;;AAKA,yCAAiD;AAEjD,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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getServeConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function getServeConfig(project, options) {
|
|
6
|
+
return {
|
|
7
|
+
executor: '@nrwl/workspace:run-commands',
|
|
8
|
+
options: {
|
|
9
|
+
commands: [
|
|
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,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.getServeConfig = getServeConfig;
|
|
23
|
+
//# sourceMappingURL=get-serve-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-serve-config.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/get-serve-config.ts"],"names":[],"mappings":";;;AAKA,yCAAiD;AAEjD,SAAgB,cAAc,CAC5B,OAA6B,EAC7B,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,8BAA8B;QACxC,OAAO,EAAE;YACP,QAAQ,EAAE;gBACR;oBACE,OAAO,EAAE,UAAU,OAAO,CAAC,IAAI,gBAAgB;iBAChD;gBACD;oBACE,OAAO,EAAE,cAAc;iBACxB;aACF;YACD,GAAG,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;YACtD,QAAQ,EAAE,IAAI;SACf;KACF,CAAC;AACJ,CAAC;AAnBD,wCAmBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./create-files"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./normalize-options"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./add-project"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/index.ts"],"names":[],"mappings":";;;AAAA,8DAA+B;AAC/B,mEAAoC;AACpC,6DAA8B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
const linter_1 = require("@nrwl/linter");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
function normalizeOptions(tree, options) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const appDirectory = options.directory
|
|
9
|
+
? `${(0, devkit_1.names)(options.directory).fileName}/${(0, devkit_1.names)(options.name).fileName}`
|
|
10
|
+
: (0, devkit_1.names)(options.name).fileName;
|
|
11
|
+
const appProjectName = appDirectory.replace(/\//g, '-');
|
|
12
|
+
const appProjectRoot = (0, devkit_1.joinPathFragments)((0, devkit_1.getWorkspaceLayout)(tree).appsDir, appDirectory);
|
|
13
|
+
const parsedTags = options.tags
|
|
14
|
+
? options.tags.split(',').map((s) => s.trim())
|
|
15
|
+
: [];
|
|
16
|
+
return Object.assign(Object.assign({}, options), { name: (0, devkit_1.names)(appProjectName).fileName, appProjectRoot, linter: (_a = options.linter) !== null && _a !== void 0 ? _a : linter_1.Linter.EsLint, unitTestRunner: (_b = options.unitTestRunner) !== null && _b !== void 0 ? _b : 'jest', parsedTags });
|
|
17
|
+
}
|
|
18
|
+
exports.normalizeOptions = normalizeOptions;
|
|
19
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,yCAA4E;AAG5E,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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ApplicationGeneratorOptions {
|
|
2
|
+
name: string;
|
|
3
|
+
directory?: string;
|
|
4
|
+
skipFormat?: boolean;
|
|
5
|
+
linter?: Exclude<Linter, Linter.TsLint>;
|
|
6
|
+
standaloneConfig?: boolean;
|
|
7
|
+
tags?: string;
|
|
8
|
+
unitTestRunner?: UnitTestRunner;
|
|
9
|
+
babelJest?: boolean;
|
|
10
|
+
js?: boolean;
|
|
11
|
+
setParserOptionsProject?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface NormalizedOptions extends ApplicationGeneratorOptions {
|
|
15
|
+
appProjectRoot: string;
|
|
16
|
+
linter: Exclude<Linter, Linter.TsLint>;
|
|
17
|
+
unitTestRunner: UnitTestRunner;
|
|
18
|
+
parsedTags: string[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxForgeApplicationGenerator",
|
|
5
|
+
"title": "Nx Application Options Schema",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the application.",
|
|
11
|
+
"$default": {
|
|
12
|
+
"$source": "argv",
|
|
13
|
+
"index": 0
|
|
14
|
+
},
|
|
15
|
+
"x-prompt": "What name would you like to use?"
|
|
16
|
+
},
|
|
17
|
+
"directory": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Directory where the project is placed",
|
|
20
|
+
"alias": "d"
|
|
21
|
+
},
|
|
22
|
+
"skipFormat": {
|
|
23
|
+
"description": "Skip formatting files.",
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": false
|
|
26
|
+
},
|
|
27
|
+
"linter": {
|
|
28
|
+
"description": "Tool to use for running lint checks.",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": ["eslint", "none"],
|
|
31
|
+
"default": "eslint"
|
|
32
|
+
},
|
|
33
|
+
"unitTestRunner": {
|
|
34
|
+
"description": "Test runner to use for unit tests.",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": ["jest", "none"],
|
|
37
|
+
"default": "jest"
|
|
38
|
+
},
|
|
39
|
+
"tags": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Add tags to the project (used for linting)",
|
|
42
|
+
"alias": "t"
|
|
43
|
+
},
|
|
44
|
+
"babelJest": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Use `babel` instead of `ts-jest`.",
|
|
47
|
+
"default": false
|
|
48
|
+
},
|
|
49
|
+
"js": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
52
|
+
"default": false
|
|
53
|
+
},
|
|
54
|
+
"setParserOptionsProject": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
57
|
+
"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
|
+
},
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": ["name"]
|
|
66
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
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");
|
|
7
|
+
const lib_1 = require("./lib");
|
|
8
|
+
const jest_1 = require("@nrwl/jest");
|
|
9
|
+
function default_1(tree, rawOptions) {
|
|
10
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
11
|
+
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
12
|
+
(0, set_default_collection_1.setDefaultCollection)(tree, '@toolsplus/nx-forge');
|
|
13
|
+
const jestTask = (0, jest_1.jestInitGenerator)(tree, {});
|
|
14
|
+
const installPackagesTask = (0, lib_1.addDependencies)(tree);
|
|
15
|
+
if (!options.skipFormat) {
|
|
16
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
17
|
+
}
|
|
18
|
+
return (0, run_tasks_in_serial_1.runTasksInSerial)(jestTask, installPackagesTask);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.default = default_1;
|
|
22
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/forge/src/generators/init/generator.ts"],"names":[],"mappings":";;;AAAA,yCAAoE;AACpE,iGAA4F;AAC5F,2FAAqF;AAErF,+BAA0D;AAC1D,qCAA+C;AAE/C,mBACE,IAAU,EACV,UAA+B;;QAE/B,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC;QAC7C,IAAA,6CAAoB,EAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAElD,MAAM,QAAQ,GAAG,IAAA,wBAAiB,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7C,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,sCAAgB,EAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACzD,CAAC;CAAA;AAfD,4BAeC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addDependencies = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const versions_1 = require("../../../utils/versions");
|
|
6
|
+
function addDependencies(tree) {
|
|
7
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
8
|
+
'@forge/api': versions_1.forgeApiVersion,
|
|
9
|
+
'@forge/resolver': versions_1.forgeResolverVersion,
|
|
10
|
+
}, {
|
|
11
|
+
'@toolsplus/nx-forge': versions_1.pluginVersion,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.addDependencies = addDependencies;
|
|
15
|
+
//# sourceMappingURL=add-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/init/lib/add-dependencies.ts"],"names":[],"mappings":";;;AACA,yCAA0D;AAC1D,sDAA6F;AAE7F,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ;QACE,YAAY,EAAE,0BAAe;QAC7B,iBAAiB,EAAE,+BAAoB;KACxC,EACD;QACE,qBAAqB,EAAE,wBAAa;KACrC,CACF,CAAC;AACJ,CAAC;AAXD,0CAWC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./add-dependencies"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./normalize-options"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/init/lib/index.ts"],"names":[],"mappings":";;;AAAA,kEAAmC;AACnC,mEAAoC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
function normalizeOptions(options) {
|
|
5
|
+
var _a;
|
|
6
|
+
return Object.assign(Object.assign({}, options), { unitTestRunner: (_a = options.unitTestRunner) !== null && _a !== void 0 ? _a : 'jest' });
|
|
7
|
+
}
|
|
8
|
+
exports.normalizeOptions = normalizeOptions;
|
|
9
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/forge/src/generators/init/lib/normalize-options.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB,CAC9B,OAA4B;;IAE5B,uCAAY,OAAO,KAAE,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,MAAM,IAAG;AAC1E,CAAC;AAJD,4CAIC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxForgeInitGenerator",
|
|
5
|
+
"title": "Init Forge Plugin",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"unitTestRunner": {
|
|
9
|
+
"description": "Adds the specified unit test runner.",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": ["jest", "none"],
|
|
12
|
+
"default": "jest"
|
|
13
|
+
},
|
|
14
|
+
"skipFormat": {
|
|
15
|
+
"description": "Skip formatting files.",
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"default": false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"required": []
|
|
22
|
+
}
|
package/src/index.d.ts
ADDED
|
File without changes
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/forge/src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.forgeResolverVersion = exports.forgeApiVersion = exports.pluginVersion = void 0;
|
|
4
|
+
exports.pluginVersion = '*';
|
|
5
|
+
exports.forgeApiVersion = 'latest';
|
|
6
|
+
exports.forgeResolverVersion = 'latest';
|
|
7
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/forge/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,GAAG,CAAC;AAEpB,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,oBAAoB,GAAG,QAAQ,CAAC"}
|