Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/node-glob
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8882c8fccabbe459465e73cc2581e121a5fdd25b
Choose a base ref
...
head repository: isaacs/node-glob
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a68703e61894ef260323dcc9f95b21f17197d951
Choose a head ref
Loading
Showing with 11,263 additions and 7,410 deletions.
  1. +3 −0 .github/FUNDING.yml
  2. +39 −0 .github/workflows/ci.yml
  3. +13 −0 .github/workflows/commit-if-modified.sh
  4. +15 −0 .github/workflows/copyright-year.sh
  5. +37 −0 .github/workflows/isaacs-makework.yml
  6. +16 −0 .github/workflows/package-json-repo.js
  7. +50 −0 .github/workflows/typedoc.yml
  8. +11 −6 .gitignore
  9. +9 −0 .prettierignore
  10. +0 −8 .travis.yml
  11. +1 −5 CONTRIBUTING.md
  12. +1 −1 LICENSE
  13. +837 −278 README.md
  14. +0 −19 appveyor.yml
  15. +2 −5 benchclean.js
  16. +170 −47 benchmark.sh
  17. +115 −0 changelog.md
  18. +0 −240 common.js
  19. +8 −5 examples/g.js
  20. +5 −5 examples/usr-local.js
  21. +13 −0 fixup.sh
  22. +0 −790 glob.js
  23. BIN logo/glob-solo.png
  24. BIN logo/glob.png
  25. +1 −0 logo/glob.svg
  26. +19 −4 make-benchmark-fixture.sh
  27. +5,583 −3,422 package-lock.json
  28. +79 −26 package.json
  29. +47 −0 patterns.sh
  30. +26 −13 prof.sh
  31. +433 −0 src/glob.ts
  32. +18 −0 src/has-magic.ts
  33. +107 −0 src/ignore.ts
  34. +3 −0 src/index-cjs.ts
  35. +202 −0 src/index.ts
  36. +266 −0 src/pattern.ts
  37. +314 −0 src/processor.ts
  38. +467 −0 src/walker.ts
  39. +0 −486 sync.js
  40. +0 −180 test/00-setup.js
  41. +185 −0 test/00-setup.ts
  42. +0 −19 test/abort.js
  43. +8 −0 test/absolute-must-be-strings.ts
  44. +0 −49 test/absolute.js
  45. +45 −0 test/absolute.ts
  46. +0 −79 test/bash-comparison.js
  47. +56 −0 test/bash-comparison.ts
  48. +0 −140 test/bash-results.json
  49. +247 −0 test/bash-results.ts
  50. +0 −82 test/broken-symlink.js
  51. +66 −0 test/broken-symlink.ts
  52. +80 −0 test/cwd-noent.ts
  53. +0 −91 test/cwd-test.js
  54. +44 −0 test/cwd-test.ts
  55. +0 −21 test/empty-set.js
  56. +18 −0 test/empty-set.ts
  57. +0 −65 test/enotsup.js
  58. +0 −112 test/eperm-stat.js
  59. +0 −38 test/error-callback.js
  60. +0 −32 test/follow.js
  61. +25 −0 test/follow.ts
  62. +0 −20 test/global-leakage.js
  63. +0 −18 test/globstar-match.js
  64. +0 −34 test/has-magic.js
  65. +30 −0 test/has-magic.ts
  66. +0 −111 test/ignore.js
  67. +386 −0 test/ignore.ts
  68. +0 −200 test/mark.js
  69. +181 −0 test/mark.ts
  70. +0 −49 test/match-base.js
  71. +105 −0 test/match-base.ts
  72. +25 −0 test/match-parent.ts
  73. +8 −0 test/match-root.ts
  74. +0 −15 test/multiple-weird-error.js
  75. +0 −12 test/new-glob-optional-options.js
  76. +0 −149 test/nocase-nomagic.js
  77. +0 −67 test/nodir.js
  78. +50 −0 test/nodir.ts
  79. +0 −31 test/nonull.js
  80. +64 −0 test/pattern.ts
  81. +0 −63 test/pause-resume.js
  82. +73 −0 test/platform.ts
  83. +0 −37 test/readme-issue.js
  84. +17 −0 test/readme-issue.ts
  85. +0 −93 test/realpath.js
  86. +96 −0 test/realpath.ts
  87. +0 −48 test/root-nomount.js
  88. +0 −81 test/root.js
  89. +89 −0 test/signal.ts
  90. +0 −20 test/slash-cwd.js
  91. +16 −0 test/slash-cwd.ts
  92. +0 −36 test/stat.js
  93. +256 −0 test/stream.ts
  94. +0 −46 test/sync-cb-throw.js
  95. +15 −0 test/url-cwd.ts
  96. +79 −0 test/windows-paths-fs.ts
  97. +52 −0 test/windows-paths-no-escape.ts
  98. +0 −12 test/zz-cleanup.js
  99. +16 −0 tsconfig-base.json
  100. +8 −0 tsconfig-esm.json
  101. +8 −0 tsconfig.json
  102. +5 −0 typedoc.json
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [isaacs]
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
node-version: [16.x, 18.x, 19.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: bash
- os: windows-latest
shell: powershell
fail-fast: false

runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run Tests
run: npm test -- -c -t0 --statements=80 --branches=80 --functions=80 --lines=80
13 changes: 13 additions & 0 deletions .github/workflows/commit-if-modified.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
git config --global user.email "$1"
shift
git config --global user.name "$1"
shift
message="$1"
shift
if [ $(git status --porcelain "$@" | egrep '^ M' | wc -l) -gt 0 ]; then
git add "$@"
git commit -m "$message"
git push || git pull --rebase
git push
fi
15 changes: 15 additions & 0 deletions .github/workflows/copyright-year.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
dir=${1:-$PWD}
dates=($(git log --date=format:%Y --pretty=format:'%ad' --reverse | sort | uniq))
if [ "${#dates[@]}" -eq 1 ]; then
datestr="${dates}"
else
datestr="${dates}-${dates[${#dates[@]}-1]}"
fi

stripDate='s/^((.*)Copyright\b(.*?))((?:,\s*)?(([0-9]{4}\s*-\s*[0-9]{4})|(([0-9]{4},\s*)*[0-9]{4})))(?:,)?\s*(.*)\n$/$1$9\n/g'
addDate='s/^.*Copyright(?:\s*\(c\))? /Copyright \(c\) '$datestr' /g'
for l in $dir/LICENSE*; do
perl -pi -e "$stripDate" $l
perl -pi -e "$addDate" $l
done
37 changes: 37 additions & 0 deletions .github/workflows/isaacs-makework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "various tidying up tasks to silence nagging"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
makework:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2.1.4
with:
node-version: 16.x
- name: put repo in package.json
run: node .github/workflows/package-json-repo.js
- name: check in package.json if modified
run: |
bash -x .github/workflows/commit-if-modified.sh \
"package-json-repo-bot@example.com" \
"package.json Repo Bot" \
"chore: add repo to package.json" \
package.json package-lock.json
- name: put all dates in license copyright line
run: bash .github/workflows/copyright-year.sh
- name: check in licenses if modified
run: |
bash .github/workflows/commit-if-modified.sh \
"license-year-bot@example.com" \
"License Year Bot" \
"chore: add copyright year to license" \
LICENSE*
16 changes: 16 additions & 0 deletions .github/workflows/package-json-repo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node

const pf = require.resolve(`${process.cwd()}/package.json`)
const pj = require(pf)

if (!pj.repository && process.env.GITHUB_REPOSITORY) {
const fs = require('fs')
const server = process.env.GITHUB_SERVER_URL || 'https://github.com'
const repo = `${server}/${process.env.GITHUB_REPOSITORY}`
pj.repository = repo
const json = fs.readFileSync(pf, 'utf8')
const match = json.match(/^\s*\{[\r\n]+([ \t]*)"/)
const indent = match[1]
const output = JSON.stringify(pj, null, indent || 2) + '\n'
fs.writeFileSync(pf, output)
}
50 changes: 50 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Generate typedocs
run: npm run typedoc

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
17 changes: 11 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.*.swp
node_modules/*
v8.log
profile.txt
nyc_output/
.nyc_output/
coverage/
/old
/*.tap
/dist
/node_modules
/v8.log
/profile.txt
/nyc_output
/.nyc_output
/coverage
/test/fixtures
/bench-working-dir
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/node_modules
/example
/.github
/dist
.env
/tap-snapshots
/.nyc_output
/coverage
/benchmark
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
Please consider signing [the neveragain.tech pledge](http://neveragain.tech/)

## Contributing

Any change to behavior (including bugfixes) must come with a test.

Patches that fail tests or reduce performance will be rejected.

```
```sh
# to run tests
npm test

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors
Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Loading