From 96e15f3d994c6240a6ee50431065e3d593d9f581 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 20 Oct 2024 16:26:52 +0200 Subject: [PATCH] fix: fix production build MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/internal-benchmark.yml | 4 +--- benchmarks/README.md | 1 - package.json | 5 +++-- rollup.config.mjs | 6 ++++-- tsconfig.json | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/internal-benchmark.yml b/.github/workflows/internal-benchmark.yml index 734ff9ca..3af6cdb4 100644 --- a/.github/workflows/internal-benchmark.yml +++ b/.github/workflows/internal-benchmark.yml @@ -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" diff --git a/benchmarks/README.md b/benchmarks/README.md index 0d4765fc..319cafcf 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -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) diff --git a/package.json b/package.json index e6dd27b6..2bffafd2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/rollup.config.mjs b/rollup.config.mjs index 826fba1e..facbff99 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -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(), ], diff --git a/tsconfig.json b/tsconfig.json index df26738d..576a66be 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "target": "ES2022", "module": "Node16", "declaration": true, - "declarationDir": "./lib/dts", + "declarationDir": "./lib", "strict": true, "verbatimModuleSyntax": true, "forceConsistentCasingInFileNames": true, -- 2.34.1