Skip to content

Commit 0c47fe8

Browse files
fix(audience): address PR review findings for npm publishability
- Declare esbuild-plugin-replace and esbuild-plugins-node-modules-polyfill as explicit devDependencies (were phantom deps via root hoisting) - Remove @uniswap/swap-router-contracts from noExternal (copy-paste artifact from root tsup config — audience has no uniswap dependency) - Add *.prepack-backup to .gitignore (prevents accidental commit if pnpm pack fails between prepack and postpack) - Clean up leftover per-file .d.ts after rollup bundles them into dist/types/index.d.ts (reduces tarball size) - Use import attribute `with` instead of deprecated `assert` syntax (Node 22+ deprecation) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0f7c5a9 commit 0c47fe8

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ examples/**/test-results/
3434

3535
tests/**/.env
3636
tests/**/playwright-report/
37-
tests/**/test-results/
37+
tests/**/test-results/
38+
39+
*.prepack-backup

packages/audience/sdk/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"@swc/jest": "^0.2.37",
1313
"@types/jest": "^29.5.12",
1414
"@types/node": "^22.10.7",
15+
"esbuild-plugin-replace": "^1.4.0",
16+
"esbuild-plugins-node-modules-polyfill": "^1.6.7",
1517
"eslint": "^8.56.0",
1618
"jest": "^29.7.0",
1719
"jest-environment-jsdom": "^29.4.3",
@@ -52,7 +54,7 @@
5254
"scripts": {
5355
"build": "pnpm transpile && pnpm typegen",
5456
"transpile": "tsup --config tsup.config.js",
55-
"typegen": "tsc --customConditions default --emitDeclarationOnly --outDir dist/types && rollup -c rollup.dts.config.js",
57+
"typegen": "tsc --customConditions default --emitDeclarationOnly --outDir dist/types && rollup -c rollup.dts.config.js && find dist/types -name '*.d.ts' ! -name 'index.d.ts' -delete",
5658
"lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0",
5759
"pack:root": "pnpm pack --pack-destination $(dirname $(pnpm root -w))",
5860
"prepack": "node scripts/prepack.mjs",

packages/audience/sdk/tsup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { defineConfig } from 'tsup';
99
import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill';
1010
import { replace } from 'esbuild-plugin-replace';
11-
import pkg from './package.json' assert { type: 'json' };
11+
import pkg from './package.json' with { type: 'json' };
1212

1313
const IMTBL_WORKSPACE = /^@imtbl\//;
1414

@@ -44,7 +44,7 @@ export default defineConfig((options) => {
4444
target: 'es2022',
4545
minify: true,
4646
bundle: true,
47-
noExternal: [IMTBL_WORKSPACE, '@uniswap/swap-router-contracts'],
47+
noExternal: [IMTBL_WORKSPACE],
4848
treeshake: true,
4949
esbuildPlugins: [
5050
nodeModulesPolyfillPlugin({
@@ -64,7 +64,7 @@ export default defineConfig((options) => {
6464
target: 'es2022',
6565
minify: true,
6666
bundle: true,
67-
noExternal: [IMTBL_WORKSPACE, '@uniswap/swap-router-contracts'],
67+
noExternal: [IMTBL_WORKSPACE],
6868
treeshake: true,
6969
esbuildPlugins: [
7070
replace({ __SDK_VERSION__: pkg.version }),

0 commit comments

Comments
 (0)