Skip to content

Commit f3b7d85

Browse files
authored
Bundle components so Svelte isn't needed to use (#7)
* Add ci/cd step * Add empty changeset * Remove circular dependencies * Clean up errors in check * Install playwright in ci * Run the correct check script * Also install dependencies for playwright * Brings bundling back to how it was so it can be used as per syncit documentation. This allows you to use it without Svelte * Fix typing * Run e2e tests in test mode
1 parent a0eedbb commit f3b7d85

File tree

7 files changed

+272
-577
lines changed

7 files changed

+272
-577
lines changed

.changeset/serious-pumas-wait.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@syncit/ui': patch
3+
---
4+
5+
Fix bundling of @syncit/ui to be consistent with the Syncit documentation
6+
Fix bug in state machine using deprecated API

packages/ui/package.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"dev": "vite dev",
66
"build": "vite build && npm run package",
77
"preview": "vite preview",
8-
"package": "svelte-kit sync && svelte-package && publint",
9-
"prepublish": "npm run package",
10-
"prepublishOnly": "npm run package",
8+
"package": "svelte-kit sync && publint",
9+
"prepublish": "npm run build",
10+
"prepublishOnly": "npm run build",
1111
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1212
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
1313
"test": "yarn test:unit && yarn test:e2e",
@@ -17,28 +17,19 @@
1717
"format": "prettier --plugin-search-dir . --write ."
1818
},
1919
"license": "MIT",
20-
"exports": {
21-
".": {
22-
"types": "./dist/index.d.ts",
23-
"svelte": "./dist/index.js"
24-
}
25-
},
2620
"files": [
2721
"dist"
2822
],
2923
"publishConfig": {
3024
"access": "public"
3125
},
32-
"peerDependencies": {
33-
"svelte": "^3.54.0"
34-
},
3526
"dependencies": {
3627
"@syncit/core": "^1.0.1",
3728
"@syncit/transporter": "^1.0.1",
3829
"copy-to-clipboard": "^3.3.1",
3930
"d3-scale": "^3.2.1",
4031
"konva": "^7.2.2",
41-
"nanoid": "^3.1.10",
32+
"nanoid": "^4.0.1",
4233
"pdfjs-dist": "^3.4.0",
4334
"rrweb": "^2.0.0-alpha.5"
4435
},
@@ -61,12 +52,13 @@
6152
"tslib": "^2.4.1",
6253
"typescript": "^4.9.3",
6354
"vite": "^4.1.4",
55+
"vite-plugin-dts": "^2.1.0",
6456
"vitest": "^0.29.2"
6557
},
66-
"main": "./dist/index.js",
67-
"module": "./dist/index.js",
68-
"unpkg": "./dist/index.js",
69-
"svelte": "./dist/index.js",
58+
"main": "./dist/ui.js",
59+
"module": "./dist/ui.js",
60+
"exports": "./dist/ui.js",
61+
"unpkg": "./dist/ui.umd.cjs",
7062
"types": "./dist/index.d.ts",
7163
"type": "module"
7264
}

packages/ui/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig, devices } from '@playwright/test';
33
export default defineConfig({
44
testDir: 'tests',
55
webServer: {
6-
command: 'npm run build && npm run preview',
6+
command: 'yarn run vite build -m test && yarn preview -m test',
77
port: 4173
88
},
99
/* Maximum time one test can run for. */

packages/ui/src/lib/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
latencies = [];
5151
sizes = [];
5252
});
53-
let current = service.state;
53+
let current = service.getSnapshot();
5454
5555
let controlService: ReturnType<typeof createAppControlService>;
5656
let controlCurrent: ReturnType<typeof createAppControlService>['state'];

0 commit comments

Comments
 (0)