@thetinkerinc/sprout 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +3 -0
- package/dist/navigation/index.d.ts +3 -0
- package/dist/navigation/index.js +22 -0
- package/package.json +12 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { page } from '$app/state';
|
|
2
|
+
import { goto } from '$app/navigation';
|
|
3
|
+
import { resolve } from '$app/paths';
|
|
4
|
+
export async function updateSearch(params) {
|
|
5
|
+
const currentParams = page.url.searchParams;
|
|
6
|
+
Object.entries(params).forEach(([k, v]) => {
|
|
7
|
+
if (v) {
|
|
8
|
+
currentParams.set(k, v);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
currentParams.delete(k);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
let query = currentParams.toString();
|
|
15
|
+
if (query) {
|
|
16
|
+
query = '?' + query;
|
|
17
|
+
}
|
|
18
|
+
await goto(resolve((page.url.pathname + query)), {
|
|
19
|
+
replaceState: true,
|
|
20
|
+
invalidateAll: true
|
|
21
|
+
});
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thetinkerinc/sprout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"svelte"
|
|
8
|
+
],
|
|
5
9
|
"scripts": {
|
|
6
10
|
"dev": "vite dev",
|
|
7
11
|
"build": "vite build && npm run prepack",
|
|
@@ -17,6 +21,9 @@
|
|
|
17
21
|
"release": "run-s build upload",
|
|
18
22
|
"cf-typegen": "wrangler types src/worker-configuration.d.ts"
|
|
19
23
|
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"sprout": "./dist/cli/index.js"
|
|
26
|
+
},
|
|
20
27
|
"files": [
|
|
21
28
|
"dist",
|
|
22
29
|
"!dist/**/*.test.*",
|
|
@@ -24,7 +31,6 @@
|
|
|
24
31
|
],
|
|
25
32
|
"svelte": "./dist/index.js",
|
|
26
33
|
"types": "./dist/index.d.ts",
|
|
27
|
-
"type": "module",
|
|
28
34
|
"exports": {
|
|
29
35
|
".": {
|
|
30
36
|
"types": "./dist/index.d.ts",
|
|
@@ -42,6 +48,10 @@
|
|
|
42
48
|
"types": "./dist/auth/index.d.ts",
|
|
43
49
|
"svelte": "./dist/auth/index.js"
|
|
44
50
|
},
|
|
51
|
+
"./navigation": {
|
|
52
|
+
"types": "./dist/navigation/index.d.ts",
|
|
53
|
+
"svelte": "./dist/navigation/index.js"
|
|
54
|
+
},
|
|
45
55
|
"./vite": {
|
|
46
56
|
"types": "./dist/vite/index.d.ts",
|
|
47
57
|
"import": "./dist/vite/index.js"
|
|
@@ -81,9 +91,6 @@
|
|
|
81
91
|
"typescript-eslint": "^8.51.0",
|
|
82
92
|
"vite": "^7.3.0"
|
|
83
93
|
},
|
|
84
|
-
"keywords": [
|
|
85
|
-
"svelte"
|
|
86
|
-
],
|
|
87
94
|
"dependencies": {
|
|
88
95
|
"@thetinkerinc/commander": "^0.1.4",
|
|
89
96
|
"kysely": "^0.28.9",
|