diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53477a88..957e546d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,5 +47,6 @@ jobs: echo "No changed files detected." else echo "::error::Formatting resulted in changed files. Please make sure this branch is up to date and run 'pnpm format'. Verify the changes are what you want and commit them." + git diff exit 1 fi diff --git a/cspell.config.json b/cspell.config.json index ddee3d0b..ea86dd58 100644 --- a/cspell.config.json +++ b/cspell.config.json @@ -34,7 +34,6 @@ "tanstack", "todos", "tsdoc", - "tsup", "corepack", "printables", "arethetypeswrong" diff --git a/examples/react/basic/package.json b/examples/react/basic/package.json index b223ea39..7b394518 100644 --- a/examples/react/basic/package.json +++ b/examples/react/basic/package.json @@ -4,9 +4,8 @@ "private": true, "type": "module", "scripts": { - "clean": "rm -rf src/gen", "dev": "vite", - "generate": "buf generate --path eliza.proto", + "generate": "rm -rf src/gen && buf generate --path eliza.proto", "license-header": "license-header", "preview": "vite preview", "test": "jest", @@ -14,12 +13,12 @@ }, "dependencies": { "@bufbuild/buf": "1.27.0", - "@bufbuild/protobuf": "^1.3.2", - "@bufbuild/protoc-gen-es": "^1.3.2", - "@connectrpc/connect": "^1.1.0", + "@bufbuild/protobuf": "^1.3.3", + "@bufbuild/protoc-gen-es": "^1.3.3", + "@connectrpc/connect": "^1.1.2", "@connectrpc/connect-query": "workspace:*", - "@connectrpc/connect-web": "^1.1.0", - "@connectrpc/protoc-gen-connect-es": "^1.1.0", + "@connectrpc/connect-web": "^1.1.2", + "@connectrpc/protoc-gen-connect-es": "^1.1.2", "@connectrpc/protoc-gen-connect-query": "workspace:*", "@tanstack/react-query": "^4.35.7", "@tanstack/react-query-devtools": "^4.35.7", diff --git a/examples/react/basic/src/gen/eliza_pb.ts b/examples/react/basic/src/gen/eliza_pb.ts index 43e83a10..9b285895 100644 --- a/examples/react/basic/src/gen/eliza_pb.ts +++ b/examples/react/basic/src/gen/eliza_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.3.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" // @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/connect-query/package.json b/packages/connect-query/package.json index 8ad2cee2..9fc21c9e 100644 --- a/packages/connect-query/package.json +++ b/packages/connect-query/package.json @@ -1,33 +1,34 @@ { "name": "@connectrpc/connect-query", "version": "0.5.1", + "description": "TypeScript-first expansion pack for TanStack Query that gives you Protobuf superpowers.", + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/connectrpc/connect-query-es.git", "directory": "packages/connect-query" }, - "license": "Apache-2.0", - "sideEffects": false, - "type": "module", - "exports": { - ".": { - "module": "./dist/index.js", - "require": "./dist/index.cjs", - "import": "./dist/index.js" - } - }, - "main": "./dist/index.cjs", - "files": [ - "dist/**" - ], "scripts": { - "build": "tsup", - "clean": "rm -rf dist", + "clean": "rm -rf ./dist/*", + "build": "npm run build:cjs && npm run build:esm && npm run build:proxy", + "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'", + "build:esm": "tsc --project tsconfig.build.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm", + "build:proxy": "node ../../scripts/gen-esm-proxy.mjs .", "generate": "buf generate --path eliza.proto", "test": "jest", "format": "prettier . --write --ignore-path ./.eslintignore && eslint . --fix && license-header", "attw": "attw --pack" }, + "type": "module", + "sideEffects": false, + "main": "./dist/cjs/index.js", + "exports": { + ".": { + "module": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "import": "./dist/proxy/index.js" + } + }, "dependencies": { "stable-hash": "^0.0.3" }, @@ -35,25 +36,27 @@ "@arethetypeswrong/cli": "^0.11.0", "@bufbuild/buf": "1.27.0", "@bufbuild/jest-environment-jsdom": "^0.1.1", - "@bufbuild/protobuf": "^1.3.2", - "@bufbuild/protoc-gen-es": "^1.3.2", - "@connectrpc/connect": "^1.1.0", - "@connectrpc/connect-web": "^1.1.0", - "@connectrpc/protoc-gen-connect-es": "^1.1.0", + "@bufbuild/protobuf": "^1.3.3", + "@bufbuild/protoc-gen-es": "^1.3.3", + "@connectrpc/connect": "^1.1.2", + "@connectrpc/connect-web": "^1.1.2", + "@connectrpc/protoc-gen-connect-es": "^1.1.2", "@tanstack/react-query": "^4.35.7", "@testing-library/react": "^14.0.0", "@types/react": "^18.2.25", "@types/react-dom": "^18.2.10", "react": "^18.2.0", "react-dom": "^18.2.0", - "tsup": "^7.2.0", "typescript": "^5.2.2" }, "peerDependencies": { - "@bufbuild/protobuf": "^1.3.0", - "@connectrpc/connect": "^1.0.0", + "@bufbuild/protobuf": "^1.3.3", + "@connectrpc/connect": "^1.1.2", "@tanstack/react-query": "4.x", "react": "^18.2.0", "react-dom": "^18.2.0" - } + }, + "files": [ + "dist/**" + ] } diff --git a/packages/connect-query/src/gen/eliza_connect.ts b/packages/connect-query/src/gen/eliza_connect.ts index 7add9cd7..620bad5b 100644 --- a/packages/connect-query/src/gen/eliza_connect.ts +++ b/packages/connect-query/src/gen/eliza_connect.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-connect-es v1.1.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v1.1.2 with parameter "target=ts" // @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/connect-query/src/gen/eliza_pb.ts b/packages/connect-query/src/gen/eliza_pb.ts index 0be2c2a9..34dcab5b 100644 --- a/packages/connect-query/src/gen/eliza_pb.ts +++ b/packages/connect-query/src/gen/eliza_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.3.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" // @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/connect-query/tsup.config.ts b/packages/connect-query/tsup.config.ts deleted file mode 100644 index 4a4b4d84..00000000 --- a/packages/connect-query/tsup.config.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2021-2023 The Connect Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import { defineConfig } from "tsup"; - -export default defineConfig({ - tsconfig: "tsconfig.build.json", - entry: ["src/index.ts"], - dts: true, - clean: true, - sourcemap: true, - format: ["cjs", "esm"], -}); diff --git a/packages/protoc-gen-connect-query/package.json b/packages/protoc-gen-connect-query/package.json index b53f62cb..ea1ba3bc 100644 --- a/packages/protoc-gen-connect-query/package.json +++ b/packages/protoc-gen-connect-query/package.json @@ -27,13 +27,13 @@ "preferUnplugged": true, "devDependencies": { "@bufbuild/buf": "1.27.0", - "@bufbuild/protoc-gen-es": "^1.3.2", - "@connectrpc/protoc-gen-connect-es": "^1.1.0", + "@bufbuild/protoc-gen-es": "^1.3.3", + "@connectrpc/protoc-gen-connect-es": "^1.1.2", "typescript": "^5.2.2" }, "dependencies": { - "@bufbuild/protobuf": "^1.3.2", - "@bufbuild/protoplugin": "^1.3.2" + "@bufbuild/protobuf": "^1.3.3", + "@bufbuild/protoplugin": "^1.3.3" }, "peerDependencies": { "@bufbuild/protoc-gen-es": "1.x" diff --git a/packages/protoc-gen-connect-query/snapshots/gen/connectrpc/eliza/v1/eliza_pb.ts b/packages/protoc-gen-connect-query/snapshots/gen/connectrpc/eliza/v1/eliza_pb.ts index 53f56ca6..b75c3ef7 100644 --- a/packages/protoc-gen-connect-query/snapshots/gen/connectrpc/eliza/v1/eliza_pb.ts +++ b/packages/protoc-gen-connect-query/snapshots/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.3.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" // @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0d6fc9ab..78f6a0eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,23 +87,23 @@ importers: specifier: 1.27.0 version: 1.27.0 '@bufbuild/protobuf': - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^1.3.3 + version: 1.3.3 '@bufbuild/protoc-gen-es': - specifier: ^1.3.2 - version: 1.3.2(@bufbuild/protobuf@1.3.2) + specifier: ^1.3.3 + version: 1.3.3(@bufbuild/protobuf@1.3.3) '@connectrpc/connect': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protobuf@1.3.2) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protobuf@1.3.3) '@connectrpc/connect-query': specifier: workspace:* version: link:../../../packages/connect-query '@connectrpc/connect-web': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protobuf@1.3.2)(@connectrpc/connect@1.1.0) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protobuf@1.3.3)(@connectrpc/connect@1.1.2) '@connectrpc/protoc-gen-connect-es': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protoc-gen-es@1.3.2)(@connectrpc/connect@1.1.0) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protoc-gen-es@1.3.3)(@connectrpc/connect@1.1.2) '@connectrpc/protoc-gen-connect-query': specifier: workspace:* version: link:../../../packages/protoc-gen-connect-query @@ -157,20 +157,20 @@ importers: specifier: ^0.1.1 version: 0.1.1(jest-environment-jsdom@29.7.0) '@bufbuild/protobuf': - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^1.3.3 + version: 1.3.3 '@bufbuild/protoc-gen-es': - specifier: ^1.3.2 - version: 1.3.2(@bufbuild/protobuf@1.3.2) + specifier: ^1.3.3 + version: 1.3.3(@bufbuild/protobuf@1.3.3) '@connectrpc/connect': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protobuf@1.3.2) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protobuf@1.3.3) '@connectrpc/connect-web': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protobuf@1.3.2)(@connectrpc/connect@1.1.0) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protobuf@1.3.3)(@connectrpc/connect@1.1.2) '@connectrpc/protoc-gen-connect-es': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protoc-gen-es@1.3.2)(@connectrpc/connect@1.1.0) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protoc-gen-es@1.3.3)(@connectrpc/connect@1.1.2) '@tanstack/react-query': specifier: ^4.35.7 version: 4.35.7(react-dom@18.2.0)(react@18.2.0) @@ -189,9 +189,6 @@ importers: react-dom: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) - tsup: - specifier: ^7.2.0 - version: 7.2.0(ts-node@10.9.1)(typescript@5.2.2) typescript: specifier: ^5.2.2 version: 5.2.2 @@ -199,21 +196,21 @@ importers: packages/protoc-gen-connect-query: dependencies: '@bufbuild/protobuf': - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^1.3.3 + version: 1.3.3 '@bufbuild/protoplugin': - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^1.3.3 + version: 1.3.3 devDependencies: '@bufbuild/buf': specifier: 1.27.0 version: 1.27.0 '@bufbuild/protoc-gen-es': - specifier: ^1.3.2 - version: 1.3.2(@bufbuild/protobuf@1.3.2) + specifier: ^1.3.3 + version: 1.3.3(@bufbuild/protobuf@1.3.3) '@connectrpc/protoc-gen-connect-es': - specifier: ^1.1.0 - version: 1.1.0(@bufbuild/protoc-gen-es@1.3.2)(@connectrpc/connect@1.1.0) + specifier: ^1.1.2 + version: 1.1.2(@bufbuild/protoc-gen-es@1.3.3)(@connectrpc/connect@1.1.2) typescript: specifier: ^5.2.2 version: 5.2.2 @@ -663,28 +660,28 @@ packages: picomatch: 2.3.1 dev: true - /@bufbuild/protobuf@1.3.2: - resolution: {integrity: sha512-Hw8ZzJEaT3JkMqeWCUfTJwB6H05b8q/xsw2k/BsXBiUCaTpDKd3pxXR3Vss2R1b+OEzRHXDeiO35M0BvVk2Sgg==} + /@bufbuild/protobuf@1.3.3: + resolution: {integrity: sha512-AoHSiIpTFF97SQgmQni4c+Tyr0CDhkaRaR2qGEJTEbauqQwLRpLrd9yVv//wVHOSxr/b4FJcL54VchhY6710xA==} - /@bufbuild/protoc-gen-es@1.3.2(@bufbuild/protobuf@1.3.2): - resolution: {integrity: sha512-m/vMlbX4CQ24vJ1LEhrYW4pF04Psvox4cejcjiuGM121CHgpMdkd2tEOEY9xggvjbMsTNF+ZoIhfxIWBRKnh2Q==} + /@bufbuild/protoc-gen-es@1.3.3(@bufbuild/protobuf@1.3.3): + resolution: {integrity: sha512-waqpvdFyqcrrmoAW9c8VCtDmT4+NYDQg/W8DAsMC2/+rXKGQYy3YbxobOuwVm3g/MJC1Gvv6ON/arxq4gYHXYw==} engines: {node: '>=14'} hasBin: true peerDependencies: - '@bufbuild/protobuf': 1.3.2 + '@bufbuild/protobuf': 1.3.3 peerDependenciesMeta: '@bufbuild/protobuf': optional: true dependencies: - '@bufbuild/protobuf': 1.3.2 - '@bufbuild/protoplugin': 1.3.2 + '@bufbuild/protobuf': 1.3.3 + '@bufbuild/protoplugin': 1.3.3 transitivePeerDependencies: - supports-color - /@bufbuild/protoplugin@1.3.2: - resolution: {integrity: sha512-d6YWD1nKaH5jA0tPY0mfdAcg5rCqCeVw7zLfReMIS8WW/aYtShPwmWS71XpTFMP0LQWlbUiTyYjvNGR35a4hWQ==} + /@bufbuild/protoplugin@1.3.3: + resolution: {integrity: sha512-sxalYoj+fWxUakknePKfqRpcGlxz45Gcjpth2M274ZvQN+XKwMLVLevArsZWFzGcPoAkiDWMFHhfeQXfjsu+uA==} dependencies: - '@bufbuild/protobuf': 1.3.2 + '@bufbuild/protobuf': 1.3.3 '@typescript/vfs': 1.5.0 typescript: 4.5.2 transitivePeerDependencies: @@ -697,39 +694,39 @@ packages: dev: true optional: true - /@connectrpc/connect-web@1.1.0(@bufbuild/protobuf@1.3.2)(@connectrpc/connect@1.1.0): - resolution: {integrity: sha512-eFJDdOrY9sf0LVDM9YYPGgdzMKs9bcWM4j0a0O0peooMMq+RGtGidDbLMsCyQ3vW8PrE+T5G+FZiomutGpjT9g==} + /@connectrpc/connect-web@1.1.2(@bufbuild/protobuf@1.3.3)(@connectrpc/connect@1.1.2): + resolution: {integrity: sha512-6Osvp4d/5Qvf0dsbUmqgzCPFIong9KBm5G24g2gapPW2huAtyVj+KwdG6453EKCirPZ5qZHY0FywLef57op9YQ==} peerDependencies: - '@bufbuild/protobuf': ^1.2.1 - '@connectrpc/connect': 1.1.0 + '@bufbuild/protobuf': ^1.3.3 + '@connectrpc/connect': 1.1.2 dependencies: - '@bufbuild/protobuf': 1.3.2 - '@connectrpc/connect': 1.1.0(@bufbuild/protobuf@1.3.2) + '@bufbuild/protobuf': 1.3.3 + '@connectrpc/connect': 1.1.2(@bufbuild/protobuf@1.3.3) - /@connectrpc/connect@1.1.0(@bufbuild/protobuf@1.3.2): - resolution: {integrity: sha512-Anw8qxJbOffrTxjA2tVp2BE7Gw/719lr7nK6tr3MumWGCKDxMJH2iLwdXCVRCjQVAIUbuVcxYP/XPfDggXbivw==} + /@connectrpc/connect@1.1.2(@bufbuild/protobuf@1.3.3): + resolution: {integrity: sha512-oDuKJFRORtzyH4IhZyNgIQ5DKjlDnbP72AH55Aabpc0fwApyus/h4cmYU1KDvahVbqsvUOpd5qUTyMH8IhMmLA==} peerDependencies: - '@bufbuild/protobuf': ^1.2.1 + '@bufbuild/protobuf': ^1.3.3 dependencies: - '@bufbuild/protobuf': 1.3.2 + '@bufbuild/protobuf': 1.3.3 - /@connectrpc/protoc-gen-connect-es@1.1.0(@bufbuild/protoc-gen-es@1.3.2)(@connectrpc/connect@1.1.0): - resolution: {integrity: sha512-5vZSH4WDiFUnVqNTDYA8koouc8mLOZfQCN4QrOxuLMuxElrNRIKX53vdIIGzf7VVmAjs4Yo9DafEAdVpsUzMGw==} + /@connectrpc/protoc-gen-connect-es@1.1.2(@bufbuild/protoc-gen-es@1.3.3)(@connectrpc/connect@1.1.2): + resolution: {integrity: sha512-TvA6Z4EOtZRXi0QbPcRUgM8RHQueIy83TmWq80WdfxZ+Yy5NLT4HVYBRWo0/x+HmPCVoT0FJeLI0iHV6C9UiDQ==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: - '@bufbuild/protoc-gen-es': ^1.2.1 - '@connectrpc/connect': 1.1.0 + '@bufbuild/protoc-gen-es': ^1.3.3 + '@connectrpc/connect': 1.1.2 peerDependenciesMeta: '@bufbuild/protoc-gen-es': optional: true '@connectrpc/connect': optional: true dependencies: - '@bufbuild/protobuf': 1.3.2 - '@bufbuild/protoc-gen-es': 1.3.2(@bufbuild/protobuf@1.3.2) - '@bufbuild/protoplugin': 1.3.2 - '@connectrpc/connect': 1.1.0(@bufbuild/protobuf@1.3.2) + '@bufbuild/protobuf': 1.3.3 + '@bufbuild/protoc-gen-es': 1.3.3(@bufbuild/protobuf@1.3.3) + '@bufbuild/protoplugin': 1.3.3 + '@connectrpc/connect': 1.1.2(@bufbuild/protobuf@1.3.3) transitivePeerDependencies: - supports-color @@ -1042,6 +1039,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-arm@0.18.20: @@ -1050,6 +1048,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-x64@0.18.20: @@ -1058,6 +1057,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/darwin-arm64@0.18.20: @@ -1066,6 +1066,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: false optional: true /@esbuild/darwin-x64@0.18.20: @@ -1074,6 +1075,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: false optional: true /@esbuild/freebsd-arm64@0.18.20: @@ -1082,6 +1084,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: false optional: true /@esbuild/freebsd-x64@0.18.20: @@ -1090,6 +1093,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: false optional: true /@esbuild/linux-arm64@0.18.20: @@ -1098,6 +1102,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-arm@0.18.20: @@ -1106,6 +1111,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-ia32@0.18.20: @@ -1114,6 +1120,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-loong64@0.18.20: @@ -1122,6 +1129,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-mips64el@0.18.20: @@ -1130,6 +1138,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-ppc64@0.18.20: @@ -1138,6 +1147,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-riscv64@0.18.20: @@ -1146,6 +1156,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-s390x@0.18.20: @@ -1154,6 +1165,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-x64@0.18.20: @@ -1162,6 +1174,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/netbsd-x64@0.18.20: @@ -1170,6 +1183,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: false optional: true /@esbuild/openbsd-x64@0.18.20: @@ -1178,6 +1192,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: false optional: true /@esbuild/sunos-x64@0.18.20: @@ -1186,6 +1201,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: false optional: true /@esbuild/win32-arm64@0.18.20: @@ -1194,6 +1210,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-ia32@0.18.20: @@ -1202,6 +1219,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-x64@0.18.20: @@ -1210,6 +1228,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: false optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.50.0): @@ -2076,10 +2095,6 @@ packages: resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} dev: true - /any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: true - /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -2263,11 +2278,6 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -2316,21 +2326,6 @@ packages: semver: 7.5.4 dev: true - /bundle-require@4.0.2(esbuild@0.18.20): - resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - peerDependencies: - esbuild: '>=0.17' - dependencies: - esbuild: 0.18.20 - load-tsconfig: 0.2.5 - dev: true - - /cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - dev: true - /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: @@ -2399,21 +2394,6 @@ packages: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - dev: true - /ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -2487,11 +2467,6 @@ packages: engines: {node: '>=16'} dev: true - /commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} - engines: {node: '>= 6'} - dev: true - /comment-json@4.2.3: resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} engines: {node: '>= 6'} @@ -3003,6 +2978,7 @@ packages: '@esbuild/win32-arm64': 0.18.20 '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 + dev: false /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -3560,17 +3536,6 @@ packages: is-glob: 4.0.3 dev: true - /glob@7.1.6: - resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -3789,13 +3754,6 @@ packages: dependencies: has-bigints: 1.0.2 - /is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: true - /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} @@ -4405,11 +4363,6 @@ packages: - supports-color - ts-node - /joycon@3.1.1: - resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} - engines: {node: '>=10'} - dev: true - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -4527,19 +4480,9 @@ packages: type-check: 0.4.0 dev: true - /lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} - dev: true - /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - /load-tsconfig@0.2.5: - resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true - /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -4568,10 +4511,6 @@ packages: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true - /lodash.sortby@4.7.0: - resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} - dev: true - /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -4683,14 +4622,6 @@ packages: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true - /mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - dev: true - /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -4750,11 +4681,6 @@ packages: resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==} dev: true - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: true - /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -4942,23 +4868,6 @@ packages: dependencies: find-up: 4.1.0 - /postcss-load-config@4.0.1(ts-node@10.9.1): - resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} - engines: {node: '>= 14'} - peerDependencies: - postcss: '>=8.0.9' - ts-node: '>=9.0.0' - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true - dependencies: - lilconfig: 2.1.0 - ts-node: 10.9.1(@types/node@20.8.2)(typescript@5.2.2) - yaml: 2.3.2 - dev: true - /postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} @@ -5048,13 +4957,6 @@ packages: dependencies: loose-envify: 1.4.0 - /readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: true - /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -5146,6 +5048,7 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 + dev: false /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -5248,13 +5151,6 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - /source-map@0.8.0-beta.0: - resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} - engines: {node: '>= 8'} - dependencies: - whatwg-url: 7.1.0 - dev: true - /spdx-exceptions@2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} dev: true @@ -5366,20 +5262,6 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - /sucrase@3.34.0: - resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} - engines: {node: '>=8'} - hasBin: true - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - commander: 4.1.1 - glob: 7.1.6 - lines-and-columns: 1.2.4 - mz: 2.7.0 - pirates: 4.0.6 - ts-interface-checker: 0.1.13 - dev: true - /superjson@1.13.3: resolution: {integrity: sha512-mJiVjfd2vokfDxsQPOwJ/PtanO87LhpYY88ubI5dUB1Ab58Txbyje3+jpm+/83R/fevaq/107NNhtYBLuoTrFg==} engines: {node: '>=10'} @@ -5438,19 +5320,6 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - dependencies: - thenify: 3.3.1 - dev: true - - /thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - dependencies: - any-promise: 1.3.0 - dev: true - /tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} @@ -5478,12 +5347,6 @@ packages: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true - /tr46@1.0.1: - resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - dependencies: - punycode: 2.3.0 - dev: true - /tr46@3.0.0: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} @@ -5491,11 +5354,6 @@ packages: punycode: 2.3.0 dev: true - /tree-kill@1.2.2: - resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true - dev: true - /ts-api-utils@1.0.3(typescript@5.2.2): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} @@ -5505,10 +5363,6 @@ packages: typescript: 5.2.2 dev: true - /ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - dev: true - /ts-jest@29.1.1(@babel/core@7.23.0)(jest@29.7.0)(typescript@5.2.2): resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5586,42 +5440,6 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tsup@7.2.0(ts-node@10.9.1)(typescript@5.2.2): - resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} - engines: {node: '>=16.14'} - hasBin: true - peerDependencies: - '@swc/core': ^1 - postcss: ^8.4.12 - typescript: '>=4.1.0' - peerDependenciesMeta: - '@swc/core': - optional: true - postcss: - optional: true - typescript: - optional: true - dependencies: - bundle-require: 4.0.2(esbuild@0.18.20) - cac: 6.7.14 - chokidar: 3.5.3 - debug: 4.3.4 - esbuild: 0.18.20 - execa: 5.1.1 - globby: 11.1.0 - joycon: 3.1.1 - postcss-load-config: 4.0.1(ts-node@10.9.1) - resolve-from: 5.0.0 - rollup: 3.29.4 - source-map: 0.8.0-beta.0 - sucrase: 3.34.0 - tree-kill: 1.2.2 - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - - ts-node - dev: true - /tsutils@3.21.0(typescript@5.2.2): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -5905,10 +5723,6 @@ packages: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true - /webidl-conversions@4.0.2: - resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} - dev: true - /webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -5941,14 +5755,6 @@ packages: webidl-conversions: 3.0.1 dev: true - /whatwg-url@7.1.0: - resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - dependencies: - lodash.sortby: 4.7.0 - tr46: 1.0.1 - webidl-conversions: 4.0.2 - dev: true - /which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: @@ -6047,11 +5853,6 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - /yaml@2.3.2: - resolution: {integrity: sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==} - engines: {node: '>= 14'} - dev: true - /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} diff --git a/scripts/gen-esm-proxy.mjs b/scripts/gen-esm-proxy.mjs new file mode 100644 index 00000000..22470d07 --- /dev/null +++ b/scripts/gen-esm-proxy.mjs @@ -0,0 +1,103 @@ +import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; +import * as path from "node:path"; +import { exit, stderr, stdout, argv } from "node:process"; + +const args = argv.slice(2); + +if (args.length === 0) { + stdout.write(`USAGE: ${path.basename(argv[1])} [...path] +path: One or more subpath exports. A dot (.) is valid. + +Generates ESM wrappers for dual packages. + +Example: + + ${path.basename(argv[1])} . foo + +Assumes that the following CJS artifacts exist: + + dist/cjs + ├── index.d.ts + ├── index.js + └── foo + ├── index.d.ts + └── index.js + +Generates the following ESM wrappers: + + dist/proxy + ├── index.d.ts + ├── index.js + └── foo + ├── index.d.ts + └── index.js + +package.json must contain: + + "type": "module", + "exports": { + ".": { + "require": "./dist/cjs/index.js", + "import": "./dist/proxy/index.js" + }, + "./protocol": { + "require": "./dist/cjs/foo/index.js", + "import": "./dist/proxy/foo/index.js" + }, + +Known limitations: +- expects CJS files with a .js extension, not .cjs +- does not support default exports +- supports only simple subpath directory exports, assuming a index.js file +- does not support export patterns +`); + exit(1); +} + +const cjsDist = "dist/cjs"; +const proxyDist = "dist/proxy"; + +const packageType = readPackageJsonType(); +if (packageType !== "module") { + stderr.write(`package.json is missing "type": "module" field.\n`); + exit(1); +} + +for (const subpath of args) { + const cjsPath = path.join(cjsDist, subpath, "index.js"); + if (!existsSync(cjsPath)) { + stderr.write( + `CommonJS artifact for subpath "${subpath}" not found at expected path ${cjsPath}\n`, + ); + exit(1); + } + const proxyDir = path.join(proxyDist, subpath); + if (!existsSync(proxyDir)) { + mkdirSync(proxyDir, { recursive: true }); + } + const cjsImportPath = path.relative(proxyDir, cjsPath); + writeFileSync( + path.join(proxyDir, "index.js"), + `export * from "${cjsImportPath}";\n`, + ); + writeFileSync( + path.join(proxyDir, "index.d.ts"), + `export * from "${cjsImportPath}";\n`, + ); +} + +/** + * @return {"commonjs"|"module"} + */ +function readPackageJsonType() { + const pkgString = readFileSync("package.json", "utf-8"); + const pkg = JSON.parse(pkgString); + const t = pkg.type; + if (typeof t !== "string") { + return "commonjs"; + } + if (t.toLowerCase() === "module") { + return "module"; + } + return "commonjs"; +} diff --git a/turbo.json b/turbo.json index b79fb62f..56f6aa68 100644 --- a/turbo.json +++ b/turbo.json @@ -1,9 +1,12 @@ { "$schema": "https://turbo.build/schema.json", - "globalDependencies": ["tsconfig.base.json", ".eslintrc.js", "package.json"], + "globalDependencies": ["tsconfig.base.json", ".eslintrc.js", "package.json", "scripts/*"], "pipeline": { + "clean": { + "outputs": ["dist/**"] + }, "build": { - "dependsOn": ["^build"], + "dependsOn": ["clean", "^build"], "outputs": ["dist/**"] }, "generate": {