diff --git a/package-lock.json b/package-lock.json index 46cb9a1..ca96fa3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "@smithy/types": "^4.14.3", "@smithy/util-retry": "^4.4.5", "@trystero-p2p/nostr": "^0.24.0", - "chokidar": "^4.0.0", "diff-match-patch": "^1.0.5", "fflate": "^0.8.2", "idb": "^8.0.3", @@ -31,14 +30,13 @@ "minimatch": "^10.2.2", "obsidian": "^1.12.3", "octagonal-wheels": "^0.1.46", - "pouchdb-adapter-leveldb": "^9.0.0", "qrcode-generator": "^1.4.4", - "werift": "^0.23.0", "xxhash-wasm-102": "npm:xxhash-wasm@^1.0.2" }, "devDependencies": { "@dword-design/eslint-plugin-import-alias": "^8.1.8", "@eslint/js": "^9.39.3", + "@playwright/test": "^1.58.2", "@sveltejs/vite-plugin-svelte": "^6.2.4", "@tsconfig/svelte": "^5.0.8", "@types/deno": "^2.5.0", @@ -94,7 +92,6 @@ "typescript": "5.9.3", "typescript-eslint": "^8.61.0", "vite": "^7.3.1", - "vite-plugin-istanbul": "^8.0.0", "vitest": "^4.1.8", "webdriverio": "^9.27.0", "yaml": "^2.8.2" @@ -2820,6 +2817,22 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@playwright/test": { + "version": "1.61.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.0.tgz", + "integrity": "sha512-cKA5B6lpFEMyMGjxF54QihfYpB4FkEGH+qZhtArDEG+wezQAJY8Pq6C7T1SjWz+FFzt3TbyoXBQYk/0292TdJA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.61.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@polka/url": { "version": "1.0.0-next.29", "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", @@ -10763,20 +10776,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/linkify-it": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", @@ -11933,14 +11932,14 @@ } }, "node_modules/playwright": { - "version": "1.58.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz", - "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==", + "version": "1.61.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.0.tgz", + "integrity": "sha512-Z+7BeeqQPRRzklHsVFP4KTGIyMxKUmfeRA4WisM6G3/XW6nwGeX6fX9qYaDa+CiUqpOkb2f6X3nar05R3kSuJQ==", "dev": true, "license": "Apache-2.0", "peer": true, "dependencies": { - "playwright-core": "1.58.2" + "playwright-core": "1.61.0" }, "bin": { "playwright": "cli.js" @@ -11953,9 +11952,9 @@ } }, "node_modules/playwright-core": { - "version": "1.58.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz", - "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==", + "version": "1.61.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.0.tgz", + "integrity": "sha512-caX7TrY3Ml6egyDX0WUcTHDxodl/b51y5wJOdCEA36QviK/s2g081hvmGs8eaE3DWb6NYZQ6BjO/QkNRPenoPA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -12087,7 +12086,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-abstract-mapreduce/-/pouchdb-abstract-mapreduce-9.0.0.tgz", "integrity": "sha512-SnTtqwAEiAa3uxKbc1J7LfiBViwEkKe2xkK92zxyTXPqWBvMnh4UU3GXxx7GrXTM4L9llsQ3lSjpbH4CNqG1Mw==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-binary-utils": "9.0.0", @@ -12103,7 +12101,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-adapter-http/-/pouchdb-adapter-http-9.0.0.tgz", "integrity": "sha512-2eL008XeRZkdyp3hMHHOhdIPqK9H6Mn4SLlQvit4zCbqnOFfAswzPjUmHULGMbDUCrQBTu6y82FnV6NHXv9kgw==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-binary-utils": "9.0.0", @@ -12221,7 +12218,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-checkpointer/-/pouchdb-checkpointer-9.0.0.tgz", "integrity": "sha512-yu1OlWw78oTHKOkg1GoxxF2qB7YUsjK3rUDJOChMs/sVlZwOTZ4mGdWFPBr3udxSGvR77E+g89kpdmAWhPpHvA==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-collate": "9.0.0", @@ -12268,7 +12264,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-find/-/pouchdb-find-9.0.0.tgz", "integrity": "sha512-vvVhq4eEOmSkwSRwf2NBYtdhURB7ryJ7sUI4WDN00GuLUj2g8jAXBJuZIryVgdYt/5S5cfn70iRL6Eow+LFhpA==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-abstract-mapreduce": "9.0.0", @@ -12284,7 +12279,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-generate-replication-id/-/pouchdb-generate-replication-id-9.0.0.tgz", "integrity": "sha512-wetxjU0W/qNYtfHIoKwBO73ddUr0/eqzYOkoKHSFXCgOzYmTglDeqXiVY9LPysRXTgaHUJPKC5LoknZZw7e+Dw==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-collate": "9.0.0", @@ -12304,7 +12298,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-mapreduce/-/pouchdb-mapreduce-9.0.0.tgz", "integrity": "sha512-ZD8PleQ9atzQAzT2LZWsvooUVEfsen5QGv/SDfci20IleCaFW2A2q7OERrqY0YWKDCCNRsWhPWPmsFvZC9K8DQ==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-abstract-mapreduce": "9.0.0", @@ -12316,7 +12309,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-9.0.0.tgz", "integrity": "sha512-Bjh8W6QXqp1j7MKmHhYYp5cYlcQsm5drD8Jd/F+ZlfNt18uiD2SQXWzGM5797+tiW/LszFGb8ttw0uHWjxufCQ==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-utils": "9.0.0" @@ -12345,7 +12337,6 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/pouchdb-replication/-/pouchdb-replication-9.0.0.tgz", "integrity": "sha512-EZ68KJ3ZUWuPe35NxP6WnRw8J6Zudf0j/tZ/6mOSrCcp3EbtBNt8Ke2FaAThUgiFahVnHD5Y8nd53EGs2DLygg==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-checkpointer": "9.0.0", @@ -12379,7 +12370,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/pouchdb-wrappers/-/pouchdb-wrappers-5.0.0.tgz", "integrity": "sha512-fXqsVn+rmlPtxaAIGaQP5TkiaT39OMwvMk+ScLLtHrmfXD2KBO6fe/qBl38N/rpTn0h/A058dPN4fLAHt550zA==", - "dev": true, "license": "Apache-2.0" }, "node_modules/prelude-ls": { @@ -14261,7 +14251,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/transform-pouch/-/transform-pouch-2.0.0.tgz", "integrity": "sha512-nDZovo0U5o0UdMNL93fMQgGjrwH9h4F/a7qqRTnF6cVA+FfgyXiJPTrSuD+LmWSO7r2deZt0P0oeCD8hkgxl5g==", - "dev": true, "license": "Apache-2.0", "dependencies": { "pouchdb-wrappers": "^5.0.0" @@ -14305,7 +14294,6 @@ "integrity": "sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "~0.28.0" }, @@ -16511,19 +16499,51 @@ }, "src/apps/cli": { "name": "self-hosted-livesync-cli", - "version": "0.0.0", - "devDependencies": {} + "version": "0.25.76-cli", + "dependencies": { + "chokidar": "^4.0.0", + "minimatch": "^10.2.2", + "octagonal-wheels": "^0.1.46", + "pouchdb-adapter-http": "^9.0.0", + "pouchdb-adapter-leveldb": "^9.0.0", + "pouchdb-core": "^9.0.0", + "pouchdb-errors": "^9.0.0", + "pouchdb-find": "^9.0.0", + "pouchdb-mapreduce": "^9.0.0", + "pouchdb-merge": "^9.0.0", + "pouchdb-replication": "^9.0.0", + "pouchdb-utils": "^9.0.0", + "transform-pouch": "^2.0.0", + "werift": "^0.23.0" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.2.4", + "typescript": "5.9.3", + "vite": "^7.3.1", + "vitest": "^4.1.8" + } }, "src/apps/webapp": { "name": "livesync-webapp", - "version": "0.0.1", + "version": "0.25.76-webapp", + "dependencies": { + "octagonal-wheels": "^0.1.46" + }, "devDependencies": { + "@playwright/test": "^1.58.2", + "@sveltejs/vite-plugin-svelte": "^6.2.4", + "playwright": "^1.58.2", + "svelte": "5.41.1", "typescript": "5.9.3", - "vite": "^7.3.1" + "vite": "^7.3.1", + "vite-plugin-istanbul": "^8.0.0" } }, "src/apps/webpeer": { - "version": "0.0.0", + "version": "0.25.76-webpeer", + "dependencies": { + "octagonal-wheels": "^0.1.46" + }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^6.2.4", "@tsconfig/svelte": "^5.0.8", diff --git a/package.json b/package.json index 9392cbe..98bc88b 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "eslint-plugin-svelte": "^3.15.0", "events": "^3.3.0", "globals": "^14.0.0", + "@playwright/test": "^1.58.2", "playwright": "^1.58.2", "postcss": "^8.5.6", "pouchdb-adapter-http": "^9.0.0", @@ -121,7 +122,6 @@ "typescript": "5.9.3", "typescript-eslint": "^8.61.0", "vite": "^7.3.1", - "vite-plugin-istanbul": "^8.0.0", "vitest": "^4.1.8", "webdriverio": "^9.27.0", "yaml": "^2.8.2" @@ -136,7 +136,6 @@ "@smithy/types": "^4.14.3", "@smithy/util-retry": "^4.4.5", "@trystero-p2p/nostr": "^0.24.0", - "chokidar": "^4.0.0", "diff-match-patch": "^1.0.5", "fflate": "^0.8.2", "idb": "^8.0.3", @@ -144,9 +143,7 @@ "minimatch": "^10.2.2", "obsidian": "^1.12.3", "octagonal-wheels": "^0.1.46", - "pouchdb-adapter-leveldb": "^9.0.0", "qrcode-generator": "^1.4.4", - "werift": "^0.23.0", "xxhash-wasm-102": "npm:xxhash-wasm@^1.0.2" }, "workspaces": [ diff --git a/src/apps/cli/Dockerfile b/src/apps/cli/Dockerfile index beed3b5..bf6b9bf 100644 --- a/src/apps/cli/Dockerfile +++ b/src/apps/cli/Dockerfile @@ -82,8 +82,8 @@ RUN apt-get update \ WORKDIR /deps -# runtime-package.json lists only the packages that Vite leaves external -COPY src/apps/cli/runtime-package.json ./package.json +# package.json lists only the packages that the CLI requires +COPY src/apps/cli/package.json ./package.json RUN npm install --omit=dev # ───────────────────────────────────────────────────────────────────────────── diff --git a/src/apps/cli/README.md b/src/apps/cli/README.md index 001e19c..edb1043 100644 --- a/src/apps/cli/README.md +++ b/src/apps/cli/README.md @@ -118,19 +118,26 @@ git submodule update --init --recursive # Install dependencies from the repository root npm install -# Build the CLI from its package directory +# Build the CLI from the repository root +npm run build -w self-hosted-livesync-cli + +# Or from the package directory cd src/apps/cli npm run build ``` -If `src/lib` is missing, `npm run build` now stops early with a targeted message -instead of a low-level Vite `ENOENT` error. +If `src/lib` is missing, the build process stops early with a targeted message instead of a low-level Vite `ENOENT` error. Run the CLI: ```bash -# Run with npm script (from repository root) -npm run --silent cli -- [database-path] [command] [args...] +# Run with npm workspace script (from repository root) +npm run cli -w self-hosted-livesync-cli -- [database-path] [command] [args...] + +# Or from the package directory +cd src/apps/cli +npm run cli -- [database-path] [command] [args...] + # Run the built executable directly node src/apps/cli/dist/index.cjs [database-path] [command] [args...] ``` diff --git a/src/apps/cli/package.json b/src/apps/cli/package.json index c95b3a6..3603bc0 100644 --- a/src/apps/cli/package.json +++ b/src/apps/cli/package.json @@ -38,6 +38,26 @@ "test:e2e:docker:p2p-sync": "RUN_BUILD=0 LIVESYNC_TEST_DOCKER=1 bash test/test-p2p-sync-linux.sh", "test:e2e:docker:all": "export RUN_BUILD=0 && npm run test:e2e:docker:setup-put-cat && npm run test:e2e:docker:push-pull && npm run test:e2e:docker:sync-two-local && npm run test:e2e:docker:mirror && npm run test:e2e:docker:remote-commands" }, - "dependencies": {}, - "devDependencies": {} + "dependencies": { + "chokidar": "^4.0.0", + "minimatch": "^10.2.2", + "octagonal-wheels": "^0.1.46", + "pouchdb-adapter-http": "^9.0.0", + "pouchdb-adapter-leveldb": "^9.0.0", + "pouchdb-core": "^9.0.0", + "pouchdb-errors": "^9.0.0", + "pouchdb-find": "^9.0.0", + "pouchdb-mapreduce": "^9.0.0", + "pouchdb-merge": "^9.0.0", + "pouchdb-replication": "^9.0.0", + "pouchdb-utils": "^9.0.0", + "transform-pouch": "^2.0.0", + "werift": "^0.23.0" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.2.4", + "typescript": "5.9.3", + "vite": "^7.3.1", + "vitest": "^4.1.8" + } } diff --git a/src/apps/cli/runtime-package.json b/src/apps/cli/runtime-package.json deleted file mode 100644 index 305d966..0000000 --- a/src/apps/cli/runtime-package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "livesync-cli-runtime", - "private": true, - "version": "0.0.0", - "description": "Runtime dependencies for Self-hosted LiveSync CLI Docker image", - "dependencies": { - "chokidar": "^4.0.0", - "commander": "^14.0.3", - "werift": "^0.22.9", - "pouchdb-adapter-http": "^9.0.0", - "pouchdb-adapter-idb": "^9.0.0", - "pouchdb-adapter-indexeddb": "^9.0.0", - "pouchdb-adapter-leveldb": "^9.0.0", - "pouchdb-adapter-memory": "^9.0.0", - "pouchdb-core": "^9.0.0", - "pouchdb-errors": "^9.0.0", - "pouchdb-find": "^9.0.0", - "pouchdb-mapreduce": "^9.0.0", - "pouchdb-merge": "^9.0.0", - "pouchdb-replication": "^9.0.0", - "pouchdb-utils": "^9.0.0", - "pouchdb-wrappers": "*", - "transform-pouch": "^2.0.0" - } -} diff --git a/src/apps/webapp/README.md b/src/apps/webapp/README.md index e65a4e0..ce1a6cb 100644 --- a/src/apps/webapp/README.md +++ b/src/apps/webapp/README.md @@ -35,8 +35,15 @@ npm install ### Development +From the repository root: + +```bash +npm run dev -w livesync-webapp +``` + +Or from the package directory: + ```bash -# Build the project (ensure you are in `src/apps/webapp` directory) cd src/apps/webapp npm run dev ``` @@ -45,8 +52,15 @@ This will start a development server at `http://localhost:3000`. ### Build +From the repository root: + +```bash +npm run build -w livesync-webapp +``` + +Or from the package directory: + ```bash -# Build the project (ensure you are in `src/apps/webapp` directory) cd src/apps/webapp npm run build ``` diff --git a/src/apps/webapp/package.json b/src/apps/webapp/package.json index bc6eaf1..7923b70 100644 --- a/src/apps/webapp/package.json +++ b/src/apps/webapp/package.json @@ -11,9 +11,16 @@ "run:docker": "docker run -p 8002:80 livesync-webapp", "preview": "vite preview" }, - "dependencies": {}, + "dependencies": { + "octagonal-wheels": "^0.1.46" + }, "devDependencies": { + "@playwright/test": "^1.58.2", + "@sveltejs/vite-plugin-svelte": "^6.2.4", + "playwright": "^1.58.2", + "svelte": "5.41.1", "typescript": "5.9.3", - "vite": "^7.3.1" + "vite": "^7.3.1", + "vite-plugin-istanbul": "^8.0.0" } } diff --git a/src/apps/webpeer/README.md b/src/apps/webpeer/README.md index 81a2af5..5494bd2 100644 --- a/src/apps/webpeer/README.md +++ b/src/apps/webpeer/README.md @@ -13,13 +13,20 @@ This pseudo client actually receives the data from other devices, and sends if s ## How to use it? -We can build the application by running the following command: +We can build the application from the repository root by running the following command: ```bash -$ deno task build +npm run build -w webpeer ``` -Then, open the `dist/index.html` in the browser. It can be configured as the same as the Self-hosted LiveSync (Same components are used[^1]). +Or from the package directory: + +```bash +cd src/apps/webpeer +npm run build +``` + +Then, open `dist/index.html` in the browser. It can be configured in the same way as Self-hosted LiveSync (the same components are used[^1]). ## Some notes diff --git a/src/apps/webpeer/package.json b/src/apps/webpeer/package.json index 8a1f9d0..3458641 100644 --- a/src/apps/webpeer/package.json +++ b/src/apps/webpeer/package.json @@ -11,7 +11,9 @@ "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json" }, - "dependencies": {}, + "dependencies": { + "octagonal-wheels": "^0.1.46" + }, "devDependencies": { "eslint-plugin-svelte": "^3.15.0", "@sveltejs/vite-plugin-svelte": "^6.2.4",