File tree Expand file tree Collapse file tree 11 files changed +53
-18
lines changed
Expand file tree Collapse file tree 11 files changed +53
-18
lines changed Original file line number Diff line number Diff line change 4646 run : pnpm build:packages
4747
4848 - name : Test Package Exports
49- run : pnpm test:packages:types
49+ run : pnpm test:packages:exports
5050
5151 - name : Start Verdaccio
5252 run : |
Original file line number Diff line number Diff line change 2121 "lint" : " eslint ." ,
2222 "release" : " pnpm build:packages:prod && pnpm changeset publish" ,
2323 "test" : " pnpm run -r --workspace-concurrency=1 test --run" ,
24- "test:packages:types " : " pnpm -r --filter {./packages/**} exec attw --pack . "
24+ "test:packages:exports " : " pnpm -r --filter {./packages/**} test:exports "
2525 },
2626 "keywords" : [],
2727 "type" : " module" ,
Original file line number Diff line number Diff line change 4141 "build:prod" : " tsc -b --sourceMap false && rollup --config --sourceMap=false" ,
4242 "clean" : " rm -rf lib tsconfig.tsbuildinfo" ,
4343 "watch" : " tsc -b -w" ,
44- "test" : " pnpm build && vitest"
44+ "test" : " pnpm build && vitest" ,
45+ "test:exports" : " attw --pack ."
4546 },
4647 "peerDependencies" : {
4748 "@powersync/common" : " workspace:^1.35.0"
Original file line number Diff line number Diff line change 4040 "build" : " tsc -b && rollup -c rollup.config.mjs" ,
4141 "build:prod" : " tsc -b --sourceMap false && rollup -c rollup.config.mjs --sourceMap false" ,
4242 "clean" : " rm -rf lib dist tsconfig.tsbuildinfo" ,
43- "test" : " vitest"
43+ "test" : " vitest" ,
44+ "test:exports" : " attw --pack ."
4445 },
4546 "dependencies" : {
4647 "js-logger" : " ^1.6.1"
Original file line number Diff line number Diff line change 3838 "build:prod" : " tsc -b --sourceMap false && rollup --config --sourceMap=false" ,
3939 "clean" : " rm -rf lib tsconfig.tsbuildinfo" ,
4040 "watch" : " tsc --build -w" ,
41- "test" : " vitest"
41+ "test" : " vitest" ,
42+ "test:exports" : " attw --pack ."
4243 },
4344 "peerDependencies" : {
4445 "@powersync/common" : " workspace:^1.35.0" ,
Original file line number Diff line number Diff line change 3838 "build:prod" : " tsc -b --sourceMap false && rollup --config --sourceMap=false" ,
3939 "clean" : " rm -rf lib tsconfig.tsbuildinfo" ,
4040 "watch" : " tsc --build -w" ,
41- "test" : " pnpm build && vitest"
41+ "test" : " pnpm build && vitest" ,
42+ "test:exports" : " attw --pack ."
4243 },
4344 "peerDependencies" : {
4445 "@powersync/common" : " workspace:^1.35.0"
Original file line number Diff line number Diff line change 1818 "build:prod" : " tsc -b --sourceMap false && rollup --config" ,
1919 "clean" : " rm -rf lib dist tsconfig.tsbuildinfo" ,
2020 "watch" : " tsc -b -w" ,
21- "test" : " vitest"
21+ "test" : " vitest" ,
22+ "test:exports" : " attw --pack . --ignore-rules no-resolution "
2223 },
2324 "type" : " module" ,
2425 "exports" : {
2526 "." : {
26- "import" : " ./lib/index.js" ,
27- "require" : " ./dist/bundle.cjs" ,
28- "types" : " ./lib/index.d.ts"
27+ "import" : {
28+ "default:" : " ./lib/index.js" ,
29+ "types" : " ./lib/worker.d.ts"
30+ },
31+ "require" : {
32+ "default:" : " ./dist/bundle.cjs" ,
33+ "types" : " ./dist/bundle.d.cts"
34+ }
2935 },
3036 "./worker.js" : {
31- "import" : " ./lib/worker.js" ,
32- "require" : " ./dist/worker.cjs" ,
33- "types" : " ./lib/worker.d.ts"
37+ "import" : {
38+ "default:" : " ./lib/worker.js" ,
39+ "types" : " ./lib/worker.d.ts"
40+ },
41+ "require" : {
42+ "default:" : " ./dist/worker.cjs" ,
43+ "types" : " ./dist/worker.d.cts"
44+ }
3445 },
3546 "./package.json" : " ./package.json"
3647 },
Original file line number Diff line number Diff line change 1+ import dts from 'rollup-plugin-dts' ;
2+
13const plugin = ( ) => {
24 return {
35 name : 'mark-as-commonjs' ,
@@ -7,7 +9,7 @@ const plugin = () => {
79 }
810
911 return null ;
10- } ,
12+ }
1113 } ;
1214} ;
1315
@@ -21,6 +23,14 @@ export default [
2123 sourcemap : true
2224 }
2325 } ,
26+ {
27+ input : 'lib/index.d.ts' ,
28+ output : {
29+ file : 'dist/bundle.d.cts' ,
30+ format : 'cjs'
31+ } ,
32+ plugins : [ dts ( ) ]
33+ } ,
2434 {
2535 input : 'lib/db/DefaultWorker.js' ,
2636 plugins : [ plugin ( ) ] ,
@@ -38,5 +48,13 @@ export default [
3848 format : 'cjs' ,
3949 sourcemap : true
4050 }
51+ } ,
52+ {
53+ input : 'lib/worker.d.ts' ,
54+ output : {
55+ file : 'dist/worker.d.cts' ,
56+ format : 'cjs'
57+ } ,
58+ plugins : [ dts ( ) ]
4159 }
4260] ;
Original file line number Diff line number Diff line change 1717 "build" : " tsc -b && rollup -c rollup.config.mjs" ,
1818 "build:prod" : " tsc -b --sourceMap false && rollup -c rollup.config.mjs --sourceMap false" ,
1919 "clean" : " rm -rf lib dist tsconfig.tsbuildinfo" ,
20- "watch" : " tsc -b -w"
20+ "watch" : " tsc -b -w" ,
21+ "test:exports" : " attw --pack ."
2122 },
2223 "repository" : {
2324 "type" : " git" ,
Original file line number Diff line number Diff line change 88 "description" : " PowerSync integration with TanStack Query for offline-first and real-time data synchronization in React apps" ,
99 "main" : " ./lib/index.js" ,
1010 "types" : " ./lib/index.d.ts" ,
11+ "type" : " module" ,
1112 "files" : [
1213 " lib"
1314 ],
1617 "build:prod" : " tsc -b --sourceMap false" ,
1718 "clean" : " rm -rf lib tsconfig.tsbuildinfo" ,
1819 "test" : " vitest" ,
19- "watch" : " tsc -b -w"
20+ "watch" : " tsc -b -w" ,
21+ "test:exports" : " attw --pack . --ignore-rules cjs-resolves-to-esm"
2022 },
2123 "repository" : {
2224 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments