sveltekit-ui 1.1.68 → 1.1.69
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.
|
@@ -2,7 +2,6 @@ import { get_user_interface, set_closurable } from "../../client/index.js"
|
|
|
2
2
|
import { create_alert_manager } from "../Alert/index.svelte.js"
|
|
3
3
|
import { create_checkbox_manager } from "../Checkbox/index.svelte.js"
|
|
4
4
|
import { create_confetti_manager } from "../Confetti/index.svelte.js"
|
|
5
|
-
import { goto } from "$app/navigation"
|
|
6
5
|
|
|
7
6
|
export function create_layout_manager(config) {
|
|
8
7
|
let is_dark_theme = $state(true)
|
|
@@ -181,7 +180,7 @@ export function create_layout_manager(config) {
|
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
function to_home() {
|
|
184
|
-
|
|
183
|
+
goto_path("/")
|
|
185
184
|
nav_link_clicks += 1
|
|
186
185
|
}
|
|
187
186
|
|
|
@@ -189,7 +188,7 @@ export function create_layout_manager(config) {
|
|
|
189
188
|
|
|
190
189
|
function goto_path(slashed_path) {
|
|
191
190
|
is_full_nav_toggled_on = false
|
|
192
|
-
|
|
191
|
+
window.location.href = slashed_path
|
|
193
192
|
}
|
|
194
193
|
|
|
195
194
|
function init(config) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sveltekit-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.69",
|
|
4
4
|
"description": "A SvelteKit UI component library for building modern web applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,12 +14,16 @@
|
|
|
14
14
|
"dev": "vite dev",
|
|
15
15
|
"build": "vite build",
|
|
16
16
|
"preview": "vite preview",
|
|
17
|
-
"package": "svelte-package -t false"
|
|
17
|
+
"package": "svelte-package -t false",
|
|
18
|
+
"clean:dist": "node ./scripts/clean-dist.js",
|
|
19
|
+
"version:available": "node ./scripts/use-next-npm-version.js",
|
|
20
|
+
"postpublish": "npm run clean:dist",
|
|
21
|
+
"publish:npm": "npm run package && npm run version:available && (npm whoami >/dev/null 2>&1 || npm login --auth-type=web) && npm publish"
|
|
18
22
|
},
|
|
19
23
|
"dependencies": {
|
|
20
24
|
"context-filter-polyfill": "^0.3.23",
|
|
21
25
|
"qr-code-styling": "^1.9.2",
|
|
22
|
-
"svelte": "^5.
|
|
26
|
+
"svelte": "^5.56.0"
|
|
23
27
|
},
|
|
24
28
|
"peerDependencies": {
|
|
25
29
|
"@sveltejs/kit": "^2.22.2"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { rmSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
const isDryRun = process.env.npm_config_dry_run === 'true' || process.argv.includes('--dry-run');
|
|
4
|
+
|
|
5
|
+
if (isDryRun) {
|
|
6
|
+
console.log('Dry run detected; keeping dist.');
|
|
7
|
+
process.exit(0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
rmSync(new URL('../dist', import.meta.url), { recursive: true, force: true });
|
|
11
|
+
console.log('Deleted dist.');
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
3
|
+
|
|
4
|
+
const packagePath = new URL('../package.json', import.meta.url);
|
|
5
|
+
const lockPath = new URL('../package-lock.json', import.meta.url);
|
|
6
|
+
const isDryRun = process.argv.includes('--dry-run');
|
|
7
|
+
|
|
8
|
+
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8'));
|
|
9
|
+
const versions = getPublishedVersions(packageJson.name);
|
|
10
|
+
const versionSet = new Set(versions);
|
|
11
|
+
const nextVersion = getAvailableVersion(packageJson.version, versionSet);
|
|
12
|
+
|
|
13
|
+
if (nextVersion === packageJson.version) {
|
|
14
|
+
console.log(`${packageJson.name}@${packageJson.version} has not been published yet; keeping it.`);
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
console.log(`${packageJson.name}@${packageJson.version} is already published; using ${nextVersion}.`);
|
|
19
|
+
|
|
20
|
+
if (isDryRun) {
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
packageJson.version = nextVersion;
|
|
25
|
+
writeJson(packagePath, packageJson);
|
|
26
|
+
|
|
27
|
+
if (existsSync(lockPath)) {
|
|
28
|
+
const lockJson = JSON.parse(readFileSync(lockPath, 'utf8'));
|
|
29
|
+
lockJson.version = nextVersion;
|
|
30
|
+
|
|
31
|
+
if (lockJson.packages?.['']) {
|
|
32
|
+
lockJson.packages[''].version = nextVersion;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
writeJson(lockPath, lockJson);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getPublishedVersions(packageName) {
|
|
39
|
+
try {
|
|
40
|
+
const output = execFileSync('npm', ['view', packageName, 'versions', '--json'], {
|
|
41
|
+
encoding: 'utf8',
|
|
42
|
+
stdio: ['ignore', 'pipe', 'pipe']
|
|
43
|
+
}).trim();
|
|
44
|
+
|
|
45
|
+
if (!output) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const parsed = JSON.parse(output);
|
|
50
|
+
return Array.isArray(parsed) ? parsed : [parsed];
|
|
51
|
+
} catch (error) {
|
|
52
|
+
const stderr = error.stderr?.toString() ?? '';
|
|
53
|
+
|
|
54
|
+
if (stderr.includes('E404')) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getAvailableVersion(version, publishedVersions) {
|
|
63
|
+
if (!/^\d+\.\d+\.\d+$/.test(version)) {
|
|
64
|
+
throw new Error(`Cannot auto-bump non-standard version "${version}". Update package.json manually.`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let [major, minor, patch] = version.split('.').map(Number);
|
|
68
|
+
let candidate = version;
|
|
69
|
+
|
|
70
|
+
while (publishedVersions.has(candidate)) {
|
|
71
|
+
patch += 1;
|
|
72
|
+
candidate = `${major}.${minor}.${patch}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return candidate;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function writeJson(path, value) {
|
|
79
|
+
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);
|
|
80
|
+
}
|
|
@@ -2,7 +2,6 @@ import { get_user_interface, set_closurable } from "$lib/client/index.js"
|
|
|
2
2
|
import { create_alert_manager } from "$lib/Components/Alert/index.svelte.js"
|
|
3
3
|
import { create_checkbox_manager } from "$lib/Components/Checkbox/index.svelte.js"
|
|
4
4
|
import { create_confetti_manager } from "$lib/Components/Confetti/index.svelte.js"
|
|
5
|
-
import { goto } from "$app/navigation"
|
|
6
5
|
|
|
7
6
|
export function create_layout_manager(config) {
|
|
8
7
|
let is_dark_theme = $state(true)
|
|
@@ -181,7 +180,7 @@ export function create_layout_manager(config) {
|
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
function to_home() {
|
|
184
|
-
|
|
183
|
+
goto_path("/")
|
|
185
184
|
nav_link_clicks += 1
|
|
186
185
|
}
|
|
187
186
|
|
|
@@ -189,7 +188,7 @@ export function create_layout_manager(config) {
|
|
|
189
188
|
|
|
190
189
|
function goto_path(slashed_path) {
|
|
191
190
|
is_full_nav_toggled_on = false
|
|
192
|
-
|
|
191
|
+
window.location.href = slashed_path
|
|
193
192
|
}
|
|
194
193
|
|
|
195
194
|
function init(config) {
|