Skip to content

Commit 730de17

Browse files
committed
🔧 Use tshy for deploy
1 parent dc0fe5b commit 730de17

File tree

8 files changed

+297
-44
lines changed

8 files changed

+297
-44
lines changed

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"prettier": "^3.1.0",
2424
"prettier-plugin-svelte": "^3.1.2",
2525
"semver": "^7.5.0",
26+
"tshy": "^3.0.2",
2627
"tsup": "^6.7.0",
2728
"tsx": "^4.7.0",
2829
"typescript": "^5.4.2",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "../src",
5+
"module": "nodenext",
6+
"moduleResolution": "nodenext"
7+
}
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "./build.json",
3+
"include": [
4+
"../src/**/*.ts",
5+
"../src/**/*.cts",
6+
"../src/**/*.tsx",
7+
"../src/**/*.json"
8+
],
9+
"exclude": [
10+
"../src/**/*.mts",
11+
"../src/package.json"
12+
],
13+
"compilerOptions": {
14+
"outDir": "../.tshy-build/commonjs"
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "./build.json",
3+
"include": [
4+
"../src/**/*.ts",
5+
"../src/**/*.mts",
6+
"../src/**/*.tsx",
7+
"../src/**/*.json"
8+
],
9+
"exclude": [
10+
"../src/package.json"
11+
],
12+
"compilerOptions": {
13+
"outDir": "../.tshy-build/esm"
14+
}
15+
}

‎packages/tasks/package.json‎

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,42 @@
77
"publishConfig": {
88
"access": "public"
99
},
10-
"main": "./dist/index.cjs",
11-
"module": "./dist/index.js",
12-
"types": "./dist/index.d.ts",
10+
"main": "./dist/commonjs/index.js",
11+
"module": "./dist/esm/index.js",
12+
"types": "./dist/commonjs/index.d.ts",
1313
"exports": {
14+
"./package.json": "./package.json",
1415
".": {
15-
"require": "./dist/index.cjs",
16-
"import": "./dist/index.js"
16+
"import": {
17+
"types": "./dist/esm/index.d.ts",
18+
"default": "./dist/esm/index.js"
19+
},
20+
"require": {
21+
"types": "./dist/commonjs/index.d.ts",
22+
"default": "./dist/commonjs/index.js"
23+
}
1724
}
1825
},
19-
"source": "src/index.ts",
2026
"scripts": {
2127
"lint": "eslint --quiet --fix --ext .cjs,.ts .",
2228
"lint:check": "eslint --ext .cjs,.ts .",
2329
"format": "prettier --write .",
2430
"format:check": "prettier --check .",
2531
"prepublishOnly": "pnpm run inference-codegen && git diff --name-only --exit-code src && pnpm run build",
26-
"build": "rm -Rf dist && tsc --declaration --outdir dist/esm && pnpm run switch-package-type commonjs && tsc --declaration --outdir dist/cjs && pnpm run switch-package-type module && pnpm run rename-cts",
27-
"watch:cjs": "tsc --declaration --outdir dist/cjs --module commonjs --watch",
32+
"build": "tshy",
33+
"watch:cjs": "tsc --declaration --outdir dist/commonjs --module commonjs --watch",
2834
"watch:esm": "tsc --declaration --outdir dist/esm --watch",
2935
"watch": "npm-run-all --parallel watch:esm watch:cjs",
3036
"prepare": "pnpm run build",
3137
"check": "tsc",
3238
"test": "vitest run",
33-
"switch-package-type": "tsx scripts/switch-package-type.ts",
34-
"rename-cts": "tsx scripts/rename-cts.ts",
3539
"inference-codegen": "tsx scripts/inference-codegen.ts && prettier --write src/tasks/*/inference.ts",
3640
"inference-tgi-import": "tsx scripts/inference-tgi-import.ts && prettier --write src/tasks/text-generation/spec/*.json && prettier --write src/tasks/chat-completion/spec/*.json",
3741
"inference-tei-import": "tsx scripts/inference-tei-import.ts && prettier --write src/tasks/feature-extraction/spec/*.json"
3842
},
3943
"type": "module",
4044
"files": [
41-
"dist",
42-
"src",
43-
"tsconfig.json"
45+
"dist"
4446
],
4547
"keywords": [
4648
"huggingface",
@@ -53,5 +55,11 @@
5355
"@types/node": "^20.11.5",
5456
"quicktype-core": "https://github.com/huggingface/quicktype/raw/pack-18.0.17/packages/quicktype-core/quicktype-core-18.0.17.tgz",
5557
"type-fest": "^3.13.1"
58+
},
59+
"tshy": {
60+
"exports": {
61+
"./package.json": "./package.json",
62+
".": "./src/index.ts"
63+
}
5664
}
5765
}

‎packages/tasks/scripts/rename-cts.ts‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎packages/tasks/scripts/switch-package-type.ts‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)