|
7 | 7 | "publishConfig": { |
8 | 8 | "access": "public" |
9 | 9 | }, |
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", |
13 | 13 | "exports": { |
| 14 | + "./package.json": "./package.json", |
14 | 15 | ".": { |
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 | + } |
17 | 24 | } |
18 | 25 | }, |
19 | | - "source": "src/index.ts", |
20 | 26 | "scripts": { |
21 | 27 | "lint": "eslint --quiet --fix --ext .cjs,.ts .", |
22 | 28 | "lint:check": "eslint --ext .cjs,.ts .", |
23 | 29 | "format": "prettier --write .", |
24 | 30 | "format:check": "prettier --check .", |
25 | 31 | "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", |
28 | 34 | "watch:esm": "tsc --declaration --outdir dist/esm --watch", |
29 | 35 | "watch": "npm-run-all --parallel watch:esm watch:cjs", |
30 | 36 | "prepare": "pnpm run build", |
31 | 37 | "check": "tsc", |
32 | 38 | "test": "vitest run", |
33 | | - "switch-package-type": "tsx scripts/switch-package-type.ts", |
34 | | - "rename-cts": "tsx scripts/rename-cts.ts", |
35 | 39 | "inference-codegen": "tsx scripts/inference-codegen.ts && prettier --write src/tasks/*/inference.ts", |
36 | 40 | "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", |
37 | 41 | "inference-tei-import": "tsx scripts/inference-tei-import.ts && prettier --write src/tasks/feature-extraction/spec/*.json" |
38 | 42 | }, |
39 | 43 | "type": "module", |
40 | 44 | "files": [ |
41 | | - "dist", |
42 | | - "src", |
43 | | - "tsconfig.json" |
| 45 | + "dist" |
44 | 46 | ], |
45 | 47 | "keywords": [ |
46 | 48 | "huggingface", |
|
53 | 55 | "@types/node": "^20.11.5", |
54 | 56 | "quicktype-core": "https://github.com/huggingface/quicktype/raw/pack-18.0.17/packages/quicktype-core/quicktype-core-18.0.17.tgz", |
55 | 57 | "type-fest": "^3.13.1" |
| 58 | + }, |
| 59 | + "tshy": { |
| 60 | + "exports": { |
| 61 | + "./package.json": "./package.json", |
| 62 | + ".": "./src/index.ts" |
| 63 | + } |
56 | 64 | } |
57 | 65 | } |
0 commit comments