Skip to content

Commit 78a4238

Browse files
committed
stable order
1 parent 84b229a commit 78a4238

File tree

116 files changed

+561
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+561
-523
lines changed

apps/svelte.dev/scripts/sync-packages/index.ts

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ for (const pkg of packages) {
3535
const cleanPkg = pkg.replace('@', '').replace('/', '-');
3636
const jsonPath = path.join(registryFolder, `${cleanPkg}.json`);
3737
if (!fs.existsSync(jsonPath)) {
38-
const p = await fetchData(pkg);
39-
writeButPretty(jsonPath, JSON.stringify(p, null, 2));
38+
const p = await getNpmAndGitHubData(pkg);
39+
writeJsonData(jsonPath, p);
4040
logsAtTheEnd.push({ type: 'new_json_file', pkg, extra: `created -> ${jsonPath}` });
4141
}
4242
}
@@ -72,7 +72,7 @@ for (let i = 0; i < registryJsonFiles.length; i += batch) {
7272
const batchFiles = registryJsonFiles.slice(i, i + batch);
7373
await Promise.all(
7474
batchFiles.map(async (pkg) => {
75-
await refreshJson(path.join(registryFolder, pkg));
75+
await refreshJsonFile(path.join(registryFolder, pkg));
7676
})
7777
);
7878
}
@@ -106,7 +106,7 @@ function theEnd(val: number) {
106106
process.exit(val);
107107
}
108108

109-
async function fetchData(pkg: string): Promise<PackageKey & PackageNpm & PackageGithub> {
109+
async function getNpmAndGitHubData(pkg: string): Promise<PackageKey & PackageNpm & PackageGithub> {
110110
const [npmInfo, npmDlInfo] = await Promise.all([
111111
fetch(`https://registry.npmjs.org/${pkg}`).then((r) => r.json()),
112112
fetch(`https://api.npmjs.org/downloads/point/last-week/${pkg}`).then((r) => r.json())
@@ -174,11 +174,11 @@ async function fetchData(pkg: string): Promise<PackageKey & PackageNpm & Package
174174
};
175175
}
176176

177-
async function refreshJson(fullPath: string) {
177+
async function refreshJsonFile(fullPath: string) {
178178
console.log(`Refreshing:`, fullPath);
179179

180180
const currentJson = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));
181-
const newData = await fetchData(currentJson.name);
181+
const newData = await getNpmAndGitHubData(currentJson.name);
182182

183183
// remove all undefined values
184184
for (const key in newData) {
@@ -215,10 +215,41 @@ async function refreshJson(fullPath: string) {
215215
logsAtTheEnd.push({ type: 'deprecated', pkg: data.name, extra: `${data.deprecated_reason}` });
216216
}
217217

218-
writeButPretty(fullPath, JSON.stringify(data, null, 2));
218+
writeJsonData(fullPath, data);
219219
}
220220

221-
function writeButPretty(path: string, data: any) {
222-
fs.writeFileSync(path, data);
221+
function writeJsonData(path: string, data: any) {
222+
const keysOrder: (keyof PackageKey | keyof PackageNpm | keyof PackageGithub)[] = [
223+
'name',
224+
'description',
225+
'repo_url',
226+
'authors',
227+
'homepage',
228+
'version',
229+
'deprecated_reason',
230+
'downloads',
231+
'github_stars',
232+
'updated',
233+
'svelte_range',
234+
'kit_range',
235+
'typescript',
236+
'runes',
237+
'last_rune_check_version'
238+
];
239+
240+
const sortedData: Record<string, any> = {};
241+
for (const key of keysOrder) {
242+
if (data[key] !== undefined) {
243+
sortedData[key] = data[key];
244+
}
245+
}
246+
// all all the remaining keys
247+
for (const key in data) {
248+
if (!keysOrder.includes(key as keyof PackageKey | keyof PackageNpm | keyof PackageGithub)) {
249+
sortedData[key] = data[key];
250+
}
251+
}
252+
253+
fs.writeFileSync(path, JSON.stringify(sortedData, null, 2));
223254
execSync(`prettier --write ${path}`);
224255
}

apps/svelte.dev/src/lib/server/content.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,14 @@ export const examples = index.examples.children;
156156
/**
157157
* Represents a Svelte package in the registry
158158
*/
159-
export interface Package extends PackageNpm, PackageGithub, PackageCalculated, PackageSv {
159+
export interface Package
160+
extends PackageKey,
161+
PackageNpm,
162+
PackageGithub,
163+
PackageCalculated,
164+
PackageSv {}
165+
166+
export interface PackageKey {
160167
/** Package name */
161168
name: string;
162169
}
@@ -194,10 +201,10 @@ export interface PackageNpm {
194201

195202
// SHOULD BE CALCULATED WHEN GET FROM NPM
196203
/** @deprecated */
197-
typescript: boolean;
204+
typescript?: boolean;
198205
// SHOULD BE CALCULATED WHEN GET FROM NPM
199206
/** @deprecated */
200-
runes: boolean;
207+
runes?: boolean;
201208
// SHOULD BE DELETED (in *.json files as well)
202209
/** @deprecated */
203210
last_rune_check_version?: string;

apps/svelte.dev/src/lib/server/generated/registry/ai-sdk-svelte.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"repo_url": "https://github.com/vercel/ai",
55
"authors": ["jaredpalmer", "vercel-release-bot", "matheuss", "matt.straka"],
66
"homepage": "https://ai-sdk.dev/docs",
7+
"version": "3.0.56",
78
"downloads": 321958,
8-
"updated": "2025-09-26T20:24:38.871Z",
9-
"runes": true,
109
"github_stars": 18042,
11-
"typescript": true,
12-
"version": "3.0.56",
10+
"updated": "2025-09-26T20:24:38.871Z",
1311
"svelte_range": "^5.31.0",
12+
"typescript": true,
13+
"runes": true,
1414
"last_rune_check_version": "2.1.9"
1515
}

apps/svelte.dev/src/lib/server/generated/registry/altcha.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"repo_url": "https://github.com/altcha-org/altcha",
55
"authors": ["ovx"],
66
"homepage": "https://altcha.org",
7+
"version": "2.2.3",
78
"downloads": 17457,
8-
"updated": "2025-09-09T04:16:51.418Z",
9-
"runes": false,
109
"github_stars": 1544,
11-
"typescript": true,
12-
"version": "2.2.3",
10+
"updated": "2025-09-09T04:16:51.418Z",
1311
"svelte_range": "^5.28.6",
12+
"typescript": true,
13+
"runes": false,
1414
"last_rune_check_version": "1.4.2"
1515
}

apps/svelte.dev/src/lib/server/generated/registry/amplify-adapter.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"repo_url": "https://github.com/gzimbron/amplify-adapter",
55
"authors": ["zimbronapps"],
66
"homepage": "https://github.com/gzimbron/amplify-adapter#readme",
7+
"version": "1.2.3",
78
"downloads": 1780,
8-
"updated": "2025-09-11T19:17:42.448Z",
9-
"runes": false,
109
"github_stars": 32,
11-
"typescript": true,
12-
"version": "1.2.3",
10+
"updated": "2025-09-11T19:17:42.448Z",
1311
"kit_range": "^2.4.0",
12+
"typescript": true,
13+
"runes": false,
1414
"last_rune_check_version": "0.2.0"
1515
}

apps/svelte.dev/src/lib/server/generated/registry/ark-ui-svelte.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"repo_url": "https://github.com/chakra-ui/ark",
55
"authors": ["segunadebayo", "schroetier"],
66
"homepage": "https://ark-ui.com",
7+
"version": "5.10.0",
78
"downloads": 395,
8-
"updated": "2025-09-17T08:32:17.119Z",
9-
"runes": true,
109
"github_stars": 4651,
11-
"typescript": true,
12-
"version": "5.10.0",
10+
"updated": "2025-09-17T08:32:17.119Z",
1311
"svelte_range": ">=5.20.0",
1412
"kit_range": "2.39.1",
13+
"typescript": true,
14+
"runes": true,
1515
"last_rune_check_version": "0.3.0"
1616
}

apps/svelte.dev/src/lib/server/generated/registry/auth-sveltekit.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"repo_url": "https://github.com/nextauthjs/next-auth",
55
"authors": ["bekacru"],
66
"homepage": "https://sveltekit.authjs.dev",
7+
"version": "1.10.0",
78
"downloads": 34865,
9+
"github_stars": 27547,
810
"updated": "2025-06-22T12:06:03.840Z",
9-
"runes": false,
10-
"github_stars": 27548,
11-
"typescript": true,
12-
"version": "1.10.0",
1311
"svelte_range": "^3.54.0 || ^4.0.0 || ^5.0.0-0",
1412
"kit_range": "^1.0.0 || ^2.0.0",
13+
"typescript": true,
14+
"runes": false,
1515
"last_rune_check_version": "1.8.0"
1616
}

