An experimental TypeSpec syntax for Lexicon

Replace globby with tinyglobby #8

globby was getting into an endless recursive readdir loop on my machine. presumably it does not pre-filter paths and was scanning node_modules while looking for externals (instead of just lexicons/**/*.json) and there was an infinite cycle loop in there. tinyglobby doesn't have this problem

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:nmc77zslrwafxn75j66mep6o/sh.tangled.repo.pull/3mgkxqjugpf22
+34 -8
Diff #0
+3 -3
packages/cli/package.json
··· 28 28 "license": "MIT", 29 29 "dependencies": { 30 30 "@typespec/compiler": "^1.4.0", 31 - "globby": "^14.0.0", 32 31 "picocolors": "^1.1.1", 32 + "tinyglobby": "^0.2.15", 33 33 "yargs": "^18.0.0" 34 34 }, 35 35 "devDependencies": { 36 + "@typelex/emitter": "workspace:*", 36 37 "@types/node": "^20.0.0", 37 38 "@types/yargs": "^17.0.33", 38 39 "typescript": "^5.0.0", 39 - "vitest": "^1.0.0", 40 - "@typelex/emitter": "workspace:*" 40 + "vitest": "^1.0.0" 41 41 }, 42 42 "peerDependencies": { 43 43 "@typelex/emitter": "^0.3.1"
+2 -2
packages/cli/src/utils/lexicon.ts
··· 1 1 import { readFile } from "fs/promises"; 2 2 import { resolve } from "path"; 3 - import { globby } from "globby"; 3 + import { glob } from "tinyglobby"; 4 4 5 5 export interface LexiconDef { 6 6 type: string; ··· 27 27 export async function findLexicons(dir: string): Promise<string[]> { 28 28 try { 29 29 const pattern = resolve(dir, "**/*.json"); 30 - return await globby(pattern); 30 + return await glob(pattern); 31 31 } catch { 32 32 // If directory doesn't exist, return empty array 33 33 return [];
+29 -3
pnpm-lock.yaml
··· 17 17 '@typespec/compiler': 18 18 specifier: ^1.4.0 19 19 version: 1.4.0(@types/node@20.19.19) 20 - globby: 21 - specifier: ^14.0.0 22 - version: 14.1.0 23 20 picocolors: 24 21 specifier: ^1.1.1 25 22 version: 1.1.1 23 + tinyglobby: 24 + specifier: ^0.2.15 25 + version: 0.2.15 26 26 yargs: 27 27 specifier: ^18.0.0 28 28 version: 18.0.0 ··· 1229 1229 resolution: {integrity: sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==} 1230 1230 cpu: [arm64] 1231 1231 os: [linux] 1232 + libc: [glibc] 1232 1233 1233 1234 '@img/sharp-libvips-linux-arm@1.2.3': 1234 1235 resolution: {integrity: sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==} 1235 1236 cpu: [arm] 1236 1237 os: [linux] 1238 + libc: [glibc] 1237 1239 1238 1240 '@img/sharp-libvips-linux-ppc64@1.2.3': 1239 1241 resolution: {integrity: sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==} 1240 1242 cpu: [ppc64] 1241 1243 os: [linux] 1244 + libc: [glibc] 1242 1245 1243 1246 '@img/sharp-libvips-linux-s390x@1.2.3': 1244 1247 resolution: {integrity: sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==} 1245 1248 cpu: [s390x] 1246 1249 os: [linux] 1250 + libc: [glibc] 1247 1251 1248 1252 '@img/sharp-libvips-linux-x64@1.2.3': 1249 1253 resolution: {integrity: sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==} 1250 1254 cpu: [x64] 1251 1255 os: [linux] 1256 + libc: [glibc] 1252 1257 1253 1258 '@img/sharp-libvips-linuxmusl-arm64@1.2.3': 1254 1259 resolution: {integrity: sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==} 1255 1260 cpu: [arm64] 1256 1261 os: [linux] 1262 + libc: [musl] 1257 1263 1258 1264 '@img/sharp-libvips-linuxmusl-x64@1.2.3': 1259 1265 resolution: {integrity: sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==} 1260 1266 cpu: [x64] 1261 1267 os: [linux] 1268 + libc: [musl] 1262 1269 1263 1270 '@img/sharp-linux-arm64@0.34.4': 1264 1271 resolution: {integrity: sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==} 1265 1272 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1266 1273 cpu: [arm64] 1267 1274 os: [linux] 1275 + libc: [glibc] 1268 1276 1269 1277 '@img/sharp-linux-arm@0.34.4': 1270 1278 resolution: {integrity: sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==} 1271 1279 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1272 1280 cpu: [arm] 1273 1281 os: [linux] 1282 + libc: [glibc] 1274 1283 1275 1284 '@img/sharp-linux-ppc64@0.34.4': 1276 1285 resolution: {integrity: sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==} 1277 1286 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1278 1287 cpu: [ppc64] 1279 1288 os: [linux] 1289 + libc: [glibc] 1280 1290 1281 1291 '@img/sharp-linux-s390x@0.34.4': 1282 1292 resolution: {integrity: sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==} 1283 1293 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1284 1294 cpu: [s390x] 1285 1295 os: [linux] 1296 + libc: [glibc] 1286 1297 1287 1298 '@img/sharp-linux-x64@0.34.4': 1288 1299 resolution: {integrity: sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==} 1289 1300 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1290 1301 cpu: [x64] 1291 1302 os: [linux] 1303 + libc: [glibc] 1292 1304 1293 1305 '@img/sharp-linuxmusl-arm64@0.34.4': 1294 1306 resolution: {integrity: sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==} 1295 1307 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1296 1308 cpu: [arm64] 1297 1309 os: [linux] 1310 + libc: [musl] 1298 1311 1299 1312 '@img/sharp-linuxmusl-x64@0.34.4': 1300 1313 resolution: {integrity: sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==} 1301 1314 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} 1302 1315 cpu: [x64] 1303 1316 os: [linux] 1317 + libc: [musl] 1304 1318 1305 1319 '@img/sharp-wasm32@0.34.4': 1306 1320 resolution: {integrity: sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==} ··· 1558 1572 resolution: {integrity: sha512-xRiOu9Of1FZ4SxVbB0iEDXc4ddIcjCv2aj03dmW8UrZIW7aIQ9jVJdLBIhxBI+MaTnGAKyvMwPwQnoOEvP7FgQ==} 1559 1573 cpu: [arm] 1560 1574 os: [linux] 1575 + libc: [glibc] 1561 1576 1562 1577 '@rollup/rollup-linux-arm-musleabihf@4.52.4': 1563 1578 resolution: {integrity: sha512-FbhM2p9TJAmEIEhIgzR4soUcsW49e9veAQCziwbR+XWB2zqJ12b4i/+hel9yLiD8pLncDH4fKIPIbt5238341Q==} 1564 1579 cpu: [arm] 1565 1580 os: [linux] 1581 + libc: [musl] 1566 1582 1567 1583 '@rollup/rollup-linux-arm64-gnu@4.52.4': 1568 1584 resolution: {integrity: sha512-4n4gVwhPHR9q/g8lKCyz0yuaD0MvDf7dV4f9tHt0C73Mp8h38UCtSCSE6R9iBlTbXlmA8CjpsZoujhszefqueg==} 1569 1585 cpu: [arm64] 1570 1586 os: [linux] 1587 + libc: [glibc] 1571 1588 1572 1589 '@rollup/rollup-linux-arm64-musl@4.52.4': 1573 1590 resolution: {integrity: sha512-u0n17nGA0nvi/11gcZKsjkLj1QIpAuPFQbR48Subo7SmZJnGxDpspyw2kbpuoQnyK+9pwf3pAoEXerJs/8Mi9g==} 1574 1591 cpu: [arm64] 1575 1592 os: [linux] 1593 + libc: [musl] 1576 1594 1577 1595 '@rollup/rollup-linux-loong64-gnu@4.52.4': 1578 1596 resolution: {integrity: sha512-0G2c2lpYtbTuXo8KEJkDkClE/+/2AFPdPAbmaHoE870foRFs4pBrDehilMcrSScrN/fB/1HTaWO4bqw+ewBzMQ==} 1579 1597 cpu: [loong64] 1580 1598 os: [linux] 1599 + libc: [glibc] 1581 1600 1582 1601 '@rollup/rollup-linux-ppc64-gnu@4.52.4': 1583 1602 resolution: {integrity: sha512-teSACug1GyZHmPDv14VNbvZFX779UqWTsd7KtTM9JIZRDI5NUwYSIS30kzI8m06gOPB//jtpqlhmraQ68b5X2g==} 1584 1603 cpu: [ppc64] 1585 1604 os: [linux] 1605 + libc: [glibc] 1586 1606 1587 1607 '@rollup/rollup-linux-riscv64-gnu@4.52.4': 1588 1608 resolution: {integrity: sha512-/MOEW3aHjjs1p4Pw1Xk4+3egRevx8Ji9N6HUIA1Ifh8Q+cg9dremvFCUbOX2Zebz80BwJIgCBUemjqhU5XI5Eg==} 1589 1609 cpu: [riscv64] 1590 1610 os: [linux] 1611 + libc: [glibc] 1591 1612 1592 1613 '@rollup/rollup-linux-riscv64-musl@4.52.4': 1593 1614 resolution: {integrity: sha512-1HHmsRyh845QDpEWzOFtMCph5Ts+9+yllCrREuBR/vg2RogAQGGBRC8lDPrPOMnrdOJ+mt1WLMOC2Kao/UwcvA==} 1594 1615 cpu: [riscv64] 1595 1616 os: [linux] 1617 + libc: [musl] 1596 1618 1597 1619 '@rollup/rollup-linux-s390x-gnu@4.52.4': 1598 1620 resolution: {integrity: sha512-seoeZp4L/6D1MUyjWkOMRU6/iLmCU2EjbMTyAG4oIOs1/I82Y5lTeaxW0KBfkUdHAWN7j25bpkt0rjnOgAcQcA==} 1599 1621 cpu: [s390x] 1600 1622 os: [linux] 1623 + libc: [glibc] 1601 1624 1602 1625 '@rollup/rollup-linux-x64-gnu@4.40.0': 1603 1626 resolution: {integrity: sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==} 1604 1627 cpu: [x64] 1605 1628 os: [linux] 1629 + libc: [glibc] 1606 1630 1607 1631 '@rollup/rollup-linux-x64-gnu@4.52.4': 1608 1632 resolution: {integrity: sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==} 1609 1633 cpu: [x64] 1610 1634 os: [linux] 1635 + libc: [glibc] 1611 1636 1612 1637 '@rollup/rollup-linux-x64-musl@4.52.4': 1613 1638 resolution: {integrity: sha512-dtBZYjDmCQ9hW+WgEkaffvRRCKm767wWhxsFW3Lw86VXz/uJRuD438/XvbZT//B96Vs8oTA8Q4A0AfHbrxP9zw==} 1614 1639 cpu: [x64] 1615 1640 os: [linux] 1641 + libc: [musl] 1616 1642 1617 1643 '@rollup/rollup-openharmony-arm64@4.52.4': 1618 1644 resolution: {integrity: sha512-1ox+GqgRWqaB1RnyZXL8PD6E5f7YyRUJYnCqKpNzxzP0TkaUh112NDrR9Tt+C8rJ4x5G9Mk8PQR3o7Ku2RKqKA==}

History

1 round 0 comments
sign up or login to add to the discussion
1 commit
expand
Replace globby with tinyglobby
no conflicts, ready to merge
expand 0 comments