@nx/js 17.2.0-beta.8 → 17.2.0-canary.20231206-a93ee1c
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "17.2.0-
|
|
3
|
+
"version": "17.2.0-canary.20231206-a93ee1c",
|
|
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": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"semver": "7.5.3",
|
|
58
58
|
"source-map-support": "0.5.19",
|
|
59
59
|
"tslib": "^2.3.0",
|
|
60
|
-
"@nx/devkit": "17.2.0-
|
|
61
|
-
"@nx/workspace": "17.2.0-
|
|
62
|
-
"@nrwl/js": "17.2.0-
|
|
60
|
+
"@nx/devkit": "17.2.0-canary.20231206-a93ee1c",
|
|
61
|
+
"@nx/workspace": "17.2.0-canary.20231206-a93ee1c",
|
|
62
|
+
"@nrwl/js": "17.2.0-canary.20231206-a93ee1c"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"verdaccio": "^5.0.4"
|
|
@@ -52,74 +52,84 @@ async function runExecutor(options, context) {
|
|
|
52
52
|
// Resolve values using the `npm config` command so that things like environment variables and `publishConfig`s are accounted for
|
|
53
53
|
const registry = options.registry ?? (0, child_process_1.execSync)(`npm config get registry`).toString().trim();
|
|
54
54
|
const tag = options.tag ?? (0, child_process_1.execSync)(`npm config get tag`).toString().trim();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
cwd: packageRoot,
|
|
76
|
-
stdio: 'ignore',
|
|
77
|
-
});
|
|
78
|
-
console.log(`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
console.log(`Would add the dist-tag ${tag} to v${currentVersion} for registry ${registry}, but ${chalk.keyword('orange')('[dry-run]')} was set.\n`);
|
|
82
|
-
}
|
|
55
|
+
/**
|
|
56
|
+
* In a dry-run scenario, it is most likely that all commands are being run with dry-run, therefore
|
|
57
|
+
* the most up to date/relevant version might not exist on disk for us to read and make the npm view
|
|
58
|
+
* request with.
|
|
59
|
+
*
|
|
60
|
+
* Therefore, so as to not produce misleading output in dry around dist-tags being altered, we do not
|
|
61
|
+
* perform the npm view step, and just show npm publish's dry-run output.
|
|
62
|
+
*/
|
|
63
|
+
if (!options.dryRun) {
|
|
64
|
+
const currentVersion = projectPackageJson.version;
|
|
65
|
+
try {
|
|
66
|
+
const result = (0, child_process_1.execSync)(npmViewCommandSegments.join(' '), {
|
|
67
|
+
env: processEnv(true),
|
|
68
|
+
cwd: packageRoot,
|
|
69
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
70
|
+
});
|
|
71
|
+
const resultJson = JSON.parse(result.toString());
|
|
72
|
+
const distTags = resultJson['dist-tags'] || {};
|
|
73
|
+
if (distTags[tag] === currentVersion) {
|
|
74
|
+
console.warn(`Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`);
|
|
83
75
|
return {
|
|
84
76
|
success: true,
|
|
85
77
|
};
|
|
86
78
|
}
|
|
87
|
-
|
|
79
|
+
if (resultJson.versions.includes(currentVersion)) {
|
|
88
80
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
console.
|
|
81
|
+
if (!options.dryRun) {
|
|
82
|
+
(0, child_process_1.execSync)(`npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry=${registry}`, {
|
|
83
|
+
env: processEnv(true),
|
|
84
|
+
cwd: packageRoot,
|
|
85
|
+
stdio: 'ignore',
|
|
86
|
+
});
|
|
87
|
+
console.log(`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`);
|
|
96
88
|
}
|
|
97
|
-
|
|
98
|
-
console.
|
|
99
|
-
console.error(JSON.stringify(stdoutData, null, 2));
|
|
89
|
+
else {
|
|
90
|
+
console.log(`Would add the dist-tag ${tag} to v${currentVersion} for registry ${registry}, but ${chalk.keyword('orange')('[dry-run]')} was set.\n`);
|
|
100
91
|
}
|
|
101
92
|
return {
|
|
102
|
-
success:
|
|
93
|
+
success: true,
|
|
103
94
|
};
|
|
104
95
|
}
|
|
105
96
|
catch (err) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
97
|
+
try {
|
|
98
|
+
const stdoutData = JSON.parse(err.stdout?.toString() || '{}');
|
|
99
|
+
console.error('npm dist-tag add error:');
|
|
100
|
+
if (stdoutData.error.summary) {
|
|
101
|
+
console.error(stdoutData.error.summary);
|
|
102
|
+
}
|
|
103
|
+
if (stdoutData.error.detail) {
|
|
104
|
+
console.error(stdoutData.error.detail);
|
|
105
|
+
}
|
|
106
|
+
if (context.isVerbose) {
|
|
107
|
+
console.error('npm dist-tag add stdout:');
|
|
108
|
+
console.error(JSON.stringify(stdoutData, null, 2));
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
success: false,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
console.error('Something unexpected went wrong when processing the npm dist-tag add output\n', err);
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
110
120
|
}
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
const stdoutData = JSON.parse(err.stdout?.toString() || '{}');
|
|
125
|
+
// If the error is that the package doesn't exist, then we can ignore it because we will be publishing it for the first time in the next step
|
|
126
|
+
if (!(stdoutData.error?.code?.includes('E404') &&
|
|
127
|
+
stdoutData.error?.summary?.includes('no such package available'))) {
|
|
128
|
+
console.error(`Something unexpected went wrong when checking for existing dist-tags.\n`, err);
|
|
129
|
+
return {
|
|
130
|
+
success: false,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
123
133
|
}
|
|
124
134
|
}
|
|
125
135
|
try {
|
|
@@ -169,7 +169,7 @@ To fix this you will either need to add a package.json file at that location, or
|
|
|
169
169
|
case 'prompt': {
|
|
170
170
|
// Only add the release group name to the log if it is one set by the user, otherwise it is useless noise
|
|
171
171
|
const maybeLogReleaseGroup = (log) => {
|
|
172
|
-
if (options.releaseGroup.name === config_1.
|
|
172
|
+
if (options.releaseGroup.name === config_1.IMPLICIT_DEFAULT_RELEASE_GROUP) {
|
|
173
173
|
return log;
|
|
174
174
|
}
|
|
175
175
|
return `${log} within release group "${options.releaseGroup.name}"`;
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export declare const typescriptVersion = "~5.2.2";
|
|
|
14
14
|
* that's supported by the lowest Angular supported version, e.g.
|
|
15
15
|
* `npm view @angular/compiler-cli@14.0.0 peerDependencies.typescript`
|
|
16
16
|
*/
|
|
17
|
-
export declare const supportedTypescriptVersions = ">=4.
|
|
17
|
+
export declare const supportedTypescriptVersions = ">=4.8.2";
|
package/src/utils/versions.js
CHANGED
|
@@ -18,4 +18,4 @@ exports.typescriptVersion = '~5.2.2';
|
|
|
18
18
|
* that's supported by the lowest Angular supported version, e.g.
|
|
19
19
|
* `npm view @angular/compiler-cli@14.0.0 peerDependencies.typescript`
|
|
20
20
|
*/
|
|
21
|
-
exports.supportedTypescriptVersions = '>=4.
|
|
21
|
+
exports.supportedTypescriptVersions = '>=4.8.2';
|