From 5817fc51e0b76ecbe7c631202fcc0a4ac6e31361 Mon Sep 17 00:00:00 2001 From: Christian Benincasa Date: Tue, 5 Mar 2024 16:04:31 -0500 Subject: [PATCH] Initial turbo test --- .gitignore | 2 +- package.json | 7 +- pnpm-lock.yaml | 145 +++++++++++++++++++++++++++++++++------ server/scripts/bundle.ts | 1 - turbo.json | 17 +++++ types/package.json | 8 +-- 6 files changed, 149 insertions(+), 31 deletions(-) create mode 100644 turbo.json diff --git a/.gitignore b/.gitignore index 1d99d57e7..bc4656a11 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ build/ log.txt *.db .DS_Store -.turbo \ No newline at end of file +.turbo/ diff --git a/package.json b/package.json index 871a528e4..041c32851 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,15 @@ "license": "Zlib", "scripts": { "preinstall": "npx only-allow pnpm", - "clean": "del-cli --force ./bin ./dist ./.dizquetv ./web/public/bundle.js", - "dist": "./make_dist.sh" + "dev": "turbo run dev" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "esbuild": "^0.19.5", "eslint": "^8.45.0", + "turbo": "^1.12.4", "typescript": "^5.2.2" - } + }, + "packageManager": "pnpm@8.15.4+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d7b377b4..2aa3560dc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: eslint: specifier: ^8.45.0 version: 8.45.0 + turbo: + specifier: ^1.12.4 + version: 1.12.4 typescript: specifier: ^5.2.2 version: 5.2.2 @@ -326,6 +329,9 @@ importers: rimraf: specifier: ^5.0.5 version: 5.0.5 + tsup: + specifier: ^8.0.2 + version: 8.0.2(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -3067,7 +3073,7 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: true @@ -3268,7 +3274,7 @@ packages: resolution: {integrity: sha512-TAlMYvOuwGyLK3PfBb5WKBXZmXz2fVCgv23d6zZFdle/q3gPjmxBaeuC0pY0Dzs5PWMSgfqqEZkrye19GlDTgw==} dependencies: archy: 1.0.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) fastq: 1.15.0 transitivePeerDependencies: - supports-color @@ -3588,6 +3594,16 @@ packages: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} dev: true + /bundle-require@4.0.2(esbuild@0.19.12): + resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.17' + dependencies: + esbuild: 0.19.12 + load-tsconfig: 0.2.5 + dev: true + /bundle-require@4.0.2(esbuild@0.19.5): resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -4111,17 +4127,6 @@ packages: ms: 2.1.2 dev: false - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - /debug@4.3.4(supports-color@5.5.0): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -4133,7 +4138,6 @@ packages: dependencies: ms: 2.1.2 supports-color: 5.5.0 - dev: true /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -5552,7 +5556,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: true @@ -5890,7 +5894,7 @@ packages: resolution: {integrity: sha512-pJ4XLQP4Q9HTxl6RVDLJ8Cyh1uitSs0CzDBAz1uoJ4sRD/Bk7cFSXL1FUXDW3zJ7YnfliJx6eu8Jn283bpZ4Yg==} engines: {node: '>=10'} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) rfdc: 1.3.0 uri-js: 4.4.1 transitivePeerDependencies: @@ -5972,7 +5976,7 @@ packages: better-sqlite3: 8.7.0 colorette: 2.0.19 commander: 10.0.1 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) escalade: 3.1.1 esm: 3.2.25 get-package-type: 0.1.0 @@ -6019,7 +6023,7 @@ packages: better-sqlite3: 9.1.1 colorette: 2.0.19 commander: 10.0.1 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) escalade: 3.1.1 esm: 3.2.25 get-package-type: 0.1.0 @@ -8680,6 +8684,45 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + /tsup@8.0.2(typescript@5.2.2): + resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@microsoft/api-extractor': ^7.36.0 + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 4.0.2(esbuild@0.19.12) + cac: 6.7.14 + chokidar: 3.5.3 + debug: 4.3.4(supports-color@5.5.0) + esbuild: 0.19.12 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 4.0.2 + resolve-from: 5.0.0 + rollup: 4.9.5 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tree-kill: 1.2.2 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /tsup@8.0.2(typescript@5.3.3): resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} engines: {node: '>=18'} @@ -8702,7 +8745,7 @@ packages: bundle-require: 4.0.2(esbuild@0.19.5) cac: 6.7.14 chokidar: 3.5.3 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) esbuild: 0.19.5 execa: 5.1.1 globby: 11.1.0 @@ -8739,6 +8782,66 @@ packages: dependencies: safe-buffer: 5.2.1 + /turbo-darwin-64@1.12.4: + resolution: {integrity: sha512-dBwFxhp9isTa9RS/fz2gDVk5wWhKQsPQMozYhjM7TT4jTrnYn0ZJMzr7V3B/M/T8QF65TbniW7w1gtgxQgX5Zg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-darwin-arm64@1.12.4: + resolution: {integrity: sha512-1Uo5iI6xsJ1j9ObsqxYRsa3W26mEbUe6fnj4rQYV6kDaqYD54oAMJ6hM53q9rB8JvFxwdrUXGp3PwTw9A0qqkA==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-64@1.12.4: + resolution: {integrity: sha512-ONg2aSqKP7LAQOg7ysmU5WpEQp4DGNxSlAiR7um+LKtbmC/UxogbR5+T+Uuq6zGuQ5kJyKjWJ4NhtvUswOqBsA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-arm64@1.12.4: + resolution: {integrity: sha512-9FPufkwdgfIKg/9jj87Cdtftw8o36y27/S2vLN7FTR2pp9c0MQiTBOLVYadUr1FlShupddmaMbTkXEhyt9SdrA==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-64@1.12.4: + resolution: {integrity: sha512-2mOtxHW5Vjh/5rDVu/aFwsMzI+chs8XcEuJHlY1sYOpEymYTz+u6AXbnzRvwZFMrLKr7J7fQOGl+v96sLKbNdA==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-arm64@1.12.4: + resolution: {integrity: sha512-nOY5wae9qnxPOpT1fRuYO0ks6dTwpKMPV6++VkDkamFDLFHUDVM/9kmD2UTeh1yyrKnrZksbb9zmShhmfj1wog==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo@1.12.4: + resolution: {integrity: sha512-yUJ7elEUSToiGwFZogXpYKJpQ0BvaMbkEuQECIWtkBLcmWzlMOt6bActsIm29oN83mRU0WbzGt4e8H1KHWedhg==} + hasBin: true + optionalDependencies: + turbo-darwin-64: 1.12.4 + turbo-darwin-arm64: 1.12.4 + turbo-linux-64: 1.12.4 + turbo-linux-arm64: 1.12.4 + turbo-windows-64: 1.12.4 + turbo-windows-arm64: 1.12.4 + dev: true + /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -8954,7 +9057,7 @@ packages: hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) pathe: 1.1.1 picocolors: 1.0.0 vite: 5.0.11(@types/node@20.8.9) @@ -9074,7 +9177,7 @@ packages: acorn-walk: 8.3.2 cac: 6.7.14 chai: 4.3.10 - debug: 4.3.4 + debug: 4.3.4(supports-color@5.5.0) execa: 8.0.1 local-pkg: 0.5.0 magic-string: 0.30.5 diff --git a/server/scripts/bundle.ts b/server/scripts/bundle.ts index 40930154c..06df37823 100644 --- a/server/scripts/bundle.ts +++ b/server/scripts/bundle.ts @@ -32,7 +32,6 @@ await esbuild.build({ inject: ['cjs-shim.ts'], packages: 'external', tsconfig: './tsconfig.build.json', - logLevel: 'verbose', // external: [ // 'mysql', // 'mysql2', diff --git a/turbo.json b/turbo.json new file mode 100644 index 000000000..40722d6c0 --- /dev/null +++ b/turbo.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://turbo.build/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["build/**"] + }, + "bundle": { + "dependsOn": ["build"], + "outputs": ["build/**", "dist/**"] + }, + "dev": { + "cache": false, + "persistent": true + } + } +} diff --git a/types/package.json b/types/package.json index 70dd28bfa..3e8c07c46 100644 --- a/types/package.json +++ b/types/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "", "scripts": { - "build": "tsc -p tsconfig.json", + "build": "tsup src/index.ts --format esm --dts -d build/", "clean": "rimraf build", "dev": "nodemon -e ts --watch src --ignore build/ -e .json,.ts,.yml,.yaml,.js -x tsc --project tsconfig.json" }, @@ -18,16 +18,14 @@ "eslint": "8.45.0", "nodemon": "^3.1.0", "rimraf": "^5.0.5", + "tsup": "^8.0.2", "typescript": "5.2.2" }, "dependencies": { "zod": "^3.22.4" }, "exports": { - ".": { - "types": "./build/src/index.d.ts", - "default": "./build/src/index.js" - }, + ".": "./src/index.ts", "./package.json": "./package.json", "./schemas": { "types": "./build/src/schemas/index.d.ts",