Skip to content

Commit

Permalink
➕ Switch from ts-node to tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 committed Jan 29, 2024
1 parent a1ea807 commit 1611d2a
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 108 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,7 @@ dist
# TernJS port file
.tern-port

.DS_Store
.DS_Store

# Generated by doc-internal
docs
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.2",
"semver": "^7.5.0",
"ts-node": "^10.9.1",
"tsx": "^4.7.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
"vite": "^5.0.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/doc-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"doc-hub": "typedoc --tsconfig ../hub/tsconfig.json --githubPages false --plugin typedoc-plugin-markdown --out ../../docs/hub --hideBreadcrumbs --hideInPageTOC --sourceLinkTemplate https://github.com/huggingface/huggingface.js/blob/main/{path}#L{line} ../hub/index.ts",
"doc-inference": "typedoc --tsconfig ../inference/tsconfig.json --githubPages false --plugin typedoc-plugin-markdown --out ../../docs/inference --hideBreadcrumbs --hideInPageTOC --sourceLinkTemplate https://github.com/huggingface/huggingface.js/blob/main/{path}#L{line} ../inference/src/index.ts",
"doc-agents": "typedoc --tsconfig ../agents/tsconfig.json --githubPages false --plugin typedoc-plugin-markdown --out ../../docs/agents --hideBreadcrumbs --hideInPageTOC --sourceLinkTemplate https://github.com/huggingface/huggingface.js/blob/main/{path}#L{line} ../agents/src/index.ts",
"update-toc": "node --experimental-specifier-resolution=node --loader ts-node/esm update-toc.ts",
"fix-cdn-versions": "node --experimental-specifier-resolution=node --loader ts-node/esm fix-cdn-versions.ts",
"fix-md-links": "node --experimental-specifier-resolution=node --loader ts-node/esm fix-md-links.ts",
"fix-md-headinghashlinks": "node --experimental-specifier-resolution=node --loader ts-node/esm fix-md-headinghashlinks.ts"
"update-toc": "tsx update-toc.ts",
"fix-cdn-versions": "tsx fix-cdn-versions.ts",
"fix-md-links": "tsx fix-md-links.ts",
"fix-md-headinghashlinks": "tsx fix-md-headinghashlinks.ts"
},
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/inference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"type": "module",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --clean && pnpm run dts",
"dts": "node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' scripts/generate-dts.ts",
"dts": "tsx scripts/generate-dts.ts",
"lint": "eslint --quiet --fix --ext .cjs,.ts .",
"lint:check": "eslint --ext .cjs,.ts .",
"format": "prettier --write .",
Expand Down
2 changes: 1 addition & 1 deletion packages/tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "tsup src/index.ts --format cjs,esm --clean --dts && pnpm run inference-codegen",
"prepare": "pnpm run build",
"check": "tsc",
"inference-codegen": "node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' scripts/inference-codegen.ts && prettier --write src/tasks/*/inference.ts"
"inference-codegen": "tsx scripts/inference-codegen.ts && prettier --write src/tasks/*/inference.ts"
},
"type": "module",
"files": [
Expand Down
Loading

0 comments on commit 1611d2a

Please sign in to comment.