Skip to content

Commit

Permalink
Bundle components so Svelte isn't needed to use (#7)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Juice10 committed Mar 14, 2023
1 parent a0eedbb commit f3b7d85
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 577 deletions.
6 changes: 6 additions & 0 deletions .changeset/serious-pumas-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@syncit/ui': patch
---

Fix bundling of @syncit/ui to be consistent with the Syncit documentation
Fix bug in state machine using deprecated API
26 changes: 9 additions & 17 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"dev": "vite dev",
"build": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublish": "npm run package",
"prepublishOnly": "npm run package",
"package": "svelte-kit sync && publint",
"prepublish": "npm run build",
"prepublishOnly": "npm run build",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "yarn test:unit && yarn test:e2e",
Expand All @@ -17,28 +17,19 @@
"format": "prettier --plugin-search-dir . --write ."
},
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"svelte": "./dist/index.js"
}
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"svelte": "^3.54.0"
},
"dependencies": {
"@syncit/core": "^1.0.1",
"@syncit/transporter": "^1.0.1",
"copy-to-clipboard": "^3.3.1",
"d3-scale": "^3.2.1",
"konva": "^7.2.2",
"nanoid": "^3.1.10",
"nanoid": "^4.0.1",
"pdfjs-dist": "^3.4.0",
"rrweb": "^2.0.0-alpha.5"
},
Expand All @@ -61,12 +52,13 @@
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"vite": "^4.1.4",
"vite-plugin-dts": "^2.1.0",
"vitest": "^0.29.2"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"unpkg": "./dist/index.js",
"svelte": "./dist/index.js",
"main": "./dist/ui.js",
"module": "./dist/ui.js",
"exports": "./dist/ui.js",
"unpkg": "./dist/ui.umd.cjs",
"types": "./dist/index.d.ts",
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/ui/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: 'tests',
webServer: {
command: 'npm run build && npm run preview',
command: 'yarn run vite build -m test && yarn preview -m test',
port: 4173
},
/* Maximum time one test can run for. */
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/lib/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
latencies = [];
sizes = [];
});
let current = service.state;
let current = service.getSnapshot();
let controlService: ReturnType<typeof createAppControlService>;
let controlCurrent: ReturnType<typeof createAppControlService>['state'];
Expand Down
Loading

0 comments on commit f3b7d85

Please sign in to comment.