diff --git a/Dockerfile b/Dockerfile index 5285f1c..58ba4a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,9 @@ COPY / ./ RUN ls -R RUN npm install -g pnpm +RUN pnpm install --unsafe-perm --frozen-lockfile +RUN pnpm -C packages/docs build RUN pnpm install --prod --unsafe-perm --frozen-lockfile +RUN pnpm store prune + CMD [ "pnpm", "-C", "packages/docs", "start" ] diff --git a/packages/docs/package.json b/packages/docs/package.json index 615cf62..30f6b58 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -5,12 +5,11 @@ "main": "./src/main.tsx", "scripts": { "dev": "esmo --no-warnings scripts/dev.ts | pino-colada", - "serve": "esmo --experimental-import-meta-resolve --no-warnings --enable-source-maps src/main.tsx", - "start": "NODE_ENV=production pnpm serve | pino-colada", + "build": "tsup src/main.tsx --target node16 --format esm --sourcemap --minify", + "start": "NODE_ENV=production node --experimental-import-meta-resolve --experimental-json-modules --no-warnings --enable-source-maps dist/main.js | pino-colada", "typecheck": "tsc --noEmit" }, "dependencies": { - "@heroicons/react": "^1.0.5", "@tailwindcss/typography": "^0.5.0", "clsx": "^1.1.1", "compression": "^1.7.4", @@ -33,6 +32,7 @@ "tailwindcss": "^3.0.8" }, "devDependencies": { + "@heroicons/react": "^1.0.5", "@types/browser-sync": "^2.26.3", "@types/compression": "^1.7.2", "@types/express": "^4.17.13", @@ -46,6 +46,7 @@ "browser-sync": "^2.27.7", "chokidar": "^3.5.2", "execa": "^6.0.0", + "tsup": "^5.11.10", "type-fest": "^2.8.0", "typescript": "^4.5.4", "wait-on": "^6.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac95b7f..273b99c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,11 +72,11 @@ importers: react: ^18.0.0-rc.0 react-dom: ^18.0.0-rc.0 tailwindcss: ^3.0.8 + tsup: ^5.11.10 type-fest: ^2.8.0 typescript: ^4.5.4 wait-on: ^6.0.0 dependencies: - '@heroicons/react': 1.0.5_react@18.0.0-rc.0 '@tailwindcss/typography': 0.5.0_tailwindcss@3.0.8 clsx: 1.1.1 compression: 1.7.4 @@ -98,6 +98,7 @@ importers: react-dom: 18.0.0-rc.0_react@18.0.0-rc.0 tailwindcss: 3.0.8_cefe482e8d38053bbf3d5815e0c551b3 devDependencies: + '@heroicons/react': 1.0.5_react@18.0.0-rc.0 '@types/browser-sync': 2.26.3 '@types/compression': 1.7.2 '@types/express': 4.17.13 @@ -111,6 +112,7 @@ importers: browser-sync: 2.27.7 chokidar: 3.5.2 execa: 6.0.0 + tsup: 5.11.10_typescript@4.5.4 type-fest: 2.8.0 typescript: 4.5.4 wait-on: 6.0.0 @@ -605,7 +607,7 @@ packages: react: '>= 16' dependencies: react: 18.0.0-rc.0 - dev: false + dev: true /@humanwhocodes/config-array/0.9.2: resolution: {integrity: sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==} @@ -7756,6 +7758,35 @@ packages: /tslib/2.3.1: resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} + /tsup/5.11.10_typescript@4.5.4: + resolution: {integrity: sha512-z8YzbPyF8Vvj37h+TY84AfvlmKZtBTRuWwRETWUbfckMj854WeLkuRQV8vRyoY8bLJQhnKWlLge/3fVbFZGERg==} + hasBin: true + peerDependencies: + typescript: ^4.1.0 + peerDependenciesMeta: + typescript: + optional: true + dependencies: + bundle-require: 2.2.0_esbuild@0.14.10 + cac: 6.7.12 + chokidar: 3.5.2 + debug: 4.3.3 + esbuild: 0.14.10 + execa: 5.1.1 + globby: 11.0.4 + joycon: 3.1.1 + postcss-load-config: 3.1.0 + resolve-from: 5.0.0 + rollup: 2.62.0 + source-map: 0.7.3 + sucrase: 3.20.3 + tree-kill: 1.2.2 + typescript: 4.5.4 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /tsup/5.11.9_typescript@4.5.4: resolution: {integrity: sha512-APFcd9qKblMVO35O5OyIcfa4lwBrVNinwtifUojO78I6j0aDhS4fQ06gq6vF1b/+Z83pYDWNb0R2fmO9PX3IVQ==} hasBin: true