fix: fix production build
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 20 Oct 2024 14:26:52 +0000 (16:26 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 20 Oct 2024 14:26:52 +0000 (16:26 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.github/workflows/internal-benchmark.yml
benchmarks/README.md
package.json
rollup.config.mjs
tsconfig.json

index 734ff9ca3b085948016a7d9458bdc36a66203f4d..3af6cdb4a2620a26845165758888c0ba01c37be1 100644 (file)
@@ -30,8 +30,6 @@ jobs:
           cache: 'pnpm'
       - name: Install dependencies
         run: pnpm install --ignore-scripts --frozen-lockfile
-      - name: Production Build
-        run: pnpm build:prod
       - uses: bencherdev/bencher@main
       - name: Run production benchmark
         run: |
@@ -51,4 +49,4 @@ jobs:
           --file benchmark-report.json \
           --err \
           --github-actions ${{ secrets.GITHUB_TOKEN }} \
-          "pnpm benchmark:tatami-ng"
+          "pnpm benchmark:tatami-ng:prod"
index 0d4765fc08c5f186eee42bb6eb3e918487e7a9c4..319cafcf4f3759f105e0359b0b31d70ea8788848 100644 (file)
@@ -24,7 +24,6 @@ See the dedicated repository [README.md](https://github.com/poolifier/benchmark#
 
 To run the internal benchmark, you just need to navigate to the root of poolifier cloned repository and run:
 
-- `pnpm build:prod`
 - `pnpm benchmark:tatami-ng`
 
 ### [Results](https://bencher.dev/perf/poolifier)
index e6dd27b614d986cf07bb1304824a858eaa3e1c55..2bffafd256db373367f3d1b2325c79c06e62a881 100644 (file)
@@ -21,8 +21,9 @@
     "build:prod": "rollup --config",
     "build:typedoc": "rollup --config --environment DOCUMENTATION,BUILD:development",
     "build:analyze": "rollup --config --environment ANALYZE,BUILD:development",
-    "benchmark:tatami-ng": "node --enable-source-maps benchmarks/internal/bench.mjs -t tatami-ng",
-    "benchmark:tatami-ng:debug": "node --enable-source-maps --inspect benchmarks/internal/bench.mjs -t tatami-ng",
+    "benchmark:tatami-ng": "pnpm build && node --enable-source-maps benchmarks/internal/bench.mjs -t tatami-ng",
+    "benchmark:tatami-ng:prod": "pnpm build:prod && node --enable-source-maps benchmarks/internal/bench.mjs -t tatami-ng",
+    "benchmark:tatami-ng:debug": "pnpm build && node --enable-source-maps --inspect benchmarks/internal/bench.mjs -t tatami-ng",
     "test": "pnpm build --environment SOURCEMAP:false && cross-env NODE_ENV=test c8 mocha 'tests/**/*.test.mjs'",
     "test:debug": "pnpm build && cross-env NODE_ENV=test mocha --no-parallel --inspect 'tests/**/*.test.mjs'",
     "coverage": "c8 report --reporter=lcov",
index 826fba1eec4a2e1350b2cf8f68d5a514ea3f5687..facbff998f9e3e510a1dedf81b6e07d0346fa29c 100644 (file)
@@ -88,13 +88,15 @@ export default defineConfig([
   },
   {
     external: [/^node:*/],
-    input: './lib/dts/index.d.ts',
+    input: './lib/index.d.ts',
     output: [{ file: './lib/index.d.ts', format: 'esm' }],
     plugins: [
       dts(),
       del({
         hook: 'buildEnd',
-        targets: ['./lib/dts'],
+        targets: isDevelopmentBuild
+          ? ['./lib/**/*.d.ts', '!./lib/index.d.ts']
+          : ['./lib/**/*.d.ts', '!./lib/index.d.ts', './lib/*/'],
       }),
       isAnalyzeBuild && analyze(),
     ],
index df26738d28f74e03982e0489addb14ae6d43c363..576a66bee8a790d07474732ec83f70b9920e1d13 100644 (file)
@@ -4,7 +4,7 @@
     "target": "ES2022",
     "module": "Node16",
     "declaration": true,
-    "declarationDir": "./lib/dts",
+    "declarationDir": "./lib",
     "strict": true,
     "verbatimModuleSyntax": true,
     "forceConsistentCasingInFileNames": true,