Skip to content

Commit

Permalink
chore: bump glob to 9.3.5
Browse files Browse the repository at this point in the history
BREAKING CHANGE: require Node 18.18.0
  • Loading branch information
theogravity committed Mar 8, 2024
1 parent a9b4e7b commit b5f529a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workflows:
condition:
and:
- equal: [ node/macos, << matrix.executor >> ]
- equal: [ '14.16', << matrix.node-version >> ]
- equal: [ '18.18', << matrix.node-version >> ]
steps:
- node/install-rosetta
- when:
Expand All @@ -35,10 +35,7 @@ workflows:
- node/windows
node-version:
- '20.9'
- '18.17'
- '16.20'
# Stay below 14.17.0 or nvm tries to download arm64 artifacts which don't exist
- '14.16'
- '18.18'
- cfa/release:
requires:
- test
Expand Down
7 changes: 7 additions & 0 deletions lib/asar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const minimatch = require('minimatch')
const Filesystem = require('./filesystem')
const disk = require('./disk')
const crawlFilesystem = require('./crawlfs')
const os = require('os')

/**
* Whether a directory should be excluded from packing due to the `--unpack-dir" option.
Expand Down Expand Up @@ -34,6 +35,12 @@ module.exports.createPackageWithOptions = async function (src, dest, options) {
const globOptions = options.globOptions ? options.globOptions : {}
globOptions.dot = options.dot === undefined ? true : options.dot

// https://github.com/isaacs/node-glob/issues/480
if (os.platform() === 'win32') {
src = src.split(path.sep).join('/')
dest = dest.split(path.sep).join('/')
}

const pattern = src + (options.pattern ? options.pattern : '/**/*')

const [filenames, metadata] = await crawlFilesystem(pattern, globOptions)
Expand Down
11 changes: 7 additions & 4 deletions lib/crawlfs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict'

const { promisify } = require('util')

const fs = require('./wrapped-fs')
const glob = promisify(require('glob'))
const { glob } = require('glob')

async function determineFileType (filename) {
const stat = await fs.lstat(filename)
Expand All @@ -18,8 +16,13 @@ async function determineFileType (filename) {

module.exports = async function (dir, options) {
const metadata = {}
const crawled = await glob(dir, options)
let crawled = await glob(dir, options || {})

// https://github.com/isaacs/node-glob/issues/576
crawled = crawled.sort((a, b) => a.localeCompare(b, 'en'))

const results = await Promise.all(crawled.map(async filename => [filename, await determineFileType(filename)]))

const links = []
const filenames = results.map(([filename, type]) => {
if (type) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lib/index.d.ts"
],
"engines": {
"node": ">=10.12.0"
"node": ">=18.18.0"
},
"license": "MIT",
"homepage": "https://github.com/electron/asar",
Expand Down Expand Up @@ -44,7 +44,7 @@
},
"dependencies": {
"commander": "^5.0.0",
"glob": "^7.1.6",
"glob": "^9.3.5",
"minimatch": "^3.0.4"
},
"devDependencies": {
Expand Down
42 changes: 41 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ [email protected]:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.0.5, glob@^7.1.3, glob@^7.1.6:
glob@^7.0.5, glob@^7.1.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
Expand All @@ -1182,6 +1182,16 @@ glob@^7.0.5, glob@^7.1.3, glob@^7.1.6:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^9.3.5:
version "9.3.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.5.tgz#ca2ed8ca452781a3009685607fdf025a899dfe21"
integrity sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==
dependencies:
fs.realpath "^1.0.0"
minimatch "^8.0.2"
minipass "^4.2.4"
path-scurry "^1.6.1"

global-agent@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-3.0.0.tgz#ae7cd31bd3583b93c5a16437a1afe27cc33a1ab6"
Expand Down Expand Up @@ -1737,6 +1747,11 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"

"lru-cache@^9.1.1 || ^10.0.0":
version "10.2.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3"
integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==

map-obj@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
Expand Down Expand Up @@ -1826,6 +1841,13 @@ minimatch@^3.0.4, minimatch@^3.1.1:
dependencies:
brace-expansion "^1.1.7"

minimatch@^8.0.2:
version "8.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229"
integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==
dependencies:
brace-expansion "^2.0.1"

[email protected]:
version "4.1.0"
resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619"
Expand All @@ -1840,6 +1862,16 @@ minimist@^1.2.5, minimist@^1.2.6:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==

minipass@^4.2.4:
version "4.2.8"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.8.tgz#f0010f64393ecfc1d1ccb5f582bcaf45f48e1a3a"
integrity sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==

"minipass@^5.0.0 || ^6.0.2 || ^7.0.0":
version "7.0.4"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c"
integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==

mkdirp@^0.5.1:
version "0.5.6"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
Expand Down Expand Up @@ -2178,6 +2210,14 @@ path-parse@^1.0.7:
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

path-scurry@^1.6.1:
version "1.10.1"
resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698"
integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==
dependencies:
lru-cache "^9.1.1 || ^10.0.0"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"

path-type@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
Expand Down

0 comments on commit b5f529a

Please sign in to comment.