Skip to content

Commit 8db8f2a

Browse files
committed
refactor: move attachments to common package
1 parent 4d5a1bc commit 8db8f2a

26 files changed

+1131
-969
lines changed

packages/attachments/README.md

Lines changed: 149 additions & 632 deletions
Large diffs are not rendered by default.

packages/attachments/package.json

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@powersync/attachments",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"publishConfig": {
55
"registry": "https://registry.npmjs.org/",
66
"access": "public"
@@ -9,6 +9,7 @@
99
"type": "git",
1010
"url": "git+https://github.com/powersync-ja/powersync-js.git"
1111
},
12+
"deprecated": "This package has been merged into @powersync/common. Please use @powersync/common instead.",
1213
"author": "JOURNEYAPPS",
1314
"license": "Apache-2.0",
1415
"homepage": "https://docs.powersync.com",
@@ -30,55 +31,28 @@
3031
"default": "./dist/index.cjs",
3132
"types": "./dist/index.d.cts"
3233
}
33-
},
34-
"./node": {
35-
"node": {
36-
"import": {
37-
"default": "./lib/node.js",
38-
"types": "./lib/node.d.ts"
39-
},
40-
"require": {
41-
"default": "./dist/node.cjs",
42-
"types": "./dist/node.d.cts"
43-
}
44-
},
45-
"default": null
4634
}
4735
},
4836
"files": [
4937
"lib",
50-
"dist"
38+
"dist",
39+
"src"
5140
],
5241
"scripts": {
5342
"build": "tsc -b && rollup --config",
54-
"build:prod": "tsc -b --sourceMap false && rollup --config --sourceMap=false",
43+
"build:prod": "tsc -b --sourceMap false && rollup --config",
5544
"clean": "rm -rf lib dist tsconfig.tsbuildinfo",
5645
"watch": "tsc -b -w",
5746
"test": "pnpm build && vitest",
5847
"test:exports": "attw --pack ."
5948
},
6049
"peerDependencies": {
61-
"@powersync/common": "workspace:^1.40.0",
62-
"expo-file-system": "^18.0.0",
63-
"base64-arraybuffer": "^1.0.0"
64-
},
65-
"peerDependenciesMeta": {
66-
"expo-file-system": {
67-
"optional": true
68-
},
69-
"base64-arraybuffer": {
70-
"optional": true
71-
}
50+
"@powersync/common": "workspace:^1.42.0"
7251
},
7352
"devDependencies": {
7453
"@powersync/common": "workspace:*",
75-
"@powersync/web": "workspace:*",
76-
"@powersync/node": "workspace:*",
77-
"@powersync/better-sqlite3": "^0.2.0",
7854
"@types/node": "^20.17.6",
79-
"memfs": "^4.50.0",
8055
"vite": "^6.1.0",
81-
"vite-plugin-top-level-await": "^1.4.4",
82-
"vite-plugin-wasm": "^3.3.0"
56+
"vite-plugin-top-level-await": "^1.4.4"
8357
}
8458
}

packages/attachments/rollup.config.js

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,32 @@ import typescript from '@rollup/plugin-typescript';
44
import { dts } from 'rollup-plugin-dts';
55

66
/** @type {import('rollup').RollupOptions} */
7-
export default (commandLineArgs) => {
8-
const sourceMap = (commandLineArgs.sourceMap || 'true') == 'true';
9-
10-
// Clears rollup CLI warning https://github.com/rollup/rollup/issues/2694
11-
delete commandLineArgs.sourceMap;
12-
13-
const plugins = [
14-
resolve(),
15-
commonjs(),
16-
typescript({
17-
tsconfig: './tsconfig.json',
18-
outDir: 'dist',
19-
sourceMap
20-
})
21-
];
22-
7+
export default () => {
238
return [
249
{
2510
input: 'src/index.ts',
2611
output: {
2712
format: 'cjs',
2813
file: 'dist/index.cjs',
29-
sourcemap: sourceMap,
14+
sourcemap: true,
3015
exports: 'named'
3116
},
32-
plugins,
33-
external: ['@powersync/common', 'expo-file-system', 'base64-arraybuffer']
34-
},
35-
{
36-
input: 'src/node.ts',
37-
output: {
38-
format: 'cjs',
39-
file: 'dist/node.cjs',
40-
sourcemap: sourceMap,
41-
exports: 'named'
42-
},
43-
plugins,
44-
external: ['@powersync/common', 'fs', 'path']
17+
plugins: [
18+
resolve(),
19+
commonjs(),
20+
typescript({
21+
tsconfig: './tsconfig.json',
22+
outDir: 'dist',
23+
sourceMap: true
24+
})
25+
],
26+
external: ['@powersync/common']
4527
},
28+
// This is required to avoid https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md
4629
{
4730
input: './lib/index.d.ts',
4831
output: [{ file: 'dist/index.d.cts', format: 'cjs' }],
4932
plugins: [dts()]
50-
},
51-
{
52-
input: './lib/node.d.ts',
53-
output: [{ file: 'dist/node.d.cts', format: 'cjs' }],
54-
plugins: [dts()]
5533
}
5634
];
57-
};
35+
};

0 commit comments

Comments
 (0)