@nx/devkit 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 (138) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +22 -0
  3. package/README.md +63 -0
  4. package/index.d.ts +19 -0
  5. package/index.js +27 -0
  6. package/migrations.json +12 -0
  7. package/ngcli-adapter.d.ts +4 -0
  8. package/ngcli-adapter.js +13 -0
  9. package/ngcli-adapter.js.map +1 -0
  10. package/nx-reexports-pre16.d.ts +127 -0
  11. package/nx-reexports-pre16.js +141 -0
  12. package/nx-reexports-pre16.js.map +1 -0
  13. package/nx.d.ts +1 -0
  14. package/nx.js +13 -0
  15. package/nx.js.map +1 -0
  16. package/package.json +49 -0
  17. package/public-api.d.ts +82 -0
  18. package/public-api.js +114 -0
  19. package/public-api.js.map +1 -0
  20. package/src/executors/parse-target-string.d.ts +31 -0
  21. package/src/executors/parse-target-string.js +36 -0
  22. package/src/executors/parse-target-string.js.map +1 -0
  23. package/src/executors/read-target-options.d.ts +8 -0
  24. package/src/executors/read-target-options.js +24 -0
  25. package/src/executors/read-target-options.js.map +1 -0
  26. package/src/generators/executor-options-utils.d.ts +21 -0
  27. package/src/generators/executor-options-utils.js +50 -0
  28. package/src/generators/executor-options-utils.js.map +1 -0
  29. package/src/generators/format-files.d.ts +6 -0
  30. package/src/generators/format-files.js +75 -0
  31. package/src/generators/format-files.js.map +1 -0
  32. package/src/generators/generate-files.d.ts +26 -0
  33. package/src/generators/generate-files.js +120 -0
  34. package/src/generators/generate-files.js.map +1 -0
  35. package/src/generators/run-tasks-in-serial.d.ts +7 -0
  36. package/src/generators/run-tasks-in-serial.js +18 -0
  37. package/src/generators/run-tasks-in-serial.js.map +1 -0
  38. package/src/generators/to-js.d.ts +5 -0
  39. package/src/generators/to-js.js +25 -0
  40. package/src/generators/to-js.js.map +1 -0
  41. package/src/generators/typescript/insert-import.d.ts +1 -0
  42. package/src/generators/typescript/insert-import.js +6 -0
  43. package/src/generators/typescript/insert-import.js.map +1 -0
  44. package/src/generators/typescript/insert-statement.d.ts +1 -0
  45. package/src/generators/typescript/insert-statement.js +6 -0
  46. package/src/generators/typescript/insert-statement.js.map +1 -0
  47. package/src/generators/update-ts-configs-to-js.d.ts +4 -0
  48. package/src/generators/update-ts-configs-to-js.js +50 -0
  49. package/src/generators/update-ts-configs-to-js.js.map +1 -0
  50. package/src/generators/visit-not-ignored-files.d.ts +5 -0
  51. package/src/generators/visit-not-ignored-files.js +37 -0
  52. package/src/generators/visit-not-ignored-files.js.map +1 -0
  53. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  54. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
  55. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
  56. package/src/tasks/install-packages-task.d.ts +10 -0
  57. package/src/tasks/install-packages-task.js +35 -0
  58. package/src/tasks/install-packages-task.js.map +1 -0
  59. package/src/utils/async-iterable/combine-async-iterables.d.ts +3 -0
  60. package/src/utils/async-iterable/combine-async-iterables.js +82 -0
  61. package/src/utils/async-iterable/combine-async-iterables.js.map +1 -0
  62. package/src/utils/async-iterable/create-async-iterable.d.ts +6 -0
  63. package/src/utils/async-iterable/create-async-iterable.js +62 -0
  64. package/src/utils/async-iterable/create-async-iterable.js.map +1 -0
  65. package/src/utils/async-iterable/index.d.ts +4 -0
  66. package/src/utils/async-iterable/index.js +8 -0
  67. package/src/utils/async-iterable/index.js.map +1 -0
  68. package/src/utils/async-iterable/map-async-iteratable.d.ts +1 -0
  69. package/src/utils/async-iterable/map-async-iteratable.js +24 -0
  70. package/src/utils/async-iterable/map-async-iteratable.js.map +1 -0
  71. package/src/utils/async-iterable/tap-async-iteratable.d.ts +1 -0
  72. package/src/utils/async-iterable/tap-async-iteratable.js +15 -0
  73. package/src/utils/async-iterable/tap-async-iteratable.js.map +1 -0
  74. package/src/utils/convert-nx-executor.d.ts +7 -0
  75. package/src/utils/convert-nx-executor.js +88 -0
  76. package/src/utils/convert-nx-executor.js.map +1 -0
  77. package/src/utils/get-workspace-layout.d.ts +25 -0
  78. package/src/utils/get-workspace-layout.js +53 -0
  79. package/src/utils/get-workspace-layout.js.map +1 -0
  80. package/src/utils/invoke-nx-generator.d.ts +6 -0
  81. package/src/utils/invoke-nx-generator.js +174 -0
  82. package/src/utils/invoke-nx-generator.js.map +1 -0
  83. package/src/utils/module-federation/dependencies.d.ts +6 -0
  84. package/src/utils/module-federation/dependencies.js +47 -0
  85. package/src/utils/module-federation/dependencies.js.map +1 -0
  86. package/src/utils/module-federation/index.d.ts +5 -0
  87. package/src/utils/module-federation/index.js +9 -0
  88. package/src/utils/module-federation/index.js.map +1 -0
  89. package/src/utils/module-federation/models/index.d.ts +39 -0
  90. package/src/utils/module-federation/models/index.js +3 -0
  91. package/src/utils/module-federation/models/index.js.map +1 -0
  92. package/src/utils/module-federation/package-json.d.ts +8 -0
  93. package/src/utils/module-federation/package-json.js +15 -0
  94. package/src/utils/module-federation/package-json.js.map +1 -0
  95. package/src/utils/module-federation/remotes.d.ts +19 -0
  96. package/src/utils/module-federation/remotes.js +59 -0
  97. package/src/utils/module-federation/remotes.js.map +1 -0
  98. package/src/utils/module-federation/secondary-entry-points.d.ts +12 -0
  99. package/src/utils/module-federation/secondary-entry-points.js +106 -0
  100. package/src/utils/module-federation/secondary-entry-points.js.map +1 -0
  101. package/src/utils/module-federation/share.d.ts +48 -0
  102. package/src/utils/module-federation/share.js +187 -0
  103. package/src/utils/module-federation/share.js.map +1 -0
  104. package/src/utils/module-federation/typescript.d.ts +3 -0
  105. package/src/utils/module-federation/typescript.js +39 -0
  106. package/src/utils/module-federation/typescript.js.map +1 -0
  107. package/src/utils/move-dir.d.ts +5 -0
  108. package/src/utils/move-dir.js +29 -0
  109. package/src/utils/move-dir.js.map +1 -0
  110. package/src/utils/names.d.ts +18 -0
  111. package/src/utils/names.js +63 -0
  112. package/src/utils/names.js.map +1 -0
  113. package/src/utils/offset-from-root.d.ts +13 -0
  114. package/src/utils/offset-from-root.js +30 -0
  115. package/src/utils/offset-from-root.js.map +1 -0
  116. package/src/utils/package-json.d.ts +74 -0
  117. package/src/utils/package-json.js +305 -0
  118. package/src/utils/package-json.js.map +1 -0
  119. package/src/utils/replace-package.d.ts +2 -0
  120. package/src/utils/replace-package.js +107 -0
  121. package/src/utils/replace-package.js.map +1 -0
  122. package/src/utils/rxjs-for-await.d.ts +109 -0
  123. package/src/utils/rxjs-for-await.js +373 -0
  124. package/src/utils/rxjs-for-await.js.map +1 -0
  125. package/src/utils/semver.d.ts +1 -0
  126. package/src/utils/semver.js +19 -0
  127. package/src/utils/semver.js.map +1 -0
  128. package/src/utils/string-change.d.ts +62 -0
  129. package/src/utils/string-change.js +110 -0
  130. package/src/utils/string-change.js.map +1 -0
  131. package/src/utils/string-utils.d.ts +95 -0
  132. package/src/utils/string-utils.js +148 -0
  133. package/src/utils/string-utils.js.map +1 -0
  134. package/testing-pre16.d.ts +2 -0
  135. package/testing-pre16.js +10 -0
  136. package/testing-pre16.js.map +1 -0
  137. package/testing.d.ts +2 -0
  138. package/testing.js +9 -0
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.featurePath = exports.group = exports.capitalize = exports.underscore = exports.classify = exports.camelize = exports.dasherize = exports.decamelize = void 0;
4
+ /**
5
+ * @license
6
+ * Copyright Google Inc. All Rights Reserved.
7
+ *
8
+ * Use of this source code is governed by an MIT-style license that can be
9
+ * found in the LICENSE file at https://angular.io/license
10
+ */
11
+ const STRING_DASHERIZE_REGEXP = /[ _.]/g;
12
+ const STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g;
13
+ const STRING_CAMELIZE_REGEXP = /(-|_|\.|\s)+(.)?/g;
14
+ const STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g;
15
+ const STRING_UNDERSCORE_REGEXP_2 = /-|\s+/g;
16
+ /**
17
+ * Converts a camelized string into all lower case separated by underscores.
18
+ *
19
+ ```javascript
20
+ decamelize('innerHTML'); // 'inner_html'
21
+ decamelize('action_name'); // 'action_name'
22
+ decamelize('css-class-name'); // 'css-class-name'
23
+ decamelize('my favorite items'); // 'my favorite items'
24
+ ```
25
+
26
+ @method decamelize
27
+ @param {String} str The string to decamelize.
28
+ @return {String} the decamelized string.
29
+ */
30
+ function decamelize(str) {
31
+ return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();
32
+ }
33
+ exports.decamelize = decamelize;
34
+ /**
35
+ Replaces underscores, spaces, periods, or camelCase with dashes.
36
+
37
+ ```javascript
38
+ dasherize('innerHTML'); // 'inner-html'
39
+ dasherize('action_name'); // 'action-name'
40
+ dasherize('css-class-name'); // 'css-class-name'
41
+ dasherize('my favorite items'); // 'my-favorite-items'
42
+ dasherize('nrwl.io'); // 'nrwl-io'
43
+ ```
44
+
45
+ @method dasherize
46
+ @param {String} str The string to dasherize.
47
+ @return {String} the dasherized string.
48
+ */
49
+ function dasherize(str) {
50
+ return decamelize(str || '').replace(STRING_DASHERIZE_REGEXP, '-');
51
+ }
52
+ exports.dasherize = dasherize;
53
+ /**
54
+ Returns the lowerCamelCase form of a string.
55
+
56
+ ```javascript
57
+ camelize('innerHTML'); // 'innerHTML'
58
+ camelize('action_name'); // 'actionName'
59
+ camelize('css-class-name'); // 'cssClassName'
60
+ camelize('my favorite items'); // 'myFavoriteItems'
61
+ camelize('My Favorite Items'); // 'myFavoriteItems'
62
+ ```
63
+
64
+ @method camelize
65
+ @param {String} str The string to camelize.
66
+ @return {String} the camelized string.
67
+ */
68
+ function camelize(str) {
69
+ return str
70
+ .replace(STRING_CAMELIZE_REGEXP, (_match, _separator, chr) => {
71
+ return chr ? chr.toUpperCase() : '';
72
+ })
73
+ .replace(/^([A-Z])/, (match) => match.toLowerCase());
74
+ }
75
+ exports.camelize = camelize;
76
+ /**
77
+ Returns the UpperCamelCase form of a string.
78
+
79
+ ```javascript
80
+ 'innerHTML'.classify(); // 'InnerHTML'
81
+ 'action_name'.classify(); // 'ActionName'
82
+ 'css-class-name'.classify(); // 'CssClassName'
83
+ 'my favorite items'.classify(); // 'MyFavoriteItems'
84
+ ```
85
+
86
+ @method classify
87
+ @param {String} str the string to classify
88
+ @return {String} the classified string
89
+ */
90
+ function classify(str) {
91
+ return str
92
+ .split('.')
93
+ .map((part) => capitalize(camelize(part)))
94
+ .join('.');
95
+ }
96
+ exports.classify = classify;
97
+ /**
98
+ More general than decamelize. Returns the lower\_case\_and\_underscored
99
+ form of a string.
100
+
101
+ ```javascript
102
+ 'innerHTML'.underscore(); // 'inner_html'
103
+ 'action_name'.underscore(); // 'action_name'
104
+ 'css-class-name'.underscore(); // 'css_class_name'
105
+ 'my favorite items'.underscore(); // 'my_favorite_items'
106
+ ```
107
+
108
+ @method underscore
109
+ @param {String} str The string to underscore.
110
+ @return {String} the underscored string.
111
+ */
112
+ function underscore(str) {
113
+ return str
114
+ .replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2')
115
+ .replace(STRING_UNDERSCORE_REGEXP_2, '_')
116
+ .toLowerCase();
117
+ }
118
+ exports.underscore = underscore;
119
+ /**
120
+ Returns the Capitalized form of a string
121
+
122
+ ```javascript
123
+ 'innerHTML'.capitalize() // 'InnerHTML'
124
+ 'action_name'.capitalize() // 'Action_name'
125
+ 'css-class-name'.capitalize() // 'Css-class-name'
126
+ 'my favorite items'.capitalize() // 'My favorite items'
127
+ ```
128
+
129
+ @method capitalize
130
+ @param {String} str The string to capitalize.
131
+ @return {String} The capitalized string.
132
+ */
133
+ function capitalize(str) {
134
+ return str.charAt(0).toUpperCase() + str.slice(1);
135
+ }
136
+ exports.capitalize = capitalize;
137
+ function group(name, group) {
138
+ return group ? `${group}/${name}` : name;
139
+ }
140
+ exports.group = group;
141
+ function featurePath(group, flat, path, name) {
142
+ if (group && !flat) {
143
+ return `../../${path}/${name}/`;
144
+ }
145
+ return group ? `../${path}/` : './';
146
+ }
147
+ exports.featurePath = featurePath;
148
+ //# sourceMappingURL=string-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../../../../packages/devkit/src/utils/string-utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AACzC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AACrD,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AACxD,MAAM,0BAA0B,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,OAAO,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AACtE,CAAC;AAFD,gCAEC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,SAAS,CAAC,GAAY;IACpC,OAAO,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;AACrE,CAAC;AAFD,8BAEC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,QAAQ,CAAC,GAAW;IAClC,OAAO,GAAG;SACP,OAAO,CACN,sBAAsB,EACtB,CAAC,MAAc,EAAE,UAAkB,EAAE,GAAW,EAAE,EAAE;QAClD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtC,CAAC,CACF;SACA,OAAO,CAAC,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACjE,CAAC;AATD,4BASC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,QAAQ,CAAC,GAAW;IAClC,OAAO,GAAG;SACP,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SACzC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AALD,4BAKC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG;SACP,OAAO,CAAC,0BAA0B,EAAE,OAAO,CAAC;SAC5C,OAAO,CAAC,0BAA0B,EAAE,GAAG,CAAC;SACxC,WAAW,EAAE,CAAC;AACnB,CAAC;AALD,gCAKC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,gCAEC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,KAAyB;IAC3D,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC;AAFD,sBAEC;AAED,SAAgB,WAAW,CACzB,KAA0B,EAC1B,IAAyB,EACzB,IAAY,EACZ,IAAY;IAEZ,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;QAClB,OAAO,SAAS,IAAI,IAAI,IAAI,GAAG,CAAC;KACjC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,CAAC;AAXD,kCAWC"}
@@ -0,0 +1,2 @@
1
+ export { createTreeWithEmptyWorkspace, createTreeWithEmptyV1Workspace, } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace';
2
+ export { createTree } from 'nx/src/generators/testing-utils/create-tree';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTree = exports.createTreeWithEmptyV1Workspace = exports.createTreeWithEmptyWorkspace = void 0;
4
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
5
+ var create_tree_with_empty_workspace_1 = require("nx/src/generators/testing-utils/create-tree-with-empty-workspace");
6
+ Object.defineProperty(exports, "createTreeWithEmptyWorkspace", { enumerable: true, get: function () { return create_tree_with_empty_workspace_1.createTreeWithEmptyWorkspace; } });
7
+ Object.defineProperty(exports, "createTreeWithEmptyV1Workspace", { enumerable: true, get: function () { return create_tree_with_empty_workspace_1.createTreeWithEmptyV1Workspace; } });
8
+ var create_tree_1 = require("nx/src/generators/testing-utils/create-tree");
9
+ Object.defineProperty(exports, "createTree", { enumerable: true, get: function () { return create_tree_1.createTree; } });
10
+ //# sourceMappingURL=testing-pre16.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing-pre16.js","sourceRoot":"","sources":["../../../packages/devkit/testing-pre16.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAC7D,qHAG0E;AAFxE,gJAAA,4BAA4B,OAAA;AAC5B,kJAAA,8BAA8B,OAAA;AAEhC,2EAAyE;AAAhE,yGAAA,UAAU,OAAA"}
package/testing.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
2
+ export * from 'nx/src/devkit-testing-exports';
package/testing.js ADDED
@@ -0,0 +1,9 @@
1
+ try {
2
+ // TODO(v17): We will not need to maintain this file anymore, change this to a regular export statement
3
+ // This file was introduced in the nx package in v15.7 but devkit is compatible down to v14.1 which doesn't have this file.
4
+ module.exports = require('nx/src/devkit-testing-exports');
5
+ } catch {
6
+ // These are the nx-reexports from before v16
7
+ // TODO(v17): This can be removed once the above is done.
8
+ module.exports = require('./testing-pre16');
9
+ }