From 1f203e291475fdac904edb507eadd448b4be3300 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Mon, 27 Sep 2021 16:29:45 +0300 Subject: [PATCH] Update Svelte component to new structure, redo tests with TypeScript and demos with API --- packages/sapper-demo/package.json | 1 - .../sapper-demo/src/components/Nav.svelte | 10 +- .../sapper-demo/src/routes/blog/index.svelte | 5 +- packages/svelte/api-extractor.json | 3 +- packages/svelte/jest.config.js | 15 + packages/svelte/offline/package.json | 16 + packages/svelte/offline/readme.md | 5 + packages/svelte/package-lock.json | 13577 +++++++--------- packages/svelte/package.json | 47 +- packages/svelte/rollup.config.js | 19 +- packages/svelte/src/functions.ts | 158 +- ...0-api-mock.test.js => 10-api-mock.test.ts} | 7 +- ....test.js => 20-rendering-from-api.test.ts} | 60 +- .../tests/api/30-changing-props.test.js | 375 - .../tests/api/fixtures/ChangeIcon.svelte | 19 - .../tests/api/fixtures/ChangeProps.svelte | 24 - .../svelte/tests/api/{load.js => load.ts} | 2 +- .../{10-basic.test.js => 10-basic.test.ts} | 21 +- .../{10-empty.test.js => 10-empty.test.ts} | 7 +- ...tributes.test.js => 20-attributes.test.ts} | 37 +- ...mensions.test.js => 20-dimensions.test.ts} | 29 +- .../{20-ids.test.js => 20-ids.test.ts} | 9 +- .../{20-inline.test.js => 20-inline.test.ts} | 21 +- ...ons.test.js => 20-transformations.test.ts} | 87 +- .../{10-basic.test.js => 10-basic.test.ts} | 21 +- .../{10-empty.test.js => 10-empty.test.ts} | 7 +- ...tributes.test.js => 20-attributes.test.ts} | 37 +- ...mensions.test.js => 20-dimensions.test.ts} | 21 +- .../{20-ids.test.js => 20-ids.test.ts} | 7 +- .../{20-inline.test.js => 20-inline.test.ts} | 21 +- ...{20-storage.test.js => 20-storage.test.ts} | 23 +- ...ons.test.js => 20-transformations.test.ts} | 85 +- packages/svelte/tests/tsconfig.json | 9 + packages/svelte/tsconfig-base.json | 17 + packages/svelte/tsconfig.json | 17 +- 35 files changed, 6476 insertions(+), 8343 deletions(-) create mode 100644 packages/svelte/jest.config.js create mode 100644 packages/svelte/offline/package.json create mode 100644 packages/svelte/offline/readme.md rename packages/svelte/tests/api/{10-api-mock.test.js => 10-api-mock.test.ts} (85%) rename packages/svelte/tests/api/{20-rendering-from-api.test.js => 20-rendering-from-api.test.ts} (76%) delete mode 100644 packages/svelte/tests/api/30-changing-props.test.js delete mode 100644 packages/svelte/tests/api/fixtures/ChangeIcon.svelte delete mode 100644 packages/svelte/tests/api/fixtures/ChangeProps.svelte rename packages/svelte/tests/api/{load.js => load.ts} (87%) rename packages/svelte/tests/iconify/{10-basic.test.js => 10-basic.test.ts} (67%) rename packages/svelte/tests/iconify/{10-empty.test.js => 10-empty.test.ts} (70%) rename packages/svelte/tests/iconify/{20-attributes.test.js => 20-attributes.test.ts} (58%) rename packages/svelte/tests/iconify/{20-dimensions.test.js => 20-dimensions.test.ts} (51%) rename packages/svelte/tests/iconify/{20-ids.test.js => 20-ids.test.ts} (96%) rename packages/svelte/tests/iconify/{20-inline.test.js => 20-inline.test.ts} (63%) rename packages/svelte/tests/iconify/{20-transformations.test.js => 20-transformations.test.ts} (51%) rename packages/svelte/tests/offline/{10-basic.test.js => 10-basic.test.ts} (65%) rename packages/svelte/tests/offline/{10-empty.test.js => 10-empty.test.ts} (71%) rename packages/svelte/tests/offline/{20-attributes.test.js => 20-attributes.test.ts} (57%) rename packages/svelte/tests/offline/{20-dimensions.test.js => 20-dimensions.test.ts} (56%) rename packages/svelte/tests/offline/{20-ids.test.js => 20-ids.test.ts} (96%) rename packages/svelte/tests/offline/{20-inline.test.js => 20-inline.test.ts} (62%) rename packages/svelte/tests/offline/{20-storage.test.js => 20-storage.test.ts} (86%) rename packages/svelte/tests/offline/{20-transformations.test.js => 20-transformations.test.ts} (51%) create mode 100644 packages/svelte/tests/tsconfig.json create mode 100644 packages/svelte/tsconfig-base.json diff --git a/packages/sapper-demo/package.json b/packages/sapper-demo/package.json index b679001..cf43c28 100644 --- a/packages/sapper-demo/package.json +++ b/packages/sapper-demo/package.json @@ -22,7 +22,6 @@ "@babel/plugin-transform-runtime": "^7.12.1", "@babel/preset-env": "^7.12.7", "@babel/runtime": "^7.12.5", - "@iconify-icons/bi": "^1.0.0", "@iconify-icons/openmoji": "^1.0.9", "@iconify/svelte": "^2.1.0-beta.1", "@rollup/plugin-babel": "^5.2.1", diff --git a/packages/sapper-demo/src/components/Nav.svelte b/packages/sapper-demo/src/components/Nav.svelte index 348293a..fefaaf9 100644 --- a/packages/sapper-demo/src/components/Nav.svelte +++ b/packages/sapper-demo/src/components/Nav.svelte @@ -1,9 +1,5 @@ @@ -67,13 +63,13 @@