Skip to content

Commit

Permalink
Use tsup to bundle dts (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernanberg authored Dec 16, 2024
1 parent b453bda commit 17f6c4d
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 26 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"build": "pnpm -r build",
"build:all": "pnpm -r build && pnpm -r build:types && pnpm install && pnpm copy-files && cd example && pnpm build:fbtee",
"build:all": "pnpm -r build && pnpm install && pnpm copy-files && cd example && pnpm build:fbtee",
"clean": "rm -rf packages/*/lib; cd example pnpm clean",
"copy-files": "find packages/* -type d -maxdepth 0 -exec cp README.md LICENSE {} \\;",
"dev": "cd example && pnpm build:fbtee && pnpm dev",
Expand Down Expand Up @@ -41,7 +41,6 @@
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/yargs": "^17.0.33",
"dts-bundle-generator": "^9.5.1",
"eslint": "^8.0.0",
"eslint-plugin-workspaces": "^0.10.1",
"invariant": "^2.2.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-fbtee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"fbtee": "lib/bin.js"
},
"scripts": {
"build": "tsup src/index.tsx src/bin.tsx -d lib --target=node22 --format=esm --clean --no-splitting",
"build:types": "dts-bundle-generator -o lib/index.d.ts src/index.tsx"
"build": "tsup src/index.tsx src/bin.tsx -d lib --target=node22 --format=esm --clean --no-splitting --dts"
},
"dependencies": {
"@nkzw/babel-plugin-fbtee": "workspace:^",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-plugin-fbtee-auto-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"type": "module",
"main": "lib/index.js",
"scripts": {
"build": "tsup src/index.tsx -d lib --target=node22 --format=esm --clean --no-splitting",
"build:types": "dts-bundle-generator -o lib/index.d.ts src/index.tsx"
"build": "tsup src/index.tsx -d lib --target=node22 --format=esm --clean --no-splitting --dts"
},
"dependencies": {
"@babel/core": "^7.26.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-plugin-fbtee-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"type": "module",
"main": "lib/index.js",
"scripts": {
"build": "tsup src/index.tsx -d lib --target=node22 --format=esm --clean --no-splitting",
"build:types": "dts-bundle-generator -o lib/index.d.ts src/index.tsx"
"build": "tsup src/index.tsx -d lib --target=node22 --format=esm --clean --no-splitting --dts"
},
"dependencies": {
"@babel/core": "^7.26.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-plugin-fbtee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"fbtee": "lib/bin.js"
},
"scripts": {
"build": "tsup src/index.tsx src/bin.tsx -d lib --target=node22 --format=esm --clean --no-splitting",
"build:types": "dts-bundle-generator -o lib/index.d.ts src/index.tsx"
"build": "tsup src/index.tsx src/bin.tsx -d lib --target=node22 --format=esm --clean --no-splitting --dts"
},
"dependencies": {
"@babel/core": "^7.26.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-plugin-fbtee/src/bin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ if (command === 'manifest') {
} else if (command === 'collect') {
import('./bin/collect.tsx');
}

export default {};
1 change: 1 addition & 0 deletions packages/babel-plugin-fbtee/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { checkOption, errorAt } from './FbtUtil.tsx';
import { FbtVariationType } from './translate/IntlVariations.tsx';
import type { FbtTableKey, PatternHash, PatternString } from './Types.d.ts';

export type { FbtTableKey, PatternHash, PatternString };
export { SENTINEL } from './FbtConstants.tsx';
export { default as fbtHashKey } from './fbtHashKey.tsx';
export { mapLeaves } from './JSFbtUtil.tsx';
Expand Down
3 changes: 1 addition & 2 deletions packages/fbtee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"type": "module",
"main": "lib/index.js",
"scripts": {
"build": "tsup src/index.tsx -d lib --target=node22 --format=esm --clean --no-splitting",
"build:types": "dts-bundle-generator -o lib/index.d.ts src/index.tsx"
"build": "tsup src/index.tsx -d lib --target=node22 --format=esm --clean --no-splitting --dts"
},
"dependencies": {
"invariant": "^2.2.4"
Expand Down
13 changes: 0 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"allowImportingTsExtensions": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"incremental": false,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
Expand Down

0 comments on commit 17f6c4d

Please sign in to comment.