@nx/js 19.6.2 → 19.6.3
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/babel.js +25 -24
- package/package.json +4 -4
- package/src/executors/verdaccio/verdaccio.impl.js +34 -32
package/babel.js
CHANGED
|
@@ -18,6 +18,30 @@ module.exports = function (api, options = {}) {
|
|
|
18
18
|
if (options.classProperties) {
|
|
19
19
|
devkit_1.logger.warn(`Use =\`loose\` option instead of \`classProperties.loose\`. The \`classProperties\` option will be removed in Nx 20`);
|
|
20
20
|
}
|
|
21
|
+
const plugins = [
|
|
22
|
+
!isNxPackage
|
|
23
|
+
? [
|
|
24
|
+
require.resolve('@babel/plugin-transform-runtime'),
|
|
25
|
+
{
|
|
26
|
+
corejs: false,
|
|
27
|
+
helpers: true,
|
|
28
|
+
regenerator: true,
|
|
29
|
+
useESModules: isModern,
|
|
30
|
+
absoluteRuntime: (0, path_1.dirname)(require.resolve('@babel/runtime/package.json')),
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
: null,
|
|
34
|
+
require.resolve('babel-plugin-macros'),
|
|
35
|
+
emitDecoratorMetadata
|
|
36
|
+
? require.resolve('babel-plugin-transform-typescript-metadata')
|
|
37
|
+
: undefined,
|
|
38
|
+
// Must use legacy decorators to remain compatible with TypeScript.
|
|
39
|
+
[
|
|
40
|
+
require.resolve('@babel/plugin-proposal-decorators'),
|
|
41
|
+
options.decorators ?? { legacy: true },
|
|
42
|
+
],
|
|
43
|
+
[require.resolve('@babel/plugin-transform-class-properties'), { loose }],
|
|
44
|
+
].filter(Boolean);
|
|
21
45
|
return {
|
|
22
46
|
presets: [
|
|
23
47
|
// Support module/nomodule pattern.
|
|
@@ -37,30 +61,7 @@ module.exports = function (api, options = {}) {
|
|
|
37
61
|
},
|
|
38
62
|
],
|
|
39
63
|
],
|
|
40
|
-
plugins
|
|
41
|
-
!isNxPackage
|
|
42
|
-
? [
|
|
43
|
-
require.resolve('@babel/plugin-transform-runtime'),
|
|
44
|
-
{
|
|
45
|
-
corejs: false,
|
|
46
|
-
helpers: true,
|
|
47
|
-
regenerator: true,
|
|
48
|
-
useESModules: isModern,
|
|
49
|
-
absoluteRuntime: (0, path_1.dirname)(require.resolve('@babel/runtime/package.json')),
|
|
50
|
-
},
|
|
51
|
-
]
|
|
52
|
-
: null,
|
|
53
|
-
require.resolve('babel-plugin-macros'),
|
|
54
|
-
emitDecoratorMetadata
|
|
55
|
-
? require.resolve('babel-plugin-transform-typescript-metadata')
|
|
56
|
-
: undefined,
|
|
57
|
-
// Must use legacy decorators to remain compatible with TypeScript.
|
|
58
|
-
[
|
|
59
|
-
require.resolve('@babel/plugin-proposal-decorators'),
|
|
60
|
-
options.decorators ?? { legacy: true },
|
|
61
|
-
],
|
|
62
|
-
[require.resolve('@babel/plugin-transform-class-properties'), { loose }],
|
|
63
|
-
].filter(Boolean),
|
|
64
|
+
plugins,
|
|
64
65
|
overrides: [
|
|
65
66
|
// Convert `const enum` to `enum`. The former cannot be supported by babel
|
|
66
67
|
// but at least we can get it to not error out.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "19.6.
|
|
3
|
+
"version": "19.6.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@babel/preset-env": "^7.23.2",
|
|
40
40
|
"@babel/preset-typescript": "^7.22.5",
|
|
41
41
|
"@babel/runtime": "^7.22.6",
|
|
42
|
-
"@nx/devkit": "19.6.
|
|
43
|
-
"@nx/workspace": "19.6.
|
|
42
|
+
"@nx/devkit": "19.6.3",
|
|
43
|
+
"@nx/workspace": "19.6.3",
|
|
44
44
|
"babel-plugin-const-enum": "^1.0.1",
|
|
45
45
|
"babel-plugin-macros": "^2.8.0",
|
|
46
46
|
"babel-plugin-transform-typescript-metadata": "^0.3.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"ts-node": "10.9.1",
|
|
62
62
|
"tsconfig-paths": "^4.1.2",
|
|
63
63
|
"tslib": "^2.3.0",
|
|
64
|
-
"@nrwl/js": "19.6.
|
|
64
|
+
"@nrwl/js": "19.6.3"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"verdaccio": "^5.0.4"
|
|
@@ -122,19 +122,19 @@ function setupNpm(options) {
|
|
|
122
122
|
const scopes = ['', ...(options.scopes || [])];
|
|
123
123
|
try {
|
|
124
124
|
scopes.forEach((scope) => {
|
|
125
|
-
const
|
|
125
|
+
const registryName = scope ? `${scope}:registry` : 'registry';
|
|
126
126
|
try {
|
|
127
|
-
npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get
|
|
127
|
+
npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env })
|
|
128
128
|
?.toString()
|
|
129
129
|
?.trim()
|
|
130
130
|
?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
|
|
131
131
|
);
|
|
132
|
-
(0, child_process_1.execSync)(`npm config set
|
|
132
|
+
(0, child_process_1.execSync)(`npm config set ${registryName} http://localhost:${options.port}/ --location ${options.location}`, { env });
|
|
133
133
|
(0, child_process_1.execSync)(`npm config set //localhost:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env });
|
|
134
|
-
devkit_1.logger.info(`Set npm ${
|
|
134
|
+
devkit_1.logger.info(`Set npm ${registryName} to http://localhost:${options.port}/`);
|
|
135
135
|
}
|
|
136
136
|
catch (e) {
|
|
137
|
-
throw new Error(`Failed to set npm ${
|
|
137
|
+
throw new Error(`Failed to set npm ${registryName} to http://localhost:${options.port}/: ${e.message}`);
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
return () => {
|
|
@@ -143,20 +143,20 @@ function setupNpm(options) {
|
|
|
143
143
|
?.toString()
|
|
144
144
|
?.trim()
|
|
145
145
|
?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
(0, child_process_1.execSync)(`npm config set
|
|
151
|
-
devkit_1.logger.info(`Reset npm ${
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
146
|
+
scopes.forEach((scope, index) => {
|
|
147
|
+
const registryName = scope ? `${scope}:registry` : 'registry';
|
|
148
|
+
if (npmRegistryPaths[index] &&
|
|
149
|
+
currentNpmRegistryPath.includes('localhost')) {
|
|
150
|
+
(0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env });
|
|
151
|
+
devkit_1.logger.info(`Reset npm ${registryName} to ${npmRegistryPaths[index]}`);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
(0, child_process_1.execSync)(`npm config delete ${registryName} --location ${options.location}`, {
|
|
155
|
+
env,
|
|
156
|
+
});
|
|
157
|
+
devkit_1.logger.info('Cleared custom npm registry');
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
160
|
(0, child_process_1.execSync)(`npm config delete //localhost:${options.port}/:_authToken --location ${options.location}`, { env });
|
|
161
161
|
}
|
|
162
162
|
catch (e) {
|
|
@@ -225,20 +225,22 @@ function setupYarn(options) {
|
|
|
225
225
|
?.toString()
|
|
226
226
|
?.trim()
|
|
227
227
|
?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
scopes.forEach((scope, index) => {
|
|
229
|
+
const registryName = scope
|
|
230
|
+
? `${scope}:${registryConfigName}`
|
|
231
|
+
: registryConfigName;
|
|
232
|
+
if (yarnRegistryPaths[index] &&
|
|
233
|
+
currentYarnRegistryPath.includes('localhost')) {
|
|
234
|
+
(0, child_process_1.execSync)(`yarn config set ${registryName} ${yarnRegistryPaths[index]}` +
|
|
233
235
|
(options.location === 'user' ? ' --home' : ''), { env });
|
|
234
|
-
devkit_1.logger.info(`Reset yarn ${
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
(
|
|
240
|
-
|
|
241
|
-
}
|
|
236
|
+
devkit_1.logger.info(`Reset yarn ${registryName} to ${yarnRegistryPaths[index]}`);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
(0, child_process_1.execSync)(`yarn config ${isYarnV1 ? 'delete' : 'unset'} ${registryName}` +
|
|
240
|
+
(options.location === 'user' ? ' --home' : ''), { env });
|
|
241
|
+
devkit_1.logger.info(`Cleared custom yarn ${registryConfigName}`);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
242
244
|
if (whitelistedLocalhost) {
|
|
243
245
|
const currentWhitelist = getYarnUnsafeHttpWhitelist(isYarnV1);
|
|
244
246
|
if (currentWhitelist.has('localhost')) {
|