apps/svelte.dev/src/lib/server/generated/registry/better-auth.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"repo_url": "https://github.com/better-auth/better-auth",
55
"authors": ["bekacru"],
66
"homepage": "https://github.com/better-auth/better-auth#readme",
7+
"version": "1.3.18",
78
"downloads": 323734,
9+
"github_stars": 20924,
810
"updated": "2025-09-25T23:45:17.956Z",
9-
"runes": false,
10-
"github_stars": 20922,
11-
"typescript": true,
12-
"version": "1.3.18",
13-
"last_rune_check_version": "1.3.12",
1411
"svelte_range": "^4.0.0 || ^5.0.0",
15-
"kit_range": "^2.0.0"
12+
"kit_range": "^2.0.0",
13+
"typescript": true,
14+
"runes": false,
15+
"last_rune_check_version": "1.3.12"
1616
}

apps/svelte.dev/src/lib/server/generated/registry/bits-ui.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"repo_url": "https://github.com/huntabyte/bits-ui",
55
"authors": ["huntabyte"],
66
"homepage": "https://github.com/huntabyte/bits-ui#readme",
7+
"version": "2.11.4",
78
"downloads": 238417,
8-
"updated": "2025-09-24T22:52:43.701Z",
9-
"runes": true,
109
"github_stars": 2626,
11-
"typescript": true,
12-
"version": "2.11.4",
10+
"updated": "2025-09-24T22:52:43.701Z",
1311
"svelte_range": "^5.33.0",
1412
"kit_range": "^2.42.0",
13+
"typescript": true,
14+
"runes": true,
1515
"last_rune_check_version": "1.3.19"
1616
}

apps/svelte.dev/src/lib/server/generated/registry/carbon-components-svelte.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"repo_url": "https://github.com/carbon-design-system/carbon-components-svelte",
55
"authors": ["metonym"],
66
"homepage": "https://svelte.carbondesignsystem.com/",
7+
"version": "0.89.7",
78
"downloads": 14259,
8-
"updated": "2025-09-05T16:18:10.948Z",
9-
"runes": false,
109
"github_stars": 2827,
10+
"updated": "2025-09-05T16:18:10.948Z",
1111
"typescript": true,
12-
"version": "0.89.7",
12+
"runes": false,
1313
"last_rune_check_version": "0.88.4"
1414
}

0 commit comments

Comments
 (0)