Skip to content

Commit 113445b

Browse files
fix: remove tsx from dependencies (#1492)
1 parent 7676a4a commit 113445b

File tree

6 files changed

+72
-36
lines changed

6 files changed

+72
-36
lines changed

package-lock.json

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"type": "module",
77
"scripts": {
88
"test": "echo \"Error: no test specified\" && exit 1",
9-
"lint": "npx eslint \"./src/**/*.ts\" \"./script/**/*.ts\" \"./rspack.config.ts\" && npx knip && tsx ./script/addonsLinter.ts",
9+
"lint": "npx eslint \"./src/**/*.ts\" \"./script/**/*.ts\" \"./rspack.config.ts\" && npx knip && cross-env NODE_OPTIONS=--experimental-transform-types node ./script/addonsLinter.ts",
1010
"format": "npx prettier --write ./src/ts/**/*.ts ./src/html/**/*.html ./src/css/**/*.css",
1111
"format:check": "npx prettier --check ./src/ts/**/*.ts ./src/html/**/*.html ./src/css/**/*.css",
1212
"build": "npx cross-env NODE_OPTIONS=--experimental-transform-types NODE_ENV=production npx rspack build",
1313
"dev": "npx cross-env NODE_OPTIONS=--experimental-transform-types NODE_ENV=development npx rspack build --watch",
1414
"ci:build": "npx cross-env NODE_OPTIONS=--experimental-transform-types NODE_ENV=production npx rspack build --env updateUserScripts",
15-
"package": "tsx ./script/package.ts",
15+
"package": "cross-env NODE_OPTIONS=--experimental-transform-types node ./script/package.ts",
1616
"version": "npm run package && git add .",
1717
"prepare": "ts-patch install && typia patch"
1818
},
@@ -62,7 +62,6 @@
6262
"fork-ts-checker-webpack-plugin": "^9.0.2",
6363
"knip": "^5.0.0",
6464
"ts-patch": "^3.3.0",
65-
"tsx": "^4.10.1",
6665
"typia": "^9.0.0"
6766
}
6867
}

rspack.config.ts

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,36 @@ class RunCommandsPlugin {
2323
}
2424

2525
private static updateManifest(): void {
26-
exec("npx tsx ./script/copyManifest.ts", (err, stdout) => {
27-
if (err) {
28-
// eslint-disable-next-line no-console
29-
console.error(`Error: ${err.message}`);
30-
} else {
31-
// eslint-disable-next-line no-console
32-
console.log(stdout);
26+
exec(
27+
"npx cross-env NODE_OPTIONS=--experimental-transform-types node ./script/copyManifest.ts",
28+
(err, stdout) => {
29+
if (err) {
30+
// eslint-disable-next-line no-console
31+
console.error(`Error: ${err.message}`);
32+
} else {
33+
// eslint-disable-next-line no-console
34+
console.log(stdout);
35+
}
3336
}
34-
});
37+
);
3538
}
3639

3740
private static updatePrivacyPolicy(callback?: () => void): void {
38-
exec("npx tsx ./script/updatePrivacyPolicy.ts", (err, stdout) => {
39-
if (err) {
40-
// eslint-disable-next-line no-console
41-
console.error(`Error: ${err.message}`);
42-
} else {
43-
// eslint-disable-next-line no-console
44-
console.log(stdout);
45-
if (callback) {
46-
callback();
41+
exec(
42+
"npx cross-env NODE_OPTIONS=--experimental-transform-types node ./script/updatePrivacyPolicy.ts",
43+
(err, stdout) => {
44+
if (err) {
45+
// eslint-disable-next-line no-console
46+
console.error(`Error: ${err.message}`);
47+
} else {
48+
// eslint-disable-next-line no-console
49+
console.log(stdout);
50+
if (callback) {
51+
callback();
52+
}
4753
}
4854
}
49-
});
55+
);
5056
}
5157

5258
// eslint-disable-next-line max-lines-per-function
@@ -107,16 +113,19 @@ class RunCommandsPlugin {
107113
isFirstRun = false;
108114

109115
if (this.env["updateUserScripts"]) {
110-
exec("npx tsx ./script/addUserScriptsComment.ts", (err, stdout) => {
111-
if (err) {
112-
// eslint-disable-next-line no-console
113-
console.error(`Error: ${err.message}`);
114-
} else {
115-
// eslint-disable-next-line no-console
116-
console.log(stdout);
116+
exec(
117+
"npx cross-env NODE_OPTIONS=--experimental-transform-types node ./script/addUserScriptsComment.ts",
118+
(err, stdout) => {
119+
if (err) {
120+
// eslint-disable-next-line no-console
121+
console.error(`Error: ${err.message}`);
122+
} else {
123+
// eslint-disable-next-line no-console
124+
console.log(stdout);
125+
}
126+
callback();
117127
}
118-
callback();
119-
});
128+
);
120129
} else {
121130
callback();
122131
}

script/addUserScriptsComment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "fs";
22
import { glob } from "glob";
33
import { isPlainObject } from "@robot-inventor/ts-utils";
4-
import packagejson from "../package.json";
4+
import packagejson from "../package.json" with { type: "json" };
55
import path from "path";
66

77
// eslint-disable-next-line no-console

script/addonsLinter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as colors from "colors/safe";
1+
import * as colors from "colors/safe.js";
22
import { type Options as LinterOptions, createInstance } from "addons-linter";
33
import { execSync } from "child_process";
44

script/copyManifest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fs from "fs";
22

3-
import manifestV2 from "../src/manifest/v2.json";
4-
import manifestV3 from "../src/manifest/v3.json";
5-
import packageJson from "../package.json";
3+
import manifestV2 from "../src/manifest/v2.json" with { type: "json" };
4+
import manifestV3 from "../src/manifest/v3.json" with { type: "json" };
5+
import packageJson from "../package.json" with { type: "json" };
66

77
const { version } = packageJson;
88

0 commit comments

Comments
 (0)