@nx/js 22.7.0-beta.0 → 22.7.0-pr.34894.3fb67b5
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/package.json +4 -4
- package/src/executors/node/lib/kill-tree.js +3 -3
- package/src/executors/release-publish/release-publish.impl.js +3 -3
- package/src/executors/verdaccio/verdaccio.impl.d.ts.map +1 -1
- package/src/executors/verdaccio/verdaccio.impl.js +17 -19
- package/src/generators/setup-verdaccio/generator.js +1 -1
- package/src/plugins/jest/start-local-registry.js +2 -2
- package/src/release/utils/update-lock-file.js +1 -1
- package/src/release/version-actions.js +1 -1
- package/src/utils/npm-config.js +1 -1
- package/src/utils/swc/compile-swc.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.7.0-
|
|
3
|
+
"version": "22.7.0-pr.34894.3fb67b5",
|
|
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": "22.7.0-
|
|
43
|
-
"@nx/workspace": "22.7.0-
|
|
42
|
+
"@nx/devkit": "22.7.0-pr.34894.3fb67b5",
|
|
43
|
+
"@nx/workspace": "22.7.0-pr.34894.3fb67b5",
|
|
44
44
|
"@zkochan/js-yaml": "0.0.7",
|
|
45
45
|
"babel-plugin-const-enum": "^1.0.1",
|
|
46
46
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tslib": "^2.3.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"nx": "22.7.0-
|
|
63
|
+
"nx": "22.7.0-pr.34894.3fb67b5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^6.0.5"
|
|
@@ -20,7 +20,7 @@ async function killTree(pid, signal) {
|
|
|
20
20
|
switch (process.platform) {
|
|
21
21
|
case 'win32':
|
|
22
22
|
(0, child_process_1.exec)('taskkill /pid ' + pid + ' /T /F', {
|
|
23
|
-
windowsHide:
|
|
23
|
+
windowsHide: true,
|
|
24
24
|
}, (error) => {
|
|
25
25
|
// Ignore Fatal errors (128) because it might be due to the process already being killed.
|
|
26
26
|
// On Linux/Mac we can check ESRCH (no such process), but on Windows we can't.
|
|
@@ -30,7 +30,7 @@ async function killTree(pid, signal) {
|
|
|
30
30
|
case 'darwin':
|
|
31
31
|
buildProcessTree(pid, tree, pidsToProcess, function (parentPid) {
|
|
32
32
|
return (0, child_process_1.spawn)('pgrep', ['-P', parentPid], {
|
|
33
|
-
windowsHide:
|
|
33
|
+
windowsHide: true,
|
|
34
34
|
});
|
|
35
35
|
}, function () {
|
|
36
36
|
killAll(tree, signal, callback);
|
|
@@ -39,7 +39,7 @@ async function killTree(pid, signal) {
|
|
|
39
39
|
default: // Linux
|
|
40
40
|
buildProcessTree(pid, tree, pidsToProcess, function (parentPid) {
|
|
41
41
|
return (0, child_process_1.spawn)('ps', ['-o', 'pid', '--no-headers', '--ppid', parentPid], {
|
|
42
|
-
windowsHide:
|
|
42
|
+
windowsHide: true,
|
|
43
43
|
});
|
|
44
44
|
}, function () {
|
|
45
45
|
killAll(tree, signal, callback);
|
|
@@ -151,7 +151,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
151
151
|
env: processEnv(true),
|
|
152
152
|
cwd: context.root,
|
|
153
153
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
154
|
-
windowsHide:
|
|
154
|
+
windowsHide: true,
|
|
155
155
|
});
|
|
156
156
|
const resultJson = JSON.parse(result.toString());
|
|
157
157
|
const distTags = resultJson['dist-tags'] || {};
|
|
@@ -173,7 +173,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
173
173
|
env: processEnv(true),
|
|
174
174
|
cwd: context.root,
|
|
175
175
|
stdio: 'ignore',
|
|
176
|
-
windowsHide:
|
|
176
|
+
windowsHide: true,
|
|
177
177
|
});
|
|
178
178
|
console.log(`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`);
|
|
179
179
|
}
|
|
@@ -286,7 +286,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
286
286
|
env: processEnv(true),
|
|
287
287
|
cwd: context.root,
|
|
288
288
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
289
|
-
windowsHide:
|
|
289
|
+
windowsHide: true,
|
|
290
290
|
});
|
|
291
291
|
// If in dry-run mode, the version on disk will not represent the version that would be published, so we scrub it from the output to avoid confusion.
|
|
292
292
|
const dryRunVersionPlaceholder = 'X.X.X-dry-run';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdaccio.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/verdaccio/verdaccio.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;GAqDzB;
|
|
1
|
+
{"version":3,"file":"verdaccio.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/verdaccio/verdaccio.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;GAqDzB;AAkTD,eAAe,iBAAiB,CAAC"}
|
|
@@ -116,7 +116,7 @@ function createVerdaccioOptions(options, workspaceRoot) {
|
|
|
116
116
|
}
|
|
117
117
|
function setupNpm(options) {
|
|
118
118
|
try {
|
|
119
|
-
(0, child_process_1.execSync)('npm --version', { env, windowsHide:
|
|
119
|
+
(0, child_process_1.execSync)('npm --version', { env, windowsHide: true });
|
|
120
120
|
}
|
|
121
121
|
catch (e) {
|
|
122
122
|
return () => { };
|
|
@@ -127,13 +127,13 @@ function setupNpm(options) {
|
|
|
127
127
|
scopes.forEach((scope) => {
|
|
128
128
|
const registryName = scope ? `${scope}:registry` : 'registry';
|
|
129
129
|
try {
|
|
130
|
-
npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env, windowsHide:
|
|
130
|
+
npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env, windowsHide: true })
|
|
131
131
|
?.toString()
|
|
132
132
|
?.trim()
|
|
133
133
|
?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
|
|
134
134
|
);
|
|
135
|
-
(0, child_process_1.execSync)(`npm config set ${registryName} http://${options.listenAddress}:${options.port}/ --location ${options.location}`, { env, windowsHide:
|
|
136
|
-
(0, child_process_1.execSync)(`npm config set //${options.listenAddress}:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env, windowsHide:
|
|
135
|
+
(0, child_process_1.execSync)(`npm config set ${registryName} http://${options.listenAddress}:${options.port}/ --location ${options.location}`, { env, windowsHide: true });
|
|
136
|
+
(0, child_process_1.execSync)(`npm config set //${options.listenAddress}:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env, windowsHide: true });
|
|
137
137
|
devkit_1.logger.info(`Set npm ${registryName} to http://${options.listenAddress}:${options.port}/`);
|
|
138
138
|
}
|
|
139
139
|
catch (e) {
|
|
@@ -142,7 +142,7 @@ function setupNpm(options) {
|
|
|
142
142
|
});
|
|
143
143
|
return () => {
|
|
144
144
|
try {
|
|
145
|
-
const currentNpmRegistryPath = (0, child_process_1.execSync)(`npm config get registry --location ${options.location}`, { env, windowsHide:
|
|
145
|
+
const currentNpmRegistryPath = (0, child_process_1.execSync)(`npm config get registry --location ${options.location}`, { env, windowsHide: true })
|
|
146
146
|
?.toString()
|
|
147
147
|
?.trim()
|
|
148
148
|
?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
|
|
@@ -150,18 +150,18 @@ function setupNpm(options) {
|
|
|
150
150
|
const registryName = scope ? `${scope}:registry` : 'registry';
|
|
151
151
|
if (npmRegistryPaths[index] &&
|
|
152
152
|
currentNpmRegistryPath.includes(options.listenAddress)) {
|
|
153
|
-
(0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env, windowsHide:
|
|
153
|
+
(0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env, windowsHide: true });
|
|
154
154
|
devkit_1.logger.info(`Reset npm ${registryName} to ${npmRegistryPaths[index]}`);
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
157
157
|
(0, child_process_1.execSync)(`npm config delete ${registryName} --location ${options.location}`, {
|
|
158
158
|
env,
|
|
159
|
-
windowsHide:
|
|
159
|
+
windowsHide: true,
|
|
160
160
|
});
|
|
161
161
|
devkit_1.logger.info('Cleared custom npm registry');
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
(0, child_process_1.execSync)(`npm config delete //${options.listenAddress}:${options.port}/:_authToken --location ${options.location}`, { env, windowsHide:
|
|
164
|
+
(0, child_process_1.execSync)(`npm config delete //${options.listenAddress}:${options.port}/:_authToken --location ${options.location}`, { env, windowsHide: true });
|
|
165
165
|
}
|
|
166
166
|
catch (e) {
|
|
167
167
|
throw new Error(`Failed to reset npm registry: ${e.message}`);
|
|
@@ -176,17 +176,17 @@ function getYarnUnsafeHttpWhitelist(isYarnV1) {
|
|
|
176
176
|
return !isYarnV1
|
|
177
177
|
? new Set(JSON.parse((0, child_process_1.execSync)(`yarn config get unsafeHttpWhitelist --json`, {
|
|
178
178
|
env,
|
|
179
|
-
windowsHide:
|
|
179
|
+
windowsHide: true,
|
|
180
180
|
}).toString()))
|
|
181
181
|
: null;
|
|
182
182
|
}
|
|
183
183
|
function setYarnUnsafeHttpWhitelist(currentWhitelist, options) {
|
|
184
184
|
if (currentWhitelist.size > 0) {
|
|
185
|
-
(0, child_process_1.execSync)(`yarn config set unsafeHttpWhitelist --json '${JSON.stringify(Array.from(currentWhitelist))}'` + (options.location === 'user' ? ' --home' : ''), { env, windowsHide:
|
|
185
|
+
(0, child_process_1.execSync)(`yarn config set unsafeHttpWhitelist --json '${JSON.stringify(Array.from(currentWhitelist))}'` + (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
|
|
186
186
|
}
|
|
187
187
|
else {
|
|
188
188
|
(0, child_process_1.execSync)(`yarn config unset unsafeHttpWhitelist` +
|
|
189
|
-
(options.location === 'user' ? ' --home' : ''), { env, windowsHide:
|
|
189
|
+
(options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
function setupYarn(options) {
|
|
@@ -195,9 +195,7 @@ function setupYarn(options) {
|
|
|
195
195
|
const scopes = ['', ...(options.scopes || [])];
|
|
196
196
|
try {
|
|
197
197
|
isYarnV1 =
|
|
198
|
-
(0, semver_1.major)((0, child_process_1.execSync)('yarn --version', { env, windowsHide:
|
|
199
|
-
.toString()
|
|
200
|
-
.trim()) === 1;
|
|
198
|
+
(0, semver_1.major)((0, child_process_1.execSync)('yarn --version', { env, windowsHide: true }).toString().trim()) === 1;
|
|
201
199
|
}
|
|
202
200
|
catch {
|
|
203
201
|
// This would fail if yarn is not installed which is okay
|
|
@@ -209,14 +207,14 @@ function setupYarn(options) {
|
|
|
209
207
|
const scopeName = scope ? `${scope}:` : '';
|
|
210
208
|
yarnRegistryPaths.push((0, child_process_1.execSync)(`yarn config get ${scopeName}${registryConfigName}`, {
|
|
211
209
|
env,
|
|
212
|
-
windowsHide:
|
|
210
|
+
windowsHide: true,
|
|
213
211
|
})
|
|
214
212
|
?.toString()
|
|
215
213
|
?.trim()
|
|
216
214
|
?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
|
|
217
215
|
);
|
|
218
216
|
(0, child_process_1.execSync)(`yarn config set ${scopeName}${registryConfigName} http://${options.listenAddress}:${options.port}/` +
|
|
219
|
-
(options.location === 'user' ? ' --home' : ''), { env, windowsHide:
|
|
217
|
+
(options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
|
|
220
218
|
devkit_1.logger.info(`Set yarn ${scopeName}registry to http://${options.listenAddress}:${options.port}/`);
|
|
221
219
|
});
|
|
222
220
|
const currentWhitelist = getYarnUnsafeHttpWhitelist(isYarnV1);
|
|
@@ -229,7 +227,7 @@ function setupYarn(options) {
|
|
|
229
227
|
}
|
|
230
228
|
return () => {
|
|
231
229
|
try {
|
|
232
|
-
const currentYarnRegistryPath = (0, child_process_1.execSync)(`yarn config get ${registryConfigName}`, { env, windowsHide:
|
|
230
|
+
const currentYarnRegistryPath = (0, child_process_1.execSync)(`yarn config get ${registryConfigName}`, { env, windowsHide: true })
|
|
233
231
|
?.toString()
|
|
234
232
|
?.trim()
|
|
235
233
|
?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
|
|
@@ -242,13 +240,13 @@ function setupYarn(options) {
|
|
|
242
240
|
(0, child_process_1.execSync)(`yarn config set ${registryName} ${yarnRegistryPaths[index]}` +
|
|
243
241
|
(options.location === 'user' ? ' --home' : ''), {
|
|
244
242
|
env,
|
|
245
|
-
windowsHide:
|
|
243
|
+
windowsHide: true,
|
|
246
244
|
});
|
|
247
245
|
devkit_1.logger.info(`Reset yarn ${registryName} to ${yarnRegistryPaths[index]}`);
|
|
248
246
|
}
|
|
249
247
|
else {
|
|
250
248
|
(0, child_process_1.execSync)(`yarn config ${isYarnV1 ? 'delete' : 'unset'} ${registryName}` +
|
|
251
|
-
(options.location === 'user' ? ' --home' : ''), { env, windowsHide:
|
|
249
|
+
(options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
|
|
252
250
|
devkit_1.logger.info(`Cleared custom yarn ${registryConfigName}`);
|
|
253
251
|
}
|
|
254
252
|
});
|
|
@@ -10,7 +10,7 @@ async function setupVerdaccio(tree, options) {
|
|
|
10
10
|
if (!tree.exists('.verdaccio/config.yml')) {
|
|
11
11
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), '.verdaccio', {
|
|
12
12
|
npmUplinkRegistry: (0, child_process_1.execSync)('npm config get registry', {
|
|
13
|
-
windowsHide:
|
|
13
|
+
windowsHide: true,
|
|
14
14
|
})
|
|
15
15
|
?.toString()
|
|
16
16
|
?.trim() ?? 'https://registry.npmjs.org',
|
|
@@ -34,7 +34,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
|
|
|
34
34
|
console.log(`Local registry started on ${registry}`);
|
|
35
35
|
process.env.npm_config_registry = registry;
|
|
36
36
|
(0, child_process_1.execSync)(`npm config set //${listenAddress}:${port}/:_authToken "${authToken}" --ws=false`, {
|
|
37
|
-
windowsHide:
|
|
37
|
+
windowsHide: true,
|
|
38
38
|
});
|
|
39
39
|
// bun
|
|
40
40
|
process.env.BUN_CONFIG_REGISTRY = registry;
|
|
@@ -48,7 +48,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
|
|
|
48
48
|
resolve(() => {
|
|
49
49
|
childProcess.kill();
|
|
50
50
|
(0, child_process_1.execSync)(`npm config delete //${listenAddress}:${port}/:_authToken --ws=false`, {
|
|
51
|
-
windowsHide:
|
|
51
|
+
windowsHide: true,
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
childProcess?.stdout?.off('data', listener);
|
|
@@ -62,7 +62,7 @@ class JsVersionActions extends release_1.VersionActions {
|
|
|
62
62
|
// Must be non-blocking async to allow spinner to render
|
|
63
63
|
currentVersion = await new Promise((resolve, reject) => {
|
|
64
64
|
(0, node_child_process_1.exec)(`npm view ${packageName} version --"${registryConfigKey}=${registry}" --tag=${tag}`, {
|
|
65
|
-
windowsHide:
|
|
65
|
+
windowsHide: true,
|
|
66
66
|
}, (error, stdout, stderr) => {
|
|
67
67
|
if (error) {
|
|
68
68
|
return reject(error);
|
package/src/utils/npm-config.js
CHANGED
|
@@ -76,7 +76,7 @@ async function getNpmConfigValue(key, cwd) {
|
|
|
76
76
|
async function execAsync(command, cwd) {
|
|
77
77
|
// Must be non-blocking async to allow spinner to render
|
|
78
78
|
return new Promise((resolve, reject) => {
|
|
79
|
-
(0, child_process_1.exec)(command, { cwd, windowsHide:
|
|
79
|
+
(0, child_process_1.exec)(command, { cwd, windowsHide: true }, (error, stdout, stderr) => {
|
|
80
80
|
if (error) {
|
|
81
81
|
return reject((stderr ? `${stderr}\n` : '') + error);
|
|
82
82
|
}
|
|
@@ -60,7 +60,7 @@ async function compileSwc(context, normalizedOptions, postCompilationCallback) {
|
|
|
60
60
|
const swcCmdLog = (0, node_child_process_1.execSync)(getSwcCmd(normalizedOptions), {
|
|
61
61
|
encoding: 'utf8',
|
|
62
62
|
cwd: normalizedOptions.swcCliOptions.swcCwd,
|
|
63
|
-
windowsHide:
|
|
63
|
+
windowsHide: true,
|
|
64
64
|
stdio: 'pipe',
|
|
65
65
|
});
|
|
66
66
|
devkit_1.logger.log(swcCmdLog.replace(/\n/, ''));
|
|
@@ -109,7 +109,7 @@ async function* compileSwcWatch(context, normalizedOptions, postCompilationCallb
|
|
|
109
109
|
let watcherOnExit;
|
|
110
110
|
const swcWatcher = (0, node_child_process_1.exec)(getSwcCmd(normalizedOptions, true), {
|
|
111
111
|
cwd: normalizedOptions.swcCliOptions.swcCwd,
|
|
112
|
-
windowsHide:
|
|
112
|
+
windowsHide: true,
|
|
113
113
|
});
|
|
114
114
|
processOnExit = () => {
|
|
115
115
|
swcWatcher.kill();
|