diff --git a/package.json b/package.json index abcf2034..929ff53d 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,6 @@ "@swc/core": "^1.10.7", "@swc/helpers": "^0.5.11", "clean-css": "^5.3.3", - "glob": "^11.0.0", "magic-string": "^0.30.17", "ora": "^8.0.1", "picomatch": "^4.0.2", @@ -75,6 +74,7 @@ "rollup-plugin-dts": "^6.1.1", "rollup-plugin-swc3": "^0.11.1", "rollup-preserve-directives": "^1.1.3", + "tinyglobby": "^0.2.10", "tslib": "^2.8.1", "yargs": "^17.7.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b58cd53..480e1033 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,9 +35,6 @@ importers: clean-css: specifier: ^5.3.3 version: 5.3.3 - glob: - specifier: ^11.0.0 - version: 11.0.0 magic-string: specifier: ^0.30.17 version: 0.30.17 @@ -62,6 +59,9 @@ importers: rollup-preserve-directives: specifier: ^1.1.3 version: 1.1.3(rollup@4.30.1) + tinyglobby: + specifier: ^0.2.10 + version: 0.2.10 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -501,10 +501,6 @@ packages: cpu: [x64] os: [win32] - '@isaacs/cliui@8.0.2': - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} - '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -1137,9 +1133,6 @@ packages: brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -1336,9 +1329,6 @@ packages: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.4.233: resolution: {integrity: sha512-ejwIKXTg1wqbmkcRJh9Ur3hFGHFDZDw1POzdsVrB2WZjgRuRMHIQQKNpe64N/qh3ZtH2otEoRoS+s6arAAuAAw==} @@ -1355,9 +1345,6 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -1422,6 +1409,14 @@ packages: picomatch: optional: true + fdir@6.4.2: + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1430,10 +1425,6 @@ packages: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} - foreground-child@3.3.0: - resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} - engines: {node: '>=14'} - fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -1472,11 +1463,6 @@ packages: get-tsconfig@4.7.3: resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} - glob@11.0.0: - resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} - engines: {node: 20 || >=22} - hasBin: true - glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported @@ -1614,10 +1600,6 @@ packages: resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} engines: {node: '>=8'} - jackspeak@4.0.2: - resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} - engines: {node: 20 || >=22} - jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1831,10 +1813,6 @@ packages: resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} engines: {node: '>=18'} - lru-cache@11.0.2: - resolution: {integrity: sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==} - engines: {node: 20 || >=22} - lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -1863,17 +1841,9 @@ packages: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - minimatch@10.0.1: - resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} - engines: {node: 20 || >=22} - minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} - engines: {node: '>=16 || 14 >=14.17'} - ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -1964,9 +1934,6 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} - package-json-from-dist@1.0.1: - resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -1990,10 +1957,6 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@2.0.0: - resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} - engines: {node: 20 || >=22} - picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -2212,10 +2175,6 @@ packages: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} - string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - string-width@7.1.0: resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} engines: {node: '>=18'} @@ -2277,6 +2236,10 @@ packages: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} + tinyglobby@0.2.10: + resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} + engines: {node: '>=12.0.0'} + tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} @@ -2335,10 +2298,6 @@ packages: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} - wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} - wrap-ansi@9.0.0: resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} engines: {node: '>=18'} @@ -2790,15 +2749,6 @@ snapshots: '@img/sharp-win32-x64@0.33.5': optional: true - '@isaacs/cliui@8.0.2': - dependencies: - string-width: 5.1.2 - string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.0 - strip-ansi-cjs: strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: wrap-ansi@7.0.0 - '@istanbuljs/load-nyc-config@1.1.0': dependencies: camelcase: 5.3.1 @@ -3478,10 +3428,6 @@ snapshots: balanced-match: 1.0.2 concat-map: 0.0.1 - brace-expansion@2.0.1: - dependencies: - balanced-match: 1.0.2 - braces@3.0.2: dependencies: fill-range: 7.0.1 @@ -3652,8 +3598,6 @@ snapshots: diff-sequences@29.6.3: {} - eastasianwidth@0.2.0: {} - electron-to-chromium@1.4.233: {} electron-to-chromium@1.5.80: {} @@ -3664,8 +3608,6 @@ snapshots: emoji-regex@8.0.0: {} - emoji-regex@9.2.2: {} - error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -3736,6 +3678,10 @@ snapshots: optionalDependencies: picomatch: 4.0.2 + fdir@6.4.2(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + fill-range@7.0.1: dependencies: to-regex-range: 5.0.1 @@ -3745,11 +3691,6 @@ snapshots: locate-path: 5.0.0 path-exists: 4.0.0 - foreground-child@3.3.0: - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.1.0 - fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -3773,15 +3714,6 @@ snapshots: dependencies: resolve-pkg-maps: 1.0.0 - glob@11.0.0: - dependencies: - foreground-child: 3.3.0 - jackspeak: 4.0.2 - minimatch: 10.0.1 - minipass: 7.1.2 - package-json-from-dist: 1.0.1 - path-scurry: 2.0.0 - glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -3905,10 +3837,6 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.0 - jackspeak@4.0.2: - dependencies: - '@isaacs/cliui': 8.0.2 - jest-changed-files@29.7.0: dependencies: execa: 5.1.1 @@ -4320,8 +4248,6 @@ snapshots: strip-ansi: 7.1.0 wrap-ansi: 9.0.0 - lru-cache@11.0.2: {} - lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -4349,16 +4275,10 @@ snapshots: mimic-fn@4.0.0: {} - minimatch@10.0.1: - dependencies: - brace-expansion: 2.0.1 - minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 - minipass@7.1.2: {} - ms@2.1.2: {} ms@2.1.3: {} @@ -4460,8 +4380,6 @@ snapshots: p-try@2.2.0: {} - package-json-from-dist@1.0.1: {} - parse-json@5.2.0: dependencies: '@babel/code-frame': 7.24.7 @@ -4479,11 +4397,6 @@ snapshots: path-parse@1.0.7: {} - path-scurry@2.0.0: - dependencies: - lru-cache: 11.0.2 - minipass: 7.1.2 - picocolors@1.0.0: {} picocolors@1.1.1: {} @@ -4713,12 +4626,6 @@ snapshots: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - string-width@5.1.2: - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.1.0 - string-width@7.1.0: dependencies: emoji-regex: 10.3.0 @@ -4768,6 +4675,11 @@ snapshots: glob: 7.2.3 minimatch: 3.1.2 + tinyglobby@0.2.10: + dependencies: + fdir: 6.4.2(picomatch@4.0.2) + picomatch: 4.0.2 + tmpl@1.0.5: {} to-fast-properties@2.0.0: {} @@ -4818,12 +4730,6 @@ snapshots: string-width: 4.2.3 strip-ansi: 6.0.1 - wrap-ansi@8.1.0: - dependencies: - ansi-styles: 6.2.1 - string-width: 5.1.2 - strip-ansi: 7.1.0 - wrap-ansi@9.0.0: dependencies: ansi-styles: 6.2.1 diff --git a/src/entries.ts b/src/entries.ts index 0803cb7e..46f8742c 100644 --- a/src/entries.ts +++ b/src/entries.ts @@ -1,7 +1,7 @@ import { existsSync } from 'fs' import fsp from 'fs/promises' import path, { posix } from 'path' -import { glob } from 'glob' +import { glob } from 'tinyglobby' import { getExportTypeFromFile, type ParsedExportsInfo } from './exports' import { PackageMetadata, type Entries, ExportPaths } from './types' import { logger } from './logger' @@ -302,7 +302,6 @@ export async function collectSourceEntriesByExportPath( const entryFiles = await glob(entryFilesPatterns, { cwd: dirPath, - nodir: true, ignore: PRIVATE_GLOB_PATTERN, }) @@ -403,7 +402,6 @@ export async function collectSourceEntriesFromExportPaths( const privatePattern = `**/_*{,/*}{,{.${suffixPattern}}}.{${extPattern}}` const privateFiles = await glob(privatePattern, { cwd: sourceFolderPath, - nodir: true, ignore: TESTS_GLOB_PATTERN, }) diff --git a/src/prepare/prepare-entries.ts b/src/prepare/prepare-entries.ts index 0f064f70..55b5cd7a 100644 --- a/src/prepare/prepare-entries.ts +++ b/src/prepare/prepare-entries.ts @@ -1,5 +1,5 @@ import { existsSync } from 'fs' -import { glob } from 'glob' +import { glob } from 'tinyglobby' import { BINARY_TAG, PRIVATE_GLOB_PATTERN, @@ -28,13 +28,11 @@ export async function collectSourceEntries(sourceFolderPath: string) { const binMatches = await glob(binPattern, { cwd: sourceFolderPath, - nodir: true, ignore: [PRIVATE_GLOB_PATTERN, TESTS_GLOB_PATTERN], // ignore private entries }) const srcMatches = await glob(srcPattern, { cwd: sourceFolderPath, - nodir: true, ignore: [PRIVATE_GLOB_PATTERN, TESTS_GLOB_PATTERN], // ignore private entries }) diff --git a/test/integration/prepare-js/index.test.ts b/test/integration/prepare-js/index.test.ts index 6e2d91f4..4863b2ca 100644 --- a/test/integration/prepare-js/index.test.ts +++ b/test/integration/prepare-js/index.test.ts @@ -51,8 +51,8 @@ describe('integration prepare-js', () => { "Discovered binaries entries: ./$binary: bin.js Discovered exports entries: - . : index.js ./foo: foo.js + . : index.js ✓ Configured \`exports\` in package.json " `) diff --git a/test/integration/prepare-ts/index.test.ts b/test/integration/prepare-ts/index.test.ts index b21c9f22..029870b6 100644 --- a/test/integration/prepare-ts/index.test.ts +++ b/test/integration/prepare-ts/index.test.ts @@ -85,12 +85,12 @@ describe('integration prepare-ts', () => { expect(stripANSIColor(stdout)).toMatchInlineSnapshot(` "Detected using TypeScript but tsconfig.json is missing, created a tsconfig.json for you. Discovered binaries entries: - ./cmd: cmd.ts ./cli: cli.ts + ./cmd: cmd.ts Discovered exports entries: - . : index.ts - . : index.react-server.ts ./foo: foo.ts + . : index.react-server.ts + . : index.ts ✓ Configured \`exports\` in package.json " `) diff --git a/test/testing-utils/index.ts b/test/testing-utils/index.ts index 2c65d683..6a0aecea 100644 --- a/test/testing-utils/index.ts +++ b/test/testing-utils/index.ts @@ -1,4 +1,4 @@ -import { glob } from 'glob' +import { glob } from 'tinyglobby' function normalizePath(filePath: string) { return filePath.replace(/\\/g, '/')