Skip to content

Commit da98c89

Browse files
chore: switch to tinyglobby (#15388)
* chore: switch to tinyglobby * update snapshot * update parameter name * changeset * delete changeset --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 3d59e84 commit da98c89

File tree

8 files changed

+77
-198
lines changed

8 files changed

+77
-198
lines changed

packages/svelte/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@
137137
"@rollup/plugin-virtual": "^3.0.2",
138138
"@types/aria-query": "^5.0.4",
139139
"@types/node": "^20.11.5",
140-
"dts-buddy": "^0.5.3",
140+
"dts-buddy": "^0.5.5",
141141
"esbuild": "^0.21.5",
142142
"rollup": "^4.22.4",
143143
"source-map": "^0.7.4",
144-
"tiny-glob": "^0.2.9",
144+
"tinyglobby": "^0.2.12",
145145
"typescript": "^5.5.4",
146146
"vitest": "^2.1.9"
147147
},

packages/svelte/tests/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @import { CompileOptions } from '#compiler' */
22
import * as fs from 'node:fs';
33
import * as path from 'node:path';
4-
import glob from 'tiny-glob/sync.js';
4+
import { globSync } from 'tinyglobby';
55
import { VERSION, compile, compileModule, preprocess } from 'svelte/compiler';
66
import { vi } from 'vitest';
77

@@ -70,7 +70,7 @@ export async function compile_directory(
7070

7171
fs.rmSync(output_dir, { recursive: true, force: true });
7272

73-
for (let file of glob('**', { cwd, filesOnly: true })) {
73+
for (let file of globSync('**', { cwd, onlyFiles: true })) {
7474
if (file.startsWith('_')) continue;
7575

7676
let text = fs.readFileSync(`${cwd}/${file}`, 'utf-8').replace(/\r\n/g, '\n');

packages/svelte/tests/preprocess/samples/script/expected_map.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 3,
3-
"mappings": "AAAA,CAAC,MAAM,CAAC;AACR,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAc,CAAC,CAAC;AAC7B,CAAC,CAAC,MAAM",
3+
"mappings": "AAAA,CAAC,MAAM;AACP,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAc,CAAC;AAC5B,CAAC,CAAC,MAAM",
44
"names": [],
55
"sources": [
66
"input.svelte"

packages/svelte/tests/runtime-legacy/shared.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as fs from 'node:fs';
22
import { setImmediate } from 'node:timers/promises';
3-
import glob from 'tiny-glob/sync.js';
3+
import { globSync } from 'tinyglobby';
44
import { createClassComponent } from 'svelte/legacy';
55
import { proxy } from 'svelte/internal/client';
66
import { flushSync, hydrate, mount, unmount } from 'svelte';
@@ -257,7 +257,7 @@ async function run_test_variant(
257257
raf.reset();
258258

259259
// Put things we need on window for testing
260-
const styles = glob('**/*.css', { cwd: `${cwd}/_output/client` })
260+
const styles = globSync('**/*.css', { cwd: `${cwd}/_output/client` })
261261
.map((file) => fs.readFileSync(`${cwd}/_output/client/${file}`, 'utf-8'))
262262
.join('\n')
263263
.replace(/\/\*<\/?style>\*\//g, '');

packages/svelte/tests/snapshot/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as fs from 'node:fs';
22
import { assert, expect } from 'vitest';
3-
import glob from 'tiny-glob/sync.js';
3+
import { globSync } from 'tinyglobby';
44
import { compile_directory } from '../helpers.js';
55
import { suite, type BaseTest } from '../suite.js';
66
import { VERSION } from 'svelte/compiler';
@@ -18,8 +18,8 @@ const { test, run } = suite<SnapshotTest>(async (config, cwd) => {
1818
fs.rmSync(`${cwd}/_expected`, { recursive: true, force: true });
1919
fs.cpSync(`${cwd}/_output`, `${cwd}/_expected`, { recursive: true, force: true });
2020
} else {
21-
const actual = glob('**', { cwd: `${cwd}/_output`, filesOnly: true });
22-
const expected = glob('**', { cwd: `${cwd}/_expected`, filesOnly: true });
21+
const actual = globSync('**', { cwd: `${cwd}/_output`, onlyFiles: true });
22+
const expected = globSync('**', { cwd: `${cwd}/_expected`, onlyFiles: true });
2323

2424
assert.deepEqual(actual, expected);
2525

playgrounds/sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
1818
"polka": "^1.0.0-next.25",
1919
"svelte": "workspace:*",
20-
"tiny-glob": "^0.2.9",
20+
"tinyglobby": "^0.2.12",
2121
"vite": "^5.4.14",
2222
"vite-plugin-inspect": "^0.8.4"
2323
}

playgrounds/sandbox/run.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'node:fs';
22
import * as path from 'node:path';
33
import { fileURLToPath } from 'node:url';
44
import { parseArgs } from 'node:util';
5-
import glob from 'tiny-glob/sync.js';
5+
import { globSync } from 'tinyglobby';
66
import { compile, compileModule, parse, migrate } from 'svelte/compiler';
77

88
const argv = parseArgs({ options: { runes: { type: 'boolean' } }, args: process.argv.slice(2) });
@@ -35,8 +35,8 @@ function write(file, contents) {
3535
fs.writeFileSync(file, contents);
3636
}
3737

38-
const svelte_modules = glob('**/*.svelte', { cwd: `${cwd}/src` });
39-
const js_modules = glob('**/*.js', { cwd: `${cwd}/src` });
38+
const svelte_modules = globSync('**/*.svelte', { cwd: `${cwd}/src` });
39+
const js_modules = globSync('**/*.js', { cwd: `${cwd}/src` });
4040

4141
for (const generate of /** @type {const} */ (['client', 'server'])) {
4242
console.error(`\n--- generating ${generate} ---\n`);

0 commit comments

Comments
 (0)