@nx/js 16.9.0-beta.4 → 16.9.0-rc.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.
- package/migrations.json +19 -0
- package/package.json +3 -3
- package/src/executors/release-publish/release-publish.impl.js +13 -6
- package/src/migrations/update-16-8-2/update-swcrc.d.ts +2 -0
- package/src/migrations/update-16-8-2/update-swcrc.js +23 -0
- package/src/utils/swc/add-swc-config.js +1 -3
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
package/migrations.json
CHANGED
|
@@ -47,6 +47,12 @@
|
|
|
47
47
|
"version": "16.6.0-beta.0",
|
|
48
48
|
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
|
|
49
49
|
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps"
|
|
50
|
+
},
|
|
51
|
+
"16-8-2-update-swcrc": {
|
|
52
|
+
"cli": "nx",
|
|
53
|
+
"version": "16.8.2-beta.0",
|
|
54
|
+
"description": "Remove invalid options (strict, noInterop) for ES6 type modules.",
|
|
55
|
+
"factory": "./src/migrations/update-16-8-2/update-swcrc"
|
|
50
56
|
}
|
|
51
57
|
},
|
|
52
58
|
"packageJsonUpdates": {
|
|
@@ -98,6 +104,19 @@
|
|
|
98
104
|
"version": "~5.1.3"
|
|
99
105
|
}
|
|
100
106
|
}
|
|
107
|
+
},
|
|
108
|
+
"16.8.2": {
|
|
109
|
+
"version": "16.8.2-beta.0",
|
|
110
|
+
"packages": {
|
|
111
|
+
"@swc/core": {
|
|
112
|
+
"version": "~1.3.85",
|
|
113
|
+
"alwaysAddToPackageJson": false
|
|
114
|
+
},
|
|
115
|
+
"@swc/helpers": {
|
|
116
|
+
"version": "~0.5.2",
|
|
117
|
+
"alwaysAddToPackageJson": false
|
|
118
|
+
}
|
|
119
|
+
}
|
|
101
120
|
}
|
|
102
121
|
}
|
|
103
122
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "16.9.0-
|
|
3
|
+
"version": "16.9.0-rc.1",
|
|
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": {
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"semver": "7.5.3",
|
|
60
60
|
"source-map-support": "0.5.19",
|
|
61
61
|
"tslib": "^2.3.0",
|
|
62
|
-
"@nx/devkit": "16.9.0-
|
|
63
|
-
"@nx/workspace": "16.9.0-
|
|
62
|
+
"@nx/devkit": "16.9.0-rc.1",
|
|
63
|
+
"@nx/workspace": "16.9.0-rc.1",
|
|
64
64
|
"@nrwl/js": "*"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
@@ -19,6 +19,19 @@ function processEnv(color) {
|
|
|
19
19
|
async function runExecutor(options, context) {
|
|
20
20
|
const projectConfig = context.projectsConfigurations.projects[context.projectName];
|
|
21
21
|
const packageRoot = (0, devkit_1.joinPathFragments)(context.root, options.packageRoot ?? projectConfig.root);
|
|
22
|
+
const packageJsonPath = (0, devkit_1.joinPathFragments)(packageRoot, 'package.json');
|
|
23
|
+
const projectPackageJson = (0, devkit_1.readJsonFile)(packageJsonPath);
|
|
24
|
+
const name = projectPackageJson.name;
|
|
25
|
+
// If package and project name match, we can make log messages terser
|
|
26
|
+
let packageTxt = name === context.projectName
|
|
27
|
+
? `package "${name}"`
|
|
28
|
+
: `package "${name}" from project "${context.projectName}"`;
|
|
29
|
+
if (projectPackageJson.private === true) {
|
|
30
|
+
console.warn(`Skipping ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`);
|
|
31
|
+
return {
|
|
32
|
+
success: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
22
35
|
const npmPublishCommandSegments = [`npm publish --json`];
|
|
23
36
|
if (options.registry) {
|
|
24
37
|
npmPublishCommandSegments.push(`--registry=${options.registry}`);
|
|
@@ -55,17 +68,11 @@ async function runExecutor(options, context) {
|
|
|
55
68
|
}
|
|
56
69
|
catch (err) {
|
|
57
70
|
try {
|
|
58
|
-
const projectPackageJson = (0, devkit_1.readJsonFile)((0, devkit_1.joinPathFragments)(packageRoot, 'package.json'));
|
|
59
|
-
const name = projectPackageJson.name;
|
|
60
71
|
const currentVersion = projectPackageJson.version;
|
|
61
72
|
const stdoutData = JSON.parse(err.stdout?.toString() || '{}');
|
|
62
73
|
if (stdoutData.error?.code === 'EPUBLISHCONFLICT' ||
|
|
63
74
|
(stdoutData.error?.code === 'E403' &&
|
|
64
75
|
stdoutData.error?.body?.error?.includes('You cannot publish over the previously published versions'))) {
|
|
65
|
-
// If package and project name match, make it terser
|
|
66
|
-
let packageTxt = name === context.projectName
|
|
67
|
-
? `package "${name}"`
|
|
68
|
-
: `package "${name}" from project "${context.projectName}"`;
|
|
69
76
|
console.warn(`Skipping ${packageTxt}, as v${currentVersion} has already been published to ${registry} with tag "${tag}"`);
|
|
70
77
|
return {
|
|
71
78
|
success: true,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
async function update(tree) {
|
|
6
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
7
|
+
for (const config of projects.values()) {
|
|
8
|
+
const swcrcPath = (0, path_1.join)(config.root, '.swcrc');
|
|
9
|
+
if (!tree.exists(swcrcPath))
|
|
10
|
+
continue;
|
|
11
|
+
const json = (0, devkit_1.readJson)(tree, swcrcPath);
|
|
12
|
+
// No longer need strict or noInterop for es6 modules
|
|
13
|
+
// See: https://github.com/swc-project/swc/commit/7e8d72d
|
|
14
|
+
if (json.module?.type === 'es6' &&
|
|
15
|
+
(json.module?.strict || json.module?.noInterop)) {
|
|
16
|
+
delete json.module.noInterop;
|
|
17
|
+
delete json.module.strict;
|
|
18
|
+
(0, devkit_1.writeJson)(tree, swcrcPath, json);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
+
}
|
|
23
|
+
exports.default = update;
|
|
@@ -27,9 +27,7 @@ const swcOptionsString = (type = 'commonjs') => `{
|
|
|
27
27
|
"loose": true
|
|
28
28
|
},
|
|
29
29
|
"module": {
|
|
30
|
-
"type": "${type}"
|
|
31
|
-
"strict": true,
|
|
32
|
-
"noInterop": true
|
|
30
|
+
"type": "${type}"
|
|
33
31
|
},
|
|
34
32
|
"sourceMaps": true,
|
|
35
33
|
"exclude": ${JSON.stringify(exports.defaultExclude)}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export declare const nxVersion: any;
|
|
|
2
2
|
export declare const esbuildVersion = "^0.17.17";
|
|
3
3
|
export declare const prettierVersion = "^2.6.2";
|
|
4
4
|
export declare const swcCliVersion = "~0.1.62";
|
|
5
|
-
export declare const swcCoreVersion = "~1.3.
|
|
6
|
-
export declare const swcHelpersVersion = "~0.5.
|
|
5
|
+
export declare const swcCoreVersion = "~1.3.85";
|
|
6
|
+
export declare const swcHelpersVersion = "~0.5.2";
|
|
7
7
|
export declare const swcNodeVersion = "~1.4.2";
|
|
8
8
|
export declare const tsLibVersion = "^2.3.0";
|
|
9
9
|
export declare const typesNodeVersion = "18.7.1";
|
package/src/utils/versions.js
CHANGED
|
@@ -5,8 +5,8 @@ exports.nxVersion = require('../../package.json').version;
|
|
|
5
5
|
exports.esbuildVersion = '^0.17.17';
|
|
6
6
|
exports.prettierVersion = '^2.6.2';
|
|
7
7
|
exports.swcCliVersion = '~0.1.62';
|
|
8
|
-
exports.swcCoreVersion = '~1.3.
|
|
9
|
-
exports.swcHelpersVersion = '~0.5.
|
|
8
|
+
exports.swcCoreVersion = '~1.3.85';
|
|
9
|
+
exports.swcHelpersVersion = '~0.5.2';
|
|
10
10
|
exports.swcNodeVersion = '~1.4.2';
|
|
11
11
|
exports.tsLibVersion = '^2.3.0';
|
|
12
12
|
exports.typesNodeVersion = '18.7.1';
|