diff --git a/.prettierignore b/.prettierignore index 810b2952..d09badb4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,6 +4,7 @@ packages/**/dist/ # api packages/api/.api/ +packages/api/.tsimp/ packages/api/example.js # httpsnippet-client-api diff --git a/package-lock.json b/package-lock.json index 92e0234c..e9cfb088 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1096,6 +1096,21 @@ "node": ">=10.13.0" } }, + "node_modules/@isaacs/cached": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/cached/-/cached-1.0.1.tgz", + "integrity": "sha512-7kGcJ9Hc1f4qpTApWz3swxbF9Qv1NF/GxuPtXeTptbsgvJIoufSd0h854Nq/2bw80F5C1onsFgEI05l+q0e4vw==", + "dev": true, + "dependencies": { + "@isaacs/catcher": "^1.0.0" + } + }, + "node_modules/@isaacs/catcher": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@isaacs/catcher/-/catcher-1.0.4.tgz", + "integrity": "sha512-g2klMwbnguClWNnCeQ1zYaDJsvPbIbnjdJPDE0z09MqoejJDZSLK5vIKiClq2Bkg5ubuI8vaN6wfIUi5GYzMVA==", + "dev": true + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -20637,6 +20652,56 @@ "pnpm": ">= 8" } }, + "node_modules/sock-daemon": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/sock-daemon/-/sock-daemon-1.4.2.tgz", + "integrity": "sha512-IzbegWshWWR+UzQ7487mbdYNmfJ1jXUXQBUHooqtpylO+aW0vMVbFN2d2ug3CSPZ0wbG7ZTTGwpUuthIDFIOGg==", + "dev": true, + "dependencies": { + "rimraf": "^5.0.5", + "signal-exit": "^4.1.0", + "socket-post-message": "^1.0.3" + }, + "engines": { + "node": "16 >=16.17.0 || 18 >= 18.6.0 || >=20" + } + }, + "node_modules/sock-daemon/node_modules/rimraf": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", + "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", + "dev": true, + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sock-daemon/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/socket-post-message": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/socket-post-message/-/socket-post-message-1.0.3.tgz", + "integrity": "sha512-UhJaB3xR2oF+HvddFOq2cBZi4zVKOHvdiBo+BaScNxsEUg3TLWSP8BkweKfe07kfH1thjn1hJR0af/w1EtBFjg==", + "dev": true + }, "node_modules/socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", @@ -21814,6 +21879,77 @@ "node": ">=4" } }, + "node_modules/tsimp": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/tsimp/-/tsimp-2.0.11.tgz", + "integrity": "sha512-wRhMmvar8tWHN3ZmykD8f4B4sjCn/f8DFM67LRY+stf/LPa2Kq8ATE2PIi570/DiDJA8kjjxzos3EgP0LmnFLA==", + "dev": true, + "dependencies": { + "@isaacs/cached": "^1.0.1", + "@isaacs/catcher": "^1.0.4", + "foreground-child": "^3.1.1", + "mkdirp": "^3.0.1", + "pirates": "^4.0.6", + "rimraf": "^5.0.5", + "signal-exit": "^4.1.0", + "sock-daemon": "^1.4.2", + "walk-up-path": "^3.0.1" + }, + "bin": { + "tsimp": "dist/esm/bin.mjs" + }, + "engines": { + "node": "16 >=16.17.0 || 18 >= 18.6.0 || >=20" + }, + "peerDependencies": { + "typescript": "^5.1.0" + } + }, + "node_modules/tsimp/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tsimp/node_modules/rimraf": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", + "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", + "dev": true, + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tsimp/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -24190,6 +24326,7 @@ "fetch-mock": "^9.11.0", "oas-normalize": "^11.0.1", "openapi-types": "^12.1.3", + "tsimp": "^2.0.11", "tsup": "^8.0.1", "type-fest": "^4.9.0", "typescript": "^5.2.2", diff --git a/packages/api/.gitignore b/packages/api/.gitignore index 2e0d94a6..866be884 100644 --- a/packages/api/.gitignore +++ b/packages/api/.gitignore @@ -1,4 +1,5 @@ .api/ +.tsimp/ coverage/ dist/ node_modules/ diff --git a/packages/api/package.json b/packages/api/package.json index 9fce66b5..70346c12 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -11,8 +11,8 @@ "attw": "attw --pack --format table-flipped", "build": "tsc", "build:legacy-handler": "tsc legacy-require-handler.cjs --checkJs --declaration --emitDeclarationOnly", - "build:versioned-files": "NODE_OPTIONS=--no-warnings node --loader ts-node/esm bin/buildVersionedFiles.ts", - "debug:bin": "NODE_OPTIONS=--no-warnings node --loader ts-node/esm src/bin.ts", + "build:versioned-files": "node --loader=tsimp/loader bin/buildVersionedFiles.ts", + "debug:bin": "node --loader=tsimp/loader src/bin.ts", "lint:types": "tsc --noEmit", "prebuild": "rm -rf dist/ && npm run build:versioned-files", "postbuild": "npm run build:legacy-handler", @@ -86,6 +86,7 @@ "fetch-mock": "^9.11.0", "oas-normalize": "^11.0.1", "openapi-types": "^12.1.3", + "tsimp": "^2.0.11", "tsup": "^8.0.1", "type-fest": "^4.9.0", "typescript": "^5.2.2",