Skip to content

Commit 91886b7

Browse files
committed
fix: lock TypeScript version to 4.x to resolve build issues after upgrading to 5.x
After upgrading to TypeScript 5.x, we encountered build issues due to compatibility problems. This commit locks the TypeScript version to 4.x to ensure stable builds and compatibility with our existing codebase.
1 parent 6a04a58 commit 91886b7

File tree

6 files changed

+51
-5
lines changed

6 files changed

+51
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ LabelPlus是一个用于图片翻译的工具包,本工程是其中的Photosho
2929
```
3030
$ sudo apt install python nodejs
3131
$ sudo npm install -g typescript yarn
32+
$ npm config set registry https://registry.npmmirror.com
33+
$ yarn config set registry https://registry.npmmirror.com
3234
```
3335

3436
### build

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
cd "${0%%/*}"
44

5+
TSC=./node_modules/typescript/bin/tsc
56
TSC_OUTPUT=build/app.js
67
PS_JSX_OUTPUT=build/LabelPlus_Ps_Script.jsx
78

89
rm -rf ./build/*
910
mkdir -p build/
10-
tsc -p . --out $TSC_OUTPUT
11+
$TSC --preserveConstEnums -p . --out $TSC_OUTPUT
1112
cat src/copyleft_header.js $TSC_OUTPUT > $PS_JSX_OUTPUT
12-
./flatten_jsx.py $PS_JSX_OUTPUT $PS_JSX_OUTPUT -I build/ src/
13+
python ./flatten_jsx.py $PS_JSX_OUTPUT $PS_JSX_OUTPUT -I build/ src/
1314

1415
cp -r doc_template/ build/ps_script_res
1516

do_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if [ $# -lt 1 ]; then
2424
fi
2525

2626
version=$1
27-
program_exists git 7z tsc python
27+
program_exists git 7z python
2828
[ $? -ne 0 ] && exit 1
2929

3030
cd "${0%%/*}"

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"dependencies": {
33
"photoshop.d.ts": "^1.0.0"
4+
},
5+
"devDependencies": {
6+
"typescript": "^4.9.5"
47
}
58
}

yarn.lock

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
photoshop.d.ts@^1.0.0:
66
version "1.0.0"
7-
resolved "https://registry.npm.taobao.org/photoshop.d.ts/download/photoshop.d.ts-1.0.0.tgz#40c8b0701a4ffb492a5b3421e46146f3560a6170"
8-
integrity sha1-QMiwcBpP+0kqWzQh5GFG81YKYXA=
7+
resolved "https://registry.npmmirror.com/photoshop.d.ts/-/photoshop.d.ts-1.0.0.tgz"
8+
integrity sha512-bNJdjg+4ZFoxHh3ZVz1PY8Gi7r/2Xa597EsJS/ZzZCXyebvYQWNWhLuP/2iwjOf148NH7X5AF5mqrhTFxBxwoQ==
9+
10+
typescript@^4.9.5:
11+
version "4.9.5"
12+
resolved "https://registry.npmmirror.com/typescript/-/typescript-4.9.5.tgz"
13+
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

0 commit comments

Comments
 (0)