Skip to content

Commit d26ef77

Browse files
authored
fix(react): Fixed issue where node module resolution wasn't being respected (#173)
* Fixed issue where node module resolution wasn't being respected * Updated package.json to include all files
1 parent e9b8d69 commit d26ef77

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

packages/react/package.json

+10-13
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,32 @@
1010
"serve:coverage": "npx serve coverage",
1111
"emulator": "firebase emulators:start --project test-project",
1212
"emulator:kill": "lsof -t -i:4001 -i:8080 -i:9000 -i:9099 -i:9199 -i:8085 | xargs kill -9",
13-
"check": "pnpm biome check --write ./packages/react/src"
13+
"check": "pnpm biome check --write ./packages/react/src",
14+
"publish-package": "pnpm run build && cd dist && npm publish"
1415
},
1516
"exports": {
1617
".": {
17-
"import": "./dist/index.js",
18-
"types": "./dist/index.d.ts"
18+
"import": "./index.js",
19+
"types": "./index.d.ts"
1920
},
2021
"./auth": {
21-
"import": "./dist/auth/index.js",
22-
"types": "./dist/auth/index.d.ts"
22+
"import": "./auth/index.js",
23+
"types": "./auth/index.d.ts"
2324
},
2425
"./firestore": {
25-
"import": "./dist/firestore/index.js",
26-
"types": "./dist/firestore/index.d.ts"
26+
"import": "./firestore/index.js",
27+
"types": "./firestore/index.d.ts"
2728
},
2829
"./data-connect": {
29-
"import": "./dist/data-connect/index.js",
30-
"types": "./dist/data-connect/index.d.ts"
30+
"import": "./data-connect/index.js",
31+
"types": "./data-connect/index.d.ts"
3132
}
3233
},
3334
"author": {
3435
"name": "Invertase",
3536
"email": "[email protected]",
3637
"url": "https://github.com/invertase/tanstack-query-firebase"
3738
},
38-
"files": [
39-
"dist",
40-
"README.md"
41-
],
4239
"license": "Apache-2.0",
4340
"devDependencies": {
4441
"@dataconnect/default-connector": "workspace:*",

packages/react/tsup.config.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from "tsup";
2-
2+
import * as fs from 'node:fs/promises';
33
const supportedPackages = ['data-connect', 'firestore', 'auth'];
44
export default defineConfig({
55
entry: [`src/(${supportedPackages.join('|')})/index.ts`, 'src/index.ts'],
@@ -11,4 +11,13 @@ export default defineConfig({
1111
},
1212
// splitting: false, // Disable code splitting to generate distinct files
1313
clean: true,
14+
async onSuccess() {
15+
try {
16+
await fs.copyFile('./package.json', './dist/package.json');
17+
await fs.copyFile('./README.md', './dist/README.md');
18+
await fs.copyFile('./LICENSE', './dist/LICENSE');
19+
} catch (e) {
20+
console.error(`Error copying files: ${e}`);
21+
}
22+
}
1423
});

0 commit comments

Comments
 (0)