Skip to content

Commit 9fe54cf

Browse files
committed
feat: big derived rework
1 parent 517a3a8 commit 9fe54cf

38 files changed

+7447
-3678
lines changed

.changeset/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ find the full documentation for it [in our repository](https://github.com/change
66

77
We have a quick list of common questions to get you started engaging with this project in
88
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
9-

.changeset/config.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": "@changesets/cli/changelog",
4-
"commit": false,
5-
"fixed": [],
6-
"linked": [],
7-
"access": "public",
8-
"baseBranch": "master",
9-
"updateInternalDependencies": "patch",
10-
"ignore": []
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
1111
}

.eslintrc.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
ignorePatterns: ['*.cjs'],
77
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
88
settings: {
9-
'svelte3/typescript': () => require('typescript')
9+
'svelte3/typescript': () => require('typescript'),
1010
},
1111
parserOptions: {
1212
sourceType: 'module',
13-
ecmaVersion: 2020
13+
ecmaVersion: 2020,
1414
},
1515
env: {
1616
browser: true,
1717
es2017: true,
18-
node: true
19-
}
18+
node: true,
19+
},
2020
};
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
name: "\U0001F41E Bug report"
22
description: Report an issue
33
body:
4-
- type: markdown
5-
attributes:
6-
value: |
7-
First thing first, thanks for reporting!
8-
- type: textarea
9-
id: bug-description
10-
attributes:
11-
label: Describe the bug
12-
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
13-
placeholder: Bug description
14-
validations:
15-
required: true
16-
- type: textarea
17-
id: reproduction
18-
attributes:
19-
label: Reproduction
20-
description: Please provide a link to a repo or better a stackblitz/replit that can reproduce the problem you ran into. This will speed up the fixing.
21-
placeholder: Reproduction
22-
validations:
23-
required: true
24-
- type: textarea
25-
id: logs
26-
attributes:
27-
label: Logs
28-
description: "Please include browser console and server logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text."
29-
render: shell
4+
- type: markdown
5+
attributes:
6+
value: |
7+
First thing first, thanks for reporting!
8+
- type: textarea
9+
id: bug-description
10+
attributes:
11+
label: Describe the bug
12+
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
13+
placeholder: Bug description
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: reproduction
18+
attributes:
19+
label: Reproduction
20+
description: Please provide a link to a repo or better a stackblitz/replit that can reproduce the problem you ran into. This will speed up the fixing.
21+
placeholder: Reproduction
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: logs
26+
attributes:
27+
label: Logs
28+
description: 'Please include browser console and server logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text.'
29+
render: shell
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
name: "\U0001F4A1 Feature Request"
22
description: Request a new feature
33
body:
4-
- type: markdown
5-
attributes:
6-
value: |
7-
Thank you for taking the time to propose a new idea
8-
- type: textarea
9-
id: problem
10-
attributes:
11-
label: Describe the problem
12-
description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
13-
placeholder: I would like to...
14-
validations:
15-
required: true
16-
- type: textarea
17-
id: solution
18-
attributes:
19-
label: Describe the proposed solution
20-
description: Try to provide a description of the API you would like to see implemented
21-
placeholder: I would like to see...
22-
validations:
23-
required: true
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thank you for taking the time to propose a new idea
8+
- type: textarea
9+
id: problem
10+
attributes:
11+
label: Describe the problem
12+
description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
13+
placeholder: I would like to...
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: solution
18+
attributes:
19+
label: Describe the proposed solution
20+
description: Try to provide a description of the API you would like to see implemented
21+
placeholder: I would like to see...
22+
validations:
23+
required: true

.github/workflows/release.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
name: Publish
22
on:
3-
push:
4-
branches:
5-
- "master"
3+
push:
4+
branches:
5+
- 'master'
66

77
concurrency: ${{ github.workflow }}-${{ github.ref }}
88

99
jobs:
10-
publish:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v3
14-
- uses: pnpm/action-setup@v2
15-
with:
16-
version: 8
17-
- uses: actions/setup-node@v3
18-
with:
19-
node-version: 16.x
20-
cache: "pnpm"
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: pnpm/action-setup@v2
15+
with:
16+
version: 8
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 16.x
20+
cache: 'pnpm'
2121

22-
- run: pnpm install --frozen-lockfile
23-
- name: Create Release Pull Request or Publish
24-
id: changesets
25-
uses: changesets/action@v1
26-
with:
27-
publish: pnpm run publish
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
- run: pnpm install --frozen-lockfile
23+
- name: Create Release Pull Request or Publish
24+
id: changesets
25+
uses: changesets/action@v1
26+
with:
27+
publish: pnpm run publish
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.prettierrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"trailingComma": "es5",
2+
"trailingComma": "all",
33
"tabWidth": 4,
4+
"useTabs": true,
45
"semi": true,
56
"singleQuote": true
6-
}
7+
}

CODE_OF_CONDUCT.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
24-
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
37-
professional setting
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
3838

3939
## Enforcement Responsibilities
4040

@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you want the fastest way to open a PR try out Codeflow
2828

2929
## Authors
3030

31-
- [@paoloricciuti](https://www.github.com/paoloricciuti)
31+
- [@paoloricciuti](https://www.github.com/paoloricciuti)
3232

3333
## Installation
3434

@@ -162,7 +162,6 @@ The count is {$count}
162162
<input bind:value={$count} type="number"/>
163163
```
164164

165-
166165
### Simple case (all parameters)
167166

168167
You can use the function queryParameters to get an object containing all the present search params.
@@ -183,8 +182,8 @@ assuming the page is `/?framework=svelte&isCool=true` the above code will show
183182

184183
```json
185184
{
186-
"framework": "svelte",
187-
"isCool": "true"
185+
"framework": "svelte",
186+
"isCool": "true"
188187
}
189188
```
190189

@@ -233,19 +232,19 @@ assuming the page is `/?framework=svelte&isCool=true` the above code will show
233232

234233
```json
235234
{
236-
"framework": "svelte",
237-
"isCool": "true",
238-
"username": null
235+
"framework": "svelte",
236+
"isCool": "true",
237+
"username": null
239238
}
240239
```
241240

242241
if we add username to the URL like this `/?framework=svelte&isCool=true&username=paoloricciuti` we will get
243242

244243
```json
245244
{
246-
"framework": "svelte",
247-
"isCool": "true",
248-
"username": "paoloricciuti"
245+
"framework": "svelte",
246+
"isCool": "true",
247+
"username": "paoloricciuti"
249248
}
250249
```
251250

@@ -276,19 +275,19 @@ assuming the page is `/?framework=svelte&isCool=true&username=paoloricciuti` the
276275

277276
```json
278277
{
279-
"framework": "svelte",
280-
"isCool": true,
281-
"username": null
278+
"framework": "svelte",
279+
"isCool": true,
280+
"username": null
282281
}
283282
```
284283

285284
notice that this time isCool it's a boolean and not a string anymore. With this particular transformation we've assured that if the url is the following `/?framework=svelte&isCool=false&username=paoloricciuti` or if the isCool parameter is completely missing like this `/?framework=svelte&username=paoloricciuti` we will get
286285

287286
```json
288287
{
289-
"framework": "svelte",
290-
"isCool": false,
291-
"username": null
288+
"framework": "svelte",
289+
"isCool": false,
290+
"username": null
292291
}
293292
```
294293

@@ -413,12 +412,12 @@ To set the configuration object you can pass it as a third parameter in case of
413412
If you ran into issues with vite you need to update your `vite.config.ts` or `vite.config.js` file to include the plugin exported from `sveltekit-search-params/plugin`. It's as simple as
414413

415414
```javascript
416-
import { sveltekit } from "@sveltejs/kit/vite";
417-
import { ssp } from "sveltekit-search-params/plugin";
415+
import { sveltekit } from '@sveltejs/kit/vite';
416+
import { ssp } from 'sveltekit-search-params/plugin';
418417

419418
/** @type {import('vite').UserConfig} */
420419
const config = {
421-
plugins: [ssp(), sveltekit()],
420+
plugins: [ssp(), sveltekit()],
422421
};
423422

424423
export default config;

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,38 @@
2626
"version:major": "npm version major",
2727
"build:landing": "vite build",
2828
"build": "svelte-kit sync && svelte-package -o package",
29+
"build:playground": "cd playground && pnpm run build",
30+
"preview:playground": "cd playground && pnpm run preview",
2931
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
3032
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
3133
"lint": "eslint .",
32-
"publish": "pnpm run build && changeset publish"
34+
"format": "prettier --write .",
35+
"publish": "pnpm run build && changeset publish",
36+
"test": "npm run test:integration && npm run test:unit",
37+
"test:integration": "playwright test",
38+
"test:unit": "vitest"
3339
},
3440
"devDependencies": {
3541
"@changesets/cli": "^2.26.0",
42+
"@playwright/test": "^1.40.1",
3643
"@sveltejs/adapter-static": "^1.0.0-next.47",
37-
"@sveltejs/kit": "^1.0.7",
44+
"@sveltejs/kit": "^1.29.1",
3845
"@sveltejs/package": "^2.0.0",
3946
"@typescript-eslint/eslint-plugin": "^5.27.0",
4047
"@typescript-eslint/parser": "^5.27.0",
4148
"eslint": "^8.16.0",
4249
"eslint-plugin-svelte3": "^4.0.0",
50+
"prettier": "^3.1.1",
51+
"prettier-plugin-svelte": "^3.1.2",
4352
"svelte": "^3.44.0",
4453
"svelte-check": "^2.7.1",
4554
"svelte-material-icons": "^2.0.4",
4655
"svelte-preprocess": "^4.10.6",
4756
"svelte-typewriter-store": "^0.0.5",
4857
"tslib": "^2.3.1",
4958
"typescript": "^4.7.4",
50-
"vite": "^4"
59+
"vite": "^4",
60+
"vitest": "^0.34.6"
5161
},
5262
"type": "module",
5363
"peerDependencies": {

0 commit comments

Comments
 (0)