@nrwl/js 16.0.0-beta.0 → 16.0.0-beta.1

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 (182) hide show
  1. package/babel.d.ts +0 -10
  2. package/babel.js +1 -88
  3. package/babel.js.map +1 -1
  4. package/executors.json +12 -12
  5. package/generators.json +2 -50
  6. package/index.d.ts +1 -0
  7. package/index.js +5 -0
  8. package/index.js.map +1 -0
  9. package/package.json +8 -30
  10. package/README.md +0 -63
  11. package/migrations.json +0 -54
  12. package/src/executors/node/compat.d.ts +0 -2
  13. package/src/executors/node/compat.js +0 -6
  14. package/src/executors/node/compat.js.map +0 -1
  15. package/src/executors/node/node-with-require-overrides.d.ts +0 -5
  16. package/src/executors/node/node-with-require-overrides.js +0 -20
  17. package/src/executors/node/node-with-require-overrides.js.map +0 -1
  18. package/src/executors/node/node.impl.d.ts +0 -8
  19. package/src/executors/node/node.impl.js +0 -184
  20. package/src/executors/node/node.impl.js.map +0 -1
  21. package/src/executors/node/schema.d.ts +0 -16
  22. package/src/executors/node/schema.json +0 -74
  23. package/src/executors/swc/compat.d.ts +0 -2
  24. package/src/executors/swc/compat.js +0 -6
  25. package/src/executors/swc/compat.js.map +0 -1
  26. package/src/executors/swc/schema.json +0 -147
  27. package/src/executors/swc/swc.impl.d.ts +0 -11
  28. package/src/executors/swc/swc.impl.js +0 -126
  29. package/src/executors/swc/swc.impl.js.map +0 -1
  30. package/src/executors/tsc/compat.d.ts +0 -2
  31. package/src/executors/tsc/compat.js +0 -6
  32. package/src/executors/tsc/compat.js.map +0 -1
  33. package/src/executors/tsc/schema.json +0 -156
  34. package/src/executors/tsc/tsc.impl.d.ts +0 -7
  35. package/src/executors/tsc/tsc.impl.js +0 -106
  36. package/src/executors/tsc/tsc.impl.js.map +0 -1
  37. package/src/generators/convert-to-swc/convert-to-swc.d.ts +0 -5
  38. package/src/generators/convert-to-swc/convert-to-swc.js +0 -62
  39. package/src/generators/convert-to-swc/convert-to-swc.js.map +0 -1
  40. package/src/generators/convert-to-swc/schema.d.ts +0 -4
  41. package/src/generators/convert-to-swc/schema.json +0 -36
  42. package/src/generators/init/files/__fileName__ +0 -20
  43. package/src/generators/init/init.d.ts +0 -5
  44. package/src/generators/init/init.js +0 -67
  45. package/src/generators/init/init.js.map +0 -1
  46. package/src/generators/init/schema.d.ts +0 -6
  47. package/src/generators/init/schema.json +0 -30
  48. package/src/generators/library/files/jest-config/jest.config.__ext__ +0 -24
  49. package/src/generators/library/files/lib/README.md +0 -19
  50. package/src/generators/library/files/lib/src/index.ts__tmpl__ +0 -1
  51. package/src/generators/library/files/lib/src/lib/__fileName__.spec.ts__tmpl__ +0 -7
  52. package/src/generators/library/files/lib/src/lib/__fileName__.ts__tmpl__ +0 -3
  53. package/src/generators/library/files/lib/tsconfig.json__tmpl__ +0 -14
  54. package/src/generators/library/files/lib/tsconfig.lib.json__tmpl__ +0 -10
  55. package/src/generators/library/library.d.ts +0 -15
  56. package/src/generators/library/library.js +0 -382
  57. package/src/generators/library/library.js.map +0 -1
  58. package/src/generators/library/schema.json +0 -134
  59. package/src/index.d.ts +0 -15
  60. package/src/index.js +0 -24
  61. package/src/index.js.map +0 -1
  62. package/src/migrations/update-13-10-1/update-lib-swcrc-exclude.d.ts +0 -2
  63. package/src/migrations/update-13-10-1/update-lib-swcrc-exclude.js +0 -32
  64. package/src/migrations/update-13-10-1/update-lib-swcrc-exclude.js.map +0 -1
  65. package/src/migrations/update-13-8-5/update-node-executor.d.ts +0 -2
  66. package/src/migrations/update-13-8-5/update-node-executor.js +0 -28
  67. package/src/migrations/update-13-8-5/update-node-executor.js.map +0 -1
  68. package/src/migrations/update-13-8-5/update-swcrc.d.ts +0 -2
  69. package/src/migrations/update-13-8-5/update-swcrc.js +0 -35
  70. package/src/migrations/update-13-8-5/update-swcrc.js.map +0 -1
  71. package/src/migrations/update-14-0-0/exclude-jest-config-swcrc.d.ts +0 -3
  72. package/src/migrations/update-14-0-0/exclude-jest-config-swcrc.js +0 -27
  73. package/src/migrations/update-14-0-0/exclude-jest-config-swcrc.js.map +0 -1
  74. package/src/migrations/update-14-1-5/update-swcrc-path.d.ts +0 -3
  75. package/src/migrations/update-14-1-5/update-swcrc-path.js +0 -30
  76. package/src/migrations/update-14-1-5/update-swcrc-path.js.map +0 -1
  77. package/src/migrations/update-15-8-0/rename-swcrc-config.d.ts +0 -2
  78. package/src/migrations/update-15-8-0/rename-swcrc-config.js +0 -81
  79. package/src/migrations/update-15-8-0/rename-swcrc-config.js.map +0 -1
  80. package/src/utils/add-babel-inputs.d.ts +0 -2
  81. package/src/utils/add-babel-inputs.js +0 -23
  82. package/src/utils/add-babel-inputs.js.map +0 -1
  83. package/src/utils/assets/assets.d.ts +0 -10
  84. package/src/utils/assets/assets.js +0 -38
  85. package/src/utils/assets/assets.js.map +0 -1
  86. package/src/utils/assets/copy-assets-handler.d.ts +0 -28
  87. package/src/utils/assets/copy-assets-handler.js +0 -155
  88. package/src/utils/assets/copy-assets-handler.js.map +0 -1
  89. package/src/utils/assets/index.d.ts +0 -16
  90. package/src/utils/assets/index.js +0 -31
  91. package/src/utils/assets/index.js.map +0 -1
  92. package/src/utils/buildable-libs-utils.d.ts +0 -32
  93. package/src/utils/buildable-libs-utils.js +0 -309
  94. package/src/utils/buildable-libs-utils.js.map +0 -1
  95. package/src/utils/check-dependencies.d.ts +0 -8
  96. package/src/utils/check-dependencies.js +0 -24
  97. package/src/utils/check-dependencies.js.map +0 -1
  98. package/src/utils/code-frames/highlight.d.ts +0 -1
  99. package/src/utils/code-frames/highlight.js +0 -87
  100. package/src/utils/code-frames/highlight.js.map +0 -1
  101. package/src/utils/code-frames/identifiers.d.ts +0 -5
  102. package/src/utils/code-frames/identifiers.js +0 -53
  103. package/src/utils/code-frames/identifiers.js.map +0 -1
  104. package/src/utils/compiler-helper-dependency.d.ts +0 -17
  105. package/src/utils/compiler-helper-dependency.js +0 -111
  106. package/src/utils/compiler-helper-dependency.js.map +0 -1
  107. package/src/utils/generate-globs.d.ts +0 -6
  108. package/src/utils/generate-globs.js +0 -81
  109. package/src/utils/generate-globs.js.map +0 -1
  110. package/src/utils/inline.d.ts +0 -19
  111. package/src/utils/inline.js +0 -211
  112. package/src/utils/inline.js.map +0 -1
  113. package/src/utils/minimal-publish-script.d.ts +0 -2
  114. package/src/utils/minimal-publish-script.js +0 -76
  115. package/src/utils/minimal-publish-script.js.map +0 -1
  116. package/src/utils/package-json/index.d.ts +0 -13
  117. package/src/utils/package-json/index.js +0 -34
  118. package/src/utils/package-json/index.js.map +0 -1
  119. package/src/utils/package-json/update-package-json.d.ts +0 -20
  120. package/src/utils/package-json/update-package-json.js +0 -142
  121. package/src/utils/package-json/update-package-json.js.map +0 -1
  122. package/src/utils/prettier.d.ts +0 -6
  123. package/src/utils/prettier.js +0 -38
  124. package/src/utils/prettier.js.map +0 -1
  125. package/src/utils/schema.d.ts +0 -81
  126. package/src/utils/swc/add-swc-config.d.ts +0 -3
  127. package/src/utils/swc/add-swc-config.js +0 -44
  128. package/src/utils/swc/add-swc-config.js.map +0 -1
  129. package/src/utils/swc/add-swc-dependencies.d.ts +0 -2
  130. package/src/utils/swc/add-swc-dependencies.js +0 -15
  131. package/src/utils/swc/add-swc-dependencies.js.map +0 -1
  132. package/src/utils/swc/compile-swc.d.ts +0 -13
  133. package/src/utils/swc/compile-swc.js +0 -161
  134. package/src/utils/swc/compile-swc.js.map +0 -1
  135. package/src/utils/swc/get-swcrc-path.d.ts +0 -2
  136. package/src/utils/swc/get-swcrc-path.js +0 -14
  137. package/src/utils/swc/get-swcrc-path.js.map +0 -1
  138. package/src/utils/swc/inline.d.ts +0 -2
  139. package/src/utils/swc/inline.js +0 -13
  140. package/src/utils/swc/inline.js.map +0 -1
  141. package/src/utils/typescript/__mocks__/plugin-a.d.ts +0 -1
  142. package/src/utils/typescript/__mocks__/plugin-a.js +0 -6
  143. package/src/utils/typescript/__mocks__/plugin-a.js.map +0 -1
  144. package/src/utils/typescript/__mocks__/plugin-b.d.ts +0 -1
  145. package/src/utils/typescript/__mocks__/plugin-b.js +0 -6
  146. package/src/utils/typescript/__mocks__/plugin-b.js.map +0 -1
  147. package/src/utils/typescript/ast-utils.d.ts +0 -22
  148. package/src/utils/typescript/ast-utils.js +0 -199
  149. package/src/utils/typescript/ast-utils.js.map +0 -1
  150. package/src/utils/typescript/compile-typescript-files.d.ts +0 -10
  151. package/src/utils/typescript/compile-typescript-files.js +0 -45
  152. package/src/utils/typescript/compile-typescript-files.js.map +0 -1
  153. package/src/utils/typescript/create-ts-config.d.ts +0 -17
  154. package/src/utils/typescript/create-ts-config.js +0 -48
  155. package/src/utils/typescript/create-ts-config.js.map +0 -1
  156. package/src/utils/typescript/ensure-typescript.d.ts +0 -1
  157. package/src/utils/typescript/ensure-typescript.js +0 -10
  158. package/src/utils/typescript/ensure-typescript.js.map +0 -1
  159. package/src/utils/typescript/get-source-nodes.d.ts +0 -2
  160. package/src/utils/typescript/get-source-nodes.js +0 -19
  161. package/src/utils/typescript/get-source-nodes.js.map +0 -1
  162. package/src/utils/typescript/load-ts-transformers.d.ts +0 -5
  163. package/src/utils/typescript/load-ts-transformers.js +0 -63
  164. package/src/utils/typescript/load-ts-transformers.js.map +0 -1
  165. package/src/utils/typescript/print-diagnostics.d.ts +0 -1
  166. package/src/utils/typescript/print-diagnostics.js +0 -22
  167. package/src/utils/typescript/print-diagnostics.js.map +0 -1
  168. package/src/utils/typescript/run-type-check.d.ts +0 -32
  169. package/src/utils/typescript/run-type-check.js +0 -125
  170. package/src/utils/typescript/run-type-check.js.map +0 -1
  171. package/src/utils/typescript/ts-config.d.ts +0 -11
  172. package/src/utils/typescript/ts-config.js +0 -55
  173. package/src/utils/typescript/ts-config.js.map +0 -1
  174. package/src/utils/typescript/types.d.ts +0 -18
  175. package/src/utils/typescript/types.js +0 -3
  176. package/src/utils/typescript/types.js.map +0 -1
  177. package/src/utils/versions.d.ts +0 -8
  178. package/src/utils/versions.js +0 -13
  179. package/src/utils/versions.js.map +0 -1
  180. package/src/utils/watch-for-single-file-changes.d.ts +0 -1
  181. package/src/utils/watch-for-single-file-changes.js +0 -27
  182. package/src/utils/watch-for-single-file-changes.js.map +0 -1
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tscExecutor = exports.createTypeScriptCompilationOptions = exports.normalizeOptions = void 0;
4
- const tslib_1 = require("tslib");
5
- const assets_1 = require("../../utils/assets/assets");
6
- const path_1 = require("path");
7
- const copy_assets_handler_1 = require("../../utils/assets/copy-assets-handler");
8
- const check_dependencies_1 = require("../../utils/check-dependencies");
9
- const compiler_helper_dependency_1 = require("../../utils/compiler-helper-dependency");
10
- const inline_1 = require("../../utils/inline");
11
- const update_package_json_1 = require("../../utils/package-json/update-package-json");
12
- const compile_typescript_files_1 = require("../../utils/typescript/compile-typescript-files");
13
- const load_ts_transformers_1 = require("../../utils/typescript/load-ts-transformers");
14
- const watch_for_single_file_changes_1 = require("../../utils/watch-for-single-file-changes");
15
- function normalizeOptions(options, contextRoot, sourceRoot, projectRoot) {
16
- const outputPath = (0, path_1.join)(contextRoot, options.outputPath);
17
- const rootDir = options.rootDir
18
- ? (0, path_1.join)(contextRoot, options.rootDir)
19
- : projectRoot;
20
- if (options.watch == null) {
21
- options.watch = false;
22
- }
23
- // TODO: put back when inlining story is more stable
24
- // if (options.external == null) {
25
- // options.external = 'all';
26
- // } else if (Array.isArray(options.external) && options.external.length === 0) {
27
- // options.external = 'none';
28
- // }
29
- if (Array.isArray(options.external) && options.external.length > 0) {
30
- const firstItem = options.external[0];
31
- if (firstItem === 'all' || firstItem === 'none') {
32
- options.external = firstItem;
33
- }
34
- }
35
- const files = (0, assets_1.assetGlobsToFiles)(options.assets, contextRoot, outputPath);
36
- return Object.assign(Object.assign({}, options), { root: contextRoot, sourceRoot,
37
- projectRoot,
38
- files,
39
- outputPath, tsConfig: (0, path_1.join)(contextRoot, options.tsConfig), rootDir, mainOutputPath: (0, path_1.resolve)(outputPath, options.main.replace(`${projectRoot}/`, '').replace('.ts', '.js')) });
40
- }
41
- exports.normalizeOptions = normalizeOptions;
42
- function createTypeScriptCompilationOptions(normalizedOptions, context) {
43
- const { compilerPluginHooks } = (0, load_ts_transformers_1.loadTsTransformers)(normalizedOptions.transformers);
44
- const getCustomTransformers = (program) => ({
45
- before: compilerPluginHooks.beforeHooks.map((hook) => hook(program)),
46
- after: compilerPluginHooks.afterHooks.map((hook) => hook(program)),
47
- afterDeclarations: compilerPluginHooks.afterDeclarationsHooks.map((hook) => hook(program)),
48
- });
49
- return {
50
- outputPath: normalizedOptions.outputPath,
51
- projectName: context.projectName,
52
- projectRoot: normalizedOptions.projectRoot,
53
- rootDir: normalizedOptions.rootDir,
54
- tsConfig: normalizedOptions.tsConfig,
55
- watch: normalizedOptions.watch,
56
- deleteOutputPath: normalizedOptions.clean,
57
- getCustomTransformers,
58
- };
59
- }
60
- exports.createTypeScriptCompilationOptions = createTypeScriptCompilationOptions;
61
- function tscExecutor(_options, context) {
62
- return tslib_1.__asyncGenerator(this, arguments, function* tscExecutor_1() {
63
- const { sourceRoot, root } = context.projectsConfigurations.projects[context.projectName];
64
- const options = normalizeOptions(_options, context.root, sourceRoot, root);
65
- const { projectRoot, tmpTsConfig, target, dependencies } = (0, check_dependencies_1.checkDependencies)(context, _options.tsConfig);
66
- if (tmpTsConfig) {
67
- options.tsConfig = tmpTsConfig;
68
- }
69
- const tsLibDependency = (0, compiler_helper_dependency_1.getHelperDependency)(compiler_helper_dependency_1.HelperDependency.tsc, options.tsConfig, dependencies, context.projectGraph);
70
- if (tsLibDependency) {
71
- dependencies.push(tsLibDependency);
72
- }
73
- const assetHandler = new copy_assets_handler_1.CopyAssetsHandler({
74
- projectDir: projectRoot,
75
- rootDir: context.root,
76
- outputDir: _options.outputPath,
77
- assets: _options.assets,
78
- });
79
- const tsCompilationOptions = createTypeScriptCompilationOptions(options, context);
80
- const inlineProjectGraph = (0, inline_1.handleInliningBuild)(context, options, tsCompilationOptions.tsConfig);
81
- if (!(0, inline_1.isInlineGraphEmpty)(inlineProjectGraph)) {
82
- tsCompilationOptions.rootDir = '.';
83
- }
84
- const typescriptCompilation = (0, compile_typescript_files_1.compileTypeScriptFiles)(options, tsCompilationOptions, () => tslib_1.__awaiter(this, void 0, void 0, function* () {
85
- yield assetHandler.processAllAssetsOnce();
86
- (0, update_package_json_1.updatePackageJson)(options, context, target, dependencies);
87
- (0, inline_1.postProcessInlinedDependencies)(tsCompilationOptions.outputPath, tsCompilationOptions.projectRoot, inlineProjectGraph);
88
- }));
89
- if (options.watch) {
90
- const disposeWatchAssetChanges = yield tslib_1.__await(assetHandler.watchAndProcessOnAssetChange());
91
- const disposePackageJsonChanges = yield tslib_1.__await((0, watch_for_single_file_changes_1.watchForSingleFileChanges)(context.projectName, options.projectRoot, 'package.json', () => (0, update_package_json_1.updatePackageJson)(options, context, target, dependencies)));
92
- const handleTermination = (exitCode) => tslib_1.__awaiter(this, void 0, void 0, function* () {
93
- yield typescriptCompilation.close();
94
- disposeWatchAssetChanges();
95
- disposePackageJsonChanges();
96
- process.exit(exitCode);
97
- });
98
- process.on('SIGINT', () => handleTermination(128 + 2));
99
- process.on('SIGTERM', () => handleTermination(128 + 15));
100
- }
101
- return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(typescriptCompilation.iterator))));
102
- });
103
- }
104
- exports.tscExecutor = tscExecutor;
105
- exports.default = tscExecutor;
106
- //# sourceMappingURL=tsc.impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsc.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/tsc/tsc.impl.ts"],"names":[],"mappings":";;;;AACA,sDAA+E;AAE/E,+BAAqC;AAOrC,gFAA2E;AAC3E,uEAAmE;AACnE,uFAGgD;AAChD,+CAI4B;AAC5B,sFAAiF;AAEjF,8FAAyF;AACzF,sFAAiF;AACjF,6FAAsF;AAEtF,SAAgB,gBAAgB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,CAAC,KAAK,EAAE;YACjB,MAAM,wBAAwB,GAC5B,sBAAM,YAAY,CAAC,4BAA4B,EAAE,CAAA,CAAC;YACpD,MAAM,yBAAyB,GAAG,sBAAM,IAAA,yDAAyB,EAC/D,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,WAAW,EACnB,cAAc,EACd,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAChE,CAAA,CAAC;YACF,MAAM,iBAAiB,GAAG,CAAO,QAAgB,EAAE,EAAE;gBACnD,MAAM,qBAAqB,CAAC,KAAK,EAAE,CAAC;gBACpC,wBAAwB,EAAE,CAAC;gBAC3B,yBAAyB,EAAE,CAAC;gBAC5B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC,CAAA,CAAC;YACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YACvD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;SAC1D;QAED,6BAAO,sBAAA,KAAK,CAAC,CAAC,yBAAA,sBAAA,qBAAqB,CAAC,QAAQ,CAAA,CAAA,CAAA,EAAC;IAC/C,CAAC;CAAA;AApFD,kCAoFC;AAED,kBAAe,WAAW,CAAC"}
@@ -1,5 +0,0 @@
1
- import { Tree } from '@nrwl/devkit';
2
- import { ConvertToSwcGeneratorSchema } from './schema';
3
- export declare function convertToSwcGenerator(tree: Tree, schema: ConvertToSwcGeneratorSchema): Promise<() => void>;
4
- export default convertToSwcGenerator;
5
- export declare const convertToSwcSchematic: (generatorOptions: ConvertToSwcGeneratorSchema) => (tree: any, context: any) => Promise<any>;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertToSwcSchematic = exports.convertToSwcGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const path_1 = require("path");
7
- const add_swc_config_1 = require("../../utils/swc/add-swc-config");
8
- const add_swc_dependencies_1 = require("../../utils/swc/add-swc-dependencies");
9
- const versions_1 = require("../../utils/versions");
10
- function convertToSwcGenerator(tree, schema) {
11
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- const options = normalizeOptions(schema);
13
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.project);
14
- updateProjectBuildTargets(tree, projectConfiguration, options.project, options.targets);
15
- return checkSwcDependencies(tree, projectConfiguration);
16
- });
17
- }
18
- exports.convertToSwcGenerator = convertToSwcGenerator;
19
- function normalizeOptions(schema) {
20
- const options = Object.assign({}, schema);
21
- if (!options.targets) {
22
- options.targets = ['build'];
23
- }
24
- return options;
25
- }
26
- function updateProjectBuildTargets(tree, projectConfiguration, projectName, projectTargets) {
27
- for (const target of projectTargets) {
28
- const targetConfiguration = projectConfiguration.targets[target];
29
- if (!targetConfiguration || targetConfiguration.executor !== '@nrwl/js:tsc')
30
- continue;
31
- targetConfiguration.executor = '@nrwl/js:swc';
32
- }
33
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
34
- }
35
- function checkSwcDependencies(tree, projectConfiguration) {
36
- const isSwcrcPresent = tree.exists((0, path_1.join)(projectConfiguration.root, '.swcrc'));
37
- const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
38
- const projectPackageJsonPath = (0, path_1.join)(projectConfiguration.root, 'package.json');
39
- const projectPackageJson = (0, devkit_1.readJson)(tree, projectPackageJsonPath);
40
- const hasSwcDependency = packageJson.dependencies && packageJson.dependencies['@swc/core'];
41
- const hasSwcHelpers = projectPackageJson.dependencies &&
42
- projectPackageJson.dependencies['@swc/helpers'];
43
- if (isSwcrcPresent && hasSwcDependency && hasSwcHelpers)
44
- return;
45
- if (!isSwcrcPresent) {
46
- (0, add_swc_config_1.addSwcConfig)(tree, projectConfiguration.root);
47
- }
48
- if (!hasSwcDependency) {
49
- (0, add_swc_dependencies_1.addSwcDependencies)(tree);
50
- }
51
- if (!hasSwcHelpers) {
52
- (0, devkit_1.addDependenciesToPackageJson)(tree, { '@swc/helpers': versions_1.swcHelpersVersion }, {}, projectPackageJsonPath);
53
- }
54
- return () => {
55
- if (!hasSwcDependency) {
56
- (0, devkit_1.installPackagesTask)(tree);
57
- }
58
- };
59
- }
60
- exports.default = convertToSwcGenerator;
61
- exports.convertToSwcSchematic = (0, devkit_1.convertNxGenerator)(convertToSwcGenerator);
62
- //# sourceMappingURL=convert-to-swc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-to-swc.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/convert-to-swc/convert-to-swc.ts"],"names":[],"mappings":";;;;AAAA,yCASsB;AACtB,+BAA4B;AAC5B,mEAA8D;AAC9D,+EAA0E;AAC1E,mDAAyD;AAGzD,SAAsB,qBAAqB,CACzC,IAAU,EACV,MAAmC;;QAEnC,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,oBAAoB,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE7E,yBAAyB,CACvB,IAAI,EACJ,oBAAoB,EACpB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,OAAO,CAChB,CAAC;QACF,OAAO,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC1D,CAAC;CAAA;AAdD,sDAcC;AAED,SAAS,gBAAgB,CACvB,MAAmC;IAEnC,MAAM,OAAO,qBAAQ,MAAM,CAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,OAAO,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;KAC7B;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,y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ED,IAAI,CAAC,aAAa,EAAE;QAClB,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,cAAc,EAAE,4BAAiB,EAAE,EACrC,EAAE,EACF,sBAAsB,CACvB,CAAC;KACH;IAED,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,gBAAgB,EAAE;YACrB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;SAC3B;IACH,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,qBAAqB,CAAC;AACxB,QAAA,qBAAqB,GAAG,IAAA,2BAAkB,EAAC,qBAAqB,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export interface ConvertToSwcGeneratorSchema {
2
- project: string;
3
- targets?: string[];
4
- }
@@ -1,36 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "NxTypescriptLibrary",
4
- "cli": "nx",
5
- "title": "Convert a TSC library to SWC",
6
- "description": "Convert a TSC library to SWC.",
7
- "type": "object",
8
- "examples": [
9
- {
10
- "command": "nx g swc mylib",
11
- "description": "Convert `libs/myapp/mylib` to SWC."
12
- }
13
- ],
14
- "properties": {
15
- "project": {
16
- "type": "string",
17
- "description": "Library name.",
18
- "$default": {
19
- "$source": "argv",
20
- "index": 0
21
- },
22
- "x-prompt": "What name would you like to use for the library?",
23
- "pattern": "^[a-zA-Z].*$"
24
- },
25
- "targets": {
26
- "type": "array",
27
- "description": "List of targets to convert.",
28
- "items": {
29
- "type": "string",
30
- "description": "Target to convert."
31
- },
32
- "default": ["build"]
33
- }
34
- },
35
- "required": ["project"]
36
- }
@@ -1,20 +0,0 @@
1
- {
2
- "compileOnSave": false,
3
- "compilerOptions": {
4
- "rootDir": ".",
5
- "sourceMap": true,
6
- "declaration": false,
7
- "moduleResolution": "node",
8
- "emitDecoratorMetadata": true,
9
- "experimentalDecorators": true,
10
- "importHelpers": true,
11
- "target": "es2015",
12
- "module": "esnext",
13
- "lib": ["es2017", "dom"],
14
- "skipLibCheck": true,
15
- "skipDefaultLibCheck": true,
16
- "baseUrl": ".",
17
- "paths": {}
18
- },
19
- "exclude": ["node_modules", "tmp"]
20
- }
@@ -1,5 +0,0 @@
1
- import { GeneratorCallback, Tree } from '@nrwl/devkit';
2
- import { InitSchema } from './schema';
3
- export declare function initGenerator(tree: Tree, schema: InitSchema): Promise<GeneratorCallback>;
4
- export default initGenerator;
5
- export declare const initSchematic: (generatorOptions: InitSchema) => (tree: any, context: any) => Promise<any>;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initSchematic = exports.initGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const ts_config_1 = require("../../utils/typescript/ts-config");
7
- const versions_1 = require("../../utils/versions");
8
- let formatTaskAdded = false;
9
- function initGenerator(tree, schema) {
10
- var _a;
11
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- const tasks = [];
13
- // add tsconfig.base.json
14
- if (!(0, ts_config_1.getRootTsConfigFileName)(tree)) {
15
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files'), '.', {
16
- fileName: (_a = schema.tsConfigName) !== null && _a !== void 0 ? _a : 'tsconfig.base.json',
17
- });
18
- }
19
- const devDependencies = {
20
- '@nrwl/js': versions_1.nxVersion,
21
- prettier: versions_1.prettierVersion,
22
- };
23
- if (!schema.js) {
24
- devDependencies['typescript'] = versions_1.typescriptVersion;
25
- }
26
- if (!tree.exists(`.prettierrc`)) {
27
- (0, devkit_1.writeJson)(tree, '.prettierrc', {
28
- singleQuote: true,
29
- });
30
- }
31
- if (!tree.exists(`.prettierignore`)) {
32
- tree.write('.prettierignore', (0, devkit_1.stripIndents) `
33
- # Add files here to ignore them from prettier formatting
34
- /dist
35
- /coverage
36
- `);
37
- }
38
- if (tree.exists('.vscode/extensions.json')) {
39
- (0, devkit_1.updateJson)(tree, '.vscode/extensions.json', (json) => {
40
- var _a;
41
- (_a = json.recommendations) !== null && _a !== void 0 ? _a : (json.recommendations = []);
42
- const extension = 'esbenp.prettier-vscode';
43
- if (!json.recommendations.includes(extension)) {
44
- json.recommendations.push(extension);
45
- }
46
- return json;
47
- });
48
- }
49
- const installTask = !schema.skipPackageJson
50
- ? (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies)
51
- : () => { };
52
- tasks.push(installTask);
53
- (0, devkit_1.ensurePackage)('prettier', versions_1.prettierVersion);
54
- if (!schema.skipFormat) {
55
- yield (0, devkit_1.formatFiles)(tree);
56
- }
57
- return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- for (const task of tasks) {
59
- yield task();
60
- }
61
- });
62
- });
63
- }
64
- exports.initGenerator = initGenerator;
65
- exports.default = initGenerator;
66
- exports.initSchematic = (0, devkit_1.convertNxGenerator)(initGenerator);
67
- //# sourceMappingURL=init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,yCAYsB;AACtB,gEAA2E;AAC3E,mDAI8B;AAG9B,IAAI,eAAe,GAAG,KAAK,CAAC;AAE5B,SAAsB,aAAa,CACjC,IAAU,EACV,MAAkB;;;QAElB,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,yBAAyB;QACzB,IAAI,CAAC,IAAA,mCAAuB,EAAC,IAAI,CAAC,EAAE;YAClC,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE;gBAChE,QAAQ,EAAE,MAAA,MAAM,CAAC,YAAY,mCAAI,oBAAoB;aACtD,CAAC,CAAC;SACJ;QACD,MAAM,eAAe,GAAG;YACtB,UAAU,EAAE,oBAAS;YACrB,QAAQ,EAAE,0BAAe;SAC1B,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YACd,eAAe,CAAC,YAAY,CAAC,GAAG,4BAAi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,CAAC;aACd;QACH,CAAC,CAAA,CAAC;;CACH;AA9DD,sCA8DC;AAED,kBAAe,aAAa,CAAC;AAEhB,QAAA,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export interface InitSchema {
2
- js?: boolean;
3
- skipFormat?: boolean;
4
- skipPackageJson?: boolean;
5
- tsConfigName?: string;
6
- }
@@ -1,30 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "NxTypescriptInit",
4
- "cli": "nx",
5
- "title": "Init nrwl/js",
6
- "description": "Init generator placeholder for nrwl/js.",
7
- "properties": {
8
- "js": {
9
- "type": "boolean",
10
- "default": false,
11
- "description": "Use JavaScript instead of TypeScript"
12
- },
13
- "skipFormat": {
14
- "type": "boolean",
15
- "aliases": ["skip-format"],
16
- "description": "Skip formatting files.",
17
- "x-priority": "internal"
18
- },
19
- "skipPackageJson": {
20
- "type": "boolean",
21
- "description": "Skip adding package.json dependencies",
22
- "x-priority": "internal"
23
- },
24
- "tsConfigName": {
25
- "type": "string",
26
- "description": "Customize the generated tsconfig file name.",
27
- "x-priority": "internal"
28
- }
29
- }
30
- }
@@ -1,24 +0,0 @@
1
- /* eslint-disable */
2
- <% if(js) {%>const { readFileSync } = require('fs')<% } else { %>import { readFileSync } from 'fs';<% } %>
3
-
4
- // Reading the SWC compilation config and remove the "exclude"
5
- // for the test files to be compiled by SWC
6
- const { exclude: _, ...swcJestConfig } = JSON.parse(
7
- readFileSync(`${__dirname}/.swcrc`, 'utf-8')
8
- );
9
-
10
- // disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
11
- // If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
12
- if (swcJestConfig.swcrc === undefined) {
13
- swcJestConfig.swcrc = false;
14
- }
15
-
16
- <% if(js) {%>module.exports =<% } else { %>export default<% } %> {
17
- displayName: '<%= project %>',
18
- preset: '<%= offsetFromRoot %>jest.preset.js',
19
- transform: {
20
- '^.+\\.[tj]s$': ['@swc/jest', swcJestConfig],
21
- },
22
- moduleFileExtensions: ['ts', 'js', 'html'],
23
- coverageDirectory: '<%= offsetFromRoot %>coverage/<%= projectRoot %>'
24
- };
@@ -1,19 +0,0 @@
1
- # <%= name %>
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- <% if (buildable) { %>
6
-
7
- ## Building
8
-
9
- Run `<%= cliCommand %> build <%= name %>` to build the library.
10
-
11
- <% } %>
12
-
13
- <% if (hasUnitTestRunner) { %>
14
-
15
- ## Running unit tests
16
-
17
- Run `<%= cliCommand %> test <%= name %>` to execute the unit tests via [Jest](https://jestjs.io).
18
-
19
- <% } %>
@@ -1 +0,0 @@
1
- export * from './lib/<%= fileName %>';
@@ -1,7 +0,0 @@
1
- import { <%= propertyName %> } from './<%= fileName %>';
2
-
3
- describe('<%= propertyName %>', () => {
4
- it('should work', () => {
5
- expect(<%= propertyName %>()).toEqual('<%= name %>');
6
- })
7
- })
@@ -1,3 +0,0 @@
1
- export function <%= propertyName %>(): string {
2
- return '<%= name %>';
3
- }
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "<%= rootTsConfigPath %>",
3
- "compilerOptions": {
4
- "module": "commonjs"<% if (js) { %>,
5
- "allowJs": true<% } %>
6
- },
7
- "files": [],
8
- "include": [],
9
- "references": [
10
- {
11
- "path": "./tsconfig.lib.json"
12
- }
13
- ]
14
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "<%= offsetFromRoot %>dist/out-tsc",
5
- "declaration": true,
6
- "types": ["node"]
7
- },
8
- "include": ["src/**/*.ts"<% if (js) { %>, "src/**/*.js"<% } %>],
9
- "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"<% if (js) { %>, "src/**/*.spec.js", "src/**/*.test.js"<% } %>]
10
- }
@@ -1,15 +0,0 @@
1
- import { GeneratorCallback, Tree } from '@nrwl/devkit';
2
- import { LibraryGeneratorSchema } from '../../utils/schema';
3
- export declare function libraryGenerator(tree: Tree, schema: LibraryGeneratorSchema): Promise<GeneratorCallback>;
4
- export declare function projectGenerator(tree: Tree, schema: LibraryGeneratorSchema, destinationDir: string, filesDir: string): Promise<GeneratorCallback>;
5
- export interface NormalizedSchema extends LibraryGeneratorSchema {
6
- name: string;
7
- fileName: string;
8
- projectRoot: string;
9
- projectDirectory: string;
10
- parsedTags: string[];
11
- importPath?: string;
12
- }
13
- export declare function addLint(tree: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
14
- export default libraryGenerator;
15
- export declare const librarySchematic: (generatorOptions: LibraryGeneratorSchema) => (tree: any, context: any) => Promise<any>;