@bleedingdev/modern-js-builder 3.5.0-ultramodern.35 → 3.5.0-ultramodern.37
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/dist/cjs/shared/tsgo.js +17 -2
- package/dist/esm/shared/tsgo.mjs +17 -2
- package/dist/esm-node/shared/tsgo.mjs +17 -2
- package/dist/types/shared/tsgo.d.ts +2 -2
- package/package.json +13 -13
package/dist/cjs/shared/tsgo.js
CHANGED
|
@@ -50,7 +50,8 @@ const external_node_path_namespaceObject = require("node:path");
|
|
|
50
50
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
51
51
|
const utils_namespaceObject = require("@modern-js/utils");
|
|
52
52
|
const builderRequire = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
53
|
-
const
|
|
53
|
+
const STABLE_TSGO_PACKAGE = "typescript/package.json";
|
|
54
|
+
const NATIVE_PREVIEW_TSGO_PACKAGE = "@typescript/native-preview/package.json";
|
|
54
55
|
const TSGO_CHECKER_DIR = external_node_path_default().join('.modern-js', 'tsgo');
|
|
55
56
|
const tryResolve = (request, rootPath)=>{
|
|
56
57
|
try {
|
|
@@ -63,6 +64,20 @@ const tryResolve = (request, rootPath)=>{
|
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
66
|
};
|
|
67
|
+
const readPackageMajorVersion = (packageJsonPath)=>{
|
|
68
|
+
try {
|
|
69
|
+
const packageJson = JSON.parse(external_node_fs_default().readFileSync(packageJsonPath, 'utf8'));
|
|
70
|
+
const major = Number.parseInt(String(packageJson.version).split('.')[0], 10);
|
|
71
|
+
return Number.isFinite(major) ? major : void 0;
|
|
72
|
+
} catch {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const resolveTsgoPackagePath = (rootPath)=>{
|
|
77
|
+
const stableTypeScriptPath = tryResolve(STABLE_TSGO_PACKAGE, rootPath);
|
|
78
|
+
if (stableTypeScriptPath && (readPackageMajorVersion(stableTypeScriptPath) ?? 0) >= 7) return stableTypeScriptPath;
|
|
79
|
+
return tryResolve(NATIVE_PREVIEW_TSGO_PACKAGE, rootPath) ?? builderRequire.resolve(NATIVE_PREVIEW_TSGO_PACKAGE);
|
|
80
|
+
};
|
|
66
81
|
const toPosixPath = (input)=>input.replaceAll(external_node_path_default().sep, '/');
|
|
67
82
|
const asTsConfigPath = (request)=>{
|
|
68
83
|
if (external_node_path_default().extname(request)) return [
|
|
@@ -169,7 +184,7 @@ const normalizeTsgoConfig = (config, rootPath)=>{
|
|
|
169
184
|
return config;
|
|
170
185
|
};
|
|
171
186
|
const withTsgoDefaults = (userOptions, rootPath)=>{
|
|
172
|
-
const tsgoPath =
|
|
187
|
+
const tsgoPath = resolveTsgoPackagePath(rootPath);
|
|
173
188
|
const userChain = userOptions ? Array.isArray(userOptions) ? userOptions : [
|
|
174
189
|
userOptions
|
|
175
190
|
] : [];
|
package/dist/esm/shared/tsgo.mjs
CHANGED
|
@@ -4,7 +4,8 @@ import { createRequire } from "node:module";
|
|
|
4
4
|
import node_path from "node:path";
|
|
5
5
|
import { json5 } from "@modern-js/utils";
|
|
6
6
|
const builderRequire = createRequire(import.meta.url);
|
|
7
|
-
const
|
|
7
|
+
const STABLE_TSGO_PACKAGE = "typescript/package.json";
|
|
8
|
+
const NATIVE_PREVIEW_TSGO_PACKAGE = "@typescript/native-preview/package.json";
|
|
8
9
|
const TSGO_CHECKER_DIR = node_path.join('.modern-js', 'tsgo');
|
|
9
10
|
const tryResolve = (request, rootPath)=>{
|
|
10
11
|
try {
|
|
@@ -17,6 +18,20 @@ const tryResolve = (request, rootPath)=>{
|
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
};
|
|
21
|
+
const readPackageMajorVersion = (packageJsonPath)=>{
|
|
22
|
+
try {
|
|
23
|
+
const packageJson = JSON.parse(node_fs.readFileSync(packageJsonPath, 'utf8'));
|
|
24
|
+
const major = Number.parseInt(String(packageJson.version).split('.')[0], 10);
|
|
25
|
+
return Number.isFinite(major) ? major : void 0;
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const resolveTsgoPackagePath = (rootPath)=>{
|
|
31
|
+
const stableTypeScriptPath = tryResolve(STABLE_TSGO_PACKAGE, rootPath);
|
|
32
|
+
if (stableTypeScriptPath && (readPackageMajorVersion(stableTypeScriptPath) ?? 0) >= 7) return stableTypeScriptPath;
|
|
33
|
+
return tryResolve(NATIVE_PREVIEW_TSGO_PACKAGE, rootPath) ?? builderRequire.resolve(NATIVE_PREVIEW_TSGO_PACKAGE);
|
|
34
|
+
};
|
|
20
35
|
const toPosixPath = (input)=>input.replaceAll(node_path.sep, '/');
|
|
21
36
|
const asTsConfigPath = (request)=>{
|
|
22
37
|
if (node_path.extname(request)) return [
|
|
@@ -123,7 +138,7 @@ const normalizeTsgoConfig = (config, rootPath)=>{
|
|
|
123
138
|
return config;
|
|
124
139
|
};
|
|
125
140
|
const withTsgoDefaults = (userOptions, rootPath)=>{
|
|
126
|
-
const tsgoPath =
|
|
141
|
+
const tsgoPath = resolveTsgoPackagePath(rootPath);
|
|
127
142
|
const userChain = userOptions ? Array.isArray(userOptions) ? userOptions : [
|
|
128
143
|
userOptions
|
|
129
144
|
] : [];
|
|
@@ -5,7 +5,8 @@ import { createRequire } from "node:module";
|
|
|
5
5
|
import node_path from "node:path";
|
|
6
6
|
import { json5 } from "@modern-js/utils";
|
|
7
7
|
const builderRequire = createRequire(import.meta.url);
|
|
8
|
-
const
|
|
8
|
+
const STABLE_TSGO_PACKAGE = "typescript/package.json";
|
|
9
|
+
const NATIVE_PREVIEW_TSGO_PACKAGE = "@typescript/native-preview/package.json";
|
|
9
10
|
const TSGO_CHECKER_DIR = node_path.join('.modern-js', 'tsgo');
|
|
10
11
|
const tryResolve = (request, rootPath)=>{
|
|
11
12
|
try {
|
|
@@ -18,6 +19,20 @@ const tryResolve = (request, rootPath)=>{
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
};
|
|
22
|
+
const readPackageMajorVersion = (packageJsonPath)=>{
|
|
23
|
+
try {
|
|
24
|
+
const packageJson = JSON.parse(node_fs.readFileSync(packageJsonPath, 'utf8'));
|
|
25
|
+
const major = Number.parseInt(String(packageJson.version).split('.')[0], 10);
|
|
26
|
+
return Number.isFinite(major) ? major : void 0;
|
|
27
|
+
} catch {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const resolveTsgoPackagePath = (rootPath)=>{
|
|
32
|
+
const stableTypeScriptPath = tryResolve(STABLE_TSGO_PACKAGE, rootPath);
|
|
33
|
+
if (stableTypeScriptPath && (readPackageMajorVersion(stableTypeScriptPath) ?? 0) >= 7) return stableTypeScriptPath;
|
|
34
|
+
return tryResolve(NATIVE_PREVIEW_TSGO_PACKAGE, rootPath) ?? builderRequire.resolve(NATIVE_PREVIEW_TSGO_PACKAGE);
|
|
35
|
+
};
|
|
21
36
|
const toPosixPath = (input)=>input.replaceAll(node_path.sep, '/');
|
|
22
37
|
const asTsConfigPath = (request)=>{
|
|
23
38
|
if (node_path.extname(request)) return [
|
|
@@ -124,7 +139,7 @@ const normalizeTsgoConfig = (config, rootPath)=>{
|
|
|
124
139
|
return config;
|
|
125
140
|
};
|
|
126
141
|
const withTsgoDefaults = (userOptions, rootPath)=>{
|
|
127
|
-
const tsgoPath =
|
|
142
|
+
const tsgoPath = resolveTsgoPackagePath(rootPath);
|
|
128
143
|
const userChain = userOptions ? Array.isArray(userOptions) ? userOptions : [
|
|
129
144
|
userOptions
|
|
130
145
|
] : [];
|
|
@@ -4,8 +4,8 @@ type TsCheckerFn = Extract<TsCheckerChain, (config: never) => unknown>;
|
|
|
4
4
|
export type TsCheckerOptions = Parameters<TsCheckerFn>[0];
|
|
5
5
|
/**
|
|
6
6
|
* Type checking runs on TypeScript Go (`tsgo`) by default. The checker
|
|
7
|
-
* prefers the project's
|
|
8
|
-
*
|
|
7
|
+
* prefers the project's stable TypeScript 7 package, then falls back to
|
|
8
|
+
* `@typescript/native-preview` for projects still on the preview lane.
|
|
9
9
|
* Set `tools.tsChecker.typescript.tsgo: false` to use the classic checker.
|
|
10
10
|
*/
|
|
11
11
|
export declare const withTsgoDefaults: (userOptions: TsCheckerChain | undefined, rootPath: string) => TsCheckerChain;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bleedingdev/modern-js-builder",
|
|
3
|
-
"version": "3.5.0-ultramodern.
|
|
3
|
+
"version": "3.5.0-ultramodern.37",
|
|
4
4
|
"description": "A builder for Modern.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,29 +26,29 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rsbuild/core": "2.1.
|
|
29
|
+
"@rsbuild/core": "2.1.5",
|
|
30
30
|
"@rsbuild/plugin-assets-retry": "2.0.1",
|
|
31
31
|
"@rsbuild/plugin-check-syntax": "2.0.0",
|
|
32
32
|
"@rsbuild/plugin-css-minimizer": "2.0.1",
|
|
33
|
-
"@rsbuild/plugin-less": "2.0.
|
|
33
|
+
"@rsbuild/plugin-less": "2.0.1",
|
|
34
34
|
"@rsbuild/plugin-react": "2.1.0",
|
|
35
35
|
"@rsbuild/plugin-rem": "1.0.6",
|
|
36
|
-
"@rsbuild/plugin-sass": "2.0.
|
|
36
|
+
"@rsbuild/plugin-sass": "2.0.1",
|
|
37
37
|
"@rsbuild/plugin-source-build": "1.0.6",
|
|
38
|
-
"@rsbuild/plugin-svgr": "2.0.
|
|
38
|
+
"@rsbuild/plugin-svgr": "2.0.5",
|
|
39
39
|
"@rsbuild/plugin-type-check": "1.5.0",
|
|
40
40
|
"@rsbuild/plugin-typed-css-modules": "1.2.4",
|
|
41
|
-
"@rsdoctor/rspack-plugin": "^1.5.
|
|
41
|
+
"@rsdoctor/rspack-plugin": "^1.5.17",
|
|
42
42
|
"@swc/core": "1.15.43",
|
|
43
43
|
"@swc/helpers": "^0.5.23",
|
|
44
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
44
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
45
45
|
"autoprefixer": "10.5.2",
|
|
46
|
-
"browserslist": "4.28.
|
|
46
|
+
"browserslist": "4.28.5",
|
|
47
47
|
"core-js": "^3.49.0",
|
|
48
48
|
"cssnano": "8.0.2",
|
|
49
49
|
"html-minifier-terser": "^7.2.0",
|
|
50
50
|
"lodash": "^4.18.1",
|
|
51
|
-
"postcss": "^8.5.
|
|
51
|
+
"postcss": "^8.5.16",
|
|
52
52
|
"postcss-custom-properties": "15.0.1",
|
|
53
53
|
"postcss-flexbugs-fixes": "5.0.2",
|
|
54
54
|
"postcss-font-variant": "5.0.0",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
"rsbuild-plugin-rsc": "0.1.1",
|
|
60
60
|
"rspack-manifest-plugin": "5.2.2",
|
|
61
61
|
"ts-deepmerge": "8.0.0",
|
|
62
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.
|
|
62
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.37"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@rslib/core": "0.23.
|
|
65
|
+
"@rslib/core": "0.23.2",
|
|
66
66
|
"@types/html-minifier-terser": "^7.0.2",
|
|
67
67
|
"@types/lodash": "^4.17.24",
|
|
68
68
|
"react": "^19.2.7",
|
|
69
69
|
"terser": "^5.48.0",
|
|
70
|
-
"typescript": "^
|
|
71
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.
|
|
70
|
+
"typescript": "^7.0.2",
|
|
71
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.37",
|
|
72
72
|
"@scripts/rstest-config": "2.66.0"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|