Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC: Replace esbuild with tsc #235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions build.ts

This file was deleted.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "2.0.4",
"description": "Thread-safe Helmet for React 16+ and friends",
"sideEffects": false,
"main": "./lib/index.js",
"module": "./lib/index.esm.js",
"typings": "./lib/index.d.ts",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/esm/index.d.ts",
"repository": "https://github.com/staylor/react-helmet-async",
"author": "Scott Taylor <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -29,7 +29,6 @@
"@types/react": "18.2.39",
"@types/shallowequal": "1.1.5",
"@vitejs/plugin-react": "4.2.0",
"esbuild": "0.19.8",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-prettier": "5.0.1",
Expand All @@ -40,7 +39,6 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"rimraf": "5.0.5",
"tsx": "4.6.1",
"typescript": "5.2.2",
"vite": "4.5.0",
"vitest": "0.34.6"
Expand All @@ -55,8 +53,9 @@
"test": "vitest run",
"test-watch": "yarn test --watch",
"test-update": "yarn test -u",
"compile": "yarn run clean && NODE_ENV=production tsx build.ts && yarn types",
"prepare": "yarn compile && husky install",
"types": "tsc src/index.tsx --jsx react --declaration --esModuleInterop --allowJs --emitDeclarationOnly --outDir lib"
"compile": "yarn run clean && yarn run compile:cjs && yarn run compile:esm",
"compile:cjs": "tsc -p ./tsconfig.cjs.json",
"compile:esm": "tsc -p ./tsconfig.esm.json",
"prepare": "yarn compile && husky install"
}
}
14 changes: 14 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"exclude": [
"__tests__",
"lib",
"node_modules"
],
"include": ["src"],
"compilerOptions": {
"declaration": true,
"noEmit": false,
"rootDir": "src"
}
}
9 changes: 9 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "node",
"target": "ESNext",
"outDir": "lib/cjs"
}
}
9 changes: 9 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"module": "ES6",
"moduleResolution": "node",
"target": "ESNext",
"outDir": "lib/esm"
}
}
70 changes: 30 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2090,35 +2090,7 @@ es-to-primitive@^1.2.1:
is-date-object "^1.0.1"
is-symbol "^1.0.2"

[email protected], esbuild@^0.19.3:
version "0.19.8"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.8.tgz#ad05b72281d84483fa6b5345bd246c27a207b8f1"
integrity sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w==
optionalDependencies:
"@esbuild/android-arm" "0.19.8"
"@esbuild/android-arm64" "0.19.8"
"@esbuild/android-x64" "0.19.8"
"@esbuild/darwin-arm64" "0.19.8"
"@esbuild/darwin-x64" "0.19.8"
"@esbuild/freebsd-arm64" "0.19.8"
"@esbuild/freebsd-x64" "0.19.8"
"@esbuild/linux-arm" "0.19.8"
"@esbuild/linux-arm64" "0.19.8"
"@esbuild/linux-ia32" "0.19.8"
"@esbuild/linux-loong64" "0.19.8"
"@esbuild/linux-mips64el" "0.19.8"
"@esbuild/linux-ppc64" "0.19.8"
"@esbuild/linux-riscv64" "0.19.8"
"@esbuild/linux-s390x" "0.19.8"
"@esbuild/linux-x64" "0.19.8"
"@esbuild/netbsd-x64" "0.19.8"
"@esbuild/openbsd-x64" "0.19.8"
"@esbuild/sunos-x64" "0.19.8"
"@esbuild/win32-arm64" "0.19.8"
"@esbuild/win32-ia32" "0.19.8"
"@esbuild/win32-x64" "0.19.8"

esbuild@^0.18.10, esbuild@~0.18.20:
esbuild@^0.18.10:
version "0.18.20"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.18.20.tgz#4709f5a34801b43b799ab7d6d82f7284a9b7a7a6"
integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==
Expand Down Expand Up @@ -2146,6 +2118,34 @@ esbuild@^0.18.10, esbuild@~0.18.20:
"@esbuild/win32-ia32" "0.18.20"
"@esbuild/win32-x64" "0.18.20"

esbuild@^0.19.3:
version "0.19.8"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.8.tgz#ad05b72281d84483fa6b5345bd246c27a207b8f1"
integrity sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w==
optionalDependencies:
"@esbuild/android-arm" "0.19.8"
"@esbuild/android-arm64" "0.19.8"
"@esbuild/android-x64" "0.19.8"
"@esbuild/darwin-arm64" "0.19.8"
"@esbuild/darwin-x64" "0.19.8"
"@esbuild/freebsd-arm64" "0.19.8"
"@esbuild/freebsd-x64" "0.19.8"
"@esbuild/linux-arm" "0.19.8"
"@esbuild/linux-arm64" "0.19.8"
"@esbuild/linux-ia32" "0.19.8"
"@esbuild/linux-loong64" "0.19.8"
"@esbuild/linux-mips64el" "0.19.8"
"@esbuild/linux-ppc64" "0.19.8"
"@esbuild/linux-riscv64" "0.19.8"
"@esbuild/linux-s390x" "0.19.8"
"@esbuild/linux-x64" "0.19.8"
"@esbuild/netbsd-x64" "0.19.8"
"@esbuild/openbsd-x64" "0.19.8"
"@esbuild/sunos-x64" "0.19.8"
"@esbuild/win32-arm64" "0.19.8"
"@esbuild/win32-ia32" "0.19.8"
"@esbuild/win32-x64" "0.19.8"

escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
Expand Down Expand Up @@ -2660,7 +2660,7 @@ get-symbol-description@^1.0.0:
call-bind "^1.0.2"
get-intrinsic "^1.1.1"

get-tsconfig@^4.5.0, get-tsconfig@^4.7.2:
get-tsconfig@^4.5.0:
version "4.7.2"
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.2.tgz#0dcd6fb330391d46332f4c6c1bf89a6514c2ddce"
integrity sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==
Expand Down Expand Up @@ -4679,16 +4679,6 @@ tsutils@^3.21.0:
dependencies:
tslib "^1.8.1"

[email protected]:
version "4.6.1"
resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.6.1.tgz#fc5456aabace99733eca23b42f223771a0ec1909"
integrity sha512-OQ4TAPHXAPUo/NZAmmIybl0o8LFOTlycQxFepLBAp6EV87U88fOKYGCQI2viGAEOVU9UW/cgQcxcOMnfEKVY3Q==
dependencies:
esbuild "~0.18.20"
get-tsconfig "^4.7.2"
optionalDependencies:
fsevents "~2.3.3"

type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
Expand Down