@quilted/create 0.2.42 → 0.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/build/esm/_virtual/index.mjs +6 -2
- package/build/esm/_virtual/index10.mjs +3 -0
- package/build/esm/_virtual/index11.mjs +3 -0
- package/build/esm/_virtual/index12.mjs +3 -0
- package/build/esm/_virtual/index13.mjs +3 -0
- package/build/esm/_virtual/index2.mjs +2 -2
- package/build/esm/_virtual/index3.mjs +6 -2
- package/build/esm/_virtual/index4.mjs +6 -2
- package/build/esm/_virtual/index5.mjs +6 -2
- package/build/esm/_virtual/index6.mjs +6 -2
- package/build/esm/_virtual/index8.mjs +3 -0
- package/build/esm/_virtual/index9.mjs +3 -0
- package/build/esm/_virtual/minimatch.mjs +12 -0
- package/build/esm/app.mjs +2 -2
- package/build/esm/cli.mjs +1 -1
- package/build/esm/module.mjs +2 -2
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.mjs +29 -21
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.mjs +24 -18
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.mjs +35 -32
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.mjs +103 -101
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.mjs +19 -13
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.mjs +63 -61
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.mjs +33 -27
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.mjs +25 -19
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.mjs +15 -10
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.mjs +27 -19
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.mjs +35 -32
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.mjs +39 -33
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.mjs +26 -20
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.mjs +24 -17
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.mjs +44 -42
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.mjs +37 -30
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.mjs +41 -34
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.mjs +22 -15
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.mjs +103 -98
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.mjs +35 -29
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.mjs +19 -12
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.mjs +64 -59
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.mjs +34 -27
- package/build/esm/node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.mjs +116 -112
- package/build/esm/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.mjs +54 -47
- package/build/esm/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.mjs +144 -137
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.mjs +173 -166
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.mjs +57 -51
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.mjs +102 -94
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.mjs +89 -83
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.mjs +312 -305
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.mjs +30 -24
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.mjs +116 -108
- package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.mjs +1 -3
- package/build/esm/node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.mjs +63 -61
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/index.mjs +75 -77
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/patterns.mjs +28 -22
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/tasks.mjs +83 -78
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/async.mjs +31 -25
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/deep.mjs +66 -60
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/entry.mjs +66 -59
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/error.mjs +23 -16
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/matcher.mjs +55 -48
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/partial.mjs +40 -33
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/provider.mjs +59 -55
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/stream.mjs +38 -32
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/sync.mjs +31 -25
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/transformers/entry.mjs +33 -26
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/async.mjs +43 -38
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/reader.mjs +41 -35
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/stream.mjs +60 -55
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/sync.mjs +48 -43
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/settings.mjs +65 -57
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/array.mjs +26 -20
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/errno.mjs +14 -8
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/fs.mjs +25 -19
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/index.mjs +33 -34
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/path.mjs +39 -33
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/pattern.mjs +170 -164
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/stream.mjs +24 -18
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/string.mjs +18 -12
- package/build/esm/node_modules/.pnpm/fastq@1.13.0/node_modules/fastq/queue.mjs +227 -221
- package/build/esm/node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.mjs +207 -200
- package/build/esm/node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.mjs +1 -6
- package/build/esm/node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.mjs +51 -44
- package/build/esm/node_modules/.pnpm/globby@13.1.1/node_modules/globby/ignore.mjs +2 -2
- package/build/esm/node_modules/.pnpm/globby@13.1.1/node_modules/globby/index.mjs +3 -3
- package/build/esm/node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.mjs +443 -439
- package/build/esm/node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.mjs +18 -11
- package/build/esm/node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.mjs +116 -109
- package/build/esm/node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.mjs +17 -10
- package/build/esm/node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.mjs +117 -110
- package/build/esm/node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.mjs +457 -451
- package/build/esm/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/lib/path.mjs +14 -7
- package/build/esm/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/minimatch.mjs +770 -770
- package/build/esm/node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.mjs +40 -34
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.mjs +10 -3
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.mjs +227 -220
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.mjs +941 -935
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.mjs +331 -325
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.mjs +303 -297
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.mjs +65 -57
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/babel.mjs +605 -605
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.mjs +378 -394
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/typescript.mjs +15 -15
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/yaml.mjs +281 -294
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/standalone.mjs +155 -155
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.mjs +17 -12
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.mjs +1 -1
- package/build/esm/node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.mjs +14 -7
- package/build/esm/node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.mjs +29 -22
- package/build/esm/node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.mjs +49 -42
- package/build/esm/node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.mjs +231 -224
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/YAMLMap.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/tags.mjs +3 -3
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.mjs +2 -2
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.mjs +2 -2
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/stringify/stringifyString.mjs +1 -1
- package/build/esm/package.mjs +2 -2
- package/build/esm/packages/cli-kit/build/esnext/prompt.esnext.mjs +1 -1
- package/build/esm/server.mjs +5 -9
- package/build/esm/shared/package-manager.mjs +1 -1
- package/build/esm/shared/prompts.mjs +1 -1
- package/build/esnext/_virtual/index.esnext +6 -2
- package/build/esnext/_virtual/index10.esnext +3 -0
- package/build/esnext/_virtual/index11.esnext +3 -0
- package/build/esnext/_virtual/index12.esnext +3 -0
- package/build/esnext/_virtual/index13.esnext +3 -0
- package/build/esnext/_virtual/index2.esnext +2 -2
- package/build/esnext/_virtual/index3.esnext +6 -2
- package/build/esnext/_virtual/index4.esnext +6 -2
- package/build/esnext/_virtual/index5.esnext +6 -2
- package/build/esnext/_virtual/index6.esnext +6 -2
- package/build/esnext/_virtual/index8.esnext +3 -0
- package/build/esnext/_virtual/index9.esnext +3 -0
- package/build/esnext/_virtual/minimatch.esnext +12 -0
- package/build/esnext/app.esnext +2 -2
- package/build/esnext/module.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.esnext +27 -19
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.esnext +19 -13
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.esnext +33 -30
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.esnext +99 -97
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.esnext +14 -8
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.esnext +59 -57
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.esnext +31 -25
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.esnext +23 -17
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.esnext +13 -8
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.esnext +25 -17
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.esnext +33 -30
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.esnext +38 -32
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.esnext +25 -19
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.esnext +23 -16
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.esnext +42 -40
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.esnext +36 -29
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.esnext +40 -33
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.esnext +21 -14
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.esnext +98 -93
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.esnext +30 -24
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.esnext +17 -10
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.esnext +59 -54
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.esnext +33 -26
- package/build/esnext/node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.esnext +132 -128
- package/build/esnext/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.esnext +54 -47
- package/build/esnext/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.esnext +137 -130
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.esnext +66 -59
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.esnext +53 -47
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.esnext +102 -95
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.esnext +89 -83
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.esnext +217 -210
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.esnext +30 -24
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.esnext +75 -67
- package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.esnext +1 -3
- package/build/esnext/node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.esnext +63 -61
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/index.esnext +68 -70
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/patterns.esnext +17 -11
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/tasks.esnext +81 -76
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/async.esnext +29 -23
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/deep.esnext +61 -55
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/entry.esnext +61 -54
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/error.esnext +21 -14
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/matcher.esnext +49 -42
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/partial.esnext +31 -24
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/provider.esnext +57 -53
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/stream.esnext +34 -28
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/sync.esnext +29 -23
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/transformers/entry.esnext +29 -22
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/async.esnext +40 -35
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/reader.esnext +39 -33
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/stream.esnext +56 -51
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/sync.esnext +46 -41
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/settings.esnext +59 -51
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/array.esnext +24 -18
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/errno.esnext +12 -6
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/fs.esnext +23 -17
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/index.esnext +31 -32
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/path.esnext +32 -26
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/pattern.esnext +135 -129
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/stream.esnext +23 -17
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/string.esnext +16 -10
- package/build/esnext/node_modules/.pnpm/fastq@1.13.0/node_modules/fastq/queue.esnext +220 -215
- package/build/esnext/node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.esnext +193 -186
- package/build/esnext/node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.esnext +1 -6
- package/build/esnext/node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.esnext +31 -24
- package/build/esnext/node_modules/.pnpm/globby@13.1.1/node_modules/globby/ignore.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/globby@13.1.1/node_modules/globby/index.esnext +3 -3
- package/build/esnext/node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.esnext +357 -353
- package/build/esnext/node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.esnext +18 -11
- package/build/esnext/node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.esnext +111 -104
- package/build/esnext/node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.esnext +17 -10
- package/build/esnext/node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.esnext +103 -96
- package/build/esnext/node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.esnext +147 -141
- package/build/esnext/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/lib/path.esnext +10 -3
- package/build/esnext/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/minimatch.esnext +495 -491
- package/build/esnext/node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.esnext +38 -32
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.esnext +10 -3
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.esnext +198 -191
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.esnext +683 -677
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.esnext +137 -131
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.esnext +279 -273
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.esnext +65 -57
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/babel.esnext +9 -9
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.esnext +20 -20
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/typescript.esnext +15 -15
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/yaml.esnext +64 -64
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/standalone.esnext +19 -19
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.esnext +16 -11
- package/build/esnext/node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.esnext +12 -5
- package/build/esnext/node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.esnext +29 -22
- package/build/esnext/node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.esnext +47 -40
- package/build/esnext/node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.esnext +196 -189
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-block-scalar.esnext +2 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.esnext +2 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-props.esnext +1 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/YAMLMap.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/lexer.esnext +5 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/parser.esnext +4 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/tags.esnext +3 -3
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/stringify/stringifyString.esnext +1 -1
- package/build/esnext/package.esnext +2 -2
- package/build/esnext/packages/cli-kit/build/esnext/prompt.esnext.esnext +1 -1
- package/build/esnext/server.esnext +5 -9
- package/build/esnext/shared/package-manager.esnext +1 -1
- package/build/esnext/shared/prompts.esnext +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/source/shared/prompts.ts +1 -1
- package/templates/app-basic/App.tsx +3 -4
- package/templates/app-basic/browser.tsx +5 -1
- package/templates/app-basic/foundation/html/Head.test.tsx +42 -0
- package/templates/app-basic/foundation/html/Head.tsx +34 -0
- package/templates/app-basic/foundation/html.ts +1 -1
- package/templates/app-basic/package.json +4 -4
- package/templates/app-basic/server.tsx +89 -3
- package/templates/app-empty/package.json +3 -3
- package/templates/app-empty/server.tsx +4 -3
- package/templates/app-graphql/App.tsx +3 -4
- package/templates/app-graphql/browser.tsx +5 -1
- package/templates/app-graphql/foundation/html/Head.test.tsx +42 -0
- package/templates/app-graphql/foundation/html/Head.tsx +34 -0
- package/templates/app-graphql/foundation/html.ts +1 -1
- package/templates/app-graphql/package.json +4 -4
- package/templates/app-graphql/server.tsx +93 -9
- package/templates/app-trpc/App.tsx +3 -4
- package/templates/app-trpc/browser.tsx +5 -1
- package/templates/app-trpc/foundation/html/Head.test.tsx +42 -0
- package/templates/app-trpc/foundation/html/Head.tsx +34 -0
- package/templates/app-trpc/foundation/html.ts +1 -1
- package/templates/app-trpc/package.json +4 -4
- package/templates/app-trpc/server.tsx +93 -8
- package/templates/package/package.json +3 -3
- package/templates/workspace/package.json +4 -4
- package/templates/app-basic/foundation/html/HTML.test.tsx +0 -46
- package/templates/app-basic/foundation/html/HTML.tsx +0 -159
- package/templates/app-graphql/foundation/html/HTML.test.tsx +0 -46
- package/templates/app-graphql/foundation/html/HTML.tsx +0 -159
- package/templates/app-trpc/foundation/html/HTML.test.tsx +0 -46
- package/templates/app-trpc/foundation/html/HTML.tsx +0 -159
|
@@ -1,833 +1,833 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { __require as requirePath } from './lib/path.mjs';
|
|
2
|
+
import { __require as requireBraceExpansion } from '../../../brace-expansion@2.0.1/node_modules/brace-expansion/index.mjs';
|
|
3
|
+
|
|
4
|
+
var minimatch_1;
|
|
5
|
+
var hasRequiredMinimatch;
|
|
6
|
+
function requireMinimatch() {
|
|
7
|
+
if (hasRequiredMinimatch) return minimatch_1;
|
|
8
|
+
hasRequiredMinimatch = 1;
|
|
9
|
+
const minimatch = minimatch_1 = (p, pattern, options = {}) => {
|
|
10
|
+
assertValidPattern(pattern);
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
|
|
12
|
+
// shortcut: comments match nothing.
|
|
13
|
+
if (!options.nocomment && pattern.charAt(0) === '#') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return new Minimatch(pattern, options).match(p);
|
|
17
|
+
};
|
|
18
|
+
minimatch_1 = minimatch;
|
|
19
|
+
const path = requirePath();
|
|
20
|
+
minimatch.sep = path.sep;
|
|
21
|
+
const GLOBSTAR = Symbol('globstar **');
|
|
22
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
23
|
+
const expand = requireBraceExpansion();
|
|
24
|
+
const plTypes = {
|
|
25
|
+
'!': {
|
|
26
|
+
open: '(?:(?!(?:',
|
|
27
|
+
close: '))[^/]*?)'
|
|
28
|
+
},
|
|
29
|
+
'?': {
|
|
30
|
+
open: '(?:',
|
|
31
|
+
close: ')?'
|
|
32
|
+
},
|
|
33
|
+
'+': {
|
|
34
|
+
open: '(?:',
|
|
35
|
+
close: ')+'
|
|
36
|
+
},
|
|
37
|
+
'*': {
|
|
38
|
+
open: '(?:',
|
|
39
|
+
close: ')*'
|
|
40
|
+
},
|
|
41
|
+
'@': {
|
|
42
|
+
open: '(?:',
|
|
43
|
+
close: ')'
|
|
44
|
+
}
|
|
45
|
+
};
|
|
7
46
|
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const star = qmark + '*?';
|
|
49
|
-
|
|
50
|
-
// ** when dots are allowed. Anything goes, except .. and .
|
|
51
|
-
// not (^ or / followed by one or two dots followed by $ or /),
|
|
52
|
-
// followed by anything, any number of times.
|
|
53
|
-
const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
|
|
54
|
-
|
|
55
|
-
// not a ^ or / followed by a dot,
|
|
56
|
-
// followed by anything, any number of times.
|
|
57
|
-
const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';
|
|
58
|
-
|
|
59
|
-
// "abc" -> { a:true, b:true, c:true }
|
|
60
|
-
const charSet = s => s.split('').reduce((set, c) => {
|
|
61
|
-
set[c] = true;
|
|
62
|
-
return set;
|
|
63
|
-
}, {});
|
|
64
|
-
|
|
65
|
-
// characters that need to be escaped in RegExp.
|
|
66
|
-
const reSpecials = charSet('().*{}+?[]^$\\!');
|
|
67
|
-
|
|
68
|
-
// characters that indicate we have to add the pattern start
|
|
69
|
-
const addPatternStartSet = charSet('[.(');
|
|
70
|
-
|
|
71
|
-
// normalizes slashes.
|
|
72
|
-
const slashSplit = /\/+/;
|
|
73
|
-
minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
|
|
74
|
-
const ext = (a, b = {}) => {
|
|
75
|
-
const t = {};
|
|
76
|
-
Object.keys(a).forEach(k => t[k] = a[k]);
|
|
77
|
-
Object.keys(b).forEach(k => t[k] = b[k]);
|
|
78
|
-
return t;
|
|
79
|
-
};
|
|
80
|
-
minimatch.defaults = def => {
|
|
81
|
-
if (!def || typeof def !== 'object' || !Object.keys(def).length) {
|
|
82
|
-
return minimatch;
|
|
83
|
-
}
|
|
84
|
-
const orig = minimatch;
|
|
85
|
-
const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
|
|
86
|
-
m.Minimatch = class Minimatch extends orig.Minimatch {
|
|
87
|
-
constructor(pattern, options) {
|
|
88
|
-
super(pattern, ext(def, options));
|
|
47
|
+
// any single thing other than /
|
|
48
|
+
// don't need to escape / when using new RegExp()
|
|
49
|
+
const qmark = '[^/]';
|
|
50
|
+
|
|
51
|
+
// * => any number of characters
|
|
52
|
+
const star = qmark + '*?';
|
|
53
|
+
|
|
54
|
+
// ** when dots are allowed. Anything goes, except .. and .
|
|
55
|
+
// not (^ or / followed by one or two dots followed by $ or /),
|
|
56
|
+
// followed by anything, any number of times.
|
|
57
|
+
const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
|
|
58
|
+
|
|
59
|
+
// not a ^ or / followed by a dot,
|
|
60
|
+
// followed by anything, any number of times.
|
|
61
|
+
const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';
|
|
62
|
+
|
|
63
|
+
// "abc" -> { a:true, b:true, c:true }
|
|
64
|
+
const charSet = s => s.split('').reduce((set, c) => {
|
|
65
|
+
set[c] = true;
|
|
66
|
+
return set;
|
|
67
|
+
}, {});
|
|
68
|
+
|
|
69
|
+
// characters that need to be escaped in RegExp.
|
|
70
|
+
const reSpecials = charSet('().*{}+?[]^$\\!');
|
|
71
|
+
|
|
72
|
+
// characters that indicate we have to add the pattern start
|
|
73
|
+
const addPatternStartSet = charSet('[.(');
|
|
74
|
+
|
|
75
|
+
// normalizes slashes.
|
|
76
|
+
const slashSplit = /\/+/;
|
|
77
|
+
minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
|
|
78
|
+
const ext = (a, b = {}) => {
|
|
79
|
+
const t = {};
|
|
80
|
+
Object.keys(a).forEach(k => t[k] = a[k]);
|
|
81
|
+
Object.keys(b).forEach(k => t[k] = b[k]);
|
|
82
|
+
return t;
|
|
83
|
+
};
|
|
84
|
+
minimatch.defaults = def => {
|
|
85
|
+
if (!def || typeof def !== 'object' || !Object.keys(def).length) {
|
|
86
|
+
return minimatch;
|
|
89
87
|
}
|
|
88
|
+
const orig = minimatch;
|
|
89
|
+
const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
|
|
90
|
+
m.Minimatch = class Minimatch extends orig.Minimatch {
|
|
91
|
+
constructor(pattern, options) {
|
|
92
|
+
super(pattern, ext(def, options));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch;
|
|
96
|
+
m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
|
|
97
|
+
m.defaults = options => orig.defaults(ext(def, options));
|
|
98
|
+
m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
|
|
99
|
+
m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
|
|
100
|
+
m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));
|
|
101
|
+
return m;
|
|
90
102
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
//
|
|
101
|
-
// a{b
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// a{b,c{d,e}f}g -> abg acdfg acefg
|
|
105
|
-
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
|
|
106
|
-
//
|
|
107
|
-
// Invalid sets are not expanded.
|
|
108
|
-
// a{2..}b -> a{2..}b
|
|
109
|
-
// a{b}c -> a{b}c
|
|
110
|
-
minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
|
|
111
|
-
const braceExpand = (pattern, options = {}) => {
|
|
112
|
-
assertValidPattern(pattern);
|
|
113
|
-
|
|
114
|
-
// Thanks to Yeting Li <https://github.com/yetingli> for
|
|
115
|
-
// improving this regexp to avoid a ReDOS vulnerability.
|
|
116
|
-
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
117
|
-
// shortcut. no need to expand.
|
|
118
|
-
return [pattern];
|
|
119
|
-
}
|
|
120
|
-
return expand(pattern);
|
|
121
|
-
};
|
|
122
|
-
const MAX_PATTERN_LENGTH = 1024 * 64;
|
|
123
|
-
const assertValidPattern = pattern => {
|
|
124
|
-
if (typeof pattern !== 'string') {
|
|
125
|
-
throw new TypeError('invalid pattern');
|
|
126
|
-
}
|
|
127
|
-
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
128
|
-
throw new TypeError('pattern is too long');
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// parse a component of the expanded set.
|
|
133
|
-
// At this point, no pattern may contain "/" in it
|
|
134
|
-
// so we're going to return a 2d array, where each entry is the full
|
|
135
|
-
// pattern, split on '/', and then turned into a regular expression.
|
|
136
|
-
// A regexp is made at the end which joins each array with an
|
|
137
|
-
// escaped /, and another full one which joins each regexp with |.
|
|
138
|
-
//
|
|
139
|
-
// Following the lead of Bash 4.1, note that "**" only has special meaning
|
|
140
|
-
// when it is the *only* thing in a path portion. Otherwise, any series
|
|
141
|
-
// of * is equivalent to a single *. Globstar behavior is enabled by
|
|
142
|
-
// default, and can be disabled by setting options.noglobstar.
|
|
143
|
-
const SUBPARSE = Symbol('subparse');
|
|
144
|
-
minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
|
|
145
|
-
minimatch.match = (list, pattern, options = {}) => {
|
|
146
|
-
const mm = new Minimatch(pattern, options);
|
|
147
|
-
list = list.filter(f => mm.match(f));
|
|
148
|
-
if (mm.options.nonull && !list.length) {
|
|
149
|
-
list.push(pattern);
|
|
150
|
-
}
|
|
151
|
-
return list;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// replace stuff like \* with *
|
|
155
|
-
const globUnescape = s => s.replace(/\\(.)/g, '$1');
|
|
156
|
-
const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
157
|
-
class Minimatch {
|
|
158
|
-
constructor(pattern, options) {
|
|
103
|
+
|
|
104
|
+
// Brace expansion:
|
|
105
|
+
// a{b,c}d -> abd acd
|
|
106
|
+
// a{b,}c -> abc ac
|
|
107
|
+
// a{0..3}d -> a0d a1d a2d a3d
|
|
108
|
+
// a{b,c{d,e}f}g -> abg acdfg acefg
|
|
109
|
+
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
|
|
110
|
+
//
|
|
111
|
+
// Invalid sets are not expanded.
|
|
112
|
+
// a{2..}b -> a{2..}b
|
|
113
|
+
// a{b}c -> a{b}c
|
|
114
|
+
minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
|
|
115
|
+
const braceExpand = (pattern, options = {}) => {
|
|
159
116
|
assertValidPattern(pattern);
|
|
160
|
-
if (!options) options = {};
|
|
161
|
-
this.options = options;
|
|
162
|
-
this.set = [];
|
|
163
|
-
this.pattern = pattern;
|
|
164
|
-
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
165
|
-
if (this.windowsPathsNoEscape) {
|
|
166
|
-
this.pattern = this.pattern.replace(/\\/g, '/');
|
|
167
|
-
}
|
|
168
|
-
this.regexp = null;
|
|
169
|
-
this.negate = false;
|
|
170
|
-
this.comment = false;
|
|
171
|
-
this.empty = false;
|
|
172
|
-
this.partial = !!options.partial;
|
|
173
|
-
|
|
174
|
-
// make the set of regexps etc.
|
|
175
|
-
this.make();
|
|
176
|
-
}
|
|
177
|
-
debug() {}
|
|
178
|
-
make() {
|
|
179
|
-
const pattern = this.pattern;
|
|
180
|
-
const options = this.options;
|
|
181
117
|
|
|
182
|
-
//
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
118
|
+
// Thanks to Yeting Li <https://github.com/yetingli> for
|
|
119
|
+
// improving this regexp to avoid a ReDOS vulnerability.
|
|
120
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
121
|
+
// shortcut. no need to expand.
|
|
122
|
+
return [pattern];
|
|
123
|
+
}
|
|
124
|
+
return expand(pattern);
|
|
125
|
+
};
|
|
126
|
+
const MAX_PATTERN_LENGTH = 1024 * 64;
|
|
127
|
+
const assertValidPattern = pattern => {
|
|
128
|
+
if (typeof pattern !== 'string') {
|
|
129
|
+
throw new TypeError('invalid pattern');
|
|
186
130
|
}
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
return;
|
|
131
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
132
|
+
throw new TypeError('pattern is too long');
|
|
190
133
|
}
|
|
134
|
+
};
|
|
191
135
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.debug(this.pattern, set);
|
|
211
|
-
|
|
212
|
-
// filter out everything that didn't compile properly.
|
|
213
|
-
set = set.filter(s => s.indexOf(false) === -1);
|
|
214
|
-
this.debug(this.pattern, set);
|
|
215
|
-
this.set = set;
|
|
216
|
-
}
|
|
217
|
-
parseNegate() {
|
|
218
|
-
if (this.options.nonegate) return;
|
|
219
|
-
const pattern = this.pattern;
|
|
220
|
-
let negate = false;
|
|
221
|
-
let negateOffset = 0;
|
|
222
|
-
for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
|
|
223
|
-
negate = !negate;
|
|
224
|
-
negateOffset++;
|
|
136
|
+
// parse a component of the expanded set.
|
|
137
|
+
// At this point, no pattern may contain "/" in it
|
|
138
|
+
// so we're going to return a 2d array, where each entry is the full
|
|
139
|
+
// pattern, split on '/', and then turned into a regular expression.
|
|
140
|
+
// A regexp is made at the end which joins each array with an
|
|
141
|
+
// escaped /, and another full one which joins each regexp with |.
|
|
142
|
+
//
|
|
143
|
+
// Following the lead of Bash 4.1, note that "**" only has special meaning
|
|
144
|
+
// when it is the *only* thing in a path portion. Otherwise, any series
|
|
145
|
+
// of * is equivalent to a single *. Globstar behavior is enabled by
|
|
146
|
+
// default, and can be disabled by setting options.noglobstar.
|
|
147
|
+
const SUBPARSE = Symbol('subparse');
|
|
148
|
+
minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
|
|
149
|
+
minimatch.match = (list, pattern, options = {}) => {
|
|
150
|
+
const mm = new Minimatch(pattern, options);
|
|
151
|
+
list = list.filter(f => mm.match(f));
|
|
152
|
+
if (mm.options.nonull && !list.length) {
|
|
153
|
+
list.push(pattern);
|
|
225
154
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
155
|
+
return list;
|
|
156
|
+
};
|
|
229
157
|
|
|
230
|
-
//
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
this.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
this.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
//
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
//
|
|
268
|
-
// a/**/b/**/c matching a/b/x/y/z/c
|
|
269
|
-
// - a matches a
|
|
270
|
-
// - doublestar
|
|
271
|
-
// - matchOne(b/x/y/z/c, b/**/c)
|
|
272
|
-
// - b matches b
|
|
273
|
-
// - doublestar
|
|
274
|
-
// - matchOne(x/y/z/c, c) -> no
|
|
275
|
-
// - matchOne(y/z/c, c) -> no
|
|
276
|
-
// - matchOne(z/c, c) -> no
|
|
277
|
-
// - matchOne(c, c) yes, hit
|
|
278
|
-
var fr = fi;
|
|
279
|
-
var pr = pi + 1;
|
|
280
|
-
if (pr === pl) {
|
|
281
|
-
this.debug('** at the end');
|
|
282
|
-
// a ** at the end will just swallow the rest.
|
|
283
|
-
// We have found a match.
|
|
284
|
-
// however, it will not swallow /.x, unless
|
|
285
|
-
// options.dot is set.
|
|
286
|
-
// . and .. are *never* matched by **, for explosively
|
|
287
|
-
// exponential reasons.
|
|
288
|
-
for (; fi < fl; fi++) {
|
|
289
|
-
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
|
|
290
|
-
}
|
|
291
|
-
return true;
|
|
292
|
-
}
|
|
158
|
+
// replace stuff like \* with *
|
|
159
|
+
const globUnescape = s => s.replace(/\\(.)/g, '$1');
|
|
160
|
+
const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
161
|
+
class Minimatch {
|
|
162
|
+
constructor(pattern, options) {
|
|
163
|
+
assertValidPattern(pattern);
|
|
164
|
+
if (!options) options = {};
|
|
165
|
+
this.options = options;
|
|
166
|
+
this.set = [];
|
|
167
|
+
this.pattern = pattern;
|
|
168
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
169
|
+
if (this.windowsPathsNoEscape) {
|
|
170
|
+
this.pattern = this.pattern.replace(/\\/g, '/');
|
|
171
|
+
}
|
|
172
|
+
this.regexp = null;
|
|
173
|
+
this.negate = false;
|
|
174
|
+
this.comment = false;
|
|
175
|
+
this.empty = false;
|
|
176
|
+
this.partial = !!options.partial;
|
|
177
|
+
|
|
178
|
+
// make the set of regexps etc.
|
|
179
|
+
this.make();
|
|
180
|
+
}
|
|
181
|
+
debug() {}
|
|
182
|
+
make() {
|
|
183
|
+
const pattern = this.pattern;
|
|
184
|
+
const options = this.options;
|
|
185
|
+
|
|
186
|
+
// empty patterns and comments match nothing.
|
|
187
|
+
if (!options.nocomment && pattern.charAt(0) === '#') {
|
|
188
|
+
this.comment = true;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (!pattern) {
|
|
192
|
+
this.empty = true;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
293
195
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
196
|
+
// step 1: figure out negation, etc.
|
|
197
|
+
this.parseNegate();
|
|
198
|
+
|
|
199
|
+
// step 2: expand braces
|
|
200
|
+
let set = this.globSet = this.braceExpand();
|
|
201
|
+
if (options.debug) this.debug = (...args) => console.error(...args);
|
|
202
|
+
this.debug(this.pattern, set);
|
|
203
|
+
|
|
204
|
+
// step 3: now we have a set, so turn each one into a series of path-portion
|
|
205
|
+
// matching patterns.
|
|
206
|
+
// These will be regexps, except in the case of "**", which is
|
|
207
|
+
// set to the GLOBSTAR object for globstar behavior,
|
|
208
|
+
// and will not contain any / characters
|
|
209
|
+
set = this.globParts = set.map(s => s.split(slashSplit));
|
|
210
|
+
this.debug(this.pattern, set);
|
|
211
|
+
|
|
212
|
+
// glob --> regexps
|
|
213
|
+
set = set.map((s, si, set) => s.map(this.parse, this));
|
|
214
|
+
this.debug(this.pattern, set);
|
|
215
|
+
|
|
216
|
+
// filter out everything that didn't compile properly.
|
|
217
|
+
set = set.filter(s => s.indexOf(false) === -1);
|
|
218
|
+
this.debug(this.pattern, set);
|
|
219
|
+
this.set = set;
|
|
220
|
+
}
|
|
221
|
+
parseNegate() {
|
|
222
|
+
if (this.options.nonegate) return;
|
|
223
|
+
const pattern = this.pattern;
|
|
224
|
+
let negate = false;
|
|
225
|
+
let negateOffset = 0;
|
|
226
|
+
for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
|
|
227
|
+
negate = !negate;
|
|
228
|
+
negateOffset++;
|
|
229
|
+
}
|
|
230
|
+
if (negateOffset) this.pattern = pattern.substr(negateOffset);
|
|
231
|
+
this.negate = negate;
|
|
232
|
+
}
|
|
298
233
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
234
|
+
// set partial to true to test if, for example,
|
|
235
|
+
// "/a/b" matches the start of "/*/b/*/d"
|
|
236
|
+
// Partial means, if you run out of file before you run
|
|
237
|
+
// out of pattern, then that's fine, as long as all
|
|
238
|
+
// the parts match.
|
|
239
|
+
matchOne(file, pattern, partial) {
|
|
240
|
+
var options = this.options;
|
|
241
|
+
this.debug('matchOne', {
|
|
242
|
+
'this': this,
|
|
243
|
+
file: file,
|
|
244
|
+
pattern: pattern
|
|
245
|
+
});
|
|
246
|
+
this.debug('matchOne', file.length, pattern.length);
|
|
247
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
248
|
+
this.debug('matchOne loop');
|
|
249
|
+
var p = pattern[pi];
|
|
250
|
+
var f = file[fi];
|
|
251
|
+
this.debug(pattern, p, f);
|
|
252
|
+
|
|
253
|
+
// should be impossible.
|
|
254
|
+
// some invalid regexp stuff in the set.
|
|
255
|
+
/* istanbul ignore if */
|
|
256
|
+
if (p === false) return false;
|
|
257
|
+
if (p === GLOBSTAR) {
|
|
258
|
+
this.debug('GLOBSTAR', [pattern, p, f]);
|
|
259
|
+
|
|
260
|
+
// "**"
|
|
261
|
+
// a/**/b/**/c would match the following:
|
|
262
|
+
// a/b/x/y/z/c
|
|
263
|
+
// a/x/y/z/b/c
|
|
264
|
+
// a/b/x/b/x/c
|
|
265
|
+
// a/b/c
|
|
266
|
+
// To do this, take the rest of the pattern after
|
|
267
|
+
// the **, and see if it would match the file remainder.
|
|
268
|
+
// If so, return success.
|
|
269
|
+
// If not, the ** "swallows" a segment, and try again.
|
|
270
|
+
// This is recursively awful.
|
|
271
|
+
//
|
|
272
|
+
// a/**/b/**/c matching a/b/x/y/z/c
|
|
273
|
+
// - a matches a
|
|
274
|
+
// - doublestar
|
|
275
|
+
// - matchOne(b/x/y/z/c, b/**/c)
|
|
276
|
+
// - b matches b
|
|
277
|
+
// - doublestar
|
|
278
|
+
// - matchOne(x/y/z/c, c) -> no
|
|
279
|
+
// - matchOne(y/z/c, c) -> no
|
|
280
|
+
// - matchOne(z/c, c) -> no
|
|
281
|
+
// - matchOne(c, c) yes, hit
|
|
282
|
+
var fr = fi;
|
|
283
|
+
var pr = pi + 1;
|
|
284
|
+
if (pr === pl) {
|
|
285
|
+
this.debug('** at the end');
|
|
286
|
+
// a ** at the end will just swallow the rest.
|
|
287
|
+
// We have found a match.
|
|
288
|
+
// however, it will not swallow /.x, unless
|
|
289
|
+
// options.dot is set.
|
|
290
|
+
// . and .. are *never* matched by **, for explosively
|
|
291
|
+
// exponential reasons.
|
|
292
|
+
for (; fi < fl; fi++) {
|
|
293
|
+
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
|
|
294
|
+
}
|
|
303
295
|
return true;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// ok, let's see if we can swallow whatever we can.
|
|
299
|
+
while (fr < fl) {
|
|
300
|
+
var swallowee = file[fr];
|
|
301
|
+
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
|
|
302
|
+
|
|
303
|
+
// XXX remove this slice. Just pass the start index.
|
|
304
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
305
|
+
this.debug('globstar found match!', fr, fl, swallowee);
|
|
306
|
+
// found a match.
|
|
307
|
+
return true;
|
|
308
|
+
} else {
|
|
309
|
+
// can't swallow "." or ".." ever.
|
|
310
|
+
// can only swallow ".foo" when explicitly asked.
|
|
311
|
+
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
|
|
312
|
+
this.debug('dot detected!', file, fr, pattern, pr);
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ** swallows a segment, and continue.
|
|
317
|
+
this.debug('globstar swallow a segment, and continue');
|
|
318
|
+
fr++;
|
|
310
319
|
}
|
|
320
|
+
}
|
|
311
321
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
322
|
+
// no match was found.
|
|
323
|
+
// However, in partial mode, we can't say this is necessarily over.
|
|
324
|
+
// If there's more *pattern* left, then
|
|
325
|
+
/* istanbul ignore if */
|
|
326
|
+
if (partial) {
|
|
327
|
+
// ran out of file
|
|
328
|
+
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
|
|
329
|
+
if (fr === fl) return true;
|
|
315
330
|
}
|
|
331
|
+
return false;
|
|
316
332
|
}
|
|
317
333
|
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
//
|
|
321
|
-
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
this.debug('
|
|
325
|
-
|
|
334
|
+
// something other than **
|
|
335
|
+
// non-magic patterns just have to match exactly
|
|
336
|
+
// patterns with magic have been turned into regexps.
|
|
337
|
+
var hit;
|
|
338
|
+
if (typeof p === 'string') {
|
|
339
|
+
hit = f === p;
|
|
340
|
+
this.debug('string match', p, f, hit);
|
|
341
|
+
} else {
|
|
342
|
+
hit = f.match(p);
|
|
343
|
+
this.debug('pattern match', p, f, hit);
|
|
326
344
|
}
|
|
327
|
-
return false;
|
|
345
|
+
if (!hit) return false;
|
|
328
346
|
}
|
|
329
347
|
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
// an exact hit!
|
|
359
|
-
return true;
|
|
360
|
-
} else if (fi === fl) {
|
|
361
|
-
// ran out of file, but still had pattern left.
|
|
362
|
-
// this is ok if we're doing the match as part of
|
|
363
|
-
// a glob fs traversal.
|
|
364
|
-
return partial;
|
|
365
|
-
} else /* istanbul ignore else */if (pi === pl) {
|
|
366
|
-
// ran out of pattern, still have file left.
|
|
367
|
-
// this is only acceptable if we're on the very last
|
|
368
|
-
// empty segment of a file with a trailing slash.
|
|
369
|
-
// a/* should match a/b/
|
|
370
|
-
return fi === fl - 1 && file[fi] === '';
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
// should be unreachable.
|
|
374
|
-
/* istanbul ignore next */
|
|
375
|
-
throw new Error('wtf?');
|
|
376
|
-
}
|
|
377
|
-
braceExpand() {
|
|
378
|
-
return braceExpand(this.pattern, this.options);
|
|
379
|
-
}
|
|
380
|
-
parse(pattern, isSub) {
|
|
381
|
-
assertValidPattern(pattern);
|
|
382
|
-
const options = this.options;
|
|
348
|
+
// Note: ending in / means that we'll get a final ""
|
|
349
|
+
// at the end of the pattern. This can only match a
|
|
350
|
+
// corresponding "" at the end of the file.
|
|
351
|
+
// If the file ends in /, then it can only match a
|
|
352
|
+
// a pattern that ends in /, unless the pattern just
|
|
353
|
+
// doesn't have any more for it. But, a/b/ should *not*
|
|
354
|
+
// match "a/b/*", even though "" matches against the
|
|
355
|
+
// [^/]*? pattern, except in partial mode, where it might
|
|
356
|
+
// simply not be reached yet.
|
|
357
|
+
// However, a/b/ should still satisfy a/*
|
|
358
|
+
|
|
359
|
+
// now either we fell off the end of the pattern, or we're done.
|
|
360
|
+
if (fi === fl && pi === pl) {
|
|
361
|
+
// ran out of pattern and filename at the same time.
|
|
362
|
+
// an exact hit!
|
|
363
|
+
return true;
|
|
364
|
+
} else if (fi === fl) {
|
|
365
|
+
// ran out of file, but still had pattern left.
|
|
366
|
+
// this is ok if we're doing the match as part of
|
|
367
|
+
// a glob fs traversal.
|
|
368
|
+
return partial;
|
|
369
|
+
} else /* istanbul ignore else */if (pi === pl) {
|
|
370
|
+
// ran out of pattern, still have file left.
|
|
371
|
+
// this is only acceptable if we're on the very last
|
|
372
|
+
// empty segment of a file with a trailing slash.
|
|
373
|
+
// a/* should match a/b/
|
|
374
|
+
return fi === fl - 1 && file[fi] === '';
|
|
375
|
+
}
|
|
383
376
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
377
|
+
// should be unreachable.
|
|
378
|
+
/* istanbul ignore next */
|
|
379
|
+
throw new Error('wtf?');
|
|
387
380
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
const negativeLists = [];
|
|
395
|
-
let stateChar;
|
|
396
|
-
let inClass = false;
|
|
397
|
-
let reClassStart = -1;
|
|
398
|
-
let classStart = -1;
|
|
399
|
-
let cs;
|
|
400
|
-
let pl;
|
|
401
|
-
let sp;
|
|
402
|
-
// . and .. never match anything that doesn't start with .,
|
|
403
|
-
// even when options.dot is set.
|
|
404
|
-
const patternStart = pattern.charAt(0) === '.' ? '' // anything
|
|
405
|
-
// not (start or / followed by . or .. followed by / or end)
|
|
406
|
-
: options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)';
|
|
407
|
-
const clearStateChar = () => {
|
|
408
|
-
if (stateChar) {
|
|
409
|
-
// we had some state-tracking character
|
|
410
|
-
// that wasn't consumed by this pass.
|
|
411
|
-
switch (stateChar) {
|
|
412
|
-
case '*':
|
|
413
|
-
re += star;
|
|
414
|
-
hasMagic = true;
|
|
415
|
-
break;
|
|
416
|
-
case '?':
|
|
417
|
-
re += qmark;
|
|
418
|
-
hasMagic = true;
|
|
419
|
-
break;
|
|
420
|
-
default:
|
|
421
|
-
re += '\\' + stateChar;
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
this.debug('clearStateChar %j %j', stateChar, re);
|
|
425
|
-
stateChar = false;
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
|
|
429
|
-
this.debug('%s\t%s %s %j', pattern, i, re, c);
|
|
381
|
+
braceExpand() {
|
|
382
|
+
return braceExpand(this.pattern, this.options);
|
|
383
|
+
}
|
|
384
|
+
parse(pattern, isSub) {
|
|
385
|
+
assertValidPattern(pattern);
|
|
386
|
+
const options = this.options;
|
|
430
387
|
|
|
431
|
-
//
|
|
432
|
-
if (
|
|
433
|
-
|
|
434
|
-
if (c === '/') {
|
|
435
|
-
return false;
|
|
436
|
-
}
|
|
437
|
-
if (reSpecials[c]) {
|
|
438
|
-
re += '\\';
|
|
439
|
-
}
|
|
440
|
-
re += c;
|
|
441
|
-
escaping = false;
|
|
442
|
-
continue;
|
|
388
|
+
// shortcuts
|
|
389
|
+
if (pattern === '**') {
|
|
390
|
+
if (!options.noglobstar) return GLOBSTAR;else pattern = '*';
|
|
443
391
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
392
|
+
if (pattern === '') return '';
|
|
393
|
+
let re = '';
|
|
394
|
+
let hasMagic = !!options.nocase;
|
|
395
|
+
let escaping = false;
|
|
396
|
+
// ? => one single character
|
|
397
|
+
const patternListStack = [];
|
|
398
|
+
const negativeLists = [];
|
|
399
|
+
let stateChar;
|
|
400
|
+
let inClass = false;
|
|
401
|
+
let reClassStart = -1;
|
|
402
|
+
let classStart = -1;
|
|
403
|
+
let cs;
|
|
404
|
+
let pl;
|
|
405
|
+
let sp;
|
|
406
|
+
// . and .. never match anything that doesn't start with .,
|
|
407
|
+
// even when options.dot is set.
|
|
408
|
+
const patternStart = pattern.charAt(0) === '.' ? '' // anything
|
|
409
|
+
// not (start or / followed by . or .. followed by / or end)
|
|
410
|
+
: options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)';
|
|
411
|
+
const clearStateChar = () => {
|
|
412
|
+
if (stateChar) {
|
|
413
|
+
// we had some state-tracking character
|
|
414
|
+
// that wasn't consumed by this pass.
|
|
415
|
+
switch (stateChar) {
|
|
416
|
+
case '*':
|
|
417
|
+
re += star;
|
|
418
|
+
hasMagic = true;
|
|
419
|
+
break;
|
|
420
|
+
case '?':
|
|
421
|
+
re += qmark;
|
|
422
|
+
hasMagic = true;
|
|
423
|
+
break;
|
|
424
|
+
default:
|
|
425
|
+
re += '\\' + stateChar;
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
this.debug('clearStateChar %j %j', stateChar, re);
|
|
429
|
+
stateChar = false;
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
|
|
433
|
+
this.debug('%s\t%s %s %j', pattern, i, re, c);
|
|
434
|
+
|
|
435
|
+
// skip over any that are escaped.
|
|
436
|
+
if (escaping) {
|
|
437
|
+
/* istanbul ignore next - completely not allowed, even escaped. */
|
|
438
|
+
if (c === '/') {
|
|
449
439
|
return false;
|
|
450
440
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
441
|
+
if (reSpecials[c]) {
|
|
442
|
+
re += '\\';
|
|
443
|
+
}
|
|
444
|
+
re += c;
|
|
445
|
+
escaping = false;
|
|
454
446
|
continue;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
// the glob [!a] means [^a] in regexp
|
|
467
|
-
if (inClass) {
|
|
468
|
-
this.debug(' in class');
|
|
469
|
-
if (c === '!' && i === classStart + 1) c = '^';
|
|
470
|
-
re += c;
|
|
447
|
+
}
|
|
448
|
+
switch (c) {
|
|
449
|
+
/* istanbul ignore next */
|
|
450
|
+
case '/':
|
|
451
|
+
{
|
|
452
|
+
// Should already be path-split by now.
|
|
453
|
+
return false;
|
|
454
|
+
}
|
|
455
|
+
case '\\':
|
|
456
|
+
clearStateChar();
|
|
457
|
+
escaping = true;
|
|
471
458
|
continue;
|
|
472
|
-
}
|
|
473
459
|
|
|
474
|
-
//
|
|
475
|
-
//
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
460
|
+
// the various stateChar values
|
|
461
|
+
// for the "extglob" stuff.
|
|
462
|
+
case '?':
|
|
463
|
+
case '*':
|
|
464
|
+
case '+':
|
|
465
|
+
case '@':
|
|
466
|
+
case '!':
|
|
467
|
+
this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
|
|
468
|
+
|
|
469
|
+
// all of those are literals inside a class, except that
|
|
470
|
+
// the glob [!a] means [^a] in regexp
|
|
471
|
+
if (inClass) {
|
|
472
|
+
this.debug(' in class');
|
|
473
|
+
if (c === '!' && i === classStart + 1) c = '^';
|
|
474
|
+
re += c;
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// if we already have a stateChar, then it means
|
|
479
|
+
// that there was something like ** or +? in there.
|
|
480
|
+
// Handle the stateChar, then proceed with this one.
|
|
481
|
+
this.debug('call clearStateChar %j', stateChar);
|
|
482
|
+
clearStateChar();
|
|
483
|
+
stateChar = c;
|
|
484
|
+
// if extglob is disabled, then +(asdf|foo) isn't a thing.
|
|
485
|
+
// just clear the statechar *now*, rather than even diving into
|
|
486
|
+
// the patternList stuff.
|
|
487
|
+
if (options.noext) clearStateChar();
|
|
488
488
|
continue;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
case '(':
|
|
490
|
+
if (inClass) {
|
|
491
|
+
re += '(';
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
if (!stateChar) {
|
|
495
|
+
re += '\\(';
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
patternListStack.push({
|
|
499
|
+
type: stateChar,
|
|
500
|
+
start: i - 1,
|
|
501
|
+
reStart: re.length,
|
|
502
|
+
open: plTypes[stateChar].open,
|
|
503
|
+
close: plTypes[stateChar].close
|
|
504
|
+
});
|
|
505
|
+
// negation is (?:(?!js)[^/]*)
|
|
506
|
+
re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
|
|
507
|
+
this.debug('plType %j %j', stateChar, re);
|
|
508
|
+
stateChar = false;
|
|
492
509
|
continue;
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
re += '\\)';
|
|
510
|
+
case ')':
|
|
511
|
+
if (inClass || !patternListStack.length) {
|
|
512
|
+
re += '\\)';
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
clearStateChar();
|
|
516
|
+
hasMagic = true;
|
|
517
|
+
pl = patternListStack.pop();
|
|
518
|
+
// negation is (?:(?!js)[^/]*)
|
|
519
|
+
// The others are (?:<pattern>)<type>
|
|
520
|
+
re += pl.close;
|
|
521
|
+
if (pl.type === '!') {
|
|
522
|
+
negativeLists.push(pl);
|
|
523
|
+
}
|
|
524
|
+
pl.reEnd = re.length;
|
|
509
525
|
continue;
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
if (pl.type === '!') {
|
|
518
|
-
negativeLists.push(pl);
|
|
519
|
-
}
|
|
520
|
-
pl.reEnd = re.length;
|
|
521
|
-
continue;
|
|
522
|
-
case '|':
|
|
523
|
-
if (inClass || !patternListStack.length) {
|
|
524
|
-
re += '\\|';
|
|
526
|
+
case '|':
|
|
527
|
+
if (inClass || !patternListStack.length) {
|
|
528
|
+
re += '\\|';
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
clearStateChar();
|
|
532
|
+
re += '|';
|
|
525
533
|
continue;
|
|
526
|
-
}
|
|
527
|
-
clearStateChar();
|
|
528
|
-
re += '|';
|
|
529
|
-
continue;
|
|
530
534
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
continue;
|
|
544
|
-
case ']':
|
|
545
|
-
// a right bracket shall lose its special
|
|
546
|
-
// meaning and represent itself in
|
|
547
|
-
// a bracket expression if it occurs
|
|
548
|
-
// first in the list. -- POSIX.2 2.8.3.2
|
|
549
|
-
if (i === classStart + 1 || !inClass) {
|
|
550
|
-
re += '\\' + c;
|
|
535
|
+
// these are mostly the same in regexp and glob
|
|
536
|
+
case '[':
|
|
537
|
+
// swallow any state-tracking char before the [
|
|
538
|
+
clearStateChar();
|
|
539
|
+
if (inClass) {
|
|
540
|
+
re += '\\' + c;
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
inClass = true;
|
|
544
|
+
classStart = i;
|
|
545
|
+
reClassStart = re.length;
|
|
546
|
+
re += c;
|
|
551
547
|
continue;
|
|
552
|
-
|
|
548
|
+
case ']':
|
|
549
|
+
// a right bracket shall lose its special
|
|
550
|
+
// meaning and represent itself in
|
|
551
|
+
// a bracket expression if it occurs
|
|
552
|
+
// first in the list. -- POSIX.2 2.8.3.2
|
|
553
|
+
if (i === classStart + 1 || !inClass) {
|
|
554
|
+
re += '\\' + c;
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
553
557
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
558
|
+
// handle the case where we left a class open.
|
|
559
|
+
// "[z-a]" is valid, equivalent to "\[z-a\]"
|
|
560
|
+
// split where the last [ was, make sure we don't have
|
|
561
|
+
// an invalid re. if so, re-walk the contents of the
|
|
562
|
+
// would-be class to re-translate any characters that
|
|
563
|
+
// were passed through as-is
|
|
564
|
+
// TODO: It would probably be faster to determine this
|
|
565
|
+
// without a try/catch and a new RegExp, but it's tricky
|
|
566
|
+
// to do safely. For now, this is safe and works.
|
|
567
|
+
cs = pattern.substring(classStart + 1, i);
|
|
568
|
+
try {
|
|
569
|
+
RegExp('[' + cs + ']');
|
|
570
|
+
} catch (er) {
|
|
571
|
+
// not a valid class!
|
|
572
|
+
sp = this.parse(cs, SUBPARSE);
|
|
573
|
+
re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
|
|
574
|
+
hasMagic = hasMagic || sp[1];
|
|
575
|
+
inClass = false;
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// finish up the class.
|
|
580
|
+
hasMagic = true;
|
|
571
581
|
inClass = false;
|
|
582
|
+
re += c;
|
|
572
583
|
continue;
|
|
573
|
-
|
|
584
|
+
default:
|
|
585
|
+
// swallow any state char that wasn't consumed
|
|
586
|
+
clearStateChar();
|
|
587
|
+
if (reSpecials[c] && !(c === '^' && inClass)) {
|
|
588
|
+
re += '\\';
|
|
589
|
+
}
|
|
590
|
+
re += c;
|
|
591
|
+
break;
|
|
592
|
+
} // switch
|
|
593
|
+
} // for
|
|
594
|
+
|
|
595
|
+
// handle the case where we left a class open.
|
|
596
|
+
// "[abc" is valid, equivalent to "\[abc"
|
|
597
|
+
if (inClass) {
|
|
598
|
+
// split where the last [ was, and escape it
|
|
599
|
+
// this is a huge pita. We now have to re-walk
|
|
600
|
+
// the contents of the would-be class to re-translate
|
|
601
|
+
// any characters that were passed through as-is
|
|
602
|
+
cs = pattern.substr(classStart + 1);
|
|
603
|
+
sp = this.parse(cs, SUBPARSE);
|
|
604
|
+
re = re.substr(0, reClassStart) + '\\[' + sp[0];
|
|
605
|
+
hasMagic = hasMagic || sp[1];
|
|
606
|
+
}
|
|
574
607
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
608
|
+
// handle the case where we had a +( thing at the *end*
|
|
609
|
+
// of the pattern.
|
|
610
|
+
// each pattern list stack adds 3 chars, and we need to go through
|
|
611
|
+
// and escape any | chars that were passed through as-is for the regexp.
|
|
612
|
+
// Go through and escape them, taking care not to double-escape any
|
|
613
|
+
// | chars that were already escaped.
|
|
614
|
+
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
|
615
|
+
let tail;
|
|
616
|
+
tail = re.slice(pl.reStart + pl.open.length);
|
|
617
|
+
this.debug('setting tail', re, pl);
|
|
618
|
+
// maybe some even number of \, then maybe 1 \, followed by a |
|
|
619
|
+
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
|
|
620
|
+
/* istanbul ignore else - should already be done */
|
|
621
|
+
if (!$2) {
|
|
622
|
+
// the | isn't already escaped, so escape it.
|
|
623
|
+
$2 = '\\';
|
|
585
624
|
}
|
|
586
|
-
re += c;
|
|
587
|
-
break;
|
|
588
|
-
} // switch
|
|
589
|
-
} // for
|
|
590
|
-
|
|
591
|
-
// handle the case where we left a class open.
|
|
592
|
-
// "[abc" is valid, equivalent to "\[abc"
|
|
593
|
-
if (inClass) {
|
|
594
|
-
// split where the last [ was, and escape it
|
|
595
|
-
// this is a huge pita. We now have to re-walk
|
|
596
|
-
// the contents of the would-be class to re-translate
|
|
597
|
-
// any characters that were passed through as-is
|
|
598
|
-
cs = pattern.substr(classStart + 1);
|
|
599
|
-
sp = this.parse(cs, SUBPARSE);
|
|
600
|
-
re = re.substr(0, reClassStart) + '\\[' + sp[0];
|
|
601
|
-
hasMagic = hasMagic || sp[1];
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
// handle the case where we had a +( thing at the *end*
|
|
605
|
-
// of the pattern.
|
|
606
|
-
// each pattern list stack adds 3 chars, and we need to go through
|
|
607
|
-
// and escape any | chars that were passed through as-is for the regexp.
|
|
608
|
-
// Go through and escape them, taking care not to double-escape any
|
|
609
|
-
// | chars that were already escaped.
|
|
610
|
-
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
|
611
|
-
let tail;
|
|
612
|
-
tail = re.slice(pl.reStart + pl.open.length);
|
|
613
|
-
this.debug('setting tail', re, pl);
|
|
614
|
-
// maybe some even number of \, then maybe 1 \, followed by a |
|
|
615
|
-
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
|
|
616
|
-
/* istanbul ignore else - should already be done */
|
|
617
|
-
if (!$2) {
|
|
618
|
-
// the | isn't already escaped, so escape it.
|
|
619
|
-
$2 = '\\';
|
|
620
|
-
}
|
|
621
625
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
626
|
+
// need to escape all those slashes *again*, without escaping the
|
|
627
|
+
// one that we need for escaping the | character. As it works out,
|
|
628
|
+
// escaping an even number of slashes can be done by simply repeating
|
|
629
|
+
// it exactly after itself. That's why this trick works.
|
|
630
|
+
//
|
|
631
|
+
// I am sorry that you have to see this.
|
|
632
|
+
return $1 + $1 + $2 + '|';
|
|
633
|
+
});
|
|
634
|
+
this.debug('tail=%j\n %s', tail, tail, pl, re);
|
|
635
|
+
const t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type;
|
|
636
|
+
hasMagic = true;
|
|
637
|
+
re = re.slice(0, pl.reStart) + t + '\\(' + tail;
|
|
638
|
+
}
|
|
635
639
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
640
|
+
// handle trailing things that only matter at the very end.
|
|
641
|
+
clearStateChar();
|
|
642
|
+
if (escaping) {
|
|
643
|
+
// trailing \\
|
|
644
|
+
re += '\\\\';
|
|
645
|
+
}
|
|
642
646
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
647
|
+
// only need to apply the nodot start if the re starts with
|
|
648
|
+
// something that could conceivably capture a dot
|
|
649
|
+
const addPatternStart = addPatternStartSet[re.charAt(0)];
|
|
650
|
+
|
|
651
|
+
// Hack to work around lack of negative lookbehind in JS
|
|
652
|
+
// A pattern like: *.!(x).!(y|z) needs to ensure that a name
|
|
653
|
+
// like 'a.xyz.yz' doesn't match. So, the first negative
|
|
654
|
+
// lookahead, has to look ALL the way ahead, to the end of
|
|
655
|
+
// the pattern.
|
|
656
|
+
for (let n = negativeLists.length - 1; n > -1; n--) {
|
|
657
|
+
const nl = negativeLists[n];
|
|
658
|
+
const nlBefore = re.slice(0, nl.reStart);
|
|
659
|
+
const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
|
|
660
|
+
let nlAfter = re.slice(nl.reEnd);
|
|
661
|
+
const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
|
|
662
|
+
|
|
663
|
+
// Handle nested stuff like *(*.js|!(*.json)), where open parens
|
|
664
|
+
// mean that we should *not* include the ) in the bit that is considered
|
|
665
|
+
// "after" the negated section.
|
|
666
|
+
const openParensBefore = nlBefore.split('(').length - 1;
|
|
667
|
+
let cleanAfter = nlAfter;
|
|
668
|
+
for (let i = 0; i < openParensBefore; i++) {
|
|
669
|
+
cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
|
|
670
|
+
}
|
|
671
|
+
nlAfter = cleanAfter;
|
|
672
|
+
const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '';
|
|
673
|
+
re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
|
666
674
|
}
|
|
667
|
-
nlAfter = cleanAfter;
|
|
668
|
-
const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '';
|
|
669
|
-
re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
|
670
|
-
}
|
|
671
675
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
676
|
+
// if the re is not "" at this point, then we need to make sure
|
|
677
|
+
// it doesn't match against an empty path part.
|
|
678
|
+
// Otherwise a/* will match a/, which it should not.
|
|
679
|
+
if (re !== '' && hasMagic) {
|
|
680
|
+
re = '(?=.)' + re;
|
|
681
|
+
}
|
|
682
|
+
if (addPatternStart) {
|
|
683
|
+
re = patternStart + re;
|
|
684
|
+
}
|
|
681
685
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
+
// parsing just a piece of a larger pattern.
|
|
687
|
+
if (isSub === SUBPARSE) {
|
|
688
|
+
return [re, hasMagic];
|
|
689
|
+
}
|
|
686
690
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
707
|
-
makeRe() {
|
|
708
|
-
if (this.regexp || this.regexp === false) return this.regexp;
|
|
709
|
-
|
|
710
|
-
// at this point, this.set is a 2d array of partial
|
|
711
|
-
// pattern strings, or "**".
|
|
712
|
-
//
|
|
713
|
-
// It's better to use .match(). This function shouldn't
|
|
714
|
-
// be used, really, but it's pretty convenient sometimes,
|
|
715
|
-
// when you just want to work with a regex.
|
|
716
|
-
const set = this.set;
|
|
717
|
-
if (!set.length) {
|
|
718
|
-
this.regexp = false;
|
|
719
|
-
return this.regexp;
|
|
691
|
+
// skip the regexp for non-magical patterns
|
|
692
|
+
// unescape anything in it, though, so that it'll be
|
|
693
|
+
// an exact match against a file etc.
|
|
694
|
+
if (!hasMagic) {
|
|
695
|
+
return globUnescape(pattern);
|
|
696
|
+
}
|
|
697
|
+
const flags = options.nocase ? 'i' : '';
|
|
698
|
+
try {
|
|
699
|
+
return Object.assign(new RegExp('^' + re + '$', flags), {
|
|
700
|
+
_glob: pattern,
|
|
701
|
+
_src: re
|
|
702
|
+
});
|
|
703
|
+
} catch (er) /* istanbul ignore next - should be impossible */{
|
|
704
|
+
// If it was an invalid regular expression, then it can't match
|
|
705
|
+
// anything. This trick looks for a character after the end of
|
|
706
|
+
// the string, which is of course impossible, except in multi-line
|
|
707
|
+
// mode, but it's not a /m regex.
|
|
708
|
+
return new RegExp('$.');
|
|
709
|
+
}
|
|
720
710
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
711
|
+
makeRe() {
|
|
712
|
+
if (this.regexp || this.regexp === false) return this.regexp;
|
|
713
|
+
|
|
714
|
+
// at this point, this.set is a 2d array of partial
|
|
715
|
+
// pattern strings, or "**".
|
|
716
|
+
//
|
|
717
|
+
// It's better to use .match(). This function shouldn't
|
|
718
|
+
// be used, really, but it's pretty convenient sometimes,
|
|
719
|
+
// when you just want to work with a regex.
|
|
720
|
+
const set = this.set;
|
|
721
|
+
if (!set.length) {
|
|
722
|
+
this.regexp = false;
|
|
723
|
+
return this.regexp;
|
|
724
|
+
}
|
|
725
|
+
const options = this.options;
|
|
726
|
+
const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
727
|
+
const flags = options.nocase ? 'i' : '';
|
|
728
|
+
|
|
729
|
+
// coalesce globstars and regexpify non-globstar patterns
|
|
730
|
+
// if it's the only item, then we just do one twoStar
|
|
731
|
+
// if it's the first, and there are more, prepend (\/|twoStar\/)? to next
|
|
732
|
+
// if it's the last, append (\/twoStar|) to previous
|
|
733
|
+
// if it's in the middle, append (\/|\/twoStar\/) to previous
|
|
734
|
+
// then filter out GLOBSTAR symbols
|
|
735
|
+
let re = set.map(pattern => {
|
|
736
|
+
pattern = pattern.map(p => typeof p === 'string' ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src).reduce((set, p) => {
|
|
737
|
+
if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
|
|
738
|
+
set.push(p);
|
|
739
|
+
}
|
|
740
|
+
return set;
|
|
741
|
+
}, []);
|
|
742
|
+
pattern.forEach((p, i) => {
|
|
743
|
+
if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) {
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
if (i === 0) {
|
|
747
|
+
if (pattern.length > 1) {
|
|
748
|
+
pattern[i + 1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i + 1];
|
|
749
|
+
} else {
|
|
750
|
+
pattern[i] = twoStar;
|
|
751
|
+
}
|
|
752
|
+
} else if (i === pattern.length - 1) {
|
|
753
|
+
pattern[i - 1] += '(?:\\\/|' + twoStar + ')?';
|
|
745
754
|
} else {
|
|
746
|
-
pattern[i]
|
|
755
|
+
pattern[i - 1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i + 1];
|
|
756
|
+
pattern[i + 1] = GLOBSTAR;
|
|
747
757
|
}
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
try {
|
|
765
|
-
this.regexp = new RegExp(re, flags);
|
|
766
|
-
} catch (ex) /* istanbul ignore next - should be impossible */{
|
|
767
|
-
this.regexp = false;
|
|
768
|
-
}
|
|
769
|
-
return this.regexp;
|
|
770
|
-
}
|
|
771
|
-
match(f, partial = this.partial) {
|
|
772
|
-
this.debug('match', f, this.pattern);
|
|
773
|
-
// short-circuit in the case of busted things.
|
|
774
|
-
// comments, etc.
|
|
775
|
-
if (this.comment) return false;
|
|
776
|
-
if (this.empty) return f === '';
|
|
777
|
-
if (f === '/' && partial) return true;
|
|
778
|
-
const options = this.options;
|
|
779
|
-
|
|
780
|
-
// windows: need to use /, not \
|
|
781
|
-
if (path.sep !== '/') {
|
|
782
|
-
f = f.split(path.sep).join('/');
|
|
758
|
+
});
|
|
759
|
+
return pattern.filter(p => p !== GLOBSTAR).join('/');
|
|
760
|
+
}).join('|');
|
|
761
|
+
|
|
762
|
+
// must match entire pattern
|
|
763
|
+
// ending in a * or ** will make it less strict.
|
|
764
|
+
re = '^(?:' + re + ')$';
|
|
765
|
+
|
|
766
|
+
// can match anything, as long as it's not this.
|
|
767
|
+
if (this.negate) re = '^(?!' + re + ').*$';
|
|
768
|
+
try {
|
|
769
|
+
this.regexp = new RegExp(re, flags);
|
|
770
|
+
} catch (ex) /* istanbul ignore next - should be impossible */{
|
|
771
|
+
this.regexp = false;
|
|
772
|
+
}
|
|
773
|
+
return this.regexp;
|
|
783
774
|
}
|
|
775
|
+
match(f, partial = this.partial) {
|
|
776
|
+
this.debug('match', f, this.pattern);
|
|
777
|
+
// short-circuit in the case of busted things.
|
|
778
|
+
// comments, etc.
|
|
779
|
+
if (this.comment) return false;
|
|
780
|
+
if (this.empty) return f === '';
|
|
781
|
+
if (f === '/' && partial) return true;
|
|
782
|
+
const options = this.options;
|
|
783
|
+
|
|
784
|
+
// windows: need to use /, not \
|
|
785
|
+
if (path.sep !== '/') {
|
|
786
|
+
f = f.split(path.sep).join('/');
|
|
787
|
+
}
|
|
784
788
|
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
789
|
+
// treat the test path as a set of pathparts.
|
|
790
|
+
f = f.split(slashSplit);
|
|
791
|
+
this.debug(this.pattern, 'split', f);
|
|
788
792
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
+
// just ONE of the pattern sets in this.set needs to match
|
|
794
|
+
// in order for it to be valid. If negating, then just one
|
|
795
|
+
// match means that we have failed.
|
|
796
|
+
// Either way, return on the first hit.
|
|
793
797
|
|
|
794
|
-
|
|
795
|
-
|
|
798
|
+
const set = this.set;
|
|
799
|
+
this.debug(this.pattern, 'set', set);
|
|
796
800
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
803
|
-
for (let i = 0; i < set.length; i++) {
|
|
804
|
-
const pattern = set[i];
|
|
805
|
-
let file = f;
|
|
806
|
-
if (options.matchBase && pattern.length === 1) {
|
|
807
|
-
file = [filename];
|
|
801
|
+
// Find the basename of the path by looking for the last non-empty segment
|
|
802
|
+
let filename;
|
|
803
|
+
for (let i = f.length - 1; i >= 0; i--) {
|
|
804
|
+
filename = f[i];
|
|
805
|
+
if (filename) break;
|
|
808
806
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
807
|
+
for (let i = 0; i < set.length; i++) {
|
|
808
|
+
const pattern = set[i];
|
|
809
|
+
let file = f;
|
|
810
|
+
if (options.matchBase && pattern.length === 1) {
|
|
811
|
+
file = [filename];
|
|
812
|
+
}
|
|
813
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
814
|
+
if (hit) {
|
|
815
|
+
if (options.flipNegate) return true;
|
|
816
|
+
return !this.negate;
|
|
817
|
+
}
|
|
813
818
|
}
|
|
814
|
-
}
|
|
815
819
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
820
|
+
// didn't get any hits. this is success if it's a negative
|
|
821
|
+
// pattern, failure otherwise.
|
|
822
|
+
if (options.flipNegate) return false;
|
|
823
|
+
return this.negate;
|
|
824
|
+
}
|
|
825
|
+
static defaults(def) {
|
|
826
|
+
return minimatch.defaults(def).Minimatch;
|
|
827
|
+
}
|
|
823
828
|
}
|
|
829
|
+
minimatch.Minimatch = Minimatch;
|
|
830
|
+
return minimatch_1;
|
|
824
831
|
}
|
|
825
|
-
minimatch.Minimatch = Minimatch;
|
|
826
|
-
const minimatch$1 = /*@__PURE__*/getDefaultExportFromCjs(minimatch_1);
|
|
827
|
-
|
|
828
|
-
const minimatch$2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
829
|
-
__proto__: null,
|
|
830
|
-
default: minimatch$1
|
|
831
|
-
}, Symbol.toStringTag, { value: 'Module' }));
|
|
832
832
|
|
|
833
|
-
export {
|
|
833
|
+
export { requireMinimatch as __require };
|