diff --git a/README.md b/README.md index 418c3509..3e23f6fb 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,6 @@ import { minimatch } from 'minimatch' // or: const { minimatch } = require('minimatch') -// default export also works -import minimatch from 'minimatch' -// or: -const minimatch = require('minimatch') - minimatch('bar.foo', '*.foo') // true! minimatch('bar.foo', '*.bar') // false! minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! diff --git a/changelog.md b/changelog.md index 38326bb8..7731b812 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # change log +## 9.0 + +- No default export, only named exports. + ## 8.0 - Recursive descent parser for extglob, allowing correct support diff --git a/package-lock.json b/package-lock.json index aa48ea64..d72170ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "minimatch", - "version": "8.0.4", + "version": "9.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "minimatch", - "version": "8.0.4", + "version": "9.0.0", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" diff --git a/package.json b/package.json index 76d1a076..06d796a2 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "author": "Isaac Z. Schlueter (http://blog.izs.me)", "name": "minimatch", "description": "a glob matcher in javascript", - "version": "8.0.4", + "version": "9.0.0", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" }, - "main": "./dist/cjs/index-cjs.js", + "main": "./dist/cjs/index.js", "module": "./dist/mjs/index.js", "types": "./dist/cjs/index.d.ts", "exports": { @@ -18,7 +18,7 @@ }, "require": { "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index-cjs.js" + "default": "./dist/cjs/index.js" } } }, diff --git a/src/index-cjs.ts b/src/index-cjs.ts deleted file mode 100644 index 812f3ea5..00000000 --- a/src/index-cjs.ts +++ /dev/null @@ -1,3 +0,0 @@ -import minimatch from './index.js' - -export = Object.assign(minimatch, { default: minimatch, minimatch }) diff --git a/src/index.ts b/src/index.ts index 85711e84..a8e55a03 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,8 +55,6 @@ export const minimatch = ( return new Minimatch(pattern, options).match(p) } -export default minimatch - // Optimized checking for the most common glob patterns. const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/ const starDotExtTest = (ext: string) => (f: string) => diff --git a/test/brace-expand.js b/test/brace-expand.js index b8731c35..b7681d13 100644 --- a/test/brace-expand.js +++ b/test/brace-expand.js @@ -1,5 +1,5 @@ -var tap = require('tap'), - minimatch = require('../').default +var tap = require('tap') +const { minimatch } = require('../') tap.test('brace expansion', function (t) { // [ pattern, [expanded] ] diff --git a/test/class-edge-cases.js b/test/class-edge-cases.js index 741755d3..0c230953 100644 --- a/test/class-edge-cases.js +++ b/test/class-edge-cases.js @@ -1,5 +1,5 @@ const t = require('tap') -const minimatch = require('../').default +const { minimatch } = require('../') const files = ['a[]b', '[b-a]x', 'a]b', 'a[]]b', 'a[[]b'] diff --git a/test/defaults.js b/test/defaults.js index f1a7319a..1b8abb95 100644 --- a/test/defaults.js +++ b/test/defaults.js @@ -5,7 +5,7 @@ const t = require('tap') const globalBefore = Object.keys(global) -const mm = require('../').default +const { minimatch: mm } = require('../') const patterns = require('./patterns.js') diff --git a/test/escaping.js b/test/escaping.js index c0d45957..2f4b2607 100644 --- a/test/escaping.js +++ b/test/escaping.js @@ -1,5 +1,5 @@ var tap = require('tap') -var minimatch = require('../').default +const { minimatch } = require('../') // test all characters with codes in range [mincc,maxcc] var mincc = 0x20 diff --git a/test/extglob-ending-with-state-char.js b/test/extglob-ending-with-state-char.js index ad7589fc..55887df4 100644 --- a/test/extglob-ending-with-state-char.js +++ b/test/extglob-ending-with-state-char.js @@ -1,5 +1,5 @@ var test = require('tap').test -var minimatch = require('../').default +const { minimatch } = require('../') test('extglob ending with statechar', function (t) { t.notOk(minimatch('ax', 'a?(b*)')) diff --git a/test/extglob-unfinished.js b/test/extglob-unfinished.js index 248b9480..4d72a46c 100644 --- a/test/extglob-unfinished.js +++ b/test/extglob-unfinished.js @@ -1,5 +1,5 @@ var t = require('tap') -var mm = require('../').default +const mm = require('../').minimatch var types = '!?+*@'.split('') diff --git a/test/negative-extglob-anchoring.js b/test/negative-extglob-anchoring.js index 1f798a4f..cb16c7a8 100644 --- a/test/negative-extglob-anchoring.js +++ b/test/negative-extglob-anchoring.js @@ -1,5 +1,5 @@ const t = require('tap') -const mm = require('../').default +const mm = require('../').minimatch const pattern = 'a/b/*/!(bar)/*' const nope = 'a/b/c/bar/x' const yup = 'a/b/c/baz/x' diff --git a/test/nocase-magic.js b/test/nocase-magic.js index 4c22945f..e6f3a0f7 100644 --- a/test/nocase-magic.js +++ b/test/nocase-magic.js @@ -1,5 +1,5 @@ const t = require('tap') -const { Minimatch } = require('../').default +const { Minimatch } = require('../') const nomagic = '../1/2/3' const yesmagic = '../x' diff --git a/test/partial.js b/test/partial.js index 9d4a8f2f..cac44317 100644 --- a/test/partial.js +++ b/test/partial.js @@ -1,5 +1,5 @@ const t = require('tap') -const mm = require('../').default +const mm = require('../').minimatch t.equal(mm('/a/b', '/*/b/x/y/z', { partial: true }), true) t.equal(mm('/a/b/c', '/*/b/x/y/z', { partial: true }), false) t.equal(mm('/', 'x', { partial: true }), true) diff --git a/test/redos.js b/test/redos.js index fa5fbae0..d8215461 100644 --- a/test/redos.js +++ b/test/redos.js @@ -1,6 +1,6 @@ var t = require('tap') -var minimatch = require('../').default +var minimatch = require('../').minimatch // utility function for generating long strings var genstr = function (len, chr) { diff --git a/test/tricky-negations.js b/test/tricky-negations.js index 656621c8..8ad4bead 100644 --- a/test/tricky-negations.js +++ b/test/tricky-negations.js @@ -1,5 +1,5 @@ var t = require('tap') -var minimatch = require('../').default +var minimatch = require('../').minimatch var cases = { 'bar.min.js': { '*.!(js|css)': true, diff --git a/test/win-path-sep.js b/test/win-path-sep.js index 4dcae24c..4e88abd3 100644 --- a/test/win-path-sep.js +++ b/test/win-path-sep.js @@ -1,7 +1,7 @@ const t = require('tap') t.test('path separator /', t => { process.env.__MINIMATCH_TESTING_PLATFORM__ = 'posix' - const mm = t.mock('../', {}).default + const mm = t.mock('../', {}).minimatch t.equal(mm('x/y/z', 'x/y/*/z'), false) t.equal(mm('x/y/w/z', 'x/y/*/z'), true) t.end() @@ -9,7 +9,7 @@ t.test('path separator /', t => { t.test('path separator \\', t => { process.env.__MINIMATCH_TESTING_PLATFORM__ = 'win32' - const mm = t.mock('../', {}).default + const mm = t.mock('../', {}).minimatch t.equal(mm('x\\y\\z', 'x/y/*/z'), false) t.equal(mm('x\\y\\w\\z', 'x/y/*/z'), true) t.end() @@ -17,7 +17,7 @@ t.test('path separator \\', t => { t.test('override with options', t => { process.env.__MINIMATCH_TESTING_PLATFORM__ = 'win32' - const mm = t.mock('../', {}).default + const mm = t.mock('../', {}).minimatch t.equal( mm('c:\\foo\\bar', 'c:\\foo\\*', {