From ab2db755ef344b81eb7166591ed5025e9f060b4f Mon Sep 17 00:00:00 2001
From: clement
Date: Thu, 17 Apr 2025 19:16:42 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
node_modules/.package-lock.json | 63 +-
node_modules/fdir/LICENSE | 7 +
node_modules/fdir/README.md | 91 +
node_modules/fdir/dist/api/async.d.ts | 3 +
node_modules/fdir/dist/api/async.js | 19 +
node_modules/fdir/dist/api/counter.d.ts | 12 +
node_modules/fdir/dist/api/counter.js | 27 +
.../fdir/dist/api/functions/get-array.d.ts | 3 +
.../fdir/dist/api/functions/get-array.js | 13 +
.../fdir/dist/api/functions/group-files.d.ts | 3 +
.../fdir/dist/api/functions/group-files.js | 11 +
.../dist/api/functions/invoke-callback.d.ts | 3 +
.../dist/api/functions/invoke-callback.js | 57 +
.../api/functions/is-recursive-symlink.d.ts | 5 +
.../api/functions/is-recursive-symlink.js | 35 +
.../fdir/dist/api/functions/join-path.d.ts | 5 +
.../fdir/dist/api/functions/join-path.js | 36 +
.../dist/api/functions/push-directory.d.ts | 3 +
.../fdir/dist/api/functions/push-directory.js | 37 +
.../fdir/dist/api/functions/push-file.d.ts | 3 +
.../fdir/dist/api/functions/push-file.js | 33 +
.../dist/api/functions/resolve-symlink.d.ts | 5 +
.../dist/api/functions/resolve-symlink.js | 67 +
.../dist/api/functions/walk-directory.d.ts | 5 +
.../fdir/dist/api/functions/walk-directory.js | 40 +
node_modules/fdir/dist/api/queue.d.ts | 15 +
node_modules/fdir/dist/api/queue.js | 23 +
node_modules/fdir/dist/api/sync.d.ts | 2 +
node_modules/fdir/dist/api/sync.js | 9 +
node_modules/fdir/dist/api/walker.d.ts | 18 +
node_modules/fdir/dist/api/walker.js | 124 +
.../fdir/dist/builder/api-builder.d.ts | 9 +
node_modules/fdir/dist/builder/api-builder.js | 23 +
node_modules/fdir/dist/builder/index.d.ts | 41 +
node_modules/fdir/dist/builder/index.js | 136 +
node_modules/fdir/dist/index.d.ts | 4 +
node_modules/fdir/dist/index.js | 20 +
node_modules/fdir/dist/optimizer.d.ts | 3 +
node_modules/fdir/dist/optimizer.js | 54 +
node_modules/fdir/dist/types.d.ts | 60 +
node_modules/fdir/dist/types.js | 2 +
node_modules/fdir/dist/utils.d.ts | 8 +
node_modules/fdir/dist/utils.js | 32 +
node_modules/fdir/package.json | 88 +
node_modules/picomatch/README.md | 96 +-
node_modules/picomatch/index.js | 16 +-
node_modules/picomatch/lib/constants.js | 10 +-
node_modules/picomatch/lib/parse.js | 12 +-
node_modules/picomatch/lib/picomatch.js | 7 +-
node_modules/picomatch/lib/utils.js | 42 +-
node_modules/picomatch/package.json | 12 +-
node_modules/picomatch/posix.js | 3 +
node_modules/tinyglobby/LICENSE | 21 +
node_modules/tinyglobby/README.md | 68 +
node_modules/tinyglobby/dist/index.d.mts | 26 +
node_modules/tinyglobby/dist/index.d.ts | 26 +
node_modules/tinyglobby/dist/index.js | 333 +
node_modules/tinyglobby/dist/index.mjs | 294 +
node_modules/tinyglobby/package.json | 65 +
.../node_modules}/picomatch/CHANGELOG.md | 0
.../node_modules/picomatch/LICENSE | 21 +
.../node_modules/picomatch/README.md | 708 +
.../node_modules/picomatch/index.js | 3 +
.../node_modules/picomatch/lib/constants.js | 179 +
.../node_modules/picomatch/lib/parse.js | 1091 ++
.../node_modules/picomatch/lib/picomatch.js | 342 +
.../node_modules/picomatch/lib/scan.js | 391 +
.../node_modules/picomatch/lib/utils.js | 64 +
.../node_modules/picomatch/package.json | 81 +
node_modules/vite/LICENSE.md | 73 -
node_modules/vite/dist/client/client.mjs | 83 +-
.../vite/dist/node-cjs/publicUtils.cjs | 2876 +---
.../{dep-Bid9ssRr.js => dep-Bxmd1Uxj.js} | 10799 ++++------------
.../{dep-BXMtZB7a.js => dep-DYEId0Fh.js} | 2 +-
.../{dep-CEj2138F.js => dep-yVbOhD1o.js} | 2 +-
node_modules/vite/dist/node/cli.js | 13 +-
node_modules/vite/dist/node/index.d.ts | 63 +-
node_modules/vite/dist/node/index.js | 47 +-
.../vite/dist/node/module-runner.d.ts | 1 +
node_modules/vite/dist/node/module-runner.js | 155 +-
node_modules/vite/index.cjs | 2 +
node_modules/vite/package.json | 17 +-
node_modules/vite/types/customEvent.d.ts | 8 +-
node_modules/vite/types/hmrPayload.d.ts | 2 +
node_modules/vite/types/hot.d.ts | 11 +-
node_modules/vite/types/importMeta.d.ts | 11 +-
node_modules/vite/types/metadata.d.ts | 25 +
package-lock.json | 63 +-
88 files changed, 8427 insertions(+), 10994 deletions(-)
create mode 100644 node_modules/fdir/LICENSE
create mode 100644 node_modules/fdir/README.md
create mode 100644 node_modules/fdir/dist/api/async.d.ts
create mode 100644 node_modules/fdir/dist/api/async.js
create mode 100644 node_modules/fdir/dist/api/counter.d.ts
create mode 100644 node_modules/fdir/dist/api/counter.js
create mode 100644 node_modules/fdir/dist/api/functions/get-array.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/get-array.js
create mode 100644 node_modules/fdir/dist/api/functions/group-files.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/group-files.js
create mode 100644 node_modules/fdir/dist/api/functions/invoke-callback.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/invoke-callback.js
create mode 100644 node_modules/fdir/dist/api/functions/is-recursive-symlink.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/is-recursive-symlink.js
create mode 100644 node_modules/fdir/dist/api/functions/join-path.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/join-path.js
create mode 100644 node_modules/fdir/dist/api/functions/push-directory.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/push-directory.js
create mode 100644 node_modules/fdir/dist/api/functions/push-file.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/push-file.js
create mode 100644 node_modules/fdir/dist/api/functions/resolve-symlink.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/resolve-symlink.js
create mode 100644 node_modules/fdir/dist/api/functions/walk-directory.d.ts
create mode 100644 node_modules/fdir/dist/api/functions/walk-directory.js
create mode 100644 node_modules/fdir/dist/api/queue.d.ts
create mode 100644 node_modules/fdir/dist/api/queue.js
create mode 100644 node_modules/fdir/dist/api/sync.d.ts
create mode 100644 node_modules/fdir/dist/api/sync.js
create mode 100644 node_modules/fdir/dist/api/walker.d.ts
create mode 100644 node_modules/fdir/dist/api/walker.js
create mode 100644 node_modules/fdir/dist/builder/api-builder.d.ts
create mode 100644 node_modules/fdir/dist/builder/api-builder.js
create mode 100644 node_modules/fdir/dist/builder/index.d.ts
create mode 100644 node_modules/fdir/dist/builder/index.js
create mode 100644 node_modules/fdir/dist/index.d.ts
create mode 100644 node_modules/fdir/dist/index.js
create mode 100644 node_modules/fdir/dist/optimizer.d.ts
create mode 100644 node_modules/fdir/dist/optimizer.js
create mode 100644 node_modules/fdir/dist/types.d.ts
create mode 100644 node_modules/fdir/dist/types.js
create mode 100644 node_modules/fdir/dist/utils.d.ts
create mode 100644 node_modules/fdir/dist/utils.js
create mode 100644 node_modules/fdir/package.json
create mode 100644 node_modules/picomatch/posix.js
create mode 100644 node_modules/tinyglobby/LICENSE
create mode 100644 node_modules/tinyglobby/README.md
create mode 100644 node_modules/tinyglobby/dist/index.d.mts
create mode 100644 node_modules/tinyglobby/dist/index.d.ts
create mode 100644 node_modules/tinyglobby/dist/index.js
create mode 100644 node_modules/tinyglobby/dist/index.mjs
create mode 100644 node_modules/tinyglobby/package.json
rename node_modules/{ => vite-plugin-full-reload/node_modules}/picomatch/CHANGELOG.md (100%)
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/LICENSE
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/README.md
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/index.js
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/constants.js
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/parse.js
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/picomatch.js
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/scan.js
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/utils.js
create mode 100644 node_modules/vite-plugin-full-reload/node_modules/picomatch/package.json
rename node_modules/vite/dist/node/chunks/{dep-Bid9ssRr.js => dep-Bxmd1Uxj.js} (85%)
rename node_modules/vite/dist/node/chunks/{dep-BXMtZB7a.js => dep-DYEId0Fh.js} (99%)
rename node_modules/vite/dist/node/chunks/{dep-CEj2138F.js => dep-yVbOhD1o.js} (99%)
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index a6364e50..8510a8e0 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -475,6 +475,20 @@
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"license": "MIT"
},
+ "node_modules/fdir": {
+ "version": "6.4.3",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz",
+ "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
"node_modules/follow-redirects": {
"version": "1.15.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
@@ -722,13 +736,12 @@
"license": "ISC"
},
"node_modules/picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
+ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
"license": "MIT",
"engines": {
- "node": ">=8.6"
+ "node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
@@ -903,15 +916,34 @@
"node": ">=0.10.0"
}
},
+ "node_modules/tinyglobby": {
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz",
+ "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==",
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.4.3",
+ "picomatch": "^4.0.2"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
"node_modules/vite": {
- "version": "6.2.6",
- "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.6.tgz",
- "integrity": "sha512-9xpjNl3kR4rVDZgPNdTL0/c6ao4km69a/2ihNQbcANz8RuCOK3hQBmLSJf3bRKVQjVMda+YvizNE8AwvogcPbw==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.1.tgz",
+ "integrity": "sha512-kkzzkqtMESYklo96HKKPE5KKLkC1amlsqt+RjFMlX2AvbRB/0wghap19NdBxxwGZ+h/C6DLCrcEphPIItlGrRQ==",
"license": "MIT",
"dependencies": {
"esbuild": "^0.25.0",
+ "fdir": "^6.4.3",
+ "picomatch": "^4.0.2",
"postcss": "^8.5.3",
- "rollup": "^4.30.1"
+ "rollup": "^4.34.9",
+ "tinyglobby": "^0.2.12"
},
"bin": {
"vite": "bin/vite.js"
@@ -985,6 +1017,19 @@
"picomatch": "^2.3.1"
}
},
+ "node_modules/vite-plugin-full-reload/node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
"node_modules/vue": {
"version": "3.5.13",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.13.tgz",
diff --git a/node_modules/fdir/LICENSE b/node_modules/fdir/LICENSE
new file mode 100644
index 00000000..bb7fdee4
--- /dev/null
+++ b/node_modules/fdir/LICENSE
@@ -0,0 +1,7 @@
+Copyright 2023 Abdullah Atta
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/fdir/README.md b/node_modules/fdir/README.md
new file mode 100644
index 00000000..5c70530f
--- /dev/null
+++ b/node_modules/fdir/README.md
@@ -0,0 +1,91 @@
+
+
+
+
The Fastest Directory Crawler & Globber for NodeJS
+
+
+
+
+
+
+
+
+
+
+
+
+⚡ **The Fastest:** Nothing similar (in the NodeJS world) beats `fdir` in speed. It can easily crawl a directory containing **1 million files in < 1 second.**
+
+💡 **Stupidly Easy:** `fdir` uses expressive Builder pattern to build the crawler increasing code readability.
+
+🤖 **Zero Dependencies\*:** `fdir` only uses NodeJS `fs` & `path` modules.
+
+🕺 **Astonishingly Small:** < 2KB in size gzipped & minified.
+
+🖮 **Hackable:** Extending `fdir` is extremely simple now that the new Builder API is here. Feel free to experiment around.
+
+_\* `picomatch` must be installed manually by the user to support globbing._
+
+## 🚄 Quickstart
+
+### Installation
+
+You can install using `npm`:
+
+```sh
+$ npm i fdir
+```
+
+or Yarn:
+
+```sh
+$ yarn add fdir
+```
+
+### Usage
+
+```ts
+import { fdir } from "fdir";
+
+// create the builder
+const api = new fdir().withFullPaths().crawl("path/to/dir");
+
+// get all files in a directory synchronously
+const files = api.sync();
+
+// or asynchronously
+api.withPromise().then((files) => {
+ // do something with the result here.
+});
+```
+
+## Documentation:
+
+Documentation for all methods is available [here](/documentation.md).
+
+## 📊 Benchmarks:
+
+Please check the benchmark against the latest version [here](/BENCHMARKS.md).
+
+## 🙏Used by:
+
+`fdir` is downloaded over 200k+ times a week by projects around the world. Here's a list of some notable projects using `fdir` in production:
+
+> Note: if you think your project should be here, feel free to open an issue. Notable is anything with a considerable amount of GitHub stars.
+
+1. [rollup/plugins](https://github.com/rollup/plugins)
+2. [SuperchupuDev/tinyglobby](https://github.com/SuperchupuDev/tinyglobby)
+3. [pulumi/pulumi](https://github.com/pulumi/pulumi)
+4. [dotenvx/dotenvx](https://github.com/dotenvx/dotenvx)
+5. [mdn/yari](https://github.com/mdn/yari)
+6. [streetwriters/notesnook](https://github.com/streetwriters/notesnook)
+7. [imba/imba](https://github.com/imba/imba)
+8. [moroshko/react-scanner](https://github.com/moroshko/react-scanner)
+9. [netlify/build](https://github.com/netlify/build)
+10. [yassinedoghri/astro-i18next](https://github.com/yassinedoghri/astro-i18next)
+11. [selfrefactor/rambda](https://github.com/selfrefactor/rambda)
+12. [whyboris/Video-Hub-App](https://github.com/whyboris/Video-Hub-App)
+
+## 🦮 LICENSE
+
+Copyright © 2024 Abdullah Atta under MIT. [Read full text here.](https://github.com/thecodrr/fdir/raw/master/LICENSE)
diff --git a/node_modules/fdir/dist/api/async.d.ts b/node_modules/fdir/dist/api/async.d.ts
new file mode 100644
index 00000000..f236ae46
--- /dev/null
+++ b/node_modules/fdir/dist/api/async.d.ts
@@ -0,0 +1,3 @@
+import { Output, Options, ResultCallback } from "../types";
+export declare function promise(root: string, options: Options): Promise;
+export declare function callback(root: string, options: Options, callback: ResultCallback): void;
diff --git a/node_modules/fdir/dist/api/async.js b/node_modules/fdir/dist/api/async.js
new file mode 100644
index 00000000..efc6649c
--- /dev/null
+++ b/node_modules/fdir/dist/api/async.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.callback = exports.promise = void 0;
+const walker_1 = require("./walker");
+function promise(root, options) {
+ return new Promise((resolve, reject) => {
+ callback(root, options, (err, output) => {
+ if (err)
+ return reject(err);
+ resolve(output);
+ });
+ });
+}
+exports.promise = promise;
+function callback(root, options, callback) {
+ let walker = new walker_1.Walker(root, options, callback);
+ walker.start();
+}
+exports.callback = callback;
diff --git a/node_modules/fdir/dist/api/counter.d.ts b/node_modules/fdir/dist/api/counter.d.ts
new file mode 100644
index 00000000..6982d0ca
--- /dev/null
+++ b/node_modules/fdir/dist/api/counter.d.ts
@@ -0,0 +1,12 @@
+export declare class Counter {
+ private _files;
+ private _directories;
+ set files(num: number);
+ get files(): number;
+ set directories(num: number);
+ get directories(): number;
+ /**
+ * @deprecated use `directories` instead
+ */
+ get dirs(): number;
+}
diff --git a/node_modules/fdir/dist/api/counter.js b/node_modules/fdir/dist/api/counter.js
new file mode 100644
index 00000000..685cb270
--- /dev/null
+++ b/node_modules/fdir/dist/api/counter.js
@@ -0,0 +1,27 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Counter = void 0;
+class Counter {
+ _files = 0;
+ _directories = 0;
+ set files(num) {
+ this._files = num;
+ }
+ get files() {
+ return this._files;
+ }
+ set directories(num) {
+ this._directories = num;
+ }
+ get directories() {
+ return this._directories;
+ }
+ /**
+ * @deprecated use `directories` instead
+ */
+ /* c8 ignore next 3 */
+ get dirs() {
+ return this._directories;
+ }
+}
+exports.Counter = Counter;
diff --git a/node_modules/fdir/dist/api/functions/get-array.d.ts b/node_modules/fdir/dist/api/functions/get-array.d.ts
new file mode 100644
index 00000000..958437f8
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/get-array.d.ts
@@ -0,0 +1,3 @@
+import { Options } from "../../types";
+export type GetArrayFunction = (paths: string[]) => string[];
+export declare function build(options: Options): GetArrayFunction;
diff --git a/node_modules/fdir/dist/api/functions/get-array.js b/node_modules/fdir/dist/api/functions/get-array.js
new file mode 100644
index 00000000..1e02308d
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/get-array.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+const getArray = (paths) => {
+ return paths;
+};
+const getArrayGroup = () => {
+ return [""].slice(0, 0);
+};
+function build(options) {
+ return options.group ? getArrayGroup : getArray;
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/functions/group-files.d.ts b/node_modules/fdir/dist/api/functions/group-files.d.ts
new file mode 100644
index 00000000..da691f79
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/group-files.d.ts
@@ -0,0 +1,3 @@
+import { Group, Options } from "../../types";
+export type GroupFilesFunction = (groups: Group[], directory: string, files: string[]) => void;
+export declare function build(options: Options): GroupFilesFunction;
diff --git a/node_modules/fdir/dist/api/functions/group-files.js b/node_modules/fdir/dist/api/functions/group-files.js
new file mode 100644
index 00000000..4ccaa1a4
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/group-files.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+const groupFiles = (groups, directory, files) => {
+ groups.push({ directory, files, dir: directory });
+};
+const empty = () => { };
+function build(options) {
+ return options.group ? groupFiles : empty;
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/functions/invoke-callback.d.ts b/node_modules/fdir/dist/api/functions/invoke-callback.d.ts
new file mode 100644
index 00000000..968c4293
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/invoke-callback.d.ts
@@ -0,0 +1,3 @@
+import { Output, ResultCallback, WalkerState, Options } from "../../types";
+export type InvokeCallbackFunction = (state: WalkerState, error: Error | null, callback?: ResultCallback) => null | TOutput;
+export declare function build(options: Options, isSynchronous: boolean): InvokeCallbackFunction;
diff --git a/node_modules/fdir/dist/api/functions/invoke-callback.js b/node_modules/fdir/dist/api/functions/invoke-callback.js
new file mode 100644
index 00000000..ed59ca2d
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/invoke-callback.js
@@ -0,0 +1,57 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+const onlyCountsSync = (state) => {
+ return state.counts;
+};
+const groupsSync = (state) => {
+ return state.groups;
+};
+const defaultSync = (state) => {
+ return state.paths;
+};
+const limitFilesSync = (state) => {
+ return state.paths.slice(0, state.options.maxFiles);
+};
+const onlyCountsAsync = (state, error, callback) => {
+ report(error, callback, state.counts, state.options.suppressErrors);
+ return null;
+};
+const defaultAsync = (state, error, callback) => {
+ report(error, callback, state.paths, state.options.suppressErrors);
+ return null;
+};
+const limitFilesAsync = (state, error, callback) => {
+ report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
+ return null;
+};
+const groupsAsync = (state, error, callback) => {
+ report(error, callback, state.groups, state.options.suppressErrors);
+ return null;
+};
+function report(error, callback, output, suppressErrors) {
+ if (error && !suppressErrors)
+ callback(error, output);
+ else
+ callback(null, output);
+}
+function build(options, isSynchronous) {
+ const { onlyCounts, group, maxFiles } = options;
+ if (onlyCounts)
+ return isSynchronous
+ ? onlyCountsSync
+ : onlyCountsAsync;
+ else if (group)
+ return isSynchronous
+ ? groupsSync
+ : groupsAsync;
+ else if (maxFiles)
+ return isSynchronous
+ ? limitFilesSync
+ : limitFilesAsync;
+ else
+ return isSynchronous
+ ? defaultSync
+ : defaultAsync;
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/functions/is-recursive-symlink.d.ts b/node_modules/fdir/dist/api/functions/is-recursive-symlink.d.ts
new file mode 100644
index 00000000..e84f63fb
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/is-recursive-symlink.d.ts
@@ -0,0 +1,5 @@
+import { WalkerState } from "../../types";
+type IsRecursiveSymlinkFunction = (state: WalkerState, path: string, resolved: string, callback: (result: boolean) => void) => void;
+export declare const isRecursiveAsync: IsRecursiveSymlinkFunction;
+export declare function isRecursive(state: WalkerState, path: string, resolved: string): boolean;
+export {};
diff --git a/node_modules/fdir/dist/api/functions/is-recursive-symlink.js b/node_modules/fdir/dist/api/functions/is-recursive-symlink.js
new file mode 100644
index 00000000..54ed3888
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/is-recursive-symlink.js
@@ -0,0 +1,35 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isRecursive = exports.isRecursiveAsync = void 0;
+const path_1 = require("path");
+const fs_1 = require("fs");
+const isRecursiveAsync = (state, path, resolved, callback) => {
+ if (state.options.useRealPaths)
+ return callback(state.visited.has(resolved + state.options.pathSeparator));
+ let parent = (0, path_1.dirname)(path);
+ if (parent + state.options.pathSeparator === state.root || parent === path)
+ return callback(false);
+ if (state.symlinks.get(parent) === resolved)
+ return callback(true);
+ (0, fs_1.readlink)(parent, (error, resolvedParent) => {
+ if (error)
+ return (0, exports.isRecursiveAsync)(state, parent, resolved, callback);
+ callback(resolvedParent === resolved);
+ });
+};
+exports.isRecursiveAsync = isRecursiveAsync;
+function isRecursive(state, path, resolved) {
+ if (state.options.useRealPaths)
+ return state.visited.has(resolved + state.options.pathSeparator);
+ let parent = (0, path_1.dirname)(path);
+ if (parent + state.options.pathSeparator === state.root || parent === path)
+ return false;
+ try {
+ const resolvedParent = state.symlinks.get(parent) || (0, fs_1.readlinkSync)(parent);
+ return resolvedParent === resolved;
+ }
+ catch (e) {
+ return isRecursive(state, parent, resolved);
+ }
+}
+exports.isRecursive = isRecursive;
diff --git a/node_modules/fdir/dist/api/functions/join-path.d.ts b/node_modules/fdir/dist/api/functions/join-path.d.ts
new file mode 100644
index 00000000..63e33e85
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/join-path.d.ts
@@ -0,0 +1,5 @@
+import { Options, PathSeparator } from "../../types";
+export declare function joinPathWithBasePath(filename: string, directoryPath: string): string;
+export declare function joinDirectoryPath(filename: string, directoryPath: string, separator: PathSeparator): string;
+export type JoinPathFunction = (filename: string, directoryPath: string) => string;
+export declare function build(root: string, options: Options): JoinPathFunction;
diff --git a/node_modules/fdir/dist/api/functions/join-path.js b/node_modules/fdir/dist/api/functions/join-path.js
new file mode 100644
index 00000000..e84faf61
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/join-path.js
@@ -0,0 +1,36 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
+const path_1 = require("path");
+const utils_1 = require("../../utils");
+function joinPathWithBasePath(filename, directoryPath) {
+ return directoryPath + filename;
+}
+exports.joinPathWithBasePath = joinPathWithBasePath;
+function joinPathWithRelativePath(root, options) {
+ return function (filename, directoryPath) {
+ const sameRoot = directoryPath.startsWith(root);
+ if (sameRoot)
+ return directoryPath.replace(root, "") + filename;
+ else
+ return ((0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) +
+ options.pathSeparator +
+ filename);
+ };
+}
+function joinPath(filename) {
+ return filename;
+}
+function joinDirectoryPath(filename, directoryPath, separator) {
+ return directoryPath + filename + separator;
+}
+exports.joinDirectoryPath = joinDirectoryPath;
+function build(root, options) {
+ const { relativePaths, includeBasePath } = options;
+ return relativePaths && root
+ ? joinPathWithRelativePath(root, options)
+ : includeBasePath
+ ? joinPathWithBasePath
+ : joinPath;
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/functions/push-directory.d.ts b/node_modules/fdir/dist/api/functions/push-directory.d.ts
new file mode 100644
index 00000000..15279207
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/push-directory.d.ts
@@ -0,0 +1,3 @@
+import { FilterPredicate, Options } from "../../types";
+export type PushDirectoryFunction = (directoryPath: string, paths: string[], filters?: FilterPredicate[]) => void;
+export declare function build(root: string, options: Options): PushDirectoryFunction;
diff --git a/node_modules/fdir/dist/api/functions/push-directory.js b/node_modules/fdir/dist/api/functions/push-directory.js
new file mode 100644
index 00000000..6858cb62
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/push-directory.js
@@ -0,0 +1,37 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+function pushDirectoryWithRelativePath(root) {
+ return function (directoryPath, paths) {
+ paths.push(directoryPath.substring(root.length) || ".");
+ };
+}
+function pushDirectoryFilterWithRelativePath(root) {
+ return function (directoryPath, paths, filters) {
+ const relativePath = directoryPath.substring(root.length) || ".";
+ if (filters.every((filter) => filter(relativePath, true))) {
+ paths.push(relativePath);
+ }
+ };
+}
+const pushDirectory = (directoryPath, paths) => {
+ paths.push(directoryPath || ".");
+};
+const pushDirectoryFilter = (directoryPath, paths, filters) => {
+ const path = directoryPath || ".";
+ if (filters.every((filter) => filter(path, true))) {
+ paths.push(path);
+ }
+};
+const empty = () => { };
+function build(root, options) {
+ const { includeDirs, filters, relativePaths } = options;
+ if (!includeDirs)
+ return empty;
+ if (relativePaths)
+ return filters && filters.length
+ ? pushDirectoryFilterWithRelativePath(root)
+ : pushDirectoryWithRelativePath(root);
+ return filters && filters.length ? pushDirectoryFilter : pushDirectory;
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/functions/push-file.d.ts b/node_modules/fdir/dist/api/functions/push-file.d.ts
new file mode 100644
index 00000000..6a4f2f6b
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/push-file.d.ts
@@ -0,0 +1,3 @@
+import { FilterPredicate, Options, Counts } from "../../types";
+export type PushFileFunction = (directoryPath: string, paths: string[], counts: Counts, filters?: FilterPredicate[]) => void;
+export declare function build(options: Options): PushFileFunction;
diff --git a/node_modules/fdir/dist/api/functions/push-file.js b/node_modules/fdir/dist/api/functions/push-file.js
new file mode 100644
index 00000000..88843952
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/push-file.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
+ if (filters.every((filter) => filter(filename, false)))
+ counts.files++;
+};
+const pushFileFilter = (filename, paths, _counts, filters) => {
+ if (filters.every((filter) => filter(filename, false)))
+ paths.push(filename);
+};
+const pushFileCount = (_filename, _paths, counts, _filters) => {
+ counts.files++;
+};
+const pushFile = (filename, paths) => {
+ paths.push(filename);
+};
+const empty = () => { };
+function build(options) {
+ const { excludeFiles, filters, onlyCounts } = options;
+ if (excludeFiles)
+ return empty;
+ if (filters && filters.length) {
+ return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
+ }
+ else if (onlyCounts) {
+ return pushFileCount;
+ }
+ else {
+ return pushFile;
+ }
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/functions/resolve-symlink.d.ts b/node_modules/fdir/dist/api/functions/resolve-symlink.d.ts
new file mode 100644
index 00000000..303342d6
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/resolve-symlink.d.ts
@@ -0,0 +1,5 @@
+///
+import fs from "fs";
+import { WalkerState, Options } from "../../types";
+export type ResolveSymlinkFunction = (path: string, state: WalkerState, callback: (stat: fs.Stats, path: string) => void) => void;
+export declare function build(options: Options, isSynchronous: boolean): ResolveSymlinkFunction | null;
diff --git a/node_modules/fdir/dist/api/functions/resolve-symlink.js b/node_modules/fdir/dist/api/functions/resolve-symlink.js
new file mode 100644
index 00000000..dbf0720c
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/resolve-symlink.js
@@ -0,0 +1,67 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+const fs_1 = __importDefault(require("fs"));
+const path_1 = require("path");
+const resolveSymlinksAsync = function (path, state, callback) {
+ const { queue, options: { suppressErrors }, } = state;
+ queue.enqueue();
+ fs_1.default.realpath(path, (error, resolvedPath) => {
+ if (error)
+ return queue.dequeue(suppressErrors ? null : error, state);
+ fs_1.default.stat(resolvedPath, (error, stat) => {
+ if (error)
+ return queue.dequeue(suppressErrors ? null : error, state);
+ if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
+ return queue.dequeue(null, state);
+ callback(stat, resolvedPath);
+ queue.dequeue(null, state);
+ });
+ });
+};
+const resolveSymlinks = function (path, state, callback) {
+ const { queue, options: { suppressErrors }, } = state;
+ queue.enqueue();
+ try {
+ const resolvedPath = fs_1.default.realpathSync(path);
+ const stat = fs_1.default.statSync(resolvedPath);
+ if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
+ return;
+ callback(stat, resolvedPath);
+ }
+ catch (e) {
+ if (!suppressErrors)
+ throw e;
+ }
+};
+function build(options, isSynchronous) {
+ if (!options.resolveSymlinks || options.excludeSymlinks)
+ return null;
+ return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
+}
+exports.build = build;
+function isRecursive(path, resolved, state) {
+ if (state.options.useRealPaths)
+ return isRecursiveUsingRealPaths(resolved, state);
+ let parent = (0, path_1.dirname)(path);
+ let depth = 1;
+ while (parent !== state.root && depth < 2) {
+ const resolvedPath = state.symlinks.get(parent);
+ const isSameRoot = !!resolvedPath &&
+ (resolvedPath === resolved ||
+ resolvedPath.startsWith(resolved) ||
+ resolved.startsWith(resolvedPath));
+ if (isSameRoot)
+ depth++;
+ else
+ parent = (0, path_1.dirname)(parent);
+ }
+ state.symlinks.set(path, resolved);
+ return depth > 1;
+}
+function isRecursiveUsingRealPaths(resolved, state) {
+ return state.visited.includes(resolved + state.options.pathSeparator);
+}
diff --git a/node_modules/fdir/dist/api/functions/walk-directory.d.ts b/node_modules/fdir/dist/api/functions/walk-directory.d.ts
new file mode 100644
index 00000000..af23d1de
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/walk-directory.d.ts
@@ -0,0 +1,5 @@
+///
+import { WalkerState } from "../../types";
+import fs from "fs";
+export type WalkDirectoryFunction = (state: WalkerState, crawlPath: string, directoryPath: string, depth: number, callback: (entries: fs.Dirent[], directoryPath: string, depth: number) => void) => void;
+export declare function build(isSynchronous: boolean): WalkDirectoryFunction;
diff --git a/node_modules/fdir/dist/api/functions/walk-directory.js b/node_modules/fdir/dist/api/functions/walk-directory.js
new file mode 100644
index 00000000..7515131e
--- /dev/null
+++ b/node_modules/fdir/dist/api/functions/walk-directory.js
@@ -0,0 +1,40 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.build = void 0;
+const fs_1 = __importDefault(require("fs"));
+const readdirOpts = { withFileTypes: true };
+const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback) => {
+ if (currentDepth < 0)
+ return state.queue.dequeue(null, state);
+ state.visited.push(crawlPath);
+ state.counts.directories++;
+ state.queue.enqueue();
+ // Perf: Node >= 10 introduced withFileTypes that helps us
+ // skip an extra fs.stat call.
+ fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
+ callback(entries, directoryPath, currentDepth);
+ state.queue.dequeue(state.options.suppressErrors ? null : error, state);
+ });
+};
+const walkSync = (state, crawlPath, directoryPath, currentDepth, callback) => {
+ if (currentDepth < 0)
+ return;
+ state.visited.push(crawlPath);
+ state.counts.directories++;
+ let entries = [];
+ try {
+ entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
+ }
+ catch (e) {
+ if (!state.options.suppressErrors)
+ throw e;
+ }
+ callback(entries, directoryPath, currentDepth);
+};
+function build(isSynchronous) {
+ return isSynchronous ? walkSync : walkAsync;
+}
+exports.build = build;
diff --git a/node_modules/fdir/dist/api/queue.d.ts b/node_modules/fdir/dist/api/queue.d.ts
new file mode 100644
index 00000000..3d4b8871
--- /dev/null
+++ b/node_modules/fdir/dist/api/queue.d.ts
@@ -0,0 +1,15 @@
+import { WalkerState } from "../types";
+type OnQueueEmptyCallback = (error: Error | null, output: WalkerState) => void;
+/**
+ * This is a custom stateless queue to track concurrent async fs calls.
+ * It increments a counter whenever a call is queued and decrements it
+ * as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
+ */
+export declare class Queue {
+ private readonly onQueueEmpty;
+ private count;
+ constructor(onQueueEmpty: OnQueueEmptyCallback);
+ enqueue(): void;
+ dequeue(error: Error | null, output: WalkerState): void;
+}
+export {};
diff --git a/node_modules/fdir/dist/api/queue.js b/node_modules/fdir/dist/api/queue.js
new file mode 100644
index 00000000..e959ebec
--- /dev/null
+++ b/node_modules/fdir/dist/api/queue.js
@@ -0,0 +1,23 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Queue = void 0;
+/**
+ * This is a custom stateless queue to track concurrent async fs calls.
+ * It increments a counter whenever a call is queued and decrements it
+ * as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
+ */
+class Queue {
+ onQueueEmpty;
+ count = 0;
+ constructor(onQueueEmpty) {
+ this.onQueueEmpty = onQueueEmpty;
+ }
+ enqueue() {
+ this.count++;
+ }
+ dequeue(error, output) {
+ if (--this.count <= 0 || error)
+ this.onQueueEmpty(error, output);
+ }
+}
+exports.Queue = Queue;
diff --git a/node_modules/fdir/dist/api/sync.d.ts b/node_modules/fdir/dist/api/sync.d.ts
new file mode 100644
index 00000000..2190cc2e
--- /dev/null
+++ b/node_modules/fdir/dist/api/sync.d.ts
@@ -0,0 +1,2 @@
+import { Output, Options } from "../types";
+export declare function sync(root: string, options: Options): TOutput;
diff --git a/node_modules/fdir/dist/api/sync.js b/node_modules/fdir/dist/api/sync.js
new file mode 100644
index 00000000..073bc88d
--- /dev/null
+++ b/node_modules/fdir/dist/api/sync.js
@@ -0,0 +1,9 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sync = void 0;
+const walker_1 = require("./walker");
+function sync(root, options) {
+ const walker = new walker_1.Walker(root, options);
+ return walker.start();
+}
+exports.sync = sync;
diff --git a/node_modules/fdir/dist/api/walker.d.ts b/node_modules/fdir/dist/api/walker.d.ts
new file mode 100644
index 00000000..cb6e1c86
--- /dev/null
+++ b/node_modules/fdir/dist/api/walker.d.ts
@@ -0,0 +1,18 @@
+import { ResultCallback, Options } from "../types";
+import { Output } from "../types";
+export declare class Walker {
+ private readonly root;
+ private readonly isSynchronous;
+ private readonly state;
+ private readonly joinPath;
+ private readonly pushDirectory;
+ private readonly pushFile;
+ private readonly getArray;
+ private readonly groupFiles;
+ private readonly resolveSymlink;
+ private readonly walkDirectory;
+ private readonly callbackInvoker;
+ constructor(root: string, options: Options, callback?: ResultCallback);
+ start(): TOutput | null;
+ private walk;
+}
diff --git a/node_modules/fdir/dist/api/walker.js b/node_modules/fdir/dist/api/walker.js
new file mode 100644
index 00000000..8812759c
--- /dev/null
+++ b/node_modules/fdir/dist/api/walker.js
@@ -0,0 +1,124 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Walker = void 0;
+const path_1 = require("path");
+const utils_1 = require("../utils");
+const joinPath = __importStar(require("./functions/join-path"));
+const pushDirectory = __importStar(require("./functions/push-directory"));
+const pushFile = __importStar(require("./functions/push-file"));
+const getArray = __importStar(require("./functions/get-array"));
+const groupFiles = __importStar(require("./functions/group-files"));
+const resolveSymlink = __importStar(require("./functions/resolve-symlink"));
+const invokeCallback = __importStar(require("./functions/invoke-callback"));
+const walkDirectory = __importStar(require("./functions/walk-directory"));
+const queue_1 = require("./queue");
+const counter_1 = require("./counter");
+class Walker {
+ root;
+ isSynchronous;
+ state;
+ joinPath;
+ pushDirectory;
+ pushFile;
+ getArray;
+ groupFiles;
+ resolveSymlink;
+ walkDirectory;
+ callbackInvoker;
+ constructor(root, options, callback) {
+ this.isSynchronous = !callback;
+ this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
+ this.root = (0, utils_1.normalizePath)(root, options);
+ this.state = {
+ root: this.root.slice(0, -1),
+ // Perf: we explicitly tell the compiler to optimize for String arrays
+ paths: [""].slice(0, 0),
+ groups: [],
+ counts: new counter_1.Counter(),
+ options,
+ queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)),
+ symlinks: new Map(),
+ visited: [""].slice(0, 0),
+ };
+ /*
+ * Perf: We conditionally change functions according to options. This gives a slight
+ * performance boost. Since these functions are so small, they are automatically inlined
+ * by the javascript engine so there's no function call overhead (in most cases).
+ */
+ this.joinPath = joinPath.build(this.root, options);
+ this.pushDirectory = pushDirectory.build(this.root, options);
+ this.pushFile = pushFile.build(options);
+ this.getArray = getArray.build(options);
+ this.groupFiles = groupFiles.build(options);
+ this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
+ this.walkDirectory = walkDirectory.build(this.isSynchronous);
+ }
+ start() {
+ this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
+ return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
+ }
+ walk = (entries, directoryPath, depth) => {
+ const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator, }, } = this.state;
+ if ((signal && signal.aborted) || (maxFiles && paths.length > maxFiles))
+ return;
+ this.pushDirectory(directoryPath, paths, filters);
+ const files = this.getArray(this.state.paths);
+ for (let i = 0; i < entries.length; ++i) {
+ const entry = entries[i];
+ if (entry.isFile() ||
+ (entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks)) {
+ const filename = this.joinPath(entry.name, directoryPath);
+ this.pushFile(filename, files, this.state.counts, filters);
+ }
+ else if (entry.isDirectory()) {
+ let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
+ if (exclude && exclude(entry.name, path))
+ continue;
+ this.walkDirectory(this.state, path, path, depth - 1, this.walk);
+ }
+ else if (entry.isSymbolicLink() && this.resolveSymlink) {
+ let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
+ this.resolveSymlink(path, this.state, (stat, resolvedPath) => {
+ if (stat.isDirectory()) {
+ resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator))
+ return;
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
+ }
+ else {
+ resolvedPath = useRealPaths ? resolvedPath : path;
+ const filename = (0, path_1.basename)(resolvedPath);
+ const directoryPath = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
+ resolvedPath = this.joinPath(filename, directoryPath);
+ this.pushFile(resolvedPath, files, this.state.counts, filters);
+ }
+ });
+ }
+ }
+ this.groupFiles(this.state.groups, directoryPath, files);
+ };
+}
+exports.Walker = Walker;
diff --git a/node_modules/fdir/dist/builder/api-builder.d.ts b/node_modules/fdir/dist/builder/api-builder.d.ts
new file mode 100644
index 00000000..690c88f1
--- /dev/null
+++ b/node_modules/fdir/dist/builder/api-builder.d.ts
@@ -0,0 +1,9 @@
+import { Options, Output, ResultCallback } from "../types";
+export declare class APIBuilder {
+ private readonly root;
+ private readonly options;
+ constructor(root: string, options: Options);
+ withPromise(): Promise;
+ withCallback(cb: ResultCallback): void;
+ sync(): TReturnType;
+}
diff --git a/node_modules/fdir/dist/builder/api-builder.js b/node_modules/fdir/dist/builder/api-builder.js
new file mode 100644
index 00000000..0538e6fa
--- /dev/null
+++ b/node_modules/fdir/dist/builder/api-builder.js
@@ -0,0 +1,23 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.APIBuilder = void 0;
+const async_1 = require("../api/async");
+const sync_1 = require("../api/sync");
+class APIBuilder {
+ root;
+ options;
+ constructor(root, options) {
+ this.root = root;
+ this.options = options;
+ }
+ withPromise() {
+ return (0, async_1.promise)(this.root, this.options);
+ }
+ withCallback(cb) {
+ (0, async_1.callback)(this.root, this.options, cb);
+ }
+ sync() {
+ return (0, sync_1.sync)(this.root, this.options);
+ }
+}
+exports.APIBuilder = APIBuilder;
diff --git a/node_modules/fdir/dist/builder/index.d.ts b/node_modules/fdir/dist/builder/index.d.ts
new file mode 100644
index 00000000..5fefafd4
--- /dev/null
+++ b/node_modules/fdir/dist/builder/index.d.ts
@@ -0,0 +1,41 @@
+///
+import { Output, OnlyCountsOutput, GroupOutput, PathsOutput, Options, FilterPredicate, ExcludePredicate, GlobParams } from "../types";
+import { APIBuilder } from "./api-builder";
+import type picomatch from "picomatch";
+export declare class Builder {
+ private readonly globCache;
+ private options;
+ private globFunction?;
+ constructor(options?: Partial>);
+ group(): Builder;
+ withPathSeparator(separator: "/" | "\\"): this;
+ withBasePath(): this;
+ withRelativePaths(): this;
+ withDirs(): this;
+ withMaxDepth(depth: number): this;
+ withMaxFiles(limit: number): this;
+ withFullPaths(): this;
+ withErrors(): this;
+ withSymlinks({ resolvePaths }?: {
+ resolvePaths?: boolean | undefined;
+ }): this;
+ withAbortSignal(signal: AbortSignal): this;
+ normalize(): this;
+ filter(predicate: FilterPredicate): this;
+ onlyDirs(): this;
+ exclude(predicate: ExcludePredicate): this;
+ onlyCounts(): Builder;
+ crawl(root?: string): APIBuilder;
+ withGlobFunction(fn: TFunc): Builder;
+ /**
+ * @deprecated Pass options using the constructor instead:
+ * ```ts
+ * new fdir(options).crawl("/path/to/root");
+ * ```
+ * This method will be removed in v7.0
+ */
+ crawlWithOptions(root: string, options: Partial>): APIBuilder;
+ glob(...patterns: string[]): Builder;
+ globWithOptions(patterns: string[]): Builder;
+ globWithOptions(patterns: string[], ...options: GlobParams): Builder;
+}
diff --git a/node_modules/fdir/dist/builder/index.js b/node_modules/fdir/dist/builder/index.js
new file mode 100644
index 00000000..a48b0050
--- /dev/null
+++ b/node_modules/fdir/dist/builder/index.js
@@ -0,0 +1,136 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Builder = void 0;
+const path_1 = require("path");
+const api_builder_1 = require("./api-builder");
+var pm = null;
+/* c8 ignore next 6 */
+try {
+ require.resolve("picomatch");
+ pm = require("picomatch");
+}
+catch (_e) {
+ // do nothing
+}
+class Builder {
+ globCache = {};
+ options = {
+ maxDepth: Infinity,
+ suppressErrors: true,
+ pathSeparator: path_1.sep,
+ filters: [],
+ };
+ globFunction;
+ constructor(options) {
+ this.options = { ...this.options, ...options };
+ this.globFunction = this.options.globFunction;
+ }
+ group() {
+ this.options.group = true;
+ return this;
+ }
+ withPathSeparator(separator) {
+ this.options.pathSeparator = separator;
+ return this;
+ }
+ withBasePath() {
+ this.options.includeBasePath = true;
+ return this;
+ }
+ withRelativePaths() {
+ this.options.relativePaths = true;
+ return this;
+ }
+ withDirs() {
+ this.options.includeDirs = true;
+ return this;
+ }
+ withMaxDepth(depth) {
+ this.options.maxDepth = depth;
+ return this;
+ }
+ withMaxFiles(limit) {
+ this.options.maxFiles = limit;
+ return this;
+ }
+ withFullPaths() {
+ this.options.resolvePaths = true;
+ this.options.includeBasePath = true;
+ return this;
+ }
+ withErrors() {
+ this.options.suppressErrors = false;
+ return this;
+ }
+ withSymlinks({ resolvePaths = true } = {}) {
+ this.options.resolveSymlinks = true;
+ this.options.useRealPaths = resolvePaths;
+ return this.withFullPaths();
+ }
+ withAbortSignal(signal) {
+ this.options.signal = signal;
+ return this;
+ }
+ normalize() {
+ this.options.normalizePath = true;
+ return this;
+ }
+ filter(predicate) {
+ this.options.filters.push(predicate);
+ return this;
+ }
+ onlyDirs() {
+ this.options.excludeFiles = true;
+ this.options.includeDirs = true;
+ return this;
+ }
+ exclude(predicate) {
+ this.options.exclude = predicate;
+ return this;
+ }
+ onlyCounts() {
+ this.options.onlyCounts = true;
+ return this;
+ }
+ crawl(root) {
+ return new api_builder_1.APIBuilder(root || ".", this.options);
+ }
+ withGlobFunction(fn) {
+ // cast this since we don't have the new type params yet
+ this.globFunction = fn;
+ return this;
+ }
+ /**
+ * @deprecated Pass options using the constructor instead:
+ * ```ts
+ * new fdir(options).crawl("/path/to/root");
+ * ```
+ * This method will be removed in v7.0
+ */
+ /* c8 ignore next 4 */
+ crawlWithOptions(root, options) {
+ this.options = { ...this.options, ...options };
+ return new api_builder_1.APIBuilder(root || ".", this.options);
+ }
+ glob(...patterns) {
+ if (this.globFunction) {
+ return this.globWithOptions(patterns);
+ }
+ return this.globWithOptions(patterns, ...[{ dot: true }]);
+ }
+ globWithOptions(patterns, ...options) {
+ const globFn = (this.globFunction || pm);
+ /* c8 ignore next 5 */
+ if (!globFn) {
+ throw new Error('Please specify a glob function to use glob matching.');
+ }
+ var isMatch = this.globCache[patterns.join("\0")];
+ if (!isMatch) {
+ isMatch = globFn(patterns, ...options);
+ this.globCache[patterns.join("\0")] = isMatch;
+ }
+ this.options.filters.push((path) => isMatch(path));
+ return this;
+ }
+}
+exports.Builder = Builder;
diff --git a/node_modules/fdir/dist/index.d.ts b/node_modules/fdir/dist/index.d.ts
new file mode 100644
index 00000000..35963763
--- /dev/null
+++ b/node_modules/fdir/dist/index.d.ts
@@ -0,0 +1,4 @@
+import { Builder } from "./builder";
+export { Builder as fdir };
+export type Fdir = typeof Builder;
+export * from "./types";
diff --git a/node_modules/fdir/dist/index.js b/node_modules/fdir/dist/index.js
new file mode 100644
index 00000000..b907a8b9
--- /dev/null
+++ b/node_modules/fdir/dist/index.js
@@ -0,0 +1,20 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.fdir = void 0;
+const builder_1 = require("./builder");
+Object.defineProperty(exports, "fdir", { enumerable: true, get: function () { return builder_1.Builder; } });
+__exportStar(require("./types"), exports);
diff --git a/node_modules/fdir/dist/optimizer.d.ts b/node_modules/fdir/dist/optimizer.d.ts
new file mode 100644
index 00000000..d2a33cd8
--- /dev/null
+++ b/node_modules/fdir/dist/optimizer.d.ts
@@ -0,0 +1,3 @@
+export declare function findCommonRoots(patterns: string[]): string[];
+export declare function findDirectoryPatterns(patterns: string[]): string[];
+export declare function findMaxDepth(patterns: string[]): number | false;
diff --git a/node_modules/fdir/dist/optimizer.js b/node_modules/fdir/dist/optimizer.js
new file mode 100644
index 00000000..bdea807d
--- /dev/null
+++ b/node_modules/fdir/dist/optimizer.js
@@ -0,0 +1,54 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.findMaxDepth = exports.findDirectoryPatterns = exports.findCommonRoots = void 0;
+// Glob Optimizations:
+// 1. Find common roots and only iterate on them
+// For example:
+// 1. "node_modules/**/*.ts" only requires us to search in node_modules
+// folder.
+// 2. Similarly, multiple glob patterns can have common deterministic roots
+// The optimizer's job is to find these roots and only crawl them.
+// 3. If any of the glob patterns have a globstar i.e. **/ in them, we
+// should bail out.
+// 2. Find out if glob is requesting only directories
+// 3. Find maximum depth requested
+// 4. If glob contains a root that doesn't exist, bail out
+const braces_1 = require("braces");
+const glob_parent_1 = __importDefault(require("glob-parent"));
+function findCommonRoots(patterns) {
+ const allRoots = new Set();
+ patterns = patterns.map((p) => (p.includes("{") ? (0, braces_1.expand)(p) : p)).flat();
+ for (const pattern of patterns) {
+ const parent = (0, glob_parent_1.default)(pattern);
+ if (parent === ".")
+ return [];
+ allRoots.add(parent);
+ }
+ return Array.from(allRoots.values()).filter((root) => {
+ for (const r of allRoots) {
+ if (r === root)
+ continue;
+ if (root.startsWith(r))
+ return false;
+ }
+ return true;
+ });
+}
+exports.findCommonRoots = findCommonRoots;
+function findDirectoryPatterns(patterns) {
+ return patterns.filter((p) => p.endsWith("/"));
+}
+exports.findDirectoryPatterns = findDirectoryPatterns;
+function findMaxDepth(patterns) {
+ const isGlobstar = patterns.some((p) => p.includes("**/") || p.includes("/**") || p === "**");
+ if (isGlobstar)
+ return false;
+ const maxDepth = patterns.reduce((depth, p) => {
+ return Math.max(depth, p.split("/").filter(Boolean).length);
+ }, 0);
+ return maxDepth;
+}
+exports.findMaxDepth = findMaxDepth;
diff --git a/node_modules/fdir/dist/types.d.ts b/node_modules/fdir/dist/types.d.ts
new file mode 100644
index 00000000..e8f536bf
--- /dev/null
+++ b/node_modules/fdir/dist/types.d.ts
@@ -0,0 +1,60 @@
+///
+import { Queue } from "./api/queue";
+export type Counts = {
+ files: number;
+ directories: number;
+ /**
+ * @deprecated use `directories` instead. Will be removed in v7.0.
+ */
+ dirs: number;
+};
+export type Group = {
+ directory: string;
+ files: string[];
+ /**
+ * @deprecated use `directory` instead. Will be removed in v7.0.
+ */
+ dir: string;
+};
+export type GroupOutput = Group[];
+export type OnlyCountsOutput = Counts;
+export type PathsOutput = string[];
+export type Output = OnlyCountsOutput | PathsOutput | GroupOutput;
+export type WalkerState = {
+ root: string;
+ paths: string[];
+ groups: Group[];
+ counts: Counts;
+ options: Options;
+ queue: Queue;
+ symlinks: Map;
+ visited: string[];
+};
+export type ResultCallback = (error: Error | null, output: TOutput) => void;
+export type FilterPredicate = (path: string, isDirectory: boolean) => boolean;
+export type ExcludePredicate = (dirName: string, dirPath: string) => boolean;
+export type PathSeparator = "/" | "\\";
+export type Options = {
+ includeBasePath?: boolean;
+ includeDirs?: boolean;
+ normalizePath?: boolean;
+ maxDepth: number;
+ maxFiles?: number;
+ resolvePaths?: boolean;
+ suppressErrors: boolean;
+ group?: boolean;
+ onlyCounts?: boolean;
+ filters: FilterPredicate[];
+ resolveSymlinks?: boolean;
+ useRealPaths?: boolean;
+ excludeFiles?: boolean;
+ excludeSymlinks?: boolean;
+ exclude?: ExcludePredicate;
+ relativePaths?: boolean;
+ pathSeparator: PathSeparator;
+ signal?: AbortSignal;
+ globFunction?: TGlobFunction;
+};
+export type GlobMatcher = (test: string) => boolean;
+export type GlobFunction = (glob: string | string[], ...params: unknown[]) => GlobMatcher;
+export type GlobParams = T extends (globs: string | string[], ...params: infer TParams extends unknown[]) => GlobMatcher ? TParams : [];
diff --git a/node_modules/fdir/dist/types.js b/node_modules/fdir/dist/types.js
new file mode 100644
index 00000000..c8ad2e54
--- /dev/null
+++ b/node_modules/fdir/dist/types.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/fdir/dist/utils.d.ts b/node_modules/fdir/dist/utils.d.ts
new file mode 100644
index 00000000..bdba24ee
--- /dev/null
+++ b/node_modules/fdir/dist/utils.d.ts
@@ -0,0 +1,8 @@
+import { PathSeparator } from "./types";
+export declare function cleanPath(path: string): string;
+export declare function convertSlashes(path: string, separator: PathSeparator): string;
+export declare function normalizePath(path: string, options: {
+ resolvePaths?: boolean;
+ normalizePath?: boolean;
+ pathSeparator: PathSeparator;
+}): string;
diff --git a/node_modules/fdir/dist/utils.js b/node_modules/fdir/dist/utils.js
new file mode 100644
index 00000000..bf27ea43
--- /dev/null
+++ b/node_modules/fdir/dist/utils.js
@@ -0,0 +1,32 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.normalizePath = exports.convertSlashes = exports.cleanPath = void 0;
+const path_1 = require("path");
+function cleanPath(path) {
+ let normalized = (0, path_1.normalize)(path);
+ // we have to remove the last path separator
+ // to account for / root path
+ if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep)
+ normalized = normalized.substring(0, normalized.length - 1);
+ return normalized;
+}
+exports.cleanPath = cleanPath;
+const SLASHES_REGEX = /[\\/]/g;
+function convertSlashes(path, separator) {
+ return path.replace(SLASHES_REGEX, separator);
+}
+exports.convertSlashes = convertSlashes;
+function normalizePath(path, options) {
+ const { resolvePaths, normalizePath, pathSeparator } = options;
+ const pathNeedsCleaning = (process.platform === "win32" && path.includes("/")) ||
+ path.startsWith(".");
+ if (resolvePaths)
+ path = (0, path_1.resolve)(path);
+ if (normalizePath || pathNeedsCleaning)
+ path = cleanPath(path);
+ if (path === ".")
+ return "";
+ const needsSeperator = path[path.length - 1] !== pathSeparator;
+ return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
+}
+exports.normalizePath = normalizePath;
diff --git a/node_modules/fdir/package.json b/node_modules/fdir/package.json
new file mode 100644
index 00000000..4657d1cc
--- /dev/null
+++ b/node_modules/fdir/package.json
@@ -0,0 +1,88 @@
+{
+ "name": "fdir",
+ "version": "6.4.3",
+ "description": "The fastest directory crawler & globbing alternative to glob, fast-glob, & tiny-glob. Crawls 1m files in < 1s",
+ "main": "dist/index.js",
+ "types": "dist/index.d.ts",
+ "scripts": {
+ "prepublishOnly": "npm run test && npm run build",
+ "build": "tsc",
+ "test": "vitest run __tests__/",
+ "test:coverage": "vitest run --coverage __tests__/",
+ "test:watch": "vitest __tests__/",
+ "bench": "ts-node benchmarks/benchmark.js",
+ "bench:glob": "ts-node benchmarks/glob-benchmark.ts",
+ "bench:fdir": "ts-node benchmarks/fdir-benchmark.ts",
+ "release": "./scripts/release.sh"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/thecodrr/fdir.git"
+ },
+ "keywords": [
+ "util",
+ "os",
+ "sys",
+ "fs",
+ "walk",
+ "crawler",
+ "directory",
+ "files",
+ "io",
+ "tiny-glob",
+ "glob",
+ "fast-glob",
+ "speed",
+ "javascript",
+ "nodejs"
+ ],
+ "author": "thecodrr ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/thecodrr/fdir/issues"
+ },
+ "homepage": "https://github.com/thecodrr/fdir#readme",
+ "devDependencies": {
+ "@types/glob": "^8.1.0",
+ "@types/mock-fs": "^4.13.4",
+ "@types/node": "^20.9.4",
+ "@types/picomatch": "^3.0.0",
+ "@types/tap": "^15.0.11",
+ "@vitest/coverage-v8": "^0.34.6",
+ "all-files-in-tree": "^1.1.2",
+ "benny": "^3.7.1",
+ "csv-to-markdown-table": "^1.3.1",
+ "expect": "^29.7.0",
+ "fast-glob": "^3.3.2",
+ "fdir1": "npm:fdir@1.2.0",
+ "fdir2": "npm:fdir@2.1.0",
+ "fdir3": "npm:fdir@3.4.2",
+ "fdir4": "npm:fdir@4.1.0",
+ "fdir5": "npm:fdir@5.0.0",
+ "fs-readdir-recursive": "^1.1.0",
+ "get-all-files": "^4.1.0",
+ "glob": "^10.3.10",
+ "klaw-sync": "^6.0.0",
+ "mock-fs": "^5.2.0",
+ "picomatch": "^4.0.2",
+ "recur-readdir": "0.0.1",
+ "recursive-files": "^1.0.2",
+ "recursive-fs": "^2.1.0",
+ "recursive-readdir": "^2.2.3",
+ "rrdir": "^12.1.0",
+ "systeminformation": "^5.21.17",
+ "tiny-glob": "^0.2.9",
+ "ts-node": "^10.9.1",
+ "typescript": "^5.3.2",
+ "vitest": "^0.34.6",
+ "walk-sync": "^3.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+}
diff --git a/node_modules/picomatch/README.md b/node_modules/picomatch/README.md
index b0526e28..5062654b 100644
--- a/node_modules/picomatch/README.md
+++ b/node_modules/picomatch/README.md
@@ -107,7 +107,7 @@ console.log(isMatch('a/b.js')); //=> false
## API
-### [picomatch](lib/picomatch.js#L32)
+### [picomatch](lib/picomatch.js#L31)
Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.
@@ -128,7 +128,24 @@ console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
-### [.test](lib/picomatch.js#L117)
+**Example without node.js**
+
+For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
+
+```js
+const picomatch = require('picomatch/posix');
+// the same API, defaulting to posix paths
+const isMatch = picomatch('a/*');
+console.log(isMatch('a\\b')); //=> false
+console.log(isMatch('a/b')); //=> true
+
+// you can still configure the matcher function to accept windows paths
+const isMatch = picomatch('a/*', { options: windows });
+console.log(isMatch('a\\b')); //=> true
+console.log(isMatch('a/b')); //=> true
+```
+
+### [.test](lib/picomatch.js#L116)
Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string.
@@ -148,7 +165,7 @@ console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
```
-### [.matchBase](lib/picomatch.js#L161)
+### [.matchBase](lib/picomatch.js#L160)
Match the basename of a filepath.
@@ -166,7 +183,7 @@ const picomatch = require('picomatch');
console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
```
-### [.isMatch](lib/picomatch.js#L183)
+### [.isMatch](lib/picomatch.js#L182)
Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -187,7 +204,7 @@ console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
```
-### [.parse](lib/picomatch.js#L199)
+### [.parse](lib/picomatch.js#L198)
Parse a glob pattern to create the source string for a regular expression.
@@ -204,7 +221,7 @@ const picomatch = require('picomatch');
const result = picomatch.parse(pattern[, options]);
```
-### [.scan](lib/picomatch.js#L231)
+### [.scan](lib/picomatch.js#L230)
Scan a glob pattern to separate the pattern into segments.
@@ -235,7 +252,7 @@ console.log(result);
negated: true }
```
-### [.compileRe](lib/picomatch.js#L245)
+### [.compileRe](lib/picomatch.js#L244)
Compile a regular expression from the `state` object returned by the
[parse()](#parse) method.
@@ -248,7 +265,7 @@ Compile a regular expression from the `state` object returned by the
* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
* `returns` **{RegExp}**
-### [.makeRe](lib/picomatch.js#L286)
+### [.makeRe](lib/picomatch.js#L285)
Create a regular expression from a parsed glob pattern.
@@ -271,7 +288,7 @@ console.log(picomatch.compileRe(state));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
```
-### [.toRegex](lib/picomatch.js#L321)
+### [.toRegex](lib/picomatch.js#L320)
Create a regular expression from the given regex source string.
@@ -339,8 +356,7 @@ The following options may be used with the main `picomatch()` function or any of
| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. |
| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. |
-
-picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error.
+| `windows` | `boolean` | `false` | Also accept backslashes as the path separator. |
### Scan Options
@@ -484,7 +500,7 @@ isMatch('baz');
| **Character** | **Description** |
| --- | --- |
| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. |
-| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
+| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` with the `windows` option) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. |
| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. |
@@ -524,9 +540,9 @@ console.log(pm.isMatch('az', 'a*(z)')); // true
console.log(pm.isMatch('azzz', 'a*(z)')); // true
// +(pattern) matches ONE or more of "pattern"
-console.log(pm.isMatch('a', 'a*(z)')); // true
-console.log(pm.isMatch('az', 'a*(z)')); // true
-console.log(pm.isMatch('azzz', 'a*(z)')); // true
+console.log(pm.isMatch('a', 'a+(z)')); // false
+console.log(pm.isMatch('az', 'a+(z)')); // true
+console.log(pm.isMatch('azzz', 'a+(z)')); // true
// supports multiple extglobs
console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false
@@ -613,30 +629,44 @@ The following table shows which features are supported by [minimatch](https://gi
Performance comparison of picomatch and minimatch.
+_(Pay special attention to the last three benchmarks. Minimatch freezes on long ranges.)_
+
```
-# .makeRe star
- picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled)
- minimatch x 627,206 ops/sec ±1.96% (87 runs sampled))
+# .makeRe star (*)
+ picomatch x 4,449,159 ops/sec ±0.24% (97 runs sampled)
+ minimatch x 632,772 ops/sec ±0.14% (98 runs sampled)
-# .makeRe star; dot=true
- picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled)
- minimatch x 525,876 ops/sec ±0.60% (88 runs sampled)
+# .makeRe star; dot=true (*)
+ picomatch x 3,500,079 ops/sec ±0.26% (99 runs sampled)
+ minimatch x 564,916 ops/sec ±0.23% (96 runs sampled)
-# .makeRe globstar
- picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled)
- minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d)
+# .makeRe globstar (**)
+ picomatch x 3,261,000 ops/sec ±0.27% (98 runs sampled)
+ minimatch x 1,664,766 ops/sec ±0.20% (100 runs sampled)
-# .makeRe globstars
- picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled)
- minimatch x 477,179 ops/sec ±1.33% (91 runs sampled)
+# .makeRe globstars (**/**/**)
+ picomatch x 3,284,469 ops/sec ±0.18% (97 runs sampled)
+ minimatch x 1,435,880 ops/sec ±0.34% (95 runs sampled)
-# .makeRe with leading star
- picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled)
- minimatch x 453,564 ops/sec ±1.43% (94 runs sampled)
+# .makeRe with leading star (*.txt)
+ picomatch x 3,100,197 ops/sec ±0.35% (99 runs sampled)
+ minimatch x 428,347 ops/sec ±0.42% (94 runs sampled)
-# .makeRe - basic braces
- picomatch x 392,067 ops/sec ±0.70% (90 runs sampled)
- minimatch x 99,532 ops/sec ±2.03% (87 runs sampled))
+# .makeRe - basic braces ({a,b,c}*.txt)
+ picomatch x 443,578 ops/sec ±1.33% (89 runs sampled)
+ minimatch x 107,143 ops/sec ±0.35% (94 runs sampled)
+
+# .makeRe - short ranges ({a..z}*.txt)
+ picomatch x 415,484 ops/sec ±0.76% (96 runs sampled)
+ minimatch x 14,299 ops/sec ±0.26% (96 runs sampled)
+
+# .makeRe - medium ranges ({1..100000}*.txt)
+ picomatch x 395,020 ops/sec ±0.87% (89 runs sampled)
+ minimatch x 2 ops/sec ±4.59% (10 runs sampled)
+
+# .makeRe - long ranges ({1..10000000}*.txt)
+ picomatch x 400,036 ops/sec ±0.83% (90 runs sampled)
+ minimatch (FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory)
```
diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js
index d2f2bc59..a753b1d9 100644
--- a/node_modules/picomatch/index.js
+++ b/node_modules/picomatch/index.js
@@ -1,3 +1,17 @@
'use strict';
-module.exports = require('./lib/picomatch');
+const pico = require('./lib/picomatch');
+const utils = require('./lib/utils');
+
+function picomatch(glob, options, returnState = false) {
+ // default to os.platform()
+ if (options && (options.windows === null || options.windows === undefined)) {
+ // don't mutate the original options object
+ options = { ...options, windows: utils.isWindows() };
+ }
+
+ return pico(glob, options, returnState);
+}
+
+Object.assign(picomatch, pico);
+module.exports = picomatch;
diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js
index a62ef387..27b3e20f 100644
--- a/node_modules/picomatch/lib/constants.js
+++ b/node_modules/picomatch/lib/constants.js
@@ -1,6 +1,5 @@
'use strict';
-const path = require('path');
const WIN_SLASH = '\\\\/';
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
@@ -23,6 +22,7 @@ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
const STAR = `${QMARK}*?`;
+const SEP = '/';
const POSIX_CHARS = {
DOT_LITERAL,
@@ -39,7 +39,8 @@ const POSIX_CHARS = {
NO_DOTS_SLASH,
QMARK_NO_DOT,
STAR,
- START_ANCHOR
+ START_ANCHOR,
+ SEP
};
/**
@@ -59,7 +60,8 @@ const WINDOWS_CHARS = {
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
+ SEP: '\\'
};
/**
@@ -153,8 +155,6 @@ module.exports = {
CHAR_VERTICAL_LINE: 124, /* | */
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
- SEP: path.sep,
-
/**
* Create EXTGLOB_CHARS
*/
diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js
index 58269d01..8fd8ff49 100644
--- a/node_modules/picomatch/lib/parse.js
+++ b/node_modules/picomatch/lib/parse.js
@@ -71,10 +71,9 @@ const parse = (input, options) => {
const tokens = [bos];
const capture = opts.capture ? '' : '?:';
- const win32 = utils.isWindows(options);
// create constants based on platform, for windows or posix
- const PLATFORM_CHARS = constants.globChars(win32);
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
const {
@@ -210,8 +209,8 @@ const parse = (input, options) => {
if (tok.value || tok.output) append(tok);
if (prev && prev.type === 'text' && tok.type === 'text') {
+ prev.output = (prev.output || prev.value) + tok.value;
prev.value += tok.value;
- prev.output = (prev.output || '') + tok.value;
return;
}
@@ -699,10 +698,6 @@ const parse = (input, options) => {
const next = peek();
let output = value;
- if (next === '<' && !utils.supportsLookbehinds()) {
- throw new Error('Node.js v10 or higher is required for regex lookbehinds');
- }
-
if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
output = `\\${value}`;
}
@@ -1010,7 +1005,6 @@ parse.fastpaths = (input, options) => {
}
input = REPLACEMENTS[input] || input;
- const win32 = utils.isWindows(options);
// create constants based on platform, for windows or posix
const {
@@ -1023,7 +1017,7 @@ parse.fastpaths = (input, options) => {
NO_DOTS_SLASH,
STAR,
START_ANCHOR
- } = constants.globChars(win32);
+ } = constants.globChars(opts.windows);
const nodot = opts.dot ? NO_DOTS : NO_DOT;
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js
index 782d8094..d0ebd9f1 100644
--- a/node_modules/picomatch/lib/picomatch.js
+++ b/node_modules/picomatch/lib/picomatch.js
@@ -1,6 +1,5 @@
'use strict';
-const path = require('path');
const scan = require('./scan');
const parse = require('./parse');
const utils = require('./utils');
@@ -49,7 +48,7 @@ const picomatch = (glob, options, returnState = false) => {
}
const opts = options || {};
- const posix = utils.isWindows(options);
+ const posix = opts.windows;
const regex = isState
? picomatch.compileRe(glob, options)
: picomatch.makeRe(glob, options, false, true);
@@ -158,9 +157,9 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
* @api public
*/
-picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
+picomatch.matchBase = (input, glob, options) => {
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
- return regex.test(path.basename(input));
+ return regex.test(utils.basename(input));
};
/**
diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js
index c3ca766a..9c97cae2 100644
--- a/node_modules/picomatch/lib/utils.js
+++ b/node_modules/picomatch/lib/utils.js
@@ -1,7 +1,6 @@
+/*global navigator*/
'use strict';
-const path = require('path');
-const win32 = process.platform === 'win32';
const {
REGEX_BACKSLASH,
REGEX_REMOVE_BACKSLASH,
@@ -15,27 +14,25 @@ exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
+exports.isWindows = () => {
+ if (typeof navigator !== 'undefined' && navigator.platform) {
+ const platform = navigator.platform.toLowerCase();
+ return platform === 'win32' || platform === 'windows';
+ }
+
+ if (typeof process !== 'undefined' && process.platform) {
+ return process.platform === 'win32';
+ }
+
+ return false;
+};
+
exports.removeBackslashes = str => {
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
return match === '\\' ? '' : match;
});
};
-exports.supportsLookbehinds = () => {
- const segs = process.version.slice(1).split('.').map(Number);
- if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
- return true;
- }
- return false;
-};
-
-exports.isWindows = options => {
- if (options && typeof options.windows === 'boolean') {
- return options.windows;
- }
- return win32 === true || path.sep === '\\';
-};
-
exports.escapeLast = (input, char, lastIdx) => {
const idx = input.lastIndexOf(char, lastIdx);
if (idx === -1) return input;
@@ -62,3 +59,14 @@ exports.wrapOutput = (input, state = {}, options = {}) => {
}
return output;
};
+
+exports.basename = (path, { windows } = {}) => {
+ const segs = path.split(windows ? /[\\/]/ : '/');
+ const last = segs[segs.length - 1];
+
+ if (last === '') {
+ return segs[segs.length - 2];
+ }
+
+ return last;
+};
diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json
index 3db22d40..703a83dc 100644
--- a/node_modules/picomatch/package.json
+++ b/node_modules/picomatch/package.json
@@ -1,7 +1,7 @@
{
"name": "picomatch",
"description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
- "version": "2.3.1",
+ "version": "4.0.2",
"homepage": "https://github.com/micromatch/picomatch",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"funding": "https://github.com/sponsors/jonschlinkert",
@@ -12,11 +12,13 @@
"license": "MIT",
"files": [
"index.js",
+ "posix.js",
"lib"
],
+ "sideEffects": false,
"main": "index.js",
"engines": {
- "node": ">=8.6"
+ "node": ">=12"
},
"scripts": {
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
@@ -26,11 +28,11 @@
"test:cover": "nyc npm run mocha"
},
"devDependencies": {
- "eslint": "^6.8.0",
+ "eslint": "^8.57.0",
"fill-range": "^7.0.1",
"gulp-format-md": "^2.0.0",
- "mocha": "^6.2.2",
- "nyc": "^15.0.0",
+ "mocha": "^10.4.0",
+ "nyc": "^15.1.0",
"time-require": "github:jonschlinkert/time-require"
},
"keywords": [
diff --git a/node_modules/picomatch/posix.js b/node_modules/picomatch/posix.js
new file mode 100644
index 00000000..d2f2bc59
--- /dev/null
+++ b/node_modules/picomatch/posix.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./lib/picomatch');
diff --git a/node_modules/tinyglobby/LICENSE b/node_modules/tinyglobby/LICENSE
new file mode 100644
index 00000000..8657364b
--- /dev/null
+++ b/node_modules/tinyglobby/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Madeline Gurriarán
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/tinyglobby/README.md b/node_modules/tinyglobby/README.md
new file mode 100644
index 00000000..9c5ff58c
--- /dev/null
+++ b/node_modules/tinyglobby/README.md
@@ -0,0 +1,68 @@
+# tinyglobby
+
+[](https://npmjs.com/package/tinyglobby)
+[](https://npmjs.com/package/tinyglobby)
+
+A fast and minimal alternative to globby and fast-glob, meant to behave the same way.
+
+Both globby and fast-glob present some behavior no other globbing lib has,
+which makes it hard to manually replace with something smaller and better.
+
+This library uses only two subdependencies, compared to `globby`'s [23](https://npmgraph.js.org/?q=globby@14.1.0)
+and `fast-glob`'s [17](https://npmgraph.js.org/?q=fast-glob@3.3.3).
+
+## Usage
+
+```js
+import { glob, globSync } from 'tinyglobby';
+
+await glob(['files/*.ts', '!**/*.d.ts'], { cwd: 'src' });
+globSync(['src/**/*.ts'], { ignore: ['**/*.d.ts'] });
+```
+
+## API
+
+- `glob(patterns: string | string[], options: GlobOptions): Promise`: Returns a promise with an array of matches.
+- `globSync(patterns: string | string[], options: GlobOptions): string[]`: Returns an array of matches.
+- `convertPathToPattern(path: string): string`: Converts a path to a pattern depending on the platform.
+- `escapePath(path: string): string`: Escapes a path's special characters depending on the platform.
+- `isDynamicPattern(pattern: string, options?: GlobOptions): boolean`: Checks if a pattern is dynamic.
+
+## Options
+
+- `patterns`: An array of glob patterns to search for. Defaults to `['**/*']`.
+- `ignore`: An array of glob patterns to ignore.
+- `cwd`: The current working directory in which to search. Defaults to `process.cwd()`.
+- `absolute`: Whether to return absolute paths. Defaults to `false`.
+- `dot`: Whether to allow entries starting with a dot. Defaults to `false`.
+- `deep`: Maximum depth of a directory. Defaults to `Infinity`.
+- `followSymbolicLinks`: Whether to traverse and include symbolic links. Defaults to `true`.
+- `caseSensitiveMatch`: Whether to match in case-sensitive mode. Defaults to `true`.
+- `expandDirectories`: Whether to expand directories. Disable to best match `fast-glob`. Defaults to `true`.
+- `onlyDirectories`: Enable to only return directories. Disables `onlyFiles` if set. Defaults to `false`.
+- `onlyFiles`: Enable to only return files. Defaults to `true`.
+- `debug`: Enable debug logs. Useful for development purposes.
+
+## Used by
+
+`tinyglobby` is downloaded many times by projects all around the world. Here's a list of notable projects that use it:
+
+
+- [`vite`](https://github.com/vitejs/vite)
+- [`node-gyp`](https://github.com/nodejs/node-gyp)
+- [`eslint-import-resolver-typescript`](https://github.com/import-js/eslint-import-resolver-typescript)
+- [`vitest`](https://github.com/vitest-dev/vitest)
+- [`ts-morph`](https://github.com/dsherret/ts-morph)
+- [`nx`](https://github.com/nrwl/nx)
+- [`sort-package-json`](https://github.com/keithamus/sort-package-json)
+- [`unimport`](https://github.com/unjs/unimport)
+- [`tsup`](https://github.com/egoist/tsup)
+- [`vite-plugin-checker`](https://github.com/fi3ework/vite-plugin-checker)
+- [`cspell`](https://github.com/streetsidesoftware/cspell)
+- [`nuxt`](https://github.com/nuxt/nuxt)
+- [`postcss-mixins`](https://github.com/postcss/postcss-mixins)
+- [`unocss`](https://github.com/unocss/unocss)
+- [`vitepress`](https://github.com/vuejs/vitepress)
+- [`pkg-pr-new`](https://github.com/stackblitz-labs/pkg.pr.new)
+- Your own project? [Open an issue](https://github.com/SuperchupuDev/tinyglobby/issues)
+if you feel like this list is incomplete.
diff --git a/node_modules/tinyglobby/dist/index.d.mts b/node_modules/tinyglobby/dist/index.d.mts
new file mode 100644
index 00000000..c60f4f85
--- /dev/null
+++ b/node_modules/tinyglobby/dist/index.d.mts
@@ -0,0 +1,26 @@
+declare const convertPathToPattern: (path: string) => string;
+declare const escapePath: (path: string) => string;
+declare function isDynamicPattern(pattern: string, options?: {
+ caseSensitiveMatch: boolean;
+}): boolean;
+
+interface GlobOptions {
+ absolute?: boolean;
+ cwd?: string;
+ patterns?: string | string[];
+ ignore?: string | string[];
+ dot?: boolean;
+ deep?: number;
+ followSymbolicLinks?: boolean;
+ caseSensitiveMatch?: boolean;
+ expandDirectories?: boolean;
+ onlyDirectories?: boolean;
+ onlyFiles?: boolean;
+ debug?: boolean;
+}
+declare function glob(patterns: string | string[], options?: Omit): Promise;
+declare function glob(options: GlobOptions): Promise;
+declare function globSync(patterns: string | string[], options?: Omit): string[];
+declare function globSync(options: GlobOptions): string[];
+
+export { type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };
diff --git a/node_modules/tinyglobby/dist/index.d.ts b/node_modules/tinyglobby/dist/index.d.ts
new file mode 100644
index 00000000..c60f4f85
--- /dev/null
+++ b/node_modules/tinyglobby/dist/index.d.ts
@@ -0,0 +1,26 @@
+declare const convertPathToPattern: (path: string) => string;
+declare const escapePath: (path: string) => string;
+declare function isDynamicPattern(pattern: string, options?: {
+ caseSensitiveMatch: boolean;
+}): boolean;
+
+interface GlobOptions {
+ absolute?: boolean;
+ cwd?: string;
+ patterns?: string | string[];
+ ignore?: string | string[];
+ dot?: boolean;
+ deep?: number;
+ followSymbolicLinks?: boolean;
+ caseSensitiveMatch?: boolean;
+ expandDirectories?: boolean;
+ onlyDirectories?: boolean;
+ onlyFiles?: boolean;
+ debug?: boolean;
+}
+declare function glob(patterns: string | string[], options?: Omit): Promise;
+declare function glob(options: GlobOptions): Promise;
+declare function globSync(patterns: string | string[], options?: Omit): string[];
+declare function globSync(options: GlobOptions): string[];
+
+export { type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };
diff --git a/node_modules/tinyglobby/dist/index.js b/node_modules/tinyglobby/dist/index.js
new file mode 100644
index 00000000..95e26e55
--- /dev/null
+++ b/node_modules/tinyglobby/dist/index.js
@@ -0,0 +1,333 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ convertPathToPattern: () => convertPathToPattern,
+ escapePath: () => escapePath,
+ glob: () => glob,
+ globSync: () => globSync,
+ isDynamicPattern: () => isDynamicPattern
+});
+module.exports = __toCommonJS(index_exports);
+var import_node_path = __toESM(require("path"));
+var import_fdir = require("fdir");
+var import_picomatch2 = __toESM(require("picomatch"));
+
+// src/utils.ts
+var import_picomatch = __toESM(require("picomatch"));
+var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
+function getPartialMatcher(patterns, options) {
+ const patternsCount = patterns.length;
+ const patternsParts = Array(patternsCount);
+ const regexes = Array(patternsCount);
+ for (let i = 0; i < patternsCount; i++) {
+ const parts = splitPattern(patterns[i]);
+ patternsParts[i] = parts;
+ const partsCount = parts.length;
+ const partRegexes = Array(partsCount);
+ for (let j = 0; j < partsCount; j++) {
+ partRegexes[j] = import_picomatch.default.makeRe(parts[j], options);
+ }
+ regexes[i] = partRegexes;
+ }
+ return (input) => {
+ const inputParts = input.split("/");
+ if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) {
+ return true;
+ }
+ for (let i = 0; i < patterns.length; i++) {
+ const patternParts = patternsParts[i];
+ const regex = regexes[i];
+ const inputPatternCount = inputParts.length;
+ const minParts = Math.min(inputPatternCount, patternParts.length);
+ let j = 0;
+ while (j < minParts) {
+ const part = patternParts[j];
+ if (part.includes("/")) {
+ return true;
+ }
+ const match = regex[j].test(inputParts[j]);
+ if (!match) {
+ break;
+ }
+ if (part === "**") {
+ return true;
+ }
+ j++;
+ }
+ if (j === inputPatternCount) {
+ return true;
+ }
+ }
+ return false;
+ };
+}
+var splitPatternOptions = { parts: true };
+function splitPattern(path2) {
+ var _a;
+ const result = import_picomatch.default.scan(path2, splitPatternOptions);
+ return ((_a = result.parts) == null ? void 0 : _a.length) ? result.parts : [path2];
+}
+var isWin = process.platform === "win32";
+var ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
+function convertPosixPathToPattern(path2) {
+ return escapePosixPath(path2);
+}
+function convertWin32PathToPattern(path2) {
+ return escapeWin32Path(path2).replace(ESCAPED_WIN32_BACKSLASHES, "/");
+}
+var convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern;
+var POSIX_UNESCAPED_GLOB_SYMBOLS = /(? path2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
+var escapeWin32Path = (path2) => path2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
+var escapePath = isWin ? escapeWin32Path : escapePosixPath;
+function isDynamicPattern(pattern, options) {
+ if ((options == null ? void 0 : options.caseSensitiveMatch) === false) {
+ return true;
+ }
+ const scan = import_picomatch.default.scan(pattern);
+ return scan.isGlob || scan.negated;
+}
+function log(...tasks) {
+ console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
+}
+
+// src/index.ts
+var PARENT_DIRECTORY = /^(\/?\.\.)+/;
+var ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
+var BACKSLASHES = /\\/g;
+function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
+ var _a;
+ let result = pattern;
+ if (pattern.endsWith("/")) {
+ result = pattern.slice(0, -1);
+ }
+ if (!result.endsWith("*") && expandDirectories) {
+ result += "/**";
+ }
+ if (import_node_path.default.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) {
+ result = import_node_path.posix.relative(escapePath(cwd), result);
+ } else {
+ result = import_node_path.posix.normalize(result);
+ }
+ const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
+ if (parentDirectoryMatch == null ? void 0 : parentDirectoryMatch[0]) {
+ const potentialRoot = import_node_path.posix.join(cwd, parentDirectoryMatch[0]);
+ if (props.root.length > potentialRoot.length) {
+ props.root = potentialRoot;
+ props.depthOffset = -(parentDirectoryMatch[0].length + 1) / 3;
+ }
+ } else if (!isIgnore && props.depthOffset >= 0) {
+ const parts = splitPattern(result);
+ (_a = props.commonPath) != null ? _a : props.commonPath = parts;
+ const newCommonPath = [];
+ const length = Math.min(props.commonPath.length, parts.length);
+ for (let i = 0; i < length; i++) {
+ const part = parts[i];
+ if (part === "**" && !parts[i + 1]) {
+ newCommonPath.pop();
+ break;
+ }
+ if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) {
+ break;
+ }
+ newCommonPath.push(part);
+ }
+ props.depthOffset = newCommonPath.length;
+ props.commonPath = newCommonPath;
+ props.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd;
+ }
+ return result;
+}
+function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
+ if (typeof patterns === "string") {
+ patterns = [patterns];
+ } else if (!patterns) {
+ patterns = ["**/*"];
+ }
+ if (typeof ignore === "string") {
+ ignore = [ignore];
+ }
+ const matchPatterns = [];
+ const ignorePatterns = [];
+ for (const pattern of ignore) {
+ if (!pattern) {
+ continue;
+ }
+ if (pattern[0] !== "!" || pattern[1] === "(") {
+ ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));
+ }
+ }
+ for (const pattern of patterns) {
+ if (!pattern) {
+ continue;
+ }
+ if (pattern[0] !== "!" || pattern[1] === "(") {
+ matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));
+ } else if (pattern[1] !== "!" || pattern[2] === "(") {
+ ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));
+ }
+ }
+ return { match: matchPatterns, ignore: ignorePatterns };
+}
+function getRelativePath(path2, cwd, root) {
+ return import_node_path.posix.relative(cwd, `${root}/${path2}`) || ".";
+}
+function processPath(path2, cwd, root, isDirectory, absolute) {
+ const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2;
+ if (root === cwd) {
+ return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
+ }
+ return getRelativePath(relativePath, cwd, root);
+}
+function formatPaths(paths, cwd, root) {
+ for (let i = paths.length - 1; i >= 0; i--) {
+ const path2 = paths[i];
+ paths[i] = getRelativePath(path2, cwd, root) + (!path2 || path2.endsWith("/") ? "/" : "");
+ }
+ return paths;
+}
+function crawl(options, cwd, sync) {
+ if (process.env.TINYGLOBBY_DEBUG) {
+ options.debug = true;
+ }
+ if (options.debug) {
+ log("globbing with options:", options, "cwd:", cwd);
+ }
+ if (Array.isArray(options.patterns) && options.patterns.length === 0) {
+ return sync ? [] : Promise.resolve([]);
+ }
+ const props = {
+ root: cwd,
+ commonPath: null,
+ depthOffset: 0
+ };
+ const processed = processPatterns(options, cwd, props);
+ const nocase = options.caseSensitiveMatch === false;
+ if (options.debug) {
+ log("internal processing patterns:", processed);
+ }
+ const matcher = (0, import_picomatch2.default)(processed.match, {
+ dot: options.dot,
+ nocase,
+ ignore: processed.ignore
+ });
+ const ignore = (0, import_picomatch2.default)(processed.ignore, {
+ dot: options.dot,
+ nocase
+ });
+ const partialMatcher = getPartialMatcher(processed.match, {
+ dot: options.dot,
+ nocase
+ });
+ const fdirOptions = {
+ // use relative paths in the matcher
+ filters: [
+ options.debug ? (p, isDirectory) => {
+ const path2 = processPath(p, cwd, props.root, isDirectory, options.absolute);
+ const matches = matcher(path2);
+ if (matches) {
+ log(`matched ${path2}`);
+ }
+ return matches;
+ } : (p, isDirectory) => matcher(processPath(p, cwd, props.root, isDirectory, options.absolute))
+ ],
+ exclude: options.debug ? (_, p) => {
+ const relativePath = processPath(p, cwd, props.root, true, true);
+ const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
+ if (skipped) {
+ log(`skipped ${p}`);
+ } else {
+ log(`crawling ${p}`);
+ }
+ return skipped;
+ } : (_, p) => {
+ const relativePath = processPath(p, cwd, props.root, true, true);
+ return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
+ },
+ pathSeparator: "/",
+ relativePaths: true,
+ resolveSymlinks: true
+ };
+ if (options.deep) {
+ fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
+ }
+ if (options.absolute) {
+ fdirOptions.relativePaths = false;
+ fdirOptions.resolvePaths = true;
+ fdirOptions.includeBasePath = true;
+ }
+ if (options.followSymbolicLinks === false) {
+ fdirOptions.resolveSymlinks = false;
+ fdirOptions.excludeSymlinks = true;
+ }
+ if (options.onlyDirectories) {
+ fdirOptions.excludeFiles = true;
+ fdirOptions.includeDirs = true;
+ } else if (options.onlyFiles === false) {
+ fdirOptions.includeDirs = true;
+ }
+ props.root = props.root.replace(BACKSLASHES, "");
+ const root = props.root;
+ if (options.debug) {
+ log("internal properties:", props);
+ }
+ const api = new import_fdir.fdir(fdirOptions).crawl(root);
+ if (cwd === root || options.absolute) {
+ return sync ? api.sync() : api.withPromise();
+ }
+ return sync ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
+}
+async function glob(patternsOrOptions, options) {
+ if (patternsOrOptions && (options == null ? void 0 : options.patterns)) {
+ throw new Error("Cannot pass patterns as both an argument and an option");
+ }
+ const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions;
+ const cwd = opts.cwd ? import_node_path.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
+ return crawl(opts, cwd, false);
+}
+function globSync(patternsOrOptions, options) {
+ if (patternsOrOptions && (options == null ? void 0 : options.patterns)) {
+ throw new Error("Cannot pass patterns as both an argument and an option");
+ }
+ const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions;
+ const cwd = opts.cwd ? import_node_path.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
+ return crawl(opts, cwd, true);
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ convertPathToPattern,
+ escapePath,
+ glob,
+ globSync,
+ isDynamicPattern
+});
diff --git a/node_modules/tinyglobby/dist/index.mjs b/node_modules/tinyglobby/dist/index.mjs
new file mode 100644
index 00000000..d9866ad8
--- /dev/null
+++ b/node_modules/tinyglobby/dist/index.mjs
@@ -0,0 +1,294 @@
+// src/index.ts
+import path, { posix } from "path";
+import { fdir } from "fdir";
+import picomatch2 from "picomatch";
+
+// src/utils.ts
+import picomatch from "picomatch";
+var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
+function getPartialMatcher(patterns, options) {
+ const patternsCount = patterns.length;
+ const patternsParts = Array(patternsCount);
+ const regexes = Array(patternsCount);
+ for (let i = 0; i < patternsCount; i++) {
+ const parts = splitPattern(patterns[i]);
+ patternsParts[i] = parts;
+ const partsCount = parts.length;
+ const partRegexes = Array(partsCount);
+ for (let j = 0; j < partsCount; j++) {
+ partRegexes[j] = picomatch.makeRe(parts[j], options);
+ }
+ regexes[i] = partRegexes;
+ }
+ return (input) => {
+ const inputParts = input.split("/");
+ if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) {
+ return true;
+ }
+ for (let i = 0; i < patterns.length; i++) {
+ const patternParts = patternsParts[i];
+ const regex = regexes[i];
+ const inputPatternCount = inputParts.length;
+ const minParts = Math.min(inputPatternCount, patternParts.length);
+ let j = 0;
+ while (j < minParts) {
+ const part = patternParts[j];
+ if (part.includes("/")) {
+ return true;
+ }
+ const match = regex[j].test(inputParts[j]);
+ if (!match) {
+ break;
+ }
+ if (part === "**") {
+ return true;
+ }
+ j++;
+ }
+ if (j === inputPatternCount) {
+ return true;
+ }
+ }
+ return false;
+ };
+}
+var splitPatternOptions = { parts: true };
+function splitPattern(path2) {
+ var _a;
+ const result = picomatch.scan(path2, splitPatternOptions);
+ return ((_a = result.parts) == null ? void 0 : _a.length) ? result.parts : [path2];
+}
+var isWin = process.platform === "win32";
+var ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
+function convertPosixPathToPattern(path2) {
+ return escapePosixPath(path2);
+}
+function convertWin32PathToPattern(path2) {
+ return escapeWin32Path(path2).replace(ESCAPED_WIN32_BACKSLASHES, "/");
+}
+var convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern;
+var POSIX_UNESCAPED_GLOB_SYMBOLS = /(? path2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
+var escapeWin32Path = (path2) => path2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
+var escapePath = isWin ? escapeWin32Path : escapePosixPath;
+function isDynamicPattern(pattern, options) {
+ if ((options == null ? void 0 : options.caseSensitiveMatch) === false) {
+ return true;
+ }
+ const scan = picomatch.scan(pattern);
+ return scan.isGlob || scan.negated;
+}
+function log(...tasks) {
+ console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
+}
+
+// src/index.ts
+var PARENT_DIRECTORY = /^(\/?\.\.)+/;
+var ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
+var BACKSLASHES = /\\/g;
+function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
+ var _a;
+ let result = pattern;
+ if (pattern.endsWith("/")) {
+ result = pattern.slice(0, -1);
+ }
+ if (!result.endsWith("*") && expandDirectories) {
+ result += "/**";
+ }
+ if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) {
+ result = posix.relative(escapePath(cwd), result);
+ } else {
+ result = posix.normalize(result);
+ }
+ const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
+ if (parentDirectoryMatch == null ? void 0 : parentDirectoryMatch[0]) {
+ const potentialRoot = posix.join(cwd, parentDirectoryMatch[0]);
+ if (props.root.length > potentialRoot.length) {
+ props.root = potentialRoot;
+ props.depthOffset = -(parentDirectoryMatch[0].length + 1) / 3;
+ }
+ } else if (!isIgnore && props.depthOffset >= 0) {
+ const parts = splitPattern(result);
+ (_a = props.commonPath) != null ? _a : props.commonPath = parts;
+ const newCommonPath = [];
+ const length = Math.min(props.commonPath.length, parts.length);
+ for (let i = 0; i < length; i++) {
+ const part = parts[i];
+ if (part === "**" && !parts[i + 1]) {
+ newCommonPath.pop();
+ break;
+ }
+ if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) {
+ break;
+ }
+ newCommonPath.push(part);
+ }
+ props.depthOffset = newCommonPath.length;
+ props.commonPath = newCommonPath;
+ props.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd;
+ }
+ return result;
+}
+function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
+ if (typeof patterns === "string") {
+ patterns = [patterns];
+ } else if (!patterns) {
+ patterns = ["**/*"];
+ }
+ if (typeof ignore === "string") {
+ ignore = [ignore];
+ }
+ const matchPatterns = [];
+ const ignorePatterns = [];
+ for (const pattern of ignore) {
+ if (!pattern) {
+ continue;
+ }
+ if (pattern[0] !== "!" || pattern[1] === "(") {
+ ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));
+ }
+ }
+ for (const pattern of patterns) {
+ if (!pattern) {
+ continue;
+ }
+ if (pattern[0] !== "!" || pattern[1] === "(") {
+ matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));
+ } else if (pattern[1] !== "!" || pattern[2] === "(") {
+ ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));
+ }
+ }
+ return { match: matchPatterns, ignore: ignorePatterns };
+}
+function getRelativePath(path2, cwd, root) {
+ return posix.relative(cwd, `${root}/${path2}`) || ".";
+}
+function processPath(path2, cwd, root, isDirectory, absolute) {
+ const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2;
+ if (root === cwd) {
+ return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
+ }
+ return getRelativePath(relativePath, cwd, root);
+}
+function formatPaths(paths, cwd, root) {
+ for (let i = paths.length - 1; i >= 0; i--) {
+ const path2 = paths[i];
+ paths[i] = getRelativePath(path2, cwd, root) + (!path2 || path2.endsWith("/") ? "/" : "");
+ }
+ return paths;
+}
+function crawl(options, cwd, sync) {
+ if (process.env.TINYGLOBBY_DEBUG) {
+ options.debug = true;
+ }
+ if (options.debug) {
+ log("globbing with options:", options, "cwd:", cwd);
+ }
+ if (Array.isArray(options.patterns) && options.patterns.length === 0) {
+ return sync ? [] : Promise.resolve([]);
+ }
+ const props = {
+ root: cwd,
+ commonPath: null,
+ depthOffset: 0
+ };
+ const processed = processPatterns(options, cwd, props);
+ const nocase = options.caseSensitiveMatch === false;
+ if (options.debug) {
+ log("internal processing patterns:", processed);
+ }
+ const matcher = picomatch2(processed.match, {
+ dot: options.dot,
+ nocase,
+ ignore: processed.ignore
+ });
+ const ignore = picomatch2(processed.ignore, {
+ dot: options.dot,
+ nocase
+ });
+ const partialMatcher = getPartialMatcher(processed.match, {
+ dot: options.dot,
+ nocase
+ });
+ const fdirOptions = {
+ // use relative paths in the matcher
+ filters: [
+ options.debug ? (p, isDirectory) => {
+ const path2 = processPath(p, cwd, props.root, isDirectory, options.absolute);
+ const matches = matcher(path2);
+ if (matches) {
+ log(`matched ${path2}`);
+ }
+ return matches;
+ } : (p, isDirectory) => matcher(processPath(p, cwd, props.root, isDirectory, options.absolute))
+ ],
+ exclude: options.debug ? (_, p) => {
+ const relativePath = processPath(p, cwd, props.root, true, true);
+ const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
+ if (skipped) {
+ log(`skipped ${p}`);
+ } else {
+ log(`crawling ${p}`);
+ }
+ return skipped;
+ } : (_, p) => {
+ const relativePath = processPath(p, cwd, props.root, true, true);
+ return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
+ },
+ pathSeparator: "/",
+ relativePaths: true,
+ resolveSymlinks: true
+ };
+ if (options.deep) {
+ fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
+ }
+ if (options.absolute) {
+ fdirOptions.relativePaths = false;
+ fdirOptions.resolvePaths = true;
+ fdirOptions.includeBasePath = true;
+ }
+ if (options.followSymbolicLinks === false) {
+ fdirOptions.resolveSymlinks = false;
+ fdirOptions.excludeSymlinks = true;
+ }
+ if (options.onlyDirectories) {
+ fdirOptions.excludeFiles = true;
+ fdirOptions.includeDirs = true;
+ } else if (options.onlyFiles === false) {
+ fdirOptions.includeDirs = true;
+ }
+ props.root = props.root.replace(BACKSLASHES, "");
+ const root = props.root;
+ if (options.debug) {
+ log("internal properties:", props);
+ }
+ const api = new fdir(fdirOptions).crawl(root);
+ if (cwd === root || options.absolute) {
+ return sync ? api.sync() : api.withPromise();
+ }
+ return sync ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
+}
+async function glob(patternsOrOptions, options) {
+ if (patternsOrOptions && (options == null ? void 0 : options.patterns)) {
+ throw new Error("Cannot pass patterns as both an argument and an option");
+ }
+ const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions;
+ const cwd = opts.cwd ? path.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
+ return crawl(opts, cwd, false);
+}
+function globSync(patternsOrOptions, options) {
+ if (patternsOrOptions && (options == null ? void 0 : options.patterns)) {
+ throw new Error("Cannot pass patterns as both an argument and an option");
+ }
+ const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions;
+ const cwd = opts.cwd ? path.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
+ return crawl(opts, cwd, true);
+}
+export {
+ convertPathToPattern,
+ escapePath,
+ glob,
+ globSync,
+ isDynamicPattern
+};
diff --git a/node_modules/tinyglobby/package.json b/node_modules/tinyglobby/package.json
new file mode 100644
index 00000000..d30c5996
--- /dev/null
+++ b/node_modules/tinyglobby/package.json
@@ -0,0 +1,65 @@
+{
+ "name": "tinyglobby",
+ "version": "0.2.12",
+ "description": "A fast and minimal alternative to globby and fast-glob",
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
+ "exports": {
+ "import": "./dist/index.mjs",
+ "require": "./dist/index.js"
+ },
+ "sideEffects": false,
+ "files": [
+ "dist"
+ ],
+ "author": "Superchupu",
+ "license": "MIT",
+ "keywords": [
+ "glob",
+ "patterns",
+ "fast",
+ "implementation"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/SuperchupuDev/tinyglobby.git"
+ },
+ "bugs": {
+ "url": "https://github.com/SuperchupuDev/tinyglobby/issues"
+ },
+ "homepage": "https://github.com/SuperchupuDev/tinyglobby#readme",
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ },
+ "dependencies": {
+ "fdir": "^6.4.3",
+ "picomatch": "^4.0.2"
+ },
+ "devDependencies": {
+ "@biomejs/biome": "^1.9.4",
+ "@types/node": "^22.13.4",
+ "@types/picomatch": "^3.0.2",
+ "fs-fixture": "^2.7.0",
+ "tsup": "^8.3.6",
+ "typescript": "^5.7.3"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "publishConfig": {
+ "access": "public",
+ "provenance": true
+ },
+ "scripts": {
+ "build": "tsup",
+ "check": "biome check",
+ "format": "biome format --write",
+ "lint": "biome lint",
+ "lint:fix": "biome lint --fix --unsafe",
+ "test": "node --experimental-transform-types --test",
+ "test:coverage": "node --experimental-transform-types --test --experimental-test-coverage",
+ "test:only": "node --experimental-transform-types --test --test-only",
+ "typecheck": "tsc --noEmit"
+ }
+}
\ No newline at end of file
diff --git a/node_modules/picomatch/CHANGELOG.md b/node_modules/vite-plugin-full-reload/node_modules/picomatch/CHANGELOG.md
similarity index 100%
rename from node_modules/picomatch/CHANGELOG.md
rename to node_modules/vite-plugin-full-reload/node_modules/picomatch/CHANGELOG.md
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/LICENSE b/node_modules/vite-plugin-full-reload/node_modules/picomatch/LICENSE
new file mode 100644
index 00000000..3608dca2
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017-present, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/README.md b/node_modules/vite-plugin-full-reload/node_modules/picomatch/README.md
new file mode 100644
index 00000000..b0526e28
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/README.md
@@ -0,0 +1,708 @@
+Picomatch
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.
+
+
+
+
+
+## Why picomatch?
+
+* **Lightweight** - No dependencies
+* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
+* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps)
+* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files)
+* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes.
+* **Well tested** - Thousands of unit tests
+
+See the [library comparison](#library-comparisons) to other libraries.
+
+
+
+
+## Table of Contents
+
+ Click to expand
+
+- [Install](#install)
+- [Usage](#usage)
+- [API](#api)
+ * [picomatch](#picomatch)
+ * [.test](#test)
+ * [.matchBase](#matchbase)
+ * [.isMatch](#ismatch)
+ * [.parse](#parse)
+ * [.scan](#scan)
+ * [.compileRe](#compilere)
+ * [.makeRe](#makere)
+ * [.toRegex](#toregex)
+- [Options](#options)
+ * [Picomatch options](#picomatch-options)
+ * [Scan Options](#scan-options)
+ * [Options Examples](#options-examples)
+- [Globbing features](#globbing-features)
+ * [Basic globbing](#basic-globbing)
+ * [Advanced globbing](#advanced-globbing)
+ * [Braces](#braces)
+ * [Matching special characters as literals](#matching-special-characters-as-literals)
+- [Library Comparisons](#library-comparisons)
+- [Benchmarks](#benchmarks)
+- [Philosophies](#philosophies)
+- [About](#about)
+ * [Author](#author)
+ * [License](#license)
+
+_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
+
+
+
+
+
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+npm install --save picomatch
+```
+
+
+
+## Usage
+
+The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.
+
+```js
+const pm = require('picomatch');
+const isMatch = pm('*.js');
+
+console.log(isMatch('abcd')); //=> false
+console.log(isMatch('a.js')); //=> true
+console.log(isMatch('a.md')); //=> false
+console.log(isMatch('a/b.js')); //=> false
+```
+
+
+
+## API
+
+### [picomatch](lib/picomatch.js#L32)
+
+Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.
+
+**Params**
+
+* `globs` **{String|Array}**: One or more glob patterns.
+* `options` **{Object=}**
+* `returns` **{Function=}**: Returns a matcher function.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch(glob[, options]);
+
+const isMatch = picomatch('*.!(*a)');
+console.log(isMatch('a.a')); //=> false
+console.log(isMatch('a.b')); //=> true
+```
+
+### [.test](lib/picomatch.js#L117)
+
+Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string.
+
+**Params**
+
+* `input` **{String}**: String to test.
+* `regex` **{RegExp}**
+* `returns` **{Object}**: Returns an object with matching info.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.test(input, regex[, options]);
+
+console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
+// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
+```
+
+### [.matchBase](lib/picomatch.js#L161)
+
+Match the basename of a filepath.
+
+**Params**
+
+* `input` **{String}**: String to test.
+* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe).
+* `returns` **{Boolean}**
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.matchBase(input, glob[, options]);
+console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
+```
+
+### [.isMatch](lib/picomatch.js#L183)
+
+Returns true if **any** of the given glob `patterns` match the specified `string`.
+
+**Params**
+
+* **{String|Array}**: str The string to test.
+* **{String|Array}**: patterns One or more glob patterns to use for matching.
+* **{Object}**: See available [options](#options).
+* `returns` **{Boolean}**: Returns true if any patterns match `str`
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.isMatch(string, patterns[, options]);
+
+console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
+console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
+```
+
+### [.parse](lib/picomatch.js#L199)
+
+Parse a glob pattern to create the source string for a regular expression.
+
+**Params**
+
+* `pattern` **{String}**
+* `options` **{Object}**
+* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const result = picomatch.parse(pattern[, options]);
+```
+
+### [.scan](lib/picomatch.js#L231)
+
+Scan a glob pattern to separate the pattern into segments.
+
+**Params**
+
+* `input` **{String}**: Glob pattern to scan.
+* `options` **{Object}**
+* `returns` **{Object}**: Returns an object with
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.scan(input[, options]);
+
+const result = picomatch.scan('!./foo/*.js');
+console.log(result);
+{ prefix: '!./',
+ input: '!./foo/*.js',
+ start: 3,
+ base: 'foo',
+ glob: '*.js',
+ isBrace: false,
+ isBracket: false,
+ isGlob: true,
+ isExtglob: false,
+ isGlobstar: false,
+ negated: true }
+```
+
+### [.compileRe](lib/picomatch.js#L245)
+
+Compile a regular expression from the `state` object returned by the
+[parse()](#parse) method.
+
+**Params**
+
+* `state` **{Object}**
+* `options` **{Object}**
+* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser.
+* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
+* `returns` **{RegExp}**
+
+### [.makeRe](lib/picomatch.js#L286)
+
+Create a regular expression from a parsed glob pattern.
+
+**Params**
+
+* `state` **{String}**: The object returned from the `.parse` method.
+* `options` **{Object}**
+* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
+* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
+* `returns` **{RegExp}**: Returns a regex created from the given pattern.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const state = picomatch.parse('*.js');
+// picomatch.compileRe(state[, options]);
+
+console.log(picomatch.compileRe(state));
+//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+```
+
+### [.toRegex](lib/picomatch.js#L321)
+
+Create a regular expression from the given regex source string.
+
+**Params**
+
+* `source` **{String}**: Regular expression source string.
+* `options` **{Object}**
+* `returns` **{RegExp}**
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.toRegex(source[, options]);
+
+const { output } = picomatch.parse('*.js');
+console.log(picomatch.toRegex(output));
+//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+```
+
+
+
+## Options
+
+### Picomatch options
+
+The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API.
+
+| **Option** | **Type** | **Default value** | **Description** |
+| --- | --- | --- | --- |
+| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
+| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). |
+| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. |
+| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). |
+| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` |
+| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. |
+| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true |
+| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. |
+| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. |
+| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. |
+| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. |
+| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
+| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. |
+| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
+| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
+| `matchBase` | `boolean` | `false` | Alias for `basename` |
+| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
+| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. |
+| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. |
+| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. |
+| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. |
+| `noext` | `boolean` | `false` | Alias for `noextglob` |
+| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) |
+| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) |
+| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` |
+| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. |
+| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. |
+| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. |
+| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
+| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). |
+| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
+| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
+| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
+| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
+| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
+| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. |
+| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. |
+
+picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error.
+
+### Scan Options
+
+In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method.
+
+| **Option** | **Type** | **Default value** | **Description** |
+| --- | --- | --- | --- |
+| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern |
+| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true |
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const result = picomatch.scan('!./foo/*.js', { tokens: true });
+console.log(result);
+// {
+// prefix: '!./',
+// input: '!./foo/*.js',
+// start: 3,
+// base: 'foo',
+// glob: '*.js',
+// isBrace: false,
+// isBracket: false,
+// isGlob: true,
+// isExtglob: false,
+// isGlobstar: false,
+// negated: true,
+// maxDepth: 2,
+// tokens: [
+// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true },
+// { value: 'foo', depth: 1, isGlob: false },
+// { value: '*.js', depth: 1, isGlob: true }
+// ],
+// slashes: [ 2, 6 ],
+// parts: [ 'foo', '*.js' ]
+// }
+```
+
+
+
+### Options Examples
+
+#### options.expandRange
+
+**Type**: `function`
+
+**Default**: `undefined`
+
+Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
+
+**Example**
+
+The following example shows how to create a glob that matches a folder
+
+```js
+const fill = require('fill-range');
+const regex = pm.makeRe('foo/{01..25}/bar', {
+ expandRange(a, b) {
+ return `(${fill(a, b, { toRegex: true })})`;
+ }
+});
+
+console.log(regex);
+//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/
+
+console.log(regex.test('foo/00/bar')) // false
+console.log(regex.test('foo/01/bar')) // true
+console.log(regex.test('foo/10/bar')) // true
+console.log(regex.test('foo/22/bar')) // true
+console.log(regex.test('foo/25/bar')) // true
+console.log(regex.test('foo/26/bar')) // false
+```
+
+#### options.format
+
+**Type**: `function`
+
+**Default**: `undefined`
+
+Custom function for formatting strings before they're matched.
+
+**Example**
+
+```js
+// strip leading './' from strings
+const format = str => str.replace(/^\.\//, '');
+const isMatch = picomatch('foo/*.js', { format });
+console.log(isMatch('./foo/bar.js')); //=> true
+```
+
+#### options.onMatch
+
+```js
+const onMatch = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onMatch });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+#### options.onIgnore
+
+```js
+const onIgnore = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onIgnore, ignore: 'f*' });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+#### options.onResult
+
+```js
+const onResult = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onResult, ignore: 'f*' });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+
+
+
+## Globbing features
+
+* [Basic globbing](#basic-globbing) (Wildcard matching)
+* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching)
+
+### Basic globbing
+
+| **Character** | **Description** |
+| --- | --- |
+| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. |
+| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
+| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. |
+| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. |
+
+#### Matching behavior vs. Bash
+
+Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions:
+
+* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`.
+* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`.
+
+
+
+### Advanced globbing
+
+* [extglobs](#extglobs)
+* [POSIX brackets](#posix-brackets)
+* [Braces](#brace-expansion)
+
+#### Extglobs
+
+| **Pattern** | **Description** |
+| --- | --- |
+| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` |
+| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` |
+| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` |
+| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` |
+| `!(pattern)` | Match _anything but_ `pattern` |
+
+**Examples**
+
+```js
+const pm = require('picomatch');
+
+// *(pattern) matches ZERO or more of "pattern"
+console.log(pm.isMatch('a', 'a*(z)')); // true
+console.log(pm.isMatch('az', 'a*(z)')); // true
+console.log(pm.isMatch('azzz', 'a*(z)')); // true
+
+// +(pattern) matches ONE or more of "pattern"
+console.log(pm.isMatch('a', 'a*(z)')); // true
+console.log(pm.isMatch('az', 'a*(z)')); // true
+console.log(pm.isMatch('azzz', 'a*(z)')); // true
+
+// supports multiple extglobs
+console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false
+
+// supports nested extglobs
+console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true
+```
+
+#### POSIX brackets
+
+POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true.
+
+**Enable POSIX bracket support**
+
+```js
+console.log(pm.makeRe('[[:word:]]+', { posix: true }));
+//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/
+```
+
+**Supported POSIX classes**
+
+The following named POSIX bracket expressions are supported:
+
+* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]`
+* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`.
+* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`.
+* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`.
+* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`.
+* `[:digit:]` - Numerical digits, equivalent to `[0-9]`.
+* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`.
+* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`.
+* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`.
+* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`.
+* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`.
+* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`.
+* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`.
+* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`.
+
+See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information.
+
+### Braces
+
+Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces.
+
+### Matching special characters as literals
+
+If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes:
+
+**Special Characters**
+
+Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.
+
+To match any of the following characters as literals: `$^*+?()[]
+
+Examples:
+
+```js
+console.log(pm.makeRe('foo/bar \\(1\\)'));
+console.log(pm.makeRe('foo/bar \\(1\\)'));
+```
+
+
+
+
+## Library Comparisons
+
+The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets).
+
+| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - |
+| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - |
+| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - |
+| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - |
+| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - |
+| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ |
+| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ |
+| File system operations | - | - | - | - | - | - | - |
+
+
+
+
+## Benchmarks
+
+Performance comparison of picomatch and minimatch.
+
+```
+# .makeRe star
+ picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled)
+ minimatch x 627,206 ops/sec ±1.96% (87 runs sampled))
+
+# .makeRe star; dot=true
+ picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled)
+ minimatch x 525,876 ops/sec ±0.60% (88 runs sampled)
+
+# .makeRe globstar
+ picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled)
+ minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d)
+
+# .makeRe globstars
+ picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled)
+ minimatch x 477,179 ops/sec ±1.33% (91 runs sampled)
+
+# .makeRe with leading star
+ picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled)
+ minimatch x 453,564 ops/sec ±1.43% (94 runs sampled)
+
+# .makeRe - basic braces
+ picomatch x 392,067 ops/sec ±0.70% (90 runs sampled)
+ minimatch x 99,532 ops/sec ±2.03% (87 runs sampled))
+```
+
+
+
+
+## Philosophies
+
+The goal of this library is to be blazing fast, without compromising on accuracy.
+
+**Accuracy**
+
+The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`.
+
+Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements.
+
+**Performance**
+
+Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer.
+
+
+
+
+## About
+
+
+Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
+
+
+
+
+Running Tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+npm install && npm test
+```
+
+
+
+
+Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+
+
+### Author
+
+**Jon Schlinkert**
+
+* [GitHub Profile](https://github.com/jonschlinkert)
+* [Twitter Profile](https://twitter.com/jonschlinkert)
+* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
+
+### License
+
+Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/index.js b/node_modules/vite-plugin-full-reload/node_modules/picomatch/index.js
new file mode 100644
index 00000000..d2f2bc59
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./lib/picomatch');
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/constants.js b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/constants.js
new file mode 100644
index 00000000..a62ef387
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/constants.js
@@ -0,0 +1,179 @@
+'use strict';
+
+const path = require('path');
+const WIN_SLASH = '\\\\/';
+const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
+
+/**
+ * Posix glob regex
+ */
+
+const DOT_LITERAL = '\\.';
+const PLUS_LITERAL = '\\+';
+const QMARK_LITERAL = '\\?';
+const SLASH_LITERAL = '\\/';
+const ONE_CHAR = '(?=.)';
+const QMARK = '[^/]';
+const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
+const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
+const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
+const NO_DOT = `(?!${DOT_LITERAL})`;
+const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
+const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
+const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
+const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
+const STAR = `${QMARK}*?`;
+
+const POSIX_CHARS = {
+ DOT_LITERAL,
+ PLUS_LITERAL,
+ QMARK_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ QMARK,
+ END_ANCHOR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOTS,
+ NO_DOT_SLASH,
+ NO_DOTS_SLASH,
+ QMARK_NO_DOT,
+ STAR,
+ START_ANCHOR
+};
+
+/**
+ * Windows glob regex
+ */
+
+const WINDOWS_CHARS = {
+ ...POSIX_CHARS,
+
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
+ QMARK: WIN_NO_SLASH,
+ STAR: `${WIN_NO_SLASH}*?`,
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
+ NO_DOT: `(?!${DOT_LITERAL})`,
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
+};
+
+/**
+ * POSIX Bracket Regex
+ */
+
+const POSIX_REGEX_SOURCE = {
+ alnum: 'a-zA-Z0-9',
+ alpha: 'a-zA-Z',
+ ascii: '\\x00-\\x7F',
+ blank: ' \\t',
+ cntrl: '\\x00-\\x1F\\x7F',
+ digit: '0-9',
+ graph: '\\x21-\\x7E',
+ lower: 'a-z',
+ print: '\\x20-\\x7E ',
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
+ space: ' \\t\\r\\n\\v\\f',
+ upper: 'A-Z',
+ word: 'A-Za-z0-9_',
+ xdigit: 'A-Fa-f0-9'
+};
+
+module.exports = {
+ MAX_LENGTH: 1024 * 64,
+ POSIX_REGEX_SOURCE,
+
+ // regular expressions
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
+
+ // Replace globs with equivalent patterns to reduce parsing time.
+ REPLACEMENTS: {
+ '***': '*',
+ '**/**': '**',
+ '**/**/**': '**'
+ },
+
+ // Digits
+ CHAR_0: 48, /* 0 */
+ CHAR_9: 57, /* 9 */
+
+ // Alphabet chars.
+ CHAR_UPPERCASE_A: 65, /* A */
+ CHAR_LOWERCASE_A: 97, /* a */
+ CHAR_UPPERCASE_Z: 90, /* Z */
+ CHAR_LOWERCASE_Z: 122, /* z */
+
+ CHAR_LEFT_PARENTHESES: 40, /* ( */
+ CHAR_RIGHT_PARENTHESES: 41, /* ) */
+
+ CHAR_ASTERISK: 42, /* * */
+
+ // Non-alphabetic chars.
+ CHAR_AMPERSAND: 38, /* & */
+ CHAR_AT: 64, /* @ */
+ CHAR_BACKWARD_SLASH: 92, /* \ */
+ CHAR_CARRIAGE_RETURN: 13, /* \r */
+ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
+ CHAR_COLON: 58, /* : */
+ CHAR_COMMA: 44, /* , */
+ CHAR_DOT: 46, /* . */
+ CHAR_DOUBLE_QUOTE: 34, /* " */
+ CHAR_EQUAL: 61, /* = */
+ CHAR_EXCLAMATION_MARK: 33, /* ! */
+ CHAR_FORM_FEED: 12, /* \f */
+ CHAR_FORWARD_SLASH: 47, /* / */
+ CHAR_GRAVE_ACCENT: 96, /* ` */
+ CHAR_HASH: 35, /* # */
+ CHAR_HYPHEN_MINUS: 45, /* - */
+ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
+ CHAR_LEFT_CURLY_BRACE: 123, /* { */
+ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
+ CHAR_LINE_FEED: 10, /* \n */
+ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
+ CHAR_PERCENT: 37, /* % */
+ CHAR_PLUS: 43, /* + */
+ CHAR_QUESTION_MARK: 63, /* ? */
+ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
+ CHAR_RIGHT_CURLY_BRACE: 125, /* } */
+ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
+ CHAR_SEMICOLON: 59, /* ; */
+ CHAR_SINGLE_QUOTE: 39, /* ' */
+ CHAR_SPACE: 32, /* */
+ CHAR_TAB: 9, /* \t */
+ CHAR_UNDERSCORE: 95, /* _ */
+ CHAR_VERTICAL_LINE: 124, /* | */
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
+
+ SEP: path.sep,
+
+ /**
+ * Create EXTGLOB_CHARS
+ */
+
+ extglobChars(chars) {
+ return {
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
+ '+': { type: 'plus', open: '(?:', close: ')+' },
+ '*': { type: 'star', open: '(?:', close: ')*' },
+ '@': { type: 'at', open: '(?:', close: ')' }
+ };
+ },
+
+ /**
+ * Create GLOB_CHARS
+ */
+
+ globChars(win32) {
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
+ }
+};
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/parse.js b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/parse.js
new file mode 100644
index 00000000..58269d01
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/parse.js
@@ -0,0 +1,1091 @@
+'use strict';
+
+const constants = require('./constants');
+const utils = require('./utils');
+
+/**
+ * Constants
+ */
+
+const {
+ MAX_LENGTH,
+ POSIX_REGEX_SOURCE,
+ REGEX_NON_SPECIAL_CHARS,
+ REGEX_SPECIAL_CHARS_BACKREF,
+ REPLACEMENTS
+} = constants;
+
+/**
+ * Helpers
+ */
+
+const expandRange = (args, options) => {
+ if (typeof options.expandRange === 'function') {
+ return options.expandRange(...args, options);
+ }
+
+ args.sort();
+ const value = `[${args.join('-')}]`;
+
+ try {
+ /* eslint-disable-next-line no-new */
+ new RegExp(value);
+ } catch (ex) {
+ return args.map(v => utils.escapeRegex(v)).join('..');
+ }
+
+ return value;
+};
+
+/**
+ * Create the message for a syntax error
+ */
+
+const syntaxError = (type, char) => {
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
+};
+
+/**
+ * Parse the given input string.
+ * @param {String} input
+ * @param {Object} options
+ * @return {Object}
+ */
+
+const parse = (input, options) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ input = REPLACEMENTS[input] || input;
+
+ const opts = { ...options };
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+
+ let len = input.length;
+ if (len > max) {
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
+ }
+
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
+ const tokens = [bos];
+
+ const capture = opts.capture ? '' : '?:';
+ const win32 = utils.isWindows(options);
+
+ // create constants based on platform, for windows or posix
+ const PLATFORM_CHARS = constants.globChars(win32);
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
+
+ const {
+ DOT_LITERAL,
+ PLUS_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOT_SLASH,
+ NO_DOTS_SLASH,
+ QMARK,
+ QMARK_NO_DOT,
+ STAR,
+ START_ANCHOR
+ } = PLATFORM_CHARS;
+
+ const globstar = opts => {
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
+ };
+
+ const nodot = opts.dot ? '' : NO_DOT;
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
+ let star = opts.bash === true ? globstar(opts) : STAR;
+
+ if (opts.capture) {
+ star = `(${star})`;
+ }
+
+ // minimatch options support
+ if (typeof opts.noext === 'boolean') {
+ opts.noextglob = opts.noext;
+ }
+
+ const state = {
+ input,
+ index: -1,
+ start: 0,
+ dot: opts.dot === true,
+ consumed: '',
+ output: '',
+ prefix: '',
+ backtrack: false,
+ negated: false,
+ brackets: 0,
+ braces: 0,
+ parens: 0,
+ quotes: 0,
+ globstar: false,
+ tokens
+ };
+
+ input = utils.removePrefix(input, state);
+ len = input.length;
+
+ const extglobs = [];
+ const braces = [];
+ const stack = [];
+ let prev = bos;
+ let value;
+
+ /**
+ * Tokenizing helpers
+ */
+
+ const eos = () => state.index === len - 1;
+ const peek = state.peek = (n = 1) => input[state.index + n];
+ const advance = state.advance = () => input[++state.index] || '';
+ const remaining = () => input.slice(state.index + 1);
+ const consume = (value = '', num = 0) => {
+ state.consumed += value;
+ state.index += num;
+ };
+
+ const append = token => {
+ state.output += token.output != null ? token.output : token.value;
+ consume(token.value);
+ };
+
+ const negate = () => {
+ let count = 1;
+
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
+ advance();
+ state.start++;
+ count++;
+ }
+
+ if (count % 2 === 0) {
+ return false;
+ }
+
+ state.negated = true;
+ state.start++;
+ return true;
+ };
+
+ const increment = type => {
+ state[type]++;
+ stack.push(type);
+ };
+
+ const decrement = type => {
+ state[type]--;
+ stack.pop();
+ };
+
+ /**
+ * Push tokens onto the tokens array. This helper speeds up
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
+ * and 2) helping us avoid creating extra tokens when consecutive
+ * characters are plain text. This improves performance and simplifies
+ * lookbehinds.
+ */
+
+ const push = tok => {
+ if (prev.type === 'globstar') {
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
+
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
+ state.output = state.output.slice(0, -prev.output.length);
+ prev.type = 'star';
+ prev.value = '*';
+ prev.output = star;
+ state.output += prev.output;
+ }
+ }
+
+ if (extglobs.length && tok.type !== 'paren') {
+ extglobs[extglobs.length - 1].inner += tok.value;
+ }
+
+ if (tok.value || tok.output) append(tok);
+ if (prev && prev.type === 'text' && tok.type === 'text') {
+ prev.value += tok.value;
+ prev.output = (prev.output || '') + tok.value;
+ return;
+ }
+
+ tok.prev = prev;
+ tokens.push(tok);
+ prev = tok;
+ };
+
+ const extglobOpen = (type, value) => {
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
+
+ token.prev = prev;
+ token.parens = state.parens;
+ token.output = state.output;
+ const output = (opts.capture ? '(' : '') + token.open;
+
+ increment('parens');
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
+ push({ type: 'paren', extglob: true, value: advance(), output });
+ extglobs.push(token);
+ };
+
+ const extglobClose = token => {
+ let output = token.close + (opts.capture ? ')' : '');
+ let rest;
+
+ if (token.type === 'negate') {
+ let extglobStar = star;
+
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
+ extglobStar = globstar(opts);
+ }
+
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
+ output = token.close = `)$))${extglobStar}`;
+ }
+
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
+ // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
+ // In this case, we need to parse the string and use it in the output of the original pattern.
+ // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
+ //
+ // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
+
+ output = token.close = `)${expression})${extglobStar})`;
+ }
+
+ if (token.prev.type === 'bos') {
+ state.negatedExtglob = true;
+ }
+ }
+
+ push({ type: 'paren', extglob: true, value, output });
+ decrement('parens');
+ };
+
+ /**
+ * Fast paths
+ */
+
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
+ let backslashes = false;
+
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
+ if (first === '\\') {
+ backslashes = true;
+ return m;
+ }
+
+ if (first === '?') {
+ if (esc) {
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
+ }
+ if (index === 0) {
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
+ }
+ return QMARK.repeat(chars.length);
+ }
+
+ if (first === '.') {
+ return DOT_LITERAL.repeat(chars.length);
+ }
+
+ if (first === '*') {
+ if (esc) {
+ return esc + first + (rest ? star : '');
+ }
+ return star;
+ }
+ return esc ? m : `\\${m}`;
+ });
+
+ if (backslashes === true) {
+ if (opts.unescape === true) {
+ output = output.replace(/\\/g, '');
+ } else {
+ output = output.replace(/\\+/g, m => {
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
+ });
+ }
+ }
+
+ if (output === input && opts.contains === true) {
+ state.output = input;
+ return state;
+ }
+
+ state.output = utils.wrapOutput(output, state, options);
+ return state;
+ }
+
+ /**
+ * Tokenize input until we reach end-of-string
+ */
+
+ while (!eos()) {
+ value = advance();
+
+ if (value === '\u0000') {
+ continue;
+ }
+
+ /**
+ * Escaped characters
+ */
+
+ if (value === '\\') {
+ const next = peek();
+
+ if (next === '/' && opts.bash !== true) {
+ continue;
+ }
+
+ if (next === '.' || next === ';') {
+ continue;
+ }
+
+ if (!next) {
+ value += '\\';
+ push({ type: 'text', value });
+ continue;
+ }
+
+ // collapse slashes to reduce potential for exploits
+ const match = /^\\+/.exec(remaining());
+ let slashes = 0;
+
+ if (match && match[0].length > 2) {
+ slashes = match[0].length;
+ state.index += slashes;
+ if (slashes % 2 !== 0) {
+ value += '\\';
+ }
+ }
+
+ if (opts.unescape === true) {
+ value = advance();
+ } else {
+ value += advance();
+ }
+
+ if (state.brackets === 0) {
+ push({ type: 'text', value });
+ continue;
+ }
+ }
+
+ /**
+ * If we're inside a regex character class, continue
+ * until we reach the closing bracket.
+ */
+
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
+ if (opts.posix !== false && value === ':') {
+ const inner = prev.value.slice(1);
+ if (inner.includes('[')) {
+ prev.posix = true;
+
+ if (inner.includes(':')) {
+ const idx = prev.value.lastIndexOf('[');
+ const pre = prev.value.slice(0, idx);
+ const rest = prev.value.slice(idx + 2);
+ const posix = POSIX_REGEX_SOURCE[rest];
+ if (posix) {
+ prev.value = pre + posix;
+ state.backtrack = true;
+ advance();
+
+ if (!bos.output && tokens.indexOf(prev) === 1) {
+ bos.output = ONE_CHAR;
+ }
+ continue;
+ }
+ }
+ }
+ }
+
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
+ value = `\\${value}`;
+ }
+
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
+ value = `\\${value}`;
+ }
+
+ if (opts.posix === true && value === '!' && prev.value === '[') {
+ value = '^';
+ }
+
+ prev.value += value;
+ append({ value });
+ continue;
+ }
+
+ /**
+ * If we're inside a quoted string, continue
+ * until we reach the closing double quote.
+ */
+
+ if (state.quotes === 1 && value !== '"') {
+ value = utils.escapeRegex(value);
+ prev.value += value;
+ append({ value });
+ continue;
+ }
+
+ /**
+ * Double quotes
+ */
+
+ if (value === '"') {
+ state.quotes = state.quotes === 1 ? 0 : 1;
+ if (opts.keepQuotes === true) {
+ push({ type: 'text', value });
+ }
+ continue;
+ }
+
+ /**
+ * Parentheses
+ */
+
+ if (value === '(') {
+ increment('parens');
+ push({ type: 'paren', value });
+ continue;
+ }
+
+ if (value === ')') {
+ if (state.parens === 0 && opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('opening', '('));
+ }
+
+ const extglob = extglobs[extglobs.length - 1];
+ if (extglob && state.parens === extglob.parens + 1) {
+ extglobClose(extglobs.pop());
+ continue;
+ }
+
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
+ decrement('parens');
+ continue;
+ }
+
+ /**
+ * Square brackets
+ */
+
+ if (value === '[') {
+ if (opts.nobracket === true || !remaining().includes(']')) {
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('closing', ']'));
+ }
+
+ value = `\\${value}`;
+ } else {
+ increment('brackets');
+ }
+
+ push({ type: 'bracket', value });
+ continue;
+ }
+
+ if (value === ']') {
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
+ push({ type: 'text', value, output: `\\${value}` });
+ continue;
+ }
+
+ if (state.brackets === 0) {
+ if (opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('opening', '['));
+ }
+
+ push({ type: 'text', value, output: `\\${value}` });
+ continue;
+ }
+
+ decrement('brackets');
+
+ const prevValue = prev.value.slice(1);
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
+ value = `/${value}`;
+ }
+
+ prev.value += value;
+ append({ value });
+
+ // when literal brackets are explicitly disabled
+ // assume we should match with a regex character class
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
+ continue;
+ }
+
+ const escaped = utils.escapeRegex(prev.value);
+ state.output = state.output.slice(0, -prev.value.length);
+
+ // when literal brackets are explicitly enabled
+ // assume we should escape the brackets to match literal characters
+ if (opts.literalBrackets === true) {
+ state.output += escaped;
+ prev.value = escaped;
+ continue;
+ }
+
+ // when the user specifies nothing, try to match both
+ prev.value = `(${capture}${escaped}|${prev.value})`;
+ state.output += prev.value;
+ continue;
+ }
+
+ /**
+ * Braces
+ */
+
+ if (value === '{' && opts.nobrace !== true) {
+ increment('braces');
+
+ const open = {
+ type: 'brace',
+ value,
+ output: '(',
+ outputIndex: state.output.length,
+ tokensIndex: state.tokens.length
+ };
+
+ braces.push(open);
+ push(open);
+ continue;
+ }
+
+ if (value === '}') {
+ const brace = braces[braces.length - 1];
+
+ if (opts.nobrace === true || !brace) {
+ push({ type: 'text', value, output: value });
+ continue;
+ }
+
+ let output = ')';
+
+ if (brace.dots === true) {
+ const arr = tokens.slice();
+ const range = [];
+
+ for (let i = arr.length - 1; i >= 0; i--) {
+ tokens.pop();
+ if (arr[i].type === 'brace') {
+ break;
+ }
+ if (arr[i].type !== 'dots') {
+ range.unshift(arr[i].value);
+ }
+ }
+
+ output = expandRange(range, opts);
+ state.backtrack = true;
+ }
+
+ if (brace.comma !== true && brace.dots !== true) {
+ const out = state.output.slice(0, brace.outputIndex);
+ const toks = state.tokens.slice(brace.tokensIndex);
+ brace.value = brace.output = '\\{';
+ value = output = '\\}';
+ state.output = out;
+ for (const t of toks) {
+ state.output += (t.output || t.value);
+ }
+ }
+
+ push({ type: 'brace', value, output });
+ decrement('braces');
+ braces.pop();
+ continue;
+ }
+
+ /**
+ * Pipes
+ */
+
+ if (value === '|') {
+ if (extglobs.length > 0) {
+ extglobs[extglobs.length - 1].conditions++;
+ }
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Commas
+ */
+
+ if (value === ',') {
+ let output = value;
+
+ const brace = braces[braces.length - 1];
+ if (brace && stack[stack.length - 1] === 'braces') {
+ brace.comma = true;
+ output = '|';
+ }
+
+ push({ type: 'comma', value, output });
+ continue;
+ }
+
+ /**
+ * Slashes
+ */
+
+ if (value === '/') {
+ // if the beginning of the glob is "./", advance the start
+ // to the current index, and don't add the "./" characters
+ // to the state. This greatly simplifies lookbehinds when
+ // checking for BOS characters like "!" and "." (not "./")
+ if (prev.type === 'dot' && state.index === state.start + 1) {
+ state.start = state.index + 1;
+ state.consumed = '';
+ state.output = '';
+ tokens.pop();
+ prev = bos; // reset "prev" to the first token
+ continue;
+ }
+
+ push({ type: 'slash', value, output: SLASH_LITERAL });
+ continue;
+ }
+
+ /**
+ * Dots
+ */
+
+ if (value === '.') {
+ if (state.braces > 0 && prev.type === 'dot') {
+ if (prev.value === '.') prev.output = DOT_LITERAL;
+ const brace = braces[braces.length - 1];
+ prev.type = 'dots';
+ prev.output += value;
+ prev.value += value;
+ brace.dots = true;
+ continue;
+ }
+
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
+ push({ type: 'text', value, output: DOT_LITERAL });
+ continue;
+ }
+
+ push({ type: 'dot', value, output: DOT_LITERAL });
+ continue;
+ }
+
+ /**
+ * Question marks
+ */
+
+ if (value === '?') {
+ const isGroup = prev && prev.value === '(';
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ extglobOpen('qmark', value);
+ continue;
+ }
+
+ if (prev && prev.type === 'paren') {
+ const next = peek();
+ let output = value;
+
+ if (next === '<' && !utils.supportsLookbehinds()) {
+ throw new Error('Node.js v10 or higher is required for regex lookbehinds');
+ }
+
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
+ output = `\\${value}`;
+ }
+
+ push({ type: 'text', value, output });
+ continue;
+ }
+
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
+ continue;
+ }
+
+ push({ type: 'qmark', value, output: QMARK });
+ continue;
+ }
+
+ /**
+ * Exclamation
+ */
+
+ if (value === '!') {
+ if (opts.noextglob !== true && peek() === '(') {
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
+ extglobOpen('negate', value);
+ continue;
+ }
+ }
+
+ if (opts.nonegate !== true && state.index === 0) {
+ negate();
+ continue;
+ }
+ }
+
+ /**
+ * Plus
+ */
+
+ if (value === '+') {
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ extglobOpen('plus', value);
+ continue;
+ }
+
+ if ((prev && prev.value === '(') || opts.regex === false) {
+ push({ type: 'plus', value, output: PLUS_LITERAL });
+ continue;
+ }
+
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
+ push({ type: 'plus', value });
+ continue;
+ }
+
+ push({ type: 'plus', value: PLUS_LITERAL });
+ continue;
+ }
+
+ /**
+ * Plain text
+ */
+
+ if (value === '@') {
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ push({ type: 'at', extglob: true, value, output: '' });
+ continue;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Plain text
+ */
+
+ if (value !== '*') {
+ if (value === '$' || value === '^') {
+ value = `\\${value}`;
+ }
+
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
+ if (match) {
+ value += match[0];
+ state.index += match[0].length;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Stars
+ */
+
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
+ prev.type = 'star';
+ prev.star = true;
+ prev.value += value;
+ prev.output = star;
+ state.backtrack = true;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ let rest = remaining();
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
+ extglobOpen('star', value);
+ continue;
+ }
+
+ if (prev.type === 'star') {
+ if (opts.noglobstar === true) {
+ consume(value);
+ continue;
+ }
+
+ const prior = prev.prev;
+ const before = prior.prev;
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
+
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
+ push({ type: 'star', value, output: '' });
+ continue;
+ }
+
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
+ push({ type: 'star', value, output: '' });
+ continue;
+ }
+
+ // strip consecutive `/**/`
+ while (rest.slice(0, 3) === '/**') {
+ const after = input[state.index + 4];
+ if (after && after !== '/') {
+ break;
+ }
+ rest = rest.slice(3);
+ consume('/**', 3);
+ }
+
+ if (prior.type === 'bos' && eos()) {
+ prev.type = 'globstar';
+ prev.value += value;
+ prev.output = globstar(opts);
+ state.output = prev.output;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
+ prior.output = `(?:${prior.output}`;
+
+ prev.type = 'globstar';
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
+ prev.value += value;
+ state.globstar = true;
+ state.output += prior.output + prev.output;
+ consume(value);
+ continue;
+ }
+
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
+ const end = rest[1] !== void 0 ? '|$' : '';
+
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
+ prior.output = `(?:${prior.output}`;
+
+ prev.type = 'globstar';
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
+ prev.value += value;
+
+ state.output += prior.output + prev.output;
+ state.globstar = true;
+
+ consume(value + advance());
+
+ push({ type: 'slash', value: '/', output: '' });
+ continue;
+ }
+
+ if (prior.type === 'bos' && rest[0] === '/') {
+ prev.type = 'globstar';
+ prev.value += value;
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
+ state.output = prev.output;
+ state.globstar = true;
+ consume(value + advance());
+ push({ type: 'slash', value: '/', output: '' });
+ continue;
+ }
+
+ // remove single star from output
+ state.output = state.output.slice(0, -prev.output.length);
+
+ // reset previous token to globstar
+ prev.type = 'globstar';
+ prev.output = globstar(opts);
+ prev.value += value;
+
+ // reset output with globstar
+ state.output += prev.output;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ const token = { type: 'star', value, output: star };
+
+ if (opts.bash === true) {
+ token.output = '.*?';
+ if (prev.type === 'bos' || prev.type === 'slash') {
+ token.output = nodot + token.output;
+ }
+ push(token);
+ continue;
+ }
+
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
+ token.output = value;
+ push(token);
+ continue;
+ }
+
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
+ if (prev.type === 'dot') {
+ state.output += NO_DOT_SLASH;
+ prev.output += NO_DOT_SLASH;
+
+ } else if (opts.dot === true) {
+ state.output += NO_DOTS_SLASH;
+ prev.output += NO_DOTS_SLASH;
+
+ } else {
+ state.output += nodot;
+ prev.output += nodot;
+ }
+
+ if (peek() !== '*') {
+ state.output += ONE_CHAR;
+ prev.output += ONE_CHAR;
+ }
+ }
+
+ push(token);
+ }
+
+ while (state.brackets > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
+ state.output = utils.escapeLast(state.output, '[');
+ decrement('brackets');
+ }
+
+ while (state.parens > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
+ state.output = utils.escapeLast(state.output, '(');
+ decrement('parens');
+ }
+
+ while (state.braces > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
+ state.output = utils.escapeLast(state.output, '{');
+ decrement('braces');
+ }
+
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
+ }
+
+ // rebuild the output if we had to backtrack at any point
+ if (state.backtrack === true) {
+ state.output = '';
+
+ for (const token of state.tokens) {
+ state.output += token.output != null ? token.output : token.value;
+
+ if (token.suffix) {
+ state.output += token.suffix;
+ }
+ }
+ }
+
+ return state;
+};
+
+/**
+ * Fast paths for creating regular expressions for common glob patterns.
+ * This can significantly speed up processing and has very little downside
+ * impact when none of the fast paths match.
+ */
+
+parse.fastpaths = (input, options) => {
+ const opts = { ...options };
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+ const len = input.length;
+ if (len > max) {
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
+ }
+
+ input = REPLACEMENTS[input] || input;
+ const win32 = utils.isWindows(options);
+
+ // create constants based on platform, for windows or posix
+ const {
+ DOT_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOTS,
+ NO_DOTS_SLASH,
+ STAR,
+ START_ANCHOR
+ } = constants.globChars(win32);
+
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
+ const capture = opts.capture ? '' : '?:';
+ const state = { negated: false, prefix: '' };
+ let star = opts.bash === true ? '.*?' : STAR;
+
+ if (opts.capture) {
+ star = `(${star})`;
+ }
+
+ const globstar = opts => {
+ if (opts.noglobstar === true) return star;
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
+ };
+
+ const create = str => {
+ switch (str) {
+ case '*':
+ return `${nodot}${ONE_CHAR}${star}`;
+
+ case '.*':
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '*.*':
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '*/*':
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
+
+ case '**':
+ return nodot + globstar(opts);
+
+ case '**/*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
+
+ case '**/*.*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '**/.*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ default: {
+ const match = /^(.*?)\.(\w+)$/.exec(str);
+ if (!match) return;
+
+ const source = create(match[1]);
+ if (!source) return;
+
+ return source + DOT_LITERAL + match[2];
+ }
+ }
+ };
+
+ const output = utils.removePrefix(input, state);
+ let source = create(output);
+
+ if (source && opts.strictSlashes !== true) {
+ source += `${SLASH_LITERAL}?`;
+ }
+
+ return source;
+};
+
+module.exports = parse;
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/picomatch.js b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/picomatch.js
new file mode 100644
index 00000000..782d8094
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/picomatch.js
@@ -0,0 +1,342 @@
+'use strict';
+
+const path = require('path');
+const scan = require('./scan');
+const parse = require('./parse');
+const utils = require('./utils');
+const constants = require('./constants');
+const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
+
+/**
+ * Creates a matcher function from one or more glob patterns. The
+ * returned function takes a string to match as its first argument,
+ * and returns true if the string is a match. The returned matcher
+ * function also takes a boolean as the second argument that, when true,
+ * returns an object with additional information.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch(glob[, options]);
+ *
+ * const isMatch = picomatch('*.!(*a)');
+ * console.log(isMatch('a.a')); //=> false
+ * console.log(isMatch('a.b')); //=> true
+ * ```
+ * @name picomatch
+ * @param {String|Array} `globs` One or more glob patterns.
+ * @param {Object=} `options`
+ * @return {Function=} Returns a matcher function.
+ * @api public
+ */
+
+const picomatch = (glob, options, returnState = false) => {
+ if (Array.isArray(glob)) {
+ const fns = glob.map(input => picomatch(input, options, returnState));
+ const arrayMatcher = str => {
+ for (const isMatch of fns) {
+ const state = isMatch(str);
+ if (state) return state;
+ }
+ return false;
+ };
+ return arrayMatcher;
+ }
+
+ const isState = isObject(glob) && glob.tokens && glob.input;
+
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
+ throw new TypeError('Expected pattern to be a non-empty string');
+ }
+
+ const opts = options || {};
+ const posix = utils.isWindows(options);
+ const regex = isState
+ ? picomatch.compileRe(glob, options)
+ : picomatch.makeRe(glob, options, false, true);
+
+ const state = regex.state;
+ delete regex.state;
+
+ let isIgnored = () => false;
+ if (opts.ignore) {
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
+ }
+
+ const matcher = (input, returnObject = false) => {
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
+
+ if (typeof opts.onResult === 'function') {
+ opts.onResult(result);
+ }
+
+ if (isMatch === false) {
+ result.isMatch = false;
+ return returnObject ? result : false;
+ }
+
+ if (isIgnored(input)) {
+ if (typeof opts.onIgnore === 'function') {
+ opts.onIgnore(result);
+ }
+ result.isMatch = false;
+ return returnObject ? result : false;
+ }
+
+ if (typeof opts.onMatch === 'function') {
+ opts.onMatch(result);
+ }
+ return returnObject ? result : true;
+ };
+
+ if (returnState) {
+ matcher.state = state;
+ }
+
+ return matcher;
+};
+
+/**
+ * Test `input` with the given `regex`. This is used by the main
+ * `picomatch()` function to test the input string.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.test(input, regex[, options]);
+ *
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
+ * ```
+ * @param {String} `input` String to test.
+ * @param {RegExp} `regex`
+ * @return {Object} Returns an object with matching info.
+ * @api public
+ */
+
+picomatch.test = (input, regex, options, { glob, posix } = {}) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected input to be a string');
+ }
+
+ if (input === '') {
+ return { isMatch: false, output: '' };
+ }
+
+ const opts = options || {};
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
+ let match = input === glob;
+ let output = (match && format) ? format(input) : input;
+
+ if (match === false) {
+ output = format ? format(input) : input;
+ match = output === glob;
+ }
+
+ if (match === false || opts.capture === true) {
+ if (opts.matchBase === true || opts.basename === true) {
+ match = picomatch.matchBase(input, regex, options, posix);
+ } else {
+ match = regex.exec(output);
+ }
+ }
+
+ return { isMatch: Boolean(match), match, output };
+};
+
+/**
+ * Match the basename of a filepath.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.matchBase(input, glob[, options]);
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
+ * ```
+ * @param {String} `input` String to test.
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
+ * @return {Boolean}
+ * @api public
+ */
+
+picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
+ return regex.test(path.basename(input));
+};
+
+/**
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.isMatch(string, patterns[, options]);
+ *
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
+ * ```
+ * @param {String|Array} str The string to test.
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
+ * @param {Object} [options] See available [options](#options).
+ * @return {Boolean} Returns true if any patterns match `str`
+ * @api public
+ */
+
+picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
+
+/**
+ * Parse a glob pattern to create the source string for a regular
+ * expression.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * const result = picomatch.parse(pattern[, options]);
+ * ```
+ * @param {String} `pattern`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
+ * @api public
+ */
+
+picomatch.parse = (pattern, options) => {
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
+ return parse(pattern, { ...options, fastpaths: false });
+};
+
+/**
+ * Scan a glob pattern to separate the pattern into segments.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.scan(input[, options]);
+ *
+ * const result = picomatch.scan('!./foo/*.js');
+ * console.log(result);
+ * { prefix: '!./',
+ * input: '!./foo/*.js',
+ * start: 3,
+ * base: 'foo',
+ * glob: '*.js',
+ * isBrace: false,
+ * isBracket: false,
+ * isGlob: true,
+ * isExtglob: false,
+ * isGlobstar: false,
+ * negated: true }
+ * ```
+ * @param {String} `input` Glob pattern to scan.
+ * @param {Object} `options`
+ * @return {Object} Returns an object with
+ * @api public
+ */
+
+picomatch.scan = (input, options) => scan(input, options);
+
+/**
+ * Compile a regular expression from the `state` object returned by the
+ * [parse()](#parse) method.
+ *
+ * @param {Object} `state`
+ * @param {Object} `options`
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
+ * @return {RegExp}
+ * @api public
+ */
+
+picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
+ if (returnOutput === true) {
+ return state.output;
+ }
+
+ const opts = options || {};
+ const prepend = opts.contains ? '' : '^';
+ const append = opts.contains ? '' : '$';
+
+ let source = `${prepend}(?:${state.output})${append}`;
+ if (state && state.negated === true) {
+ source = `^(?!${source}).*$`;
+ }
+
+ const regex = picomatch.toRegex(source, options);
+ if (returnState === true) {
+ regex.state = state;
+ }
+
+ return regex;
+};
+
+/**
+ * Create a regular expression from a parsed glob pattern.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * const state = picomatch.parse('*.js');
+ * // picomatch.compileRe(state[, options]);
+ *
+ * console.log(picomatch.compileRe(state));
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ * ```
+ * @param {String} `state` The object returned from the `.parse` method.
+ * @param {Object} `options`
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
+ * @return {RegExp} Returns a regex created from the given pattern.
+ * @api public
+ */
+
+picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
+ if (!input || typeof input !== 'string') {
+ throw new TypeError('Expected a non-empty string');
+ }
+
+ let parsed = { negated: false, fastpaths: true };
+
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
+ parsed.output = parse.fastpaths(input, options);
+ }
+
+ if (!parsed.output) {
+ parsed = parse(input, options);
+ }
+
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
+};
+
+/**
+ * Create a regular expression from the given regex source string.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.toRegex(source[, options]);
+ *
+ * const { output } = picomatch.parse('*.js');
+ * console.log(picomatch.toRegex(output));
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ * ```
+ * @param {String} `source` Regular expression source string.
+ * @param {Object} `options`
+ * @return {RegExp}
+ * @api public
+ */
+
+picomatch.toRegex = (source, options) => {
+ try {
+ const opts = options || {};
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
+ } catch (err) {
+ if (options && options.debug === true) throw err;
+ return /$^/;
+ }
+};
+
+/**
+ * Picomatch constants.
+ * @return {Object}
+ */
+
+picomatch.constants = constants;
+
+/**
+ * Expose "picomatch"
+ */
+
+module.exports = picomatch;
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/scan.js b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/scan.js
new file mode 100644
index 00000000..e59cd7a1
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/scan.js
@@ -0,0 +1,391 @@
+'use strict';
+
+const utils = require('./utils');
+const {
+ CHAR_ASTERISK, /* * */
+ CHAR_AT, /* @ */
+ CHAR_BACKWARD_SLASH, /* \ */
+ CHAR_COMMA, /* , */
+ CHAR_DOT, /* . */
+ CHAR_EXCLAMATION_MARK, /* ! */
+ CHAR_FORWARD_SLASH, /* / */
+ CHAR_LEFT_CURLY_BRACE, /* { */
+ CHAR_LEFT_PARENTHESES, /* ( */
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
+ CHAR_PLUS, /* + */
+ CHAR_QUESTION_MARK, /* ? */
+ CHAR_RIGHT_CURLY_BRACE, /* } */
+ CHAR_RIGHT_PARENTHESES, /* ) */
+ CHAR_RIGHT_SQUARE_BRACKET /* ] */
+} = require('./constants');
+
+const isPathSeparator = code => {
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
+};
+
+const depth = token => {
+ if (token.isPrefix !== true) {
+ token.depth = token.isGlobstar ? Infinity : 1;
+ }
+};
+
+/**
+ * Quickly scans a glob pattern and returns an object with a handful of
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
+ *
+ * ```js
+ * const pm = require('picomatch');
+ * console.log(pm.scan('foo/bar/*.js'));
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
+ * ```
+ * @param {String} `str`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with tokens and regex source string.
+ * @api public
+ */
+
+const scan = (input, options) => {
+ const opts = options || {};
+
+ const length = input.length - 1;
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
+ const slashes = [];
+ const tokens = [];
+ const parts = [];
+
+ let str = input;
+ let index = -1;
+ let start = 0;
+ let lastIndex = 0;
+ let isBrace = false;
+ let isBracket = false;
+ let isGlob = false;
+ let isExtglob = false;
+ let isGlobstar = false;
+ let braceEscaped = false;
+ let backslashes = false;
+ let negated = false;
+ let negatedExtglob = false;
+ let finished = false;
+ let braces = 0;
+ let prev;
+ let code;
+ let token = { value: '', depth: 0, isGlob: false };
+
+ const eos = () => index >= length;
+ const peek = () => str.charCodeAt(index + 1);
+ const advance = () => {
+ prev = code;
+ return str.charCodeAt(++index);
+ };
+
+ while (index < length) {
+ code = advance();
+ let next;
+
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ code = advance();
+
+ if (code === CHAR_LEFT_CURLY_BRACE) {
+ braceEscaped = true;
+ }
+ continue;
+ }
+
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
+ braces++;
+
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ advance();
+ continue;
+ }
+
+ if (code === CHAR_LEFT_CURLY_BRACE) {
+ braces++;
+ continue;
+ }
+
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
+ isBrace = token.isBrace = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (braceEscaped !== true && code === CHAR_COMMA) {
+ isBrace = token.isBrace = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
+ braces--;
+
+ if (braces === 0) {
+ braceEscaped = false;
+ isBrace = token.isBrace = true;
+ finished = true;
+ break;
+ }
+ }
+ }
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (code === CHAR_FORWARD_SLASH) {
+ slashes.push(index);
+ tokens.push(token);
+ token = { value: '', depth: 0, isGlob: false };
+
+ if (finished === true) continue;
+ if (prev === CHAR_DOT && index === (start + 1)) {
+ start += 2;
+ continue;
+ }
+
+ lastIndex = index + 1;
+ continue;
+ }
+
+ if (opts.noext !== true) {
+ const isExtglobChar = code === CHAR_PLUS
+ || code === CHAR_AT
+ || code === CHAR_ASTERISK
+ || code === CHAR_QUESTION_MARK
+ || code === CHAR_EXCLAMATION_MARK;
+
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+ isExtglob = token.isExtglob = true;
+ finished = true;
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
+ negatedExtglob = true;
+ }
+
+ if (scanToEnd === true) {
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ code = advance();
+ continue;
+ }
+
+ if (code === CHAR_RIGHT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+ finished = true;
+ break;
+ }
+ }
+ continue;
+ }
+ break;
+ }
+ }
+
+ if (code === CHAR_ASTERISK) {
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+ break;
+ }
+
+ if (code === CHAR_QUESTION_MARK) {
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+ break;
+ }
+
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
+ while (eos() !== true && (next = advance())) {
+ if (next === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ advance();
+ continue;
+ }
+
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
+ isBracket = token.isBracket = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+ break;
+ }
+ }
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
+ negated = token.negated = true;
+ start++;
+ continue;
+ }
+
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+
+ if (scanToEnd === true) {
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_LEFT_PARENTHESES) {
+ backslashes = token.backslashes = true;
+ code = advance();
+ continue;
+ }
+
+ if (code === CHAR_RIGHT_PARENTHESES) {
+ finished = true;
+ break;
+ }
+ }
+ continue;
+ }
+ break;
+ }
+
+ if (isGlob === true) {
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+ }
+
+ if (opts.noext === true) {
+ isExtglob = false;
+ isGlob = false;
+ }
+
+ let base = str;
+ let prefix = '';
+ let glob = '';
+
+ if (start > 0) {
+ prefix = str.slice(0, start);
+ str = str.slice(start);
+ lastIndex -= start;
+ }
+
+ if (base && isGlob === true && lastIndex > 0) {
+ base = str.slice(0, lastIndex);
+ glob = str.slice(lastIndex);
+ } else if (isGlob === true) {
+ base = '';
+ glob = str;
+ } else {
+ base = str;
+ }
+
+ if (base && base !== '' && base !== '/' && base !== str) {
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
+ base = base.slice(0, -1);
+ }
+ }
+
+ if (opts.unescape === true) {
+ if (glob) glob = utils.removeBackslashes(glob);
+
+ if (base && backslashes === true) {
+ base = utils.removeBackslashes(base);
+ }
+ }
+
+ const state = {
+ prefix,
+ input,
+ start,
+ base,
+ glob,
+ isBrace,
+ isBracket,
+ isGlob,
+ isExtglob,
+ isGlobstar,
+ negated,
+ negatedExtglob
+ };
+
+ if (opts.tokens === true) {
+ state.maxDepth = 0;
+ if (!isPathSeparator(code)) {
+ tokens.push(token);
+ }
+ state.tokens = tokens;
+ }
+
+ if (opts.parts === true || opts.tokens === true) {
+ let prevIndex;
+
+ for (let idx = 0; idx < slashes.length; idx++) {
+ const n = prevIndex ? prevIndex + 1 : start;
+ const i = slashes[idx];
+ const value = input.slice(n, i);
+ if (opts.tokens) {
+ if (idx === 0 && start !== 0) {
+ tokens[idx].isPrefix = true;
+ tokens[idx].value = prefix;
+ } else {
+ tokens[idx].value = value;
+ }
+ depth(tokens[idx]);
+ state.maxDepth += tokens[idx].depth;
+ }
+ if (idx !== 0 || value !== '') {
+ parts.push(value);
+ }
+ prevIndex = i;
+ }
+
+ if (prevIndex && prevIndex + 1 < input.length) {
+ const value = input.slice(prevIndex + 1);
+ parts.push(value);
+
+ if (opts.tokens) {
+ tokens[tokens.length - 1].value = value;
+ depth(tokens[tokens.length - 1]);
+ state.maxDepth += tokens[tokens.length - 1].depth;
+ }
+ }
+
+ state.slashes = slashes;
+ state.parts = parts;
+ }
+
+ return state;
+};
+
+module.exports = scan;
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/utils.js b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/utils.js
new file mode 100644
index 00000000..c3ca766a
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/lib/utils.js
@@ -0,0 +1,64 @@
+'use strict';
+
+const path = require('path');
+const win32 = process.platform === 'win32';
+const {
+ REGEX_BACKSLASH,
+ REGEX_REMOVE_BACKSLASH,
+ REGEX_SPECIAL_CHARS,
+ REGEX_SPECIAL_CHARS_GLOBAL
+} = require('./constants');
+
+exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
+exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
+exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
+exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
+exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
+
+exports.removeBackslashes = str => {
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
+ return match === '\\' ? '' : match;
+ });
+};
+
+exports.supportsLookbehinds = () => {
+ const segs = process.version.slice(1).split('.').map(Number);
+ if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
+ return true;
+ }
+ return false;
+};
+
+exports.isWindows = options => {
+ if (options && typeof options.windows === 'boolean') {
+ return options.windows;
+ }
+ return win32 === true || path.sep === '\\';
+};
+
+exports.escapeLast = (input, char, lastIdx) => {
+ const idx = input.lastIndexOf(char, lastIdx);
+ if (idx === -1) return input;
+ if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
+};
+
+exports.removePrefix = (input, state = {}) => {
+ let output = input;
+ if (output.startsWith('./')) {
+ output = output.slice(2);
+ state.prefix = './';
+ }
+ return output;
+};
+
+exports.wrapOutput = (input, state = {}, options = {}) => {
+ const prepend = options.contains ? '' : '^';
+ const append = options.contains ? '' : '$';
+
+ let output = `${prepend}(?:${input})${append}`;
+ if (state.negated === true) {
+ output = `(?:^(?!${output}).*$)`;
+ }
+ return output;
+};
diff --git a/node_modules/vite-plugin-full-reload/node_modules/picomatch/package.json b/node_modules/vite-plugin-full-reload/node_modules/picomatch/package.json
new file mode 100644
index 00000000..3db22d40
--- /dev/null
+++ b/node_modules/vite-plugin-full-reload/node_modules/picomatch/package.json
@@ -0,0 +1,81 @@
+{
+ "name": "picomatch",
+ "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
+ "version": "2.3.1",
+ "homepage": "https://github.com/micromatch/picomatch",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "funding": "https://github.com/sponsors/jonschlinkert",
+ "repository": "micromatch/picomatch",
+ "bugs": {
+ "url": "https://github.com/micromatch/picomatch/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js",
+ "lib"
+ ],
+ "main": "index.js",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "scripts": {
+ "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
+ "mocha": "mocha --reporter dot",
+ "test": "npm run lint && npm run mocha",
+ "test:ci": "npm run test:cover",
+ "test:cover": "nyc npm run mocha"
+ },
+ "devDependencies": {
+ "eslint": "^6.8.0",
+ "fill-range": "^7.0.1",
+ "gulp-format-md": "^2.0.0",
+ "mocha": "^6.2.2",
+ "nyc": "^15.0.0",
+ "time-require": "github:jonschlinkert/time-require"
+ },
+ "keywords": [
+ "glob",
+ "match",
+ "picomatch"
+ ],
+ "nyc": {
+ "reporter": [
+ "html",
+ "lcov",
+ "text-summary"
+ ]
+ },
+ "verb": {
+ "toc": {
+ "render": true,
+ "method": "preWrite",
+ "maxdepth": 3
+ },
+ "layout": "empty",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "related": {
+ "list": [
+ "braces",
+ "micromatch"
+ ]
+ },
+ "reflinks": [
+ "braces",
+ "expand-brackets",
+ "extglob",
+ "fill-range",
+ "micromatch",
+ "minimatch",
+ "nanomatch",
+ "picomatch"
+ ]
+ }
+}
diff --git a/node_modules/vite/LICENSE.md b/node_modules/vite/LICENSE.md
index d9c9262f..af33d3a2 100644
--- a/node_modules/vite/LICENSE.md
+++ b/node_modules/vite/LICENSE.md
@@ -1056,21 +1056,6 @@ Repository: git://github.com/primus/eventemitter3.git
---------------------------------------
-## fdir
-License: MIT
-By: thecodrr
-Repository: git+https://github.com/thecodrr/fdir.git
-
-> Copyright 2023 Abdullah Atta
->
-> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
->
-> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
->
-> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
----------------------------------------
-
## finalhandler
License: MIT
By: Douglas Christopher Wilson
@@ -1799,35 +1784,6 @@ Repository: alexeyraspopov/picocolors
---------------------------------------
-## picomatch
-License: MIT
-By: Jon Schlinkert
-Repository: micromatch/picomatch
-
-> The MIT License (MIT)
->
-> Copyright (c) 2017-present, Jon Schlinkert.
->
-> Permission is hereby granted, free of charge, to any person obtaining a copy
-> of this software and associated documentation files (the "Software"), to deal
-> in the Software without restriction, including without limitation the rights
-> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-> copies of the Software, and to permit persons to whom the Software is
-> furnished to do so, subject to the following conditions:
->
-> The above copyright notice and this permission notice shall be included in
-> all copies or substantial portions of the Software.
->
-> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-> THE SOFTWARE.
-
----------------------------------------
-
## postcss-import
License: MIT
By: Maxime Thirouin
@@ -2220,35 +2176,6 @@ Repository: git+https://github.com/antfu/strip-literal.git
---------------------------------------
-## tinyglobby
-License: MIT
-By: Superchupu
-Repository: git+https://github.com/SuperchupuDev/tinyglobby.git
-
-> MIT License
->
-> Copyright (c) 2024 Madeline Gurriarán
->
-> Permission is hereby granted, free of charge, to any person obtaining a copy
-> of this software and associated documentation files (the "Software"), to deal
-> in the Software without restriction, including without limitation the rights
-> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-> copies of the Software, and to permit persons to whom the Software is
-> furnished to do so, subject to the following conditions:
->
-> The above copyright notice and this permission notice shall be included in all
-> copies or substantial portions of the Software.
->
-> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-> SOFTWARE.
-
----------------------------------------
-
## to-regex-range
License: MIT
By: Jon Schlinkert, Rouven Weßling
diff --git a/node_modules/vite/dist/client/client.mjs b/node_modules/vite/dist/client/client.mjs
index 87bf9dfd..e395b722 100644
--- a/node_modules/vite/dist/client/client.mjs
+++ b/node_modules/vite/dist/client/client.mjs
@@ -56,13 +56,16 @@ class HMRContext {
decline() {
}
invalidate(message) {
+ const firstInvalidatedBy = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;
this.hmrClient.notifyListeners("vite:invalidate", {
path: this.ownerPath,
- message
+ message,
+ firstInvalidatedBy
});
this.send("vite:invalidate", {
path: this.ownerPath,
- message
+ message,
+ firstInvalidatedBy
});
this.hmrClient.logger.debug(
`invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`
@@ -160,7 +163,7 @@ class HMRClient {
});
}
warnFailedUpdate(err, path) {
- if (!err.message.includes("fetch")) {
+ if (!(err instanceof Error) || !err.message.includes("fetch")) {
this.logger.error(err);
}
this.logger.error(
@@ -184,7 +187,7 @@ class HMRClient {
}
}
async fetchUpdate(update) {
- const { path, acceptedPath } = update;
+ const { path, acceptedPath, firstInvalidatedBy } = update;
const mod = this.hotModulesMap.get(path);
if (!mod) {
return;
@@ -204,13 +207,20 @@ class HMRClient {
}
}
return () => {
- for (const { deps, fn } of qualifiedCallbacks) {
- fn(
- deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0)
- );
+ try {
+ this.currentFirstInvalidatedBy = firstInvalidatedBy;
+ for (const { deps, fn } of qualifiedCallbacks) {
+ fn(
+ deps.map(
+ (dep) => dep === acceptedPath ? fetchedModule : void 0
+ )
+ );
+ }
+ const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
+ this.logger.debug(`hot updated: ${loggedPath}`);
+ } finally {
+ this.currentFirstInvalidatedBy = void 0;
}
- const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
- this.logger.debug(`hot updated: ${loggedPath}`);
};
}
}
@@ -475,6 +485,42 @@ const createWebSocketModuleRunnerTransport = (options) => {
};
};
+function createHMRHandler(handler) {
+ const queue = new Queue();
+ return (payload) => queue.enqueue(() => handler(payload));
+}
+class Queue {
+ constructor() {
+ this.queue = [];
+ this.pending = false;
+ }
+ enqueue(promise) {
+ return new Promise((resolve, reject) => {
+ this.queue.push({
+ promise,
+ resolve,
+ reject
+ });
+ this.dequeue();
+ });
+ }
+ dequeue() {
+ if (this.pending) {
+ return false;
+ }
+ const item = this.queue.shift();
+ if (!item) {
+ return false;
+ }
+ this.pending = true;
+ item.promise().then(item.resolve).catch(item.reject).finally(() => {
+ this.pending = false;
+ this.dequeue();
+ });
+ return true;
+ }
+}
+
const hmrConfigName = __HMR_CONFIG_NAME__;
const base$1 = __BASE__ || "/";
function h(e, attrs = {}, ...children) {
@@ -859,14 +905,14 @@ const hmrClient = new HMRClient(
return await importPromise;
}
);
-transport.connect(handleMessage);
+transport.connect(createHMRHandler(handleMessage));
async function handleMessage(payload) {
switch (payload.type) {
case "connected":
console.debug(`[vite] connected.`);
break;
case "update":
- notifyListeners("vite:beforeUpdate", payload);
+ await hmrClient.notifyListeners("vite:beforeUpdate", payload);
if (hasDocument) {
if (isFirstUpdate && hasErrorOverlay()) {
location.reload();
@@ -909,10 +955,10 @@ async function handleMessage(payload) {
});
})
);
- notifyListeners("vite:afterUpdate", payload);
+ await hmrClient.notifyListeners("vite:afterUpdate", payload);
break;
case "custom": {
- notifyListeners(payload.event, payload.data);
+ await hmrClient.notifyListeners(payload.event, payload.data);
if (payload.event === "vite:ws:disconnect") {
if (hasDocument && !willUnload) {
console.log(`[vite] server connection lost. Polling for restart...`);
@@ -926,7 +972,7 @@ async function handleMessage(payload) {
break;
}
case "full-reload":
- notifyListeners("vite:beforeFullReload", payload);
+ await hmrClient.notifyListeners("vite:beforeFullReload", payload);
if (hasDocument) {
if (payload.path && payload.path.endsWith(".html")) {
const pagePath = decodeURI(location.pathname);
@@ -941,11 +987,11 @@ async function handleMessage(payload) {
}
break;
case "prune":
- notifyListeners("vite:beforePrune", payload);
+ await hmrClient.notifyListeners("vite:beforePrune", payload);
await hmrClient.prunePaths(payload.paths);
break;
case "error": {
- notifyListeners("vite:error", payload);
+ await hmrClient.notifyListeners("vite:error", payload);
if (hasDocument) {
const err = payload.err;
if (enableOverlay) {
@@ -968,9 +1014,6 @@ ${err.stack}`
}
}
}
-function notifyListeners(event, data) {
- hmrClient.notifyListeners(event, data);
-}
const enableOverlay = __HMR_ENABLE_OVERLAY__;
const hasDocument = "document" in globalThis;
function createErrorOverlay(err) {
diff --git a/node_modules/vite/dist/node-cjs/publicUtils.cjs b/node_modules/vite/dist/node-cjs/publicUtils.cjs
index dba79bc6..e89d8bc0 100644
--- a/node_modules/vite/dist/node-cjs/publicUtils.cjs
+++ b/node_modules/vite/dist/node-cjs/publicUtils.cjs
@@ -9,6 +9,7 @@ var node_module = require('node:module');
var require$$0 = require('tty');
var require$$1 = require('util');
var require$$1$1 = require('path');
+var pm = require('picomatch');
var require$$0$1 = require('crypto');
var require$$1$2 = require('fs');
var readline = require('node:readline');
@@ -227,9 +228,7 @@ picocolors.exports.createColors = createColors;
var picocolorsExports = picocolors.exports;
var colors = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
-var src = {exports: {}};
-
-var browser = {exports: {}};
+var node = {exports: {}};
/**
* Helpers.
@@ -702,2656 +701,274 @@ function requireCommon () {
return common;
}
-/* eslint-env browser */
-
-var hasRequiredBrowser;
-
-function requireBrowser () {
- if (hasRequiredBrowser) return browser.exports;
- hasRequiredBrowser = 1;
- (function (module, exports) {
- /**
- * This is the web browser implementation of `debug()`.
- */
-
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = localstorage();
- exports.destroy = (() => {
- let warned = false;
-
- return () => {
- if (!warned) {
- warned = true;
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
- };
- })();
-
- /**
- * Colors.
- */
-
- exports.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33'
- ];
-
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
- // eslint-disable-next-line complexity
- function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
-
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
-
- let m;
-
- // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- // eslint-disable-next-line no-return-assign
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // Is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
- // Double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
- }
-
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
- function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- args[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' + module.exports.humanize(this.diff);
-
- if (!this.useColors) {
- return;
- }
-
- const c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
-
- // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, match => {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- }
-
- /**
- * Invokes `console.debug()` when available.
- * No-op when `console.debug` is not a "function".
- * If `console.debug` is not available, falls back
- * to `console.log`.
- *
- * @api public
- */
- exports.log = console.debug || console.log || (() => {});
-
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
- function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
-
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
- function load() {
- let r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
-
- return r;
- }
-
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
- function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
-
- module.exports = requireCommon()(exports);
-
- const {formatters} = module.exports;
-
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
- formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
- };
- } (browser, browser.exports));
- return browser.exports;
-}
-
-var node = {exports: {}};
-
/**
* Module dependencies.
*/
-var hasRequiredNode;
+(function (module, exports) {
+ const tty = require$$0;
+ const util = require$$1;
-function requireNode () {
- if (hasRequiredNode) return node.exports;
- hasRequiredNode = 1;
- (function (module, exports) {
- const tty = require$$0;
- const util = require$$1;
+ /**
+ * This is the Node.js implementation of `debug()`.
+ */
- /**
- * This is the Node.js implementation of `debug()`.
- */
+ exports.init = init;
+ exports.log = log;
+ exports.formatArgs = formatArgs;
+ exports.save = save;
+ exports.load = load;
+ exports.useColors = useColors;
+ exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+ );
- exports.init = init;
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.destroy = util.deprecate(
- () => {},
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
- );
+ /**
+ * Colors.
+ */
- /**
- * Colors.
- */
+ exports.colors = [6, 2, 3, 4, 5, 1];
- exports.colors = [6, 2, 3, 4, 5, 1];
+ try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = require('supports-color');
- try {
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
- // eslint-disable-next-line import/no-extraneous-dependencies
- const supportsColor = require('supports-color');
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+ } catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+ }
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
- exports.colors = [
- 20,
- 21,
- 26,
- 27,
- 32,
- 33,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 56,
- 57,
- 62,
- 63,
- 68,
- 69,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 92,
- 93,
- 98,
- 99,
- 112,
- 113,
- 128,
- 129,
- 134,
- 135,
- 148,
- 149,
- 160,
- 161,
- 162,
- 163,
- 164,
- 165,
- 166,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 178,
- 179,
- 184,
- 185,
- 196,
- 197,
- 198,
- 199,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 209,
- 214,
- 215,
- 220,
- 221
- ];
- }
- } catch (error) {
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+ /**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+ exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+ }).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
}
- /**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
+ obj[prop] = val;
+ return obj;
+ }, {});
- exports.inspectOpts = Object.keys(process.env).filter(key => {
- return /^debug_/i.test(key);
- }).reduce((obj, key) => {
- // Camel-case
- const prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, (_, k) => {
- return k.toUpperCase();
- });
+ /**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
- // Coerce string value into JS value
- let val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) {
- val = true;
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
- val = false;
- } else if (val === 'null') {
- val = null;
- } else {
- val = Number(val);
- }
+ function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+ }
- obj[prop] = val;
- return obj;
- }, {});
+ /**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
- /**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
+ function formatArgs(args) {
+ const {namespace: name, useColors} = this;
- function useColors() {
- return 'colors' in exports.inspectOpts ?
- Boolean(exports.inspectOpts.colors) :
- tty.isatty(process.stderr.fd);
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
}
+ }
- /**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
-
- function formatArgs(args) {
- const {namespace: name, useColors} = this;
-
- if (useColors) {
- const c = this.color;
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
-
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
- } else {
- args[0] = getDate() + name + ' ' + args[0];
- }
+ function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
}
+ return new Date().toISOString() + ' ';
+ }
- function getDate() {
- if (exports.inspectOpts.hideDate) {
- return '';
- }
- return new Date().toISOString() + ' ';
+ /**
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
+ */
+
+ function log(...args) {
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+ }
+
+ /**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+ function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
}
+ }
- /**
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
- */
+ /**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
- function log(...args) {
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+ function load() {
+ return process.env.DEBUG;
+ }
+
+ /**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+ function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
}
+ }
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
- function save(namespaces) {
- if (namespaces) {
- process.env.DEBUG = namespaces;
- } else {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- }
- }
+ module.exports = requireCommon()(exports);
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
+ const {formatters} = module.exports;
- function load() {
- return process.env.DEBUG;
- }
+ /**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
- /**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
-
- function init(debug) {
- debug.inspectOpts = {};
-
- const keys = Object.keys(exports.inspectOpts);
- for (let i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
- }
-
- module.exports = requireCommon()(exports);
-
- const {formatters} = module.exports;
-
- /**
- * Map %o to `util.inspect()`, all on a single line.
- */
-
- formatters.o = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n')
- .map(str => str.trim())
- .join(' ');
- };
-
- /**
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
- */
-
- formatters.O = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
- };
- } (node, node.exports));
- return node.exports;
-}
-
-/**
- * Detect Electron renderer / nwjs process, which is node, but we should
- * treat as a browser.
- */
-
-if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
- src.exports = requireBrowser();
-} else {
- src.exports = requireNode();
-}
-
-var srcExports = src.exports;
-var debug$3 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
-
-var utils$4 = {};
-
-const WIN_SLASH = '\\\\/';
-const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
-
-/**
- * Posix glob regex
- */
-
-const DOT_LITERAL = '\\.';
-const PLUS_LITERAL = '\\+';
-const QMARK_LITERAL = '\\?';
-const SLASH_LITERAL = '\\/';
-const ONE_CHAR = '(?=.)';
-const QMARK = '[^/]';
-const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
-const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
-const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
-const NO_DOT = `(?!${DOT_LITERAL})`;
-const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
-const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
-const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
-const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
-const STAR = `${QMARK}*?`;
-const SEP = '/';
-
-const POSIX_CHARS = {
- DOT_LITERAL,
- PLUS_LITERAL,
- QMARK_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- QMARK,
- END_ANCHOR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR,
- SEP
-};
-
-/**
- * Windows glob regex
- */
-
-const WINDOWS_CHARS = {
- ...POSIX_CHARS,
-
- SLASH_LITERAL: `[${WIN_SLASH}]`,
- QMARK: WIN_NO_SLASH,
- STAR: `${WIN_NO_SLASH}*?`,
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
- SEP: '\\'
-};
-
-/**
- * POSIX Bracket Regex
- */
-
-const POSIX_REGEX_SOURCE$1 = {
- alnum: 'a-zA-Z0-9',
- alpha: 'a-zA-Z',
- ascii: '\\x00-\\x7F',
- blank: ' \\t',
- cntrl: '\\x00-\\x1F\\x7F',
- digit: '0-9',
- graph: '\\x21-\\x7E',
- lower: 'a-z',
- print: '\\x20-\\x7E ',
- punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
- space: ' \\t\\r\\n\\v\\f',
- upper: 'A-Z',
- word: 'A-Za-z0-9_',
- xdigit: 'A-Fa-f0-9'
-};
-
-var constants$2 = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
-
- // regular expressions
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
-
- // Replace globs with equivalent patterns to reduce parsing time.
- REPLACEMENTS: {
- '***': '*',
- '**/**': '**',
- '**/**/**': '**'
- },
-
- // Digits
- CHAR_0: 48, /* 0 */
- CHAR_9: 57, /* 9 */
-
- // Alphabet chars.
- CHAR_UPPERCASE_A: 65, /* A */
- CHAR_LOWERCASE_A: 97, /* a */
- CHAR_UPPERCASE_Z: 90, /* Z */
- CHAR_LOWERCASE_Z: 122, /* z */
-
- CHAR_LEFT_PARENTHESES: 40, /* ( */
- CHAR_RIGHT_PARENTHESES: 41, /* ) */
-
- CHAR_ASTERISK: 42, /* * */
-
- // Non-alphabetic chars.
- CHAR_AMPERSAND: 38, /* & */
- CHAR_AT: 64, /* @ */
- CHAR_BACKWARD_SLASH: 92, /* \ */
- CHAR_CARRIAGE_RETURN: 13, /* \r */
- CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
- CHAR_COLON: 58, /* : */
- CHAR_COMMA: 44, /* , */
- CHAR_DOT: 46, /* . */
- CHAR_DOUBLE_QUOTE: 34, /* " */
- CHAR_EQUAL: 61, /* = */
- CHAR_EXCLAMATION_MARK: 33, /* ! */
- CHAR_FORM_FEED: 12, /* \f */
- CHAR_FORWARD_SLASH: 47, /* / */
- CHAR_GRAVE_ACCENT: 96, /* ` */
- CHAR_HASH: 35, /* # */
- CHAR_HYPHEN_MINUS: 45, /* - */
- CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
- CHAR_LEFT_CURLY_BRACE: 123, /* { */
- CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
- CHAR_LINE_FEED: 10, /* \n */
- CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
- CHAR_PERCENT: 37, /* % */
- CHAR_PLUS: 43, /* + */
- CHAR_QUESTION_MARK: 63, /* ? */
- CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
- CHAR_RIGHT_CURLY_BRACE: 125, /* } */
- CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
- CHAR_SEMICOLON: 59, /* ; */
- CHAR_SINGLE_QUOTE: 39, /* ' */
- CHAR_SPACE: 32, /* */
- CHAR_TAB: 9, /* \t */
- CHAR_UNDERSCORE: 95, /* _ */
- CHAR_VERTICAL_LINE: 124, /* | */
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
-
- /**
- * Create EXTGLOB_CHARS
- */
-
- extglobChars(chars) {
- return {
- '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
- '?': { type: 'qmark', open: '(?:', close: ')?' },
- '+': { type: 'plus', open: '(?:', close: ')+' },
- '*': { type: 'star', open: '(?:', close: ')*' },
- '@': { type: 'at', open: '(?:', close: ')' }
- };
- },
-
- /**
- * Create GLOB_CHARS
- */
-
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
- }
-};
-
-/*global navigator*/
-
-(function (exports) {
-
- const {
- REGEX_BACKSLASH,
- REGEX_REMOVE_BACKSLASH,
- REGEX_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_GLOBAL
- } = constants$2;
-
- exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
- exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
- exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
- exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
- exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
-
- exports.isWindows = () => {
- if (typeof navigator !== 'undefined' && navigator.platform) {
- const platform = navigator.platform.toLowerCase();
- return platform === 'win32' || platform === 'windows';
- }
-
- if (typeof process !== 'undefined' && process.platform) {
- return process.platform === 'win32';
- }
-
- return false;
+ formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
};
- exports.removeBackslashes = str => {
- return str.replace(REGEX_REMOVE_BACKSLASH, match => {
- return match === '\\' ? '' : match;
- });
- };
+ /**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
- exports.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1) return input;
- if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
- };
-
- exports.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith('./')) {
- output = output.slice(2);
- state.prefix = './';
- }
- return output;
- };
-
- exports.wrapOutput = (input, state = {}, options = {}) => {
- const prepend = options.contains ? '' : '^';
- const append = options.contains ? '' : '$';
-
- let output = `${prepend}(?:${input})${append}`;
- if (state.negated === true) {
- output = `(?:^(?!${output}).*$)`;
- }
- return output;
- };
-
- exports.basename = (path, { windows } = {}) => {
- const segs = path.split(windows ? /[\\/]/ : '/');
- const last = segs[segs.length - 1];
-
- if (last === '') {
- return segs[segs.length - 2];
- }
-
- return last;
+ formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
};
-} (utils$4));
+} (node, node.exports));
-const utils$3 = utils$4;
-const {
- CHAR_ASTERISK, /* * */
- CHAR_AT, /* @ */
- CHAR_BACKWARD_SLASH, /* \ */
- CHAR_COMMA, /* , */
- CHAR_DOT, /* . */
- CHAR_EXCLAMATION_MARK, /* ! */
- CHAR_FORWARD_SLASH, /* / */
- CHAR_LEFT_CURLY_BRACE, /* { */
- CHAR_LEFT_PARENTHESES, /* ( */
- CHAR_LEFT_SQUARE_BRACKET, /* [ */
- CHAR_PLUS, /* + */
- CHAR_QUESTION_MARK, /* ? */
- CHAR_RIGHT_CURLY_BRACE, /* } */
- CHAR_RIGHT_PARENTHESES, /* ) */
- CHAR_RIGHT_SQUARE_BRACKET /* ] */
-} = constants$2;
-
-const isPathSeparator = code => {
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
-};
-
-const depth = token => {
- if (token.isPrefix !== true) {
- token.depth = token.isGlobstar ? Infinity : 1;
- }
-};
-
-/**
- * Quickly scans a glob pattern and returns an object with a handful of
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
- * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
- * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
- *
- * ```js
- * const pm = require('picomatch');
- * console.log(pm.scan('foo/bar/*.js'));
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an object with tokens and regex source string.
- * @api public
- */
-
-const scan$1 = (input, options) => {
- const opts = options || {};
-
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
-
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let negatedExtglob = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = { value: '', depth: 0, isGlob: false };
-
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
-
- while (index < length) {
- code = advance();
- let next;
-
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
-
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braceEscaped = true;
- }
- continue;
- }
-
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
-
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- continue;
- }
-
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (braceEscaped !== true && code === CHAR_COMMA) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_RIGHT_CURLY_BRACE) {
- braces--;
-
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_FORWARD_SLASH) {
- slashes.push(index);
- tokens.push(token);
- token = { value: '', depth: 0, isGlob: false };
-
- if (finished === true) continue;
- if (prev === CHAR_DOT && index === (start + 1)) {
- start += 2;
- continue;
- }
-
- lastIndex = index + 1;
- continue;
- }
-
- if (opts.noext !== true) {
- const isExtglobChar = code === CHAR_PLUS
- || code === CHAR_AT
- || code === CHAR_ASTERISK
- || code === CHAR_QUESTION_MARK
- || code === CHAR_EXCLAMATION_MARK;
-
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
- if (code === CHAR_EXCLAMATION_MARK && index === start) {
- negatedExtglob = true;
- }
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
-
- if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_QUESTION_MARK) {
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
-
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
-
- if (isGlob === true) {
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
- }
-
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
-
- let base = str;
- let prefix = '';
- let glob = '';
-
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
-
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = '';
- glob = str;
- } else {
- base = str;
- }
-
- if (base && base !== '' && base !== '/' && base !== str) {
- if (isPathSeparator(base.charCodeAt(base.length - 1))) {
- base = base.slice(0, -1);
- }
- }
-
- if (opts.unescape === true) {
- if (glob) glob = utils$3.removeBackslashes(glob);
-
- if (base && backslashes === true) {
- base = utils$3.removeBackslashes(base);
- }
- }
-
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated,
- negatedExtglob
- };
-
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator(code)) {
- tokens.push(token);
- }
- state.tokens = tokens;
- }
-
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
-
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else {
- tokens[idx].value = value;
- }
- depth(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== '') {
- parts.push(value);
- }
- prevIndex = i;
- }
-
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
-
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
-
- state.slashes = slashes;
- state.parts = parts;
- }
-
- return state;
-};
-
-var scan_1 = scan$1;
-
-const constants$1 = constants$2;
-const utils$2 = utils$4;
-
-/**
- * Constants
- */
-
-const {
- MAX_LENGTH,
- POSIX_REGEX_SOURCE,
- REGEX_NON_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_BACKREF,
- REPLACEMENTS
-} = constants$1;
-
-/**
- * Helpers
- */
-
-const expandRange = (args, options) => {
- if (typeof options.expandRange === 'function') {
- return options.expandRange(...args, options);
- }
-
- args.sort();
- const value = `[${args.join('-')}]`;
-
- return value;
-};
-
-/**
- * Create the message for a syntax error
- */
-
-const syntaxError = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
-};
-
-/**
- * Parse the given input string.
- * @param {String} input
- * @param {Object} options
- * @return {Object}
- */
-
-const parse$2 = (input, options) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- input = REPLACEMENTS[input] || input;
-
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
-
- let len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- const bos = { type: 'bos', value: '', output: opts.prepend || '' };
- const tokens = [bos];
-
- const capture = opts.capture ? '' : '?:';
-
- // create constants based on platform, for windows or posix
- const PLATFORM_CHARS = constants$1.globChars(opts.windows);
- const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
-
- const {
- DOT_LITERAL,
- PLUS_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- } = PLATFORM_CHARS;
-
- const globstar = opts => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const nodot = opts.dot ? '' : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- // minimatch options support
- if (typeof opts.noext === 'boolean') {
- opts.noextglob = opts.noext;
- }
-
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: '',
- output: '',
- prefix: '',
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
-
- input = utils$2.removePrefix(input, state);
- len = input.length;
-
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
-
- /**
- * Tokenizing helpers
- */
-
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index] || '';
- const remaining = () => input.slice(state.index + 1);
- const consume = (value = '', num = 0) => {
- state.consumed += value;
- state.index += num;
- };
-
- const append = token => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
-
- const negate = () => {
- let count = 1;
-
- while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
- advance();
- state.start++;
- count++;
- }
-
- if (count % 2 === 0) {
- return false;
- }
-
- state.negated = true;
- state.start++;
- return true;
- };
-
- const increment = type => {
- state[type]++;
- stack.push(type);
- };
-
- const decrement = type => {
- state[type]--;
- stack.pop();
- };
-
- /**
- * Push tokens onto the tokens array. This helper speeds up
- * tokenizing by 1) helping us avoid backtracking as much as possible,
- * and 2) helping us avoid creating extra tokens when consecutive
- * characters are plain text. This improves performance and simplifies
- * lookbehinds.
- */
-
- const push = tok => {
- if (prev.type === 'globstar') {
- const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
- const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
-
- if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = 'star';
- prev.value = '*';
- prev.output = star;
- state.output += prev.output;
- }
- }
-
- if (extglobs.length && tok.type !== 'paren') {
- extglobs[extglobs.length - 1].inner += tok.value;
- }
-
- if (tok.value || tok.output) append(tok);
- if (prev && prev.type === 'text' && tok.type === 'text') {
- prev.output = (prev.output || prev.value) + tok.value;
- prev.value += tok.value;
- return;
- }
-
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
-
- const extglobOpen = (type, value) => {
- const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
-
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? '(' : '') + token.open;
-
- increment('parens');
- push({ type, value, output: state.output ? '' : ONE_CHAR });
- push({ type: 'paren', extglob: true, value: advance(), output });
- extglobs.push(token);
- };
-
- const extglobClose = token => {
- let output = token.close + (opts.capture ? ')' : '');
- let rest;
-
- if (token.type === 'negate') {
- let extglobStar = star;
-
- if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
- extglobStar = globstar(opts);
- }
-
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
- output = token.close = `)$))${extglobStar}`;
- }
-
- if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
- // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
- // In this case, we need to parse the string and use it in the output of the original pattern.
- // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
- //
- // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
- const expression = parse$2(rest, { ...options, fastpaths: false }).output;
-
- output = token.close = `)${expression})${extglobStar})`;
- }
-
- if (token.prev.type === 'bos') {
- state.negatedExtglob = true;
- }
- }
-
- push({ type: 'paren', extglob: true, value, output });
- decrement('parens');
- };
-
- /**
- * Fast paths
- */
-
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
-
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
- if (first === '\\') {
- backslashes = true;
- return m;
- }
-
- if (first === '?') {
- if (esc) {
- return esc + first + (rest ? QMARK.repeat(rest.length) : '');
- }
- if (index === 0) {
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
- }
- return QMARK.repeat(chars.length);
- }
-
- if (first === '.') {
- return DOT_LITERAL.repeat(chars.length);
- }
-
- if (first === '*') {
- if (esc) {
- return esc + first + (rest ? star : '');
- }
- return star;
- }
- return esc ? m : `\\${m}`;
- });
-
- if (backslashes === true) {
- if (opts.unescape === true) {
- output = output.replace(/\\/g, '');
- } else {
- output = output.replace(/\\+/g, m => {
- return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
- });
- }
- }
-
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
-
- state.output = utils$2.wrapOutput(output, state, options);
- return state;
- }
-
- /**
- * Tokenize input until we reach end-of-string
- */
-
- while (!eos()) {
- value = advance();
-
- if (value === '\u0000') {
- continue;
- }
-
- /**
- * Escaped characters
- */
-
- if (value === '\\') {
- const next = peek();
-
- if (next === '/' && opts.bash !== true) {
- continue;
- }
-
- if (next === '.' || next === ';') {
- continue;
- }
-
- if (!next) {
- value += '\\';
- push({ type: 'text', value });
- continue;
- }
-
- // collapse slashes to reduce potential for exploits
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
-
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) {
- value += '\\';
- }
- }
-
- if (opts.unescape === true) {
- value = advance();
- } else {
- value += advance();
- }
-
- if (state.brackets === 0) {
- push({ type: 'text', value });
- continue;
- }
- }
-
- /**
- * If we're inside a regex character class, continue
- * until we reach the closing bracket.
- */
-
- if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
- if (opts.posix !== false && value === ':') {
- const inner = prev.value.slice(1);
- if (inner.includes('[')) {
- prev.posix = true;
-
- if (inner.includes(':')) {
- const idx = prev.value.lastIndexOf('[');
- const pre = prev.value.slice(0, idx);
- const rest = prev.value.slice(idx + 2);
- const posix = POSIX_REGEX_SOURCE[rest];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
-
- if (!bos.output && tokens.indexOf(prev) === 1) {
- bos.output = ONE_CHAR;
- }
- continue;
- }
- }
- }
- }
-
- if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
- value = `\\${value}`;
- }
-
- if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
- value = `\\${value}`;
- }
-
- if (opts.posix === true && value === '!' && prev.value === '[') {
- value = '^';
- }
-
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * If we're inside a quoted string, continue
- * until we reach the closing double quote.
- */
-
- if (state.quotes === 1 && value !== '"') {
- value = utils$2.escapeRegex(value);
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * Double quotes
- */
-
- if (value === '"') {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) {
- push({ type: 'text', value });
- }
- continue;
- }
-
- /**
- * Parentheses
- */
-
- if (value === '(') {
- increment('parens');
- push({ type: 'paren', value });
- continue;
- }
-
- if (value === ')') {
- if (state.parens === 0 && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '('));
- }
-
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
-
- push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
- decrement('parens');
- continue;
- }
-
- /**
- * Square brackets
- */
-
- if (value === '[') {
- if (opts.nobracket === true || !remaining().includes(']')) {
- if (opts.nobracket !== true && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('closing', ']'));
- }
-
- value = `\\${value}`;
- } else {
- increment('brackets');
- }
-
- push({ type: 'bracket', value });
- continue;
- }
-
- if (value === ']') {
- if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '['));
- }
-
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- decrement('brackets');
-
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
- value = `/${value}`;
- }
-
- prev.value += value;
- append({ value });
-
- // when literal brackets are explicitly disabled
- // assume we should match with a regex character class
- if (opts.literalBrackets === false || utils$2.hasRegexChars(prevValue)) {
- continue;
- }
-
- const escaped = utils$2.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
-
- // when literal brackets are explicitly enabled
- // assume we should escape the brackets to match literal characters
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
-
- // when the user specifies nothing, try to match both
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
-
- /**
- * Braces
- */
-
- if (value === '{' && opts.nobrace !== true) {
- increment('braces');
-
- const open = {
- type: 'brace',
- value,
- output: '(',
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
-
- braces.push(open);
- push(open);
- continue;
- }
-
- if (value === '}') {
- const brace = braces[braces.length - 1];
-
- if (opts.nobrace === true || !brace) {
- push({ type: 'text', value, output: value });
- continue;
- }
-
- let output = ')';
-
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
-
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === 'brace') {
- break;
- }
- if (arr[i].type !== 'dots') {
- range.unshift(arr[i].value);
- }
- }
-
- output = expandRange(range, opts);
- state.backtrack = true;
- }
-
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = '\\{';
- value = output = '\\}';
- state.output = out;
- for (const t of toks) {
- state.output += (t.output || t.value);
- }
- }
-
- push({ type: 'brace', value, output });
- decrement('braces');
- braces.pop();
- continue;
- }
-
- /**
- * Pipes
- */
-
- if (value === '|') {
- if (extglobs.length > 0) {
- extglobs[extglobs.length - 1].conditions++;
- }
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Commas
- */
-
- if (value === ',') {
- let output = value;
-
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === 'braces') {
- brace.comma = true;
- output = '|';
- }
-
- push({ type: 'comma', value, output });
- continue;
- }
-
- /**
- * Slashes
- */
-
- if (value === '/') {
- // if the beginning of the glob is "./", advance the start
- // to the current index, and don't add the "./" characters
- // to the state. This greatly simplifies lookbehinds when
- // checking for BOS characters like "!" and "." (not "./")
- if (prev.type === 'dot' && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = '';
- state.output = '';
- tokens.pop();
- prev = bos; // reset "prev" to the first token
- continue;
- }
-
- push({ type: 'slash', value, output: SLASH_LITERAL });
- continue;
- }
-
- /**
- * Dots
- */
-
- if (value === '.') {
- if (state.braces > 0 && prev.type === 'dot') {
- if (prev.value === '.') prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = 'dots';
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
-
- if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
- push({ type: 'text', value, output: DOT_LITERAL });
- continue;
- }
-
- push({ type: 'dot', value, output: DOT_LITERAL });
- continue;
- }
-
- /**
- * Question marks
- */
-
- if (value === '?') {
- const isGroup = prev && prev.value === '(';
- if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('qmark', value);
- continue;
- }
-
- if (prev && prev.type === 'paren') {
- const next = peek();
- let output = value;
-
- if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
- output = `\\${value}`;
- }
-
- push({ type: 'text', value, output });
- continue;
- }
-
- if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
- push({ type: 'qmark', value, output: QMARK_NO_DOT });
- continue;
- }
-
- push({ type: 'qmark', value, output: QMARK });
- continue;
- }
-
- /**
- * Exclamation
- */
-
- if (value === '!') {
- if (opts.noextglob !== true && peek() === '(') {
- if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
- extglobOpen('negate', value);
- continue;
- }
- }
-
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
-
- /**
- * Plus
- */
-
- if (value === '+') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('plus', value);
- continue;
- }
-
- if ((prev && prev.value === '(') || opts.regex === false) {
- push({ type: 'plus', value, output: PLUS_LITERAL });
- continue;
- }
-
- if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
- push({ type: 'plus', value });
- continue;
- }
-
- push({ type: 'plus', value: PLUS_LITERAL });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value === '@') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- push({ type: 'at', extglob: true, value, output: '' });
- continue;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value !== '*') {
- if (value === '$' || value === '^') {
- value = `\\${value}`;
- }
-
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Stars
- */
-
- if (prev && (prev.type === 'globstar' || prev.star === true)) {
- prev.type = 'star';
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen('star', value);
- continue;
- }
-
- if (prev.type === 'star') {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
-
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === 'slash' || prior.type === 'bos';
- const afterStar = before && (before.type === 'star' || before.type === 'globstar');
-
- if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
- const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
- if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- // strip consecutive `/**/`
- while (rest.slice(0, 3) === '/**') {
- const after = input[state.index + 4];
- if (after && after !== '/') {
- break;
- }
- rest = rest.slice(3);
- consume('/**', 3);
- }
-
- if (prior.type === 'bos' && eos()) {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
- const end = rest[1] !== void 0 ? '|$' : '';
-
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
-
- state.output += prior.output + prev.output;
- state.globstar = true;
-
- consume(value + advance());
-
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- if (prior.type === 'bos' && rest[0] === '/') {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- // remove single star from output
- state.output = state.output.slice(0, -prev.output.length);
-
- // reset previous token to globstar
- prev.type = 'globstar';
- prev.output = globstar(opts);
- prev.value += value;
-
- // reset output with globstar
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- const token = { type: 'star', value, output: star };
-
- if (opts.bash === true) {
- token.output = '.*?';
- if (prev.type === 'bos' || prev.type === 'slash') {
- token.output = nodot + token.output;
- }
- push(token);
- continue;
- }
-
- if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
-
- if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
- if (prev.type === 'dot') {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
-
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
-
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
-
- if (peek() !== '*') {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
-
- push(token);
- }
-
- while (state.brackets > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
- state.output = utils$2.escapeLast(state.output, '[');
- decrement('brackets');
- }
-
- while (state.parens > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
- state.output = utils$2.escapeLast(state.output, '(');
- decrement('parens');
- }
-
- while (state.braces > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
- state.output = utils$2.escapeLast(state.output, '{');
- decrement('braces');
- }
-
- if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
- push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
- }
-
- // rebuild the output if we had to backtrack at any point
- if (state.backtrack === true) {
- state.output = '';
-
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
-
- if (token.suffix) {
- state.output += token.suffix;
- }
- }
- }
-
- return state;
-};
-
-/**
- * Fast paths for creating regular expressions for common glob patterns.
- * This can significantly speed up processing and has very little downside
- * impact when none of the fast paths match.
- */
-
-parse$2.fastpaths = (input, options) => {
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- const len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- input = REPLACEMENTS[input] || input;
-
- // create constants based on platform, for windows or posix
- const {
- DOT_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOTS_SLASH,
- STAR,
- START_ANCHOR
- } = constants$1.globChars(opts.windows);
-
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? '' : '?:';
- const state = { negated: false, prefix: '' };
- let star = opts.bash === true ? '.*?' : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- const globstar = opts => {
- if (opts.noglobstar === true) return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const create = str => {
- switch (str) {
- case '*':
- return `${nodot}${ONE_CHAR}${star}`;
-
- case '.*':
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*.*':
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*/*':
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
-
- case '**':
- return nodot + globstar(opts);
-
- case '**/*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
-
- case '**/*.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '**/.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match) return;
-
- const source = create(match[1]);
- if (!source) return;
-
- return source + DOT_LITERAL + match[2];
- }
- }
- };
-
- const output = utils$2.removePrefix(input, state);
- let source = create(output);
-
- if (source && opts.strictSlashes !== true) {
- source += `${SLASH_LITERAL}?`;
- }
-
- return source;
-};
-
-var parse_1$1 = parse$2;
-
-const scan = scan_1;
-const parse$1 = parse_1$1;
-const utils$1 = utils$4;
-const constants = constants$2;
-const isObject$2 = val => val && typeof val === 'object' && !Array.isArray(val);
-
-/**
- * Creates a matcher function from one or more glob patterns. The
- * returned function takes a string to match as its first argument,
- * and returns true if the string is a match. The returned matcher
- * function also takes a boolean as the second argument that, when true,
- * returns an object with additional information.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch(glob[, options]);
- *
- * const isMatch = picomatch('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @name picomatch
- * @param {String|Array} `globs` One or more glob patterns.
- * @param {Object=} `options`
- * @return {Function=} Returns a matcher function.
- * @api public
- */
-
-const picomatch$1 = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map(input => picomatch$1(input, options, returnState));
- const arrayMatcher = str => {
- for (const isMatch of fns) {
- const state = isMatch(str);
- if (state) return state;
- }
- return false;
- };
- return arrayMatcher;
- }
-
- const isState = isObject$2(glob) && glob.tokens && glob.input;
-
- if (glob === '' || (typeof glob !== 'string' && !isState)) {
- throw new TypeError('Expected pattern to be a non-empty string');
- }
-
- const opts = options || {};
- const posix = opts.windows;
- const regex = isState
- ? picomatch$1.compileRe(glob, options)
- : picomatch$1.makeRe(glob, options, false, true);
-
- const state = regex.state;
- delete regex.state;
-
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
- isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
- }
-
- const matcher = (input, returnObject = false) => {
- const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix });
- const result = { glob, state, regex, posix, input, output, match, isMatch };
-
- if (typeof opts.onResult === 'function') {
- opts.onResult(result);
- }
-
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === 'function') {
- opts.onIgnore(result);
- }
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (typeof opts.onMatch === 'function') {
- opts.onMatch(result);
- }
- return returnObject ? result : true;
- };
-
- if (returnState) {
- matcher.state = state;
- }
-
- return matcher;
-};
-
-/**
- * Test `input` with the given `regex`. This is used by the main
- * `picomatch()` function to test the input string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.test(input, regex[, options]);
- *
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp} `regex`
- * @return {Object} Returns an object with matching info.
- * @api public
- */
-
-picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected input to be a string');
- }
-
- if (input === '') {
- return { isMatch: false, output: '' };
- }
-
- const opts = options || {};
- const format = opts.format || (posix ? utils$1.toPosixSlashes : null);
- let match = input === glob;
- let output = (match && format) ? format(input) : input;
-
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
-
- if (match === false || opts.capture === true) {
- if (opts.matchBase === true || opts.basename === true) {
- match = picomatch$1.matchBase(input, regex, options, posix);
- } else {
- match = regex.exec(output);
- }
- }
-
- return { isMatch: Boolean(match), match, output };
-};
-
-/**
- * Match the basename of a filepath.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.matchBase(input, glob[, options]);
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
- * @return {Boolean}
- * @api public
- */
-
-picomatch$1.matchBase = (input, glob, options) => {
- const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
- return regex.test(utils$1.basename(input));
-};
-
-/**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.isMatch(string, patterns[, options]);
- *
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String|Array} str The string to test.
- * @param {String|Array} patterns One or more glob patterns to use for matching.
- * @param {Object} [options] See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str);
-
-/**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const result = picomatch.parse(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
- * @api public
- */
-
-picomatch$1.parse = (pattern, options) => {
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options));
- return parse$1(pattern, { ...options, fastpaths: false });
-};
-
-/**
- * Scan a glob pattern to separate the pattern into segments.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.scan(input[, options]);
- *
- * const result = picomatch.scan('!./foo/*.js');
- * console.log(result);
- * { prefix: '!./',
- * input: '!./foo/*.js',
- * start: 3,
- * base: 'foo',
- * glob: '*.js',
- * isBrace: false,
- * isBracket: false,
- * isGlob: true,
- * isExtglob: false,
- * isGlobstar: false,
- * negated: true }
- * ```
- * @param {String} `input` Glob pattern to scan.
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
-
-picomatch$1.scan = (input, options) => scan(input, options);
-
-/**
- * Compile a regular expression from the `state` object returned by the
- * [parse()](#parse) method.
- *
- * @param {Object} `state`
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
- * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
- * @return {RegExp}
- * @api public
- */
-
-picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) {
- return state.output;
- }
-
- const opts = options || {};
- const prepend = opts.contains ? '' : '^';
- const append = opts.contains ? '' : '$';
-
- let source = `${prepend}(?:${state.output})${append}`;
- if (state && state.negated === true) {
- source = `^(?!${source}).*$`;
- }
-
- const regex = picomatch$1.toRegex(source, options);
- if (returnState === true) {
- regex.state = state;
- }
-
- return regex;
-};
-
-/**
- * Create a regular expression from a parsed glob pattern.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const state = picomatch.parse('*.js');
- * // picomatch.compileRe(state[, options]);
- *
- * console.log(picomatch.compileRe(state));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `state` The object returned from the `.parse` method.
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
- * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
-
-picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== 'string') {
- throw new TypeError('Expected a non-empty string');
- }
-
- let parsed = { negated: false, fastpaths: true };
-
- if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
- parsed.output = parse$1.fastpaths(input, options);
- }
-
- if (!parsed.output) {
- parsed = parse$1(input, options);
- }
-
- return picomatch$1.compileRe(parsed, options, returnOutput, returnState);
-};
-
-/**
- * Create a regular expression from the given regex source string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.toRegex(source[, options]);
- *
- * const { output } = picomatch.parse('*.js');
- * console.log(picomatch.toRegex(output));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `source` Regular expression source string.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-picomatch$1.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
- } catch (err) {
- if (options && options.debug === true) throw err;
- return /$^/;
- }
-};
-
-/**
- * Picomatch constants.
- * @return {Object}
- */
-
-picomatch$1.constants = constants;
-
-/**
- * Expose "picomatch"
- */
-
-var picomatch_1$1 = picomatch$1;
-
-const pico = picomatch_1$1;
-const utils = utils$4;
-
-function picomatch(glob, options, returnState = false) {
- // default to os.platform()
- if (options && (options.windows === null || options.windows === undefined)) {
- // don't mutate the original options object
- options = { ...options, windows: utils.isWindows() };
- }
-
- return pico(glob, options, returnState);
-}
-
-Object.assign(picomatch, pico);
-var picomatch_1 = picomatch;
-
-var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch_1);
+var nodeExports = node.exports;
+var debug$3 = /*@__PURE__*/getDefaultExportFromCjs(nodeExports);
// Helper since Typescript can't detect readonly arrays with Array.isArray
function isArray(arg) {
@@ -6275,16 +3892,19 @@ var expand_1 = expand;
const debug = createDebugger("vite:env");
function getEnvFilesForMode(mode, envDir) {
- return [
- /** default file */
- `.env`,
- /** local file */
- `.env.local`,
- /** mode file */
- `.env.${mode}`,
- /** mode local file */
- `.env.${mode}.local`
- ].map((file) => normalizePath(path$1.join(envDir, file)));
+ if (envDir !== false) {
+ return [
+ /** default file */
+ `.env`,
+ /** local file */
+ `.env.local`,
+ /** mode file */
+ `.env.${mode}`,
+ /** mode local file */
+ `.env.${mode}.local`
+ ].map((file) => normalizePath(path$1.join(envDir, file)));
+ }
+ return [];
}
function loadEnv(mode, envDir, prefixes = "VITE_") {
const start = performance.now();
diff --git a/node_modules/vite/dist/node/chunks/dep-Bid9ssRr.js b/node_modules/vite/dist/node/chunks/dep-Bxmd1Uxj.js
similarity index 85%
rename from node_modules/vite/dist/node/chunks/dep-Bid9ssRr.js
rename to node_modules/vite/dist/node/chunks/dep-Bxmd1Uxj.js
index 976c851b..bca5e35c 100644
--- a/node_modules/vite/dist/node/chunks/dep-Bid9ssRr.js
+++ b/node_modules/vite/dist/node/chunks/dep-Bxmd1Uxj.js
@@ -1,20 +1,22 @@
import * as fs$8 from 'node:fs';
import fs__default, { promises as promises$1, existsSync as existsSync$1, readFileSync as readFileSync$1 } from 'node:fs';
-import path$d, { posix as posix$1, isAbsolute as isAbsolute$1, join as join$1, resolve as resolve$4, normalize, dirname as dirname$2, relative as relative$2, basename as basename$2, extname as extname$1 } from 'node:path';
-import fsp, { constants as constants$9 } from 'node:fs/promises';
+import path$b, { posix as posix$1, isAbsolute as isAbsolute$1, join as join$1, resolve as resolve$4, normalize, dirname as dirname$2, relative as relative$2, basename as basename$2, extname as extname$1 } from 'node:path';
+import fsp, { constants as constants$3 } from 'node:fs/promises';
import require$$1$1, { fileURLToPath as fileURLToPath$1, URL as URL$3, pathToFileURL as pathToFileURL$1 } from 'node:url';
import { promisify as promisify$4, format as format$2, inspect, stripVTControlCharacters } from 'node:util';
import { performance as performance$1 } from 'node:perf_hooks';
import require$$0$6, { createRequire as createRequire$1, builtinModules } from 'node:module';
import crypto$2 from 'node:crypto';
-import esbuild, { transform as transform$1, formatMessages, build as build$b } from 'esbuild';
+import picomatch$2 from 'picomatch';
+import esbuild, { transform as transform$1, formatMessages, build as build$3 } from 'esbuild';
import { CLIENT_ENTRY, wildcardHosts, loopbackHosts, OPTIMIZABLE_ENTRY_RE, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, DEFAULT_ASSETS_INLINE_LIMIT, SPECIAL_QUERY_RE, KNOWN_ASSET_TYPES, JS_TYPES_RE, CSS_LANGS_RE, METADATA_FILENAME, ESBUILD_MODULES_TARGET, ENV_ENTRY, DEP_VERSION_RE, DEV_PROD_CONDITION, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, VITE_PACKAGE_DIR, defaultAllowedOrigins, DEFAULT_DEV_PORT, CLIENT_DIR, VERSION, ROLLUP_HOOKS, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_CLIENT_CONDITIONS, DEFAULT_SERVER_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_SERVER_MAIN_FIELDS } from '../constants.js';
import require$$0$2, { posix, isAbsolute, resolve as resolve$3, win32, relative as relative$1, join, dirname as dirname$1, extname, basename as basename$1, sep } from 'path';
-import require$$0$3, { statSync, existsSync, readFileSync, readdirSync } from 'fs';
+import require$$0$4, { statSync, existsSync, readFileSync, readdirSync } from 'fs';
+import { fdir } from 'fdir';
import childProcess$2, { exec, execFile, execSync } from 'node:child_process';
import { createServer as createServer$3, STATUS_CODES, get as get$2 } from 'node:http';
import { createServer as createServer$2, get as get$1 } from 'node:https';
-import require$$0$4 from 'tty';
+import require$$0$3 from 'tty';
import require$$1 from 'util';
import require$$4$1 from 'net';
import require$$0$7 from 'events';
@@ -33,6 +35,7 @@ import { createRequire as createRequire$2 } from 'module';
import readline from 'node:readline';
import process$1 from 'node:process';
import { EventEmitter as EventEmitter$4 } from 'node:events';
+import { glob, escapePath, isDynamicPattern, globSync } from 'tinyglobby';
import require$$3 from 'crypto';
import assert$1 from 'node:assert';
import v8 from 'node:v8';
@@ -135,2086 +138,6 @@ picocolors.exports.createColors = createColors;
var picocolorsExports = picocolors.exports;
var colors$1 = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
-var utils$d = {};
-
-const WIN_SLASH$1 = '\\\\/';
-const WIN_NO_SLASH$1 = `[^${WIN_SLASH$1}]`;
-
-/**
- * Posix glob regex
- */
-
-const DOT_LITERAL$1 = '\\.';
-const PLUS_LITERAL$1 = '\\+';
-const QMARK_LITERAL$1 = '\\?';
-const SLASH_LITERAL$1 = '\\/';
-const ONE_CHAR$1 = '(?=.)';
-const QMARK$1 = '[^/]';
-const END_ANCHOR$1 = `(?:${SLASH_LITERAL$1}|$)`;
-const START_ANCHOR$1 = `(?:^|${SLASH_LITERAL$1})`;
-const DOTS_SLASH$1 = `${DOT_LITERAL$1}{1,2}${END_ANCHOR$1}`;
-const NO_DOT$1 = `(?!${DOT_LITERAL$1})`;
-const NO_DOTS$1 = `(?!${START_ANCHOR$1}${DOTS_SLASH$1})`;
-const NO_DOT_SLASH$1 = `(?!${DOT_LITERAL$1}{0,1}${END_ANCHOR$1})`;
-const NO_DOTS_SLASH$1 = `(?!${DOTS_SLASH$1})`;
-const QMARK_NO_DOT$1 = `[^.${SLASH_LITERAL$1}]`;
-const STAR$2 = `${QMARK$1}*?`;
-const SEP = '/';
-
-const POSIX_CHARS$1 = {
- DOT_LITERAL: DOT_LITERAL$1,
- PLUS_LITERAL: PLUS_LITERAL$1,
- QMARK_LITERAL: QMARK_LITERAL$1,
- SLASH_LITERAL: SLASH_LITERAL$1,
- ONE_CHAR: ONE_CHAR$1,
- QMARK: QMARK$1,
- END_ANCHOR: END_ANCHOR$1,
- DOTS_SLASH: DOTS_SLASH$1,
- NO_DOT: NO_DOT$1,
- NO_DOTS: NO_DOTS$1,
- NO_DOT_SLASH: NO_DOT_SLASH$1,
- NO_DOTS_SLASH: NO_DOTS_SLASH$1,
- QMARK_NO_DOT: QMARK_NO_DOT$1,
- STAR: STAR$2,
- START_ANCHOR: START_ANCHOR$1,
- SEP
-};
-
-/**
- * Windows glob regex
- */
-
-const WINDOWS_CHARS$1 = {
- ...POSIX_CHARS$1,
-
- SLASH_LITERAL: `[${WIN_SLASH$1}]`,
- QMARK: WIN_NO_SLASH$1,
- STAR: `${WIN_NO_SLASH$1}*?`,
- DOTS_SLASH: `${DOT_LITERAL$1}{1,2}(?:[${WIN_SLASH$1}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL$1})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH$1}])${DOT_LITERAL$1}{1,2}(?:[${WIN_SLASH$1}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL$1}{0,1}(?:[${WIN_SLASH$1}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL$1}{1,2}(?:[${WIN_SLASH$1}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH$1}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH$1}])`,
- END_ANCHOR: `(?:[${WIN_SLASH$1}]|$)`,
- SEP: '\\'
-};
-
-/**
- * POSIX Bracket Regex
- */
-
-const POSIX_REGEX_SOURCE$3 = {
- alnum: 'a-zA-Z0-9',
- alpha: 'a-zA-Z',
- ascii: '\\x00-\\x7F',
- blank: ' \\t',
- cntrl: '\\x00-\\x1F\\x7F',
- digit: '0-9',
- graph: '\\x21-\\x7E',
- lower: 'a-z',
- print: '\\x20-\\x7E ',
- punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
- space: ' \\t\\r\\n\\v\\f',
- upper: 'A-Z',
- word: 'A-Za-z0-9_',
- xdigit: 'A-Fa-f0-9'
-};
-
-var constants$8 = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$3,
-
- // regular expressions
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
-
- // Replace globs with equivalent patterns to reduce parsing time.
- REPLACEMENTS: {
- '***': '*',
- '**/**': '**',
- '**/**/**': '**'
- },
-
- // Digits
- CHAR_0: 48, /* 0 */
- CHAR_9: 57, /* 9 */
-
- // Alphabet chars.
- CHAR_UPPERCASE_A: 65, /* A */
- CHAR_LOWERCASE_A: 97, /* a */
- CHAR_UPPERCASE_Z: 90, /* Z */
- CHAR_LOWERCASE_Z: 122, /* z */
-
- CHAR_LEFT_PARENTHESES: 40, /* ( */
- CHAR_RIGHT_PARENTHESES: 41, /* ) */
-
- CHAR_ASTERISK: 42, /* * */
-
- // Non-alphabetic chars.
- CHAR_AMPERSAND: 38, /* & */
- CHAR_AT: 64, /* @ */
- CHAR_BACKWARD_SLASH: 92, /* \ */
- CHAR_CARRIAGE_RETURN: 13, /* \r */
- CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
- CHAR_COLON: 58, /* : */
- CHAR_COMMA: 44, /* , */
- CHAR_DOT: 46, /* . */
- CHAR_DOUBLE_QUOTE: 34, /* " */
- CHAR_EQUAL: 61, /* = */
- CHAR_EXCLAMATION_MARK: 33, /* ! */
- CHAR_FORM_FEED: 12, /* \f */
- CHAR_FORWARD_SLASH: 47, /* / */
- CHAR_GRAVE_ACCENT: 96, /* ` */
- CHAR_HASH: 35, /* # */
- CHAR_HYPHEN_MINUS: 45, /* - */
- CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
- CHAR_LEFT_CURLY_BRACE: 123, /* { */
- CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
- CHAR_LINE_FEED: 10, /* \n */
- CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
- CHAR_PERCENT: 37, /* % */
- CHAR_PLUS: 43, /* + */
- CHAR_QUESTION_MARK: 63, /* ? */
- CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
- CHAR_RIGHT_CURLY_BRACE: 125, /* } */
- CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
- CHAR_SEMICOLON: 59, /* ; */
- CHAR_SINGLE_QUOTE: 39, /* ' */
- CHAR_SPACE: 32, /* */
- CHAR_TAB: 9, /* \t */
- CHAR_UNDERSCORE: 95, /* _ */
- CHAR_VERTICAL_LINE: 124, /* | */
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
-
- /**
- * Create EXTGLOB_CHARS
- */
-
- extglobChars(chars) {
- return {
- '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
- '?': { type: 'qmark', open: '(?:', close: ')?' },
- '+': { type: 'plus', open: '(?:', close: ')+' },
- '*': { type: 'star', open: '(?:', close: ')*' },
- '@': { type: 'at', open: '(?:', close: ')' }
- };
- },
-
- /**
- * Create GLOB_CHARS
- */
-
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS$1 : POSIX_CHARS$1;
- }
-};
-
-/*global navigator*/
-
-(function (exports) {
-
- const {
- REGEX_BACKSLASH,
- REGEX_REMOVE_BACKSLASH,
- REGEX_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_GLOBAL
- } = constants$8;
-
- exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
- exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
- exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
- exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
- exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
-
- exports.isWindows = () => {
- if (typeof navigator !== 'undefined' && navigator.platform) {
- const platform = navigator.platform.toLowerCase();
- return platform === 'win32' || platform === 'windows';
- }
-
- if (typeof process !== 'undefined' && process.platform) {
- return process.platform === 'win32';
- }
-
- return false;
- };
-
- exports.removeBackslashes = str => {
- return str.replace(REGEX_REMOVE_BACKSLASH, match => {
- return match === '\\' ? '' : match;
- });
- };
-
- exports.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1) return input;
- if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
- };
-
- exports.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith('./')) {
- output = output.slice(2);
- state.prefix = './';
- }
- return output;
- };
-
- exports.wrapOutput = (input, state = {}, options = {}) => {
- const prepend = options.contains ? '' : '^';
- const append = options.contains ? '' : '$';
-
- let output = `${prepend}(?:${input})${append}`;
- if (state.negated === true) {
- output = `(?:^(?!${output}).*$)`;
- }
- return output;
- };
-
- exports.basename = (path, { windows } = {}) => {
- const segs = path.split(windows ? /[\\/]/ : '/');
- const last = segs[segs.length - 1];
-
- if (last === '') {
- return segs[segs.length - 2];
- }
-
- return last;
- };
-} (utils$d));
-
-const utils$c = utils$d;
-const {
- CHAR_ASTERISK: CHAR_ASTERISK$1, /* * */
- CHAR_AT: CHAR_AT$1, /* @ */
- CHAR_BACKWARD_SLASH: CHAR_BACKWARD_SLASH$1, /* \ */
- CHAR_COMMA: CHAR_COMMA$2, /* , */
- CHAR_DOT: CHAR_DOT$2, /* . */
- CHAR_EXCLAMATION_MARK: CHAR_EXCLAMATION_MARK$1, /* ! */
- CHAR_FORWARD_SLASH: CHAR_FORWARD_SLASH$1, /* / */
- CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$2, /* { */
- CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$2, /* ( */
- CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$2, /* [ */
- CHAR_PLUS: CHAR_PLUS$1, /* + */
- CHAR_QUESTION_MARK: CHAR_QUESTION_MARK$1, /* ? */
- CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$2, /* } */
- CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$2, /* ) */
- CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$2 /* ] */
-} = constants$8;
-
-const isPathSeparator$1 = code => {
- return code === CHAR_FORWARD_SLASH$1 || code === CHAR_BACKWARD_SLASH$1;
-};
-
-const depth$1 = token => {
- if (token.isPrefix !== true) {
- token.depth = token.isGlobstar ? Infinity : 1;
- }
-};
-
-/**
- * Quickly scans a glob pattern and returns an object with a handful of
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
- * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
- * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
- *
- * ```js
- * const pm = require('picomatch');
- * console.log(pm.scan('foo/bar/*.js'));
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an object with tokens and regex source string.
- * @api public
- */
-
-const scan$3 = (input, options) => {
- const opts = options || {};
-
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
-
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let negatedExtglob = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = { value: '', depth: 0, isGlob: false };
-
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
-
- while (index < length) {
- code = advance();
- let next;
-
- if (code === CHAR_BACKWARD_SLASH$1) {
- backslashes = token.backslashes = true;
- code = advance();
-
- if (code === CHAR_LEFT_CURLY_BRACE$2) {
- braceEscaped = true;
- }
- continue;
- }
-
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE$2) {
- braces++;
-
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH$1) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (code === CHAR_LEFT_CURLY_BRACE$2) {
- braces++;
- continue;
- }
-
- if (braceEscaped !== true && code === CHAR_DOT$2 && (code = advance()) === CHAR_DOT$2) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (braceEscaped !== true && code === CHAR_COMMA$2) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_RIGHT_CURLY_BRACE$2) {
- braces--;
-
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_FORWARD_SLASH$1) {
- slashes.push(index);
- tokens.push(token);
- token = { value: '', depth: 0, isGlob: false };
-
- if (finished === true) continue;
- if (prev === CHAR_DOT$2 && index === (start + 1)) {
- start += 2;
- continue;
- }
-
- lastIndex = index + 1;
- continue;
- }
-
- if (opts.noext !== true) {
- const isExtglobChar = code === CHAR_PLUS$1
- || code === CHAR_AT$1
- || code === CHAR_ASTERISK$1
- || code === CHAR_QUESTION_MARK$1
- || code === CHAR_EXCLAMATION_MARK$1;
-
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES$2) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
- if (code === CHAR_EXCLAMATION_MARK$1 && index === start) {
- negatedExtglob = true;
- }
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH$1) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES$2) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
-
- if (code === CHAR_ASTERISK$1) {
- if (prev === CHAR_ASTERISK$1) isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_QUESTION_MARK$1) {
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_LEFT_SQUARE_BRACKET$2) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH$1) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (next === CHAR_RIGHT_SQUARE_BRACKET$2) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK$1 && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
-
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES$2) {
- isGlob = token.isGlob = true;
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES$2) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES$2) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
-
- if (isGlob === true) {
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
- }
-
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
-
- let base = str;
- let prefix = '';
- let glob = '';
-
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
-
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = '';
- glob = str;
- } else {
- base = str;
- }
-
- if (base && base !== '' && base !== '/' && base !== str) {
- if (isPathSeparator$1(base.charCodeAt(base.length - 1))) {
- base = base.slice(0, -1);
- }
- }
-
- if (opts.unescape === true) {
- if (glob) glob = utils$c.removeBackslashes(glob);
-
- if (base && backslashes === true) {
- base = utils$c.removeBackslashes(base);
- }
- }
-
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated,
- negatedExtglob
- };
-
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator$1(code)) {
- tokens.push(token);
- }
- state.tokens = tokens;
- }
-
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
-
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else {
- tokens[idx].value = value;
- }
- depth$1(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== '') {
- parts.push(value);
- }
- prevIndex = i;
- }
-
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
-
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth$1(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
-
- state.slashes = slashes;
- state.parts = parts;
- }
-
- return state;
-};
-
-var scan_1$1 = scan$3;
-
-const constants$7 = constants$8;
-const utils$b = utils$d;
-
-/**
- * Constants
- */
-
-const {
- MAX_LENGTH: MAX_LENGTH$2,
- POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$2,
- REGEX_NON_SPECIAL_CHARS: REGEX_NON_SPECIAL_CHARS$1,
- REGEX_SPECIAL_CHARS_BACKREF: REGEX_SPECIAL_CHARS_BACKREF$1,
- REPLACEMENTS: REPLACEMENTS$1
-} = constants$7;
-
-/**
- * Helpers
- */
-
-const expandRange$1 = (args, options) => {
- if (typeof options.expandRange === 'function') {
- return options.expandRange(...args, options);
- }
-
- args.sort();
- const value = `[${args.join('-')}]`;
-
- return value;
-};
-
-/**
- * Create the message for a syntax error
- */
-
-const syntaxError$1 = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
-};
-
-/**
- * Parse the given input string.
- * @param {String} input
- * @param {Object} options
- * @return {Object}
- */
-
-const parse$h = (input, options) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- input = REPLACEMENTS$1[input] || input;
-
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$2, opts.maxLength) : MAX_LENGTH$2;
-
- let len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- const bos = { type: 'bos', value: '', output: opts.prepend || '' };
- const tokens = [bos];
-
- const capture = opts.capture ? '' : '?:';
-
- // create constants based on platform, for windows or posix
- const PLATFORM_CHARS = constants$7.globChars(opts.windows);
- const EXTGLOB_CHARS = constants$7.extglobChars(PLATFORM_CHARS);
-
- const {
- DOT_LITERAL,
- PLUS_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- } = PLATFORM_CHARS;
-
- const globstar = opts => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const nodot = opts.dot ? '' : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- // minimatch options support
- if (typeof opts.noext === 'boolean') {
- opts.noextglob = opts.noext;
- }
-
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: '',
- output: '',
- prefix: '',
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
-
- input = utils$b.removePrefix(input, state);
- len = input.length;
-
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
-
- /**
- * Tokenizing helpers
- */
-
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index] || '';
- const remaining = () => input.slice(state.index + 1);
- const consume = (value = '', num = 0) => {
- state.consumed += value;
- state.index += num;
- };
-
- const append = token => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
-
- const negate = () => {
- let count = 1;
-
- while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
- advance();
- state.start++;
- count++;
- }
-
- if (count % 2 === 0) {
- return false;
- }
-
- state.negated = true;
- state.start++;
- return true;
- };
-
- const increment = type => {
- state[type]++;
- stack.push(type);
- };
-
- const decrement = type => {
- state[type]--;
- stack.pop();
- };
-
- /**
- * Push tokens onto the tokens array. This helper speeds up
- * tokenizing by 1) helping us avoid backtracking as much as possible,
- * and 2) helping us avoid creating extra tokens when consecutive
- * characters are plain text. This improves performance and simplifies
- * lookbehinds.
- */
-
- const push = tok => {
- if (prev.type === 'globstar') {
- const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
- const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
-
- if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = 'star';
- prev.value = '*';
- prev.output = star;
- state.output += prev.output;
- }
- }
-
- if (extglobs.length && tok.type !== 'paren') {
- extglobs[extglobs.length - 1].inner += tok.value;
- }
-
- if (tok.value || tok.output) append(tok);
- if (prev && prev.type === 'text' && tok.type === 'text') {
- prev.output = (prev.output || prev.value) + tok.value;
- prev.value += tok.value;
- return;
- }
-
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
-
- const extglobOpen = (type, value) => {
- const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
-
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? '(' : '') + token.open;
-
- increment('parens');
- push({ type, value, output: state.output ? '' : ONE_CHAR });
- push({ type: 'paren', extglob: true, value: advance(), output });
- extglobs.push(token);
- };
-
- const extglobClose = token => {
- let output = token.close + (opts.capture ? ')' : '');
- let rest;
-
- if (token.type === 'negate') {
- let extglobStar = star;
-
- if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
- extglobStar = globstar(opts);
- }
-
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
- output = token.close = `)$))${extglobStar}`;
- }
-
- if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
- // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
- // In this case, we need to parse the string and use it in the output of the original pattern.
- // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
- //
- // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
- const expression = parse$h(rest, { ...options, fastpaths: false }).output;
-
- output = token.close = `)${expression})${extglobStar})`;
- }
-
- if (token.prev.type === 'bos') {
- state.negatedExtglob = true;
- }
- }
-
- push({ type: 'paren', extglob: true, value, output });
- decrement('parens');
- };
-
- /**
- * Fast paths
- */
-
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
-
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF$1, (m, esc, chars, first, rest, index) => {
- if (first === '\\') {
- backslashes = true;
- return m;
- }
-
- if (first === '?') {
- if (esc) {
- return esc + first + (rest ? QMARK.repeat(rest.length) : '');
- }
- if (index === 0) {
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
- }
- return QMARK.repeat(chars.length);
- }
-
- if (first === '.') {
- return DOT_LITERAL.repeat(chars.length);
- }
-
- if (first === '*') {
- if (esc) {
- return esc + first + (rest ? star : '');
- }
- return star;
- }
- return esc ? m : `\\${m}`;
- });
-
- if (backslashes === true) {
- if (opts.unescape === true) {
- output = output.replace(/\\/g, '');
- } else {
- output = output.replace(/\\+/g, m => {
- return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
- });
- }
- }
-
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
-
- state.output = utils$b.wrapOutput(output, state, options);
- return state;
- }
-
- /**
- * Tokenize input until we reach end-of-string
- */
-
- while (!eos()) {
- value = advance();
-
- if (value === '\u0000') {
- continue;
- }
-
- /**
- * Escaped characters
- */
-
- if (value === '\\') {
- const next = peek();
-
- if (next === '/' && opts.bash !== true) {
- continue;
- }
-
- if (next === '.' || next === ';') {
- continue;
- }
-
- if (!next) {
- value += '\\';
- push({ type: 'text', value });
- continue;
- }
-
- // collapse slashes to reduce potential for exploits
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
-
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) {
- value += '\\';
- }
- }
-
- if (opts.unescape === true) {
- value = advance();
- } else {
- value += advance();
- }
-
- if (state.brackets === 0) {
- push({ type: 'text', value });
- continue;
- }
- }
-
- /**
- * If we're inside a regex character class, continue
- * until we reach the closing bracket.
- */
-
- if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
- if (opts.posix !== false && value === ':') {
- const inner = prev.value.slice(1);
- if (inner.includes('[')) {
- prev.posix = true;
-
- if (inner.includes(':')) {
- const idx = prev.value.lastIndexOf('[');
- const pre = prev.value.slice(0, idx);
- const rest = prev.value.slice(idx + 2);
- const posix = POSIX_REGEX_SOURCE$2[rest];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
-
- if (!bos.output && tokens.indexOf(prev) === 1) {
- bos.output = ONE_CHAR;
- }
- continue;
- }
- }
- }
- }
-
- if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
- value = `\\${value}`;
- }
-
- if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
- value = `\\${value}`;
- }
-
- if (opts.posix === true && value === '!' && prev.value === '[') {
- value = '^';
- }
-
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * If we're inside a quoted string, continue
- * until we reach the closing double quote.
- */
-
- if (state.quotes === 1 && value !== '"') {
- value = utils$b.escapeRegex(value);
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * Double quotes
- */
-
- if (value === '"') {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) {
- push({ type: 'text', value });
- }
- continue;
- }
-
- /**
- * Parentheses
- */
-
- if (value === '(') {
- increment('parens');
- push({ type: 'paren', value });
- continue;
- }
-
- if (value === ')') {
- if (state.parens === 0 && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError$1('opening', '('));
- }
-
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
-
- push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
- decrement('parens');
- continue;
- }
-
- /**
- * Square brackets
- */
-
- if (value === '[') {
- if (opts.nobracket === true || !remaining().includes(']')) {
- if (opts.nobracket !== true && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError$1('closing', ']'));
- }
-
- value = `\\${value}`;
- } else {
- increment('brackets');
- }
-
- push({ type: 'bracket', value });
- continue;
- }
-
- if (value === ']') {
- if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError$1('opening', '['));
- }
-
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- decrement('brackets');
-
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
- value = `/${value}`;
- }
-
- prev.value += value;
- append({ value });
-
- // when literal brackets are explicitly disabled
- // assume we should match with a regex character class
- if (opts.literalBrackets === false || utils$b.hasRegexChars(prevValue)) {
- continue;
- }
-
- const escaped = utils$b.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
-
- // when literal brackets are explicitly enabled
- // assume we should escape the brackets to match literal characters
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
-
- // when the user specifies nothing, try to match both
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
-
- /**
- * Braces
- */
-
- if (value === '{' && opts.nobrace !== true) {
- increment('braces');
-
- const open = {
- type: 'brace',
- value,
- output: '(',
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
-
- braces.push(open);
- push(open);
- continue;
- }
-
- if (value === '}') {
- const brace = braces[braces.length - 1];
-
- if (opts.nobrace === true || !brace) {
- push({ type: 'text', value, output: value });
- continue;
- }
-
- let output = ')';
-
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
-
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === 'brace') {
- break;
- }
- if (arr[i].type !== 'dots') {
- range.unshift(arr[i].value);
- }
- }
-
- output = expandRange$1(range, opts);
- state.backtrack = true;
- }
-
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = '\\{';
- value = output = '\\}';
- state.output = out;
- for (const t of toks) {
- state.output += (t.output || t.value);
- }
- }
-
- push({ type: 'brace', value, output });
- decrement('braces');
- braces.pop();
- continue;
- }
-
- /**
- * Pipes
- */
-
- if (value === '|') {
- if (extglobs.length > 0) {
- extglobs[extglobs.length - 1].conditions++;
- }
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Commas
- */
-
- if (value === ',') {
- let output = value;
-
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === 'braces') {
- brace.comma = true;
- output = '|';
- }
-
- push({ type: 'comma', value, output });
- continue;
- }
-
- /**
- * Slashes
- */
-
- if (value === '/') {
- // if the beginning of the glob is "./", advance the start
- // to the current index, and don't add the "./" characters
- // to the state. This greatly simplifies lookbehinds when
- // checking for BOS characters like "!" and "." (not "./")
- if (prev.type === 'dot' && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = '';
- state.output = '';
- tokens.pop();
- prev = bos; // reset "prev" to the first token
- continue;
- }
-
- push({ type: 'slash', value, output: SLASH_LITERAL });
- continue;
- }
-
- /**
- * Dots
- */
-
- if (value === '.') {
- if (state.braces > 0 && prev.type === 'dot') {
- if (prev.value === '.') prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = 'dots';
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
-
- if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
- push({ type: 'text', value, output: DOT_LITERAL });
- continue;
- }
-
- push({ type: 'dot', value, output: DOT_LITERAL });
- continue;
- }
-
- /**
- * Question marks
- */
-
- if (value === '?') {
- const isGroup = prev && prev.value === '(';
- if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('qmark', value);
- continue;
- }
-
- if (prev && prev.type === 'paren') {
- const next = peek();
- let output = value;
-
- if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
- output = `\\${value}`;
- }
-
- push({ type: 'text', value, output });
- continue;
- }
-
- if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
- push({ type: 'qmark', value, output: QMARK_NO_DOT });
- continue;
- }
-
- push({ type: 'qmark', value, output: QMARK });
- continue;
- }
-
- /**
- * Exclamation
- */
-
- if (value === '!') {
- if (opts.noextglob !== true && peek() === '(') {
- if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
- extglobOpen('negate', value);
- continue;
- }
- }
-
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
-
- /**
- * Plus
- */
-
- if (value === '+') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('plus', value);
- continue;
- }
-
- if ((prev && prev.value === '(') || opts.regex === false) {
- push({ type: 'plus', value, output: PLUS_LITERAL });
- continue;
- }
-
- if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
- push({ type: 'plus', value });
- continue;
- }
-
- push({ type: 'plus', value: PLUS_LITERAL });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value === '@') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- push({ type: 'at', extglob: true, value, output: '' });
- continue;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value !== '*') {
- if (value === '$' || value === '^') {
- value = `\\${value}`;
- }
-
- const match = REGEX_NON_SPECIAL_CHARS$1.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Stars
- */
-
- if (prev && (prev.type === 'globstar' || prev.star === true)) {
- prev.type = 'star';
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen('star', value);
- continue;
- }
-
- if (prev.type === 'star') {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
-
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === 'slash' || prior.type === 'bos';
- const afterStar = before && (before.type === 'star' || before.type === 'globstar');
-
- if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
- const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
- if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- // strip consecutive `/**/`
- while (rest.slice(0, 3) === '/**') {
- const after = input[state.index + 4];
- if (after && after !== '/') {
- break;
- }
- rest = rest.slice(3);
- consume('/**', 3);
- }
-
- if (prior.type === 'bos' && eos()) {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
- const end = rest[1] !== void 0 ? '|$' : '';
-
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
-
- state.output += prior.output + prev.output;
- state.globstar = true;
-
- consume(value + advance());
-
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- if (prior.type === 'bos' && rest[0] === '/') {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- // remove single star from output
- state.output = state.output.slice(0, -prev.output.length);
-
- // reset previous token to globstar
- prev.type = 'globstar';
- prev.output = globstar(opts);
- prev.value += value;
-
- // reset output with globstar
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- const token = { type: 'star', value, output: star };
-
- if (opts.bash === true) {
- token.output = '.*?';
- if (prev.type === 'bos' || prev.type === 'slash') {
- token.output = nodot + token.output;
- }
- push(token);
- continue;
- }
-
- if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
-
- if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
- if (prev.type === 'dot') {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
-
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
-
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
-
- if (peek() !== '*') {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
-
- push(token);
- }
-
- while (state.brackets > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError$1('closing', ']'));
- state.output = utils$b.escapeLast(state.output, '[');
- decrement('brackets');
- }
-
- while (state.parens > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError$1('closing', ')'));
- state.output = utils$b.escapeLast(state.output, '(');
- decrement('parens');
- }
-
- while (state.braces > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError$1('closing', '}'));
- state.output = utils$b.escapeLast(state.output, '{');
- decrement('braces');
- }
-
- if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
- push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
- }
-
- // rebuild the output if we had to backtrack at any point
- if (state.backtrack === true) {
- state.output = '';
-
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
-
- if (token.suffix) {
- state.output += token.suffix;
- }
- }
- }
-
- return state;
-};
-
-/**
- * Fast paths for creating regular expressions for common glob patterns.
- * This can significantly speed up processing and has very little downside
- * impact when none of the fast paths match.
- */
-
-parse$h.fastpaths = (input, options) => {
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$2, opts.maxLength) : MAX_LENGTH$2;
- const len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- input = REPLACEMENTS$1[input] || input;
-
- // create constants based on platform, for windows or posix
- const {
- DOT_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOTS_SLASH,
- STAR,
- START_ANCHOR
- } = constants$7.globChars(opts.windows);
-
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? '' : '?:';
- const state = { negated: false, prefix: '' };
- let star = opts.bash === true ? '.*?' : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- const globstar = opts => {
- if (opts.noglobstar === true) return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const create = str => {
- switch (str) {
- case '*':
- return `${nodot}${ONE_CHAR}${star}`;
-
- case '.*':
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*.*':
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*/*':
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
-
- case '**':
- return nodot + globstar(opts);
-
- case '**/*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
-
- case '**/*.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '**/.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match) return;
-
- const source = create(match[1]);
- if (!source) return;
-
- return source + DOT_LITERAL + match[2];
- }
- }
- };
-
- const output = utils$b.removePrefix(input, state);
- let source = create(output);
-
- if (source && opts.strictSlashes !== true) {
- source += `${SLASH_LITERAL}?`;
- }
-
- return source;
-};
-
-var parse_1$4 = parse$h;
-
-const scan$2 = scan_1$1;
-const parse$g = parse_1$4;
-const utils$a = utils$d;
-const constants$6 = constants$8;
-const isObject$4 = val => val && typeof val === 'object' && !Array.isArray(val);
-
-/**
- * Creates a matcher function from one or more glob patterns. The
- * returned function takes a string to match as its first argument,
- * and returns true if the string is a match. The returned matcher
- * function also takes a boolean as the second argument that, when true,
- * returns an object with additional information.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch(glob[, options]);
- *
- * const isMatch = picomatch('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @name picomatch
- * @param {String|Array} `globs` One or more glob patterns.
- * @param {Object=} `options`
- * @return {Function=} Returns a matcher function.
- * @api public
- */
-
-const picomatch$6 = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map(input => picomatch$6(input, options, returnState));
- const arrayMatcher = str => {
- for (const isMatch of fns) {
- const state = isMatch(str);
- if (state) return state;
- }
- return false;
- };
- return arrayMatcher;
- }
-
- const isState = isObject$4(glob) && glob.tokens && glob.input;
-
- if (glob === '' || (typeof glob !== 'string' && !isState)) {
- throw new TypeError('Expected pattern to be a non-empty string');
- }
-
- const opts = options || {};
- const posix = opts.windows;
- const regex = isState
- ? picomatch$6.compileRe(glob, options)
- : picomatch$6.makeRe(glob, options, false, true);
-
- const state = regex.state;
- delete regex.state;
-
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
- isIgnored = picomatch$6(opts.ignore, ignoreOpts, returnState);
- }
-
- const matcher = (input, returnObject = false) => {
- const { isMatch, match, output } = picomatch$6.test(input, regex, options, { glob, posix });
- const result = { glob, state, regex, posix, input, output, match, isMatch };
-
- if (typeof opts.onResult === 'function') {
- opts.onResult(result);
- }
-
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === 'function') {
- opts.onIgnore(result);
- }
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (typeof opts.onMatch === 'function') {
- opts.onMatch(result);
- }
- return returnObject ? result : true;
- };
-
- if (returnState) {
- matcher.state = state;
- }
-
- return matcher;
-};
-
-/**
- * Test `input` with the given `regex`. This is used by the main
- * `picomatch()` function to test the input string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.test(input, regex[, options]);
- *
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp} `regex`
- * @return {Object} Returns an object with matching info.
- * @api public
- */
-
-picomatch$6.test = (input, regex, options, { glob, posix } = {}) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected input to be a string');
- }
-
- if (input === '') {
- return { isMatch: false, output: '' };
- }
-
- const opts = options || {};
- const format = opts.format || (posix ? utils$a.toPosixSlashes : null);
- let match = input === glob;
- let output = (match && format) ? format(input) : input;
-
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
-
- if (match === false || opts.capture === true) {
- if (opts.matchBase === true || opts.basename === true) {
- match = picomatch$6.matchBase(input, regex, options, posix);
- } else {
- match = regex.exec(output);
- }
- }
-
- return { isMatch: Boolean(match), match, output };
-};
-
-/**
- * Match the basename of a filepath.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.matchBase(input, glob[, options]);
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
- * @return {Boolean}
- * @api public
- */
-
-picomatch$6.matchBase = (input, glob, options) => {
- const regex = glob instanceof RegExp ? glob : picomatch$6.makeRe(glob, options);
- return regex.test(utils$a.basename(input));
-};
-
-/**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.isMatch(string, patterns[, options]);
- *
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String|Array} str The string to test.
- * @param {String|Array} patterns One or more glob patterns to use for matching.
- * @param {Object} [options] See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-picomatch$6.isMatch = (str, patterns, options) => picomatch$6(patterns, options)(str);
-
-/**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const result = picomatch.parse(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
- * @api public
- */
-
-picomatch$6.parse = (pattern, options) => {
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$6.parse(p, options));
- return parse$g(pattern, { ...options, fastpaths: false });
-};
-
-/**
- * Scan a glob pattern to separate the pattern into segments.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.scan(input[, options]);
- *
- * const result = picomatch.scan('!./foo/*.js');
- * console.log(result);
- * { prefix: '!./',
- * input: '!./foo/*.js',
- * start: 3,
- * base: 'foo',
- * glob: '*.js',
- * isBrace: false,
- * isBracket: false,
- * isGlob: true,
- * isExtglob: false,
- * isGlobstar: false,
- * negated: true }
- * ```
- * @param {String} `input` Glob pattern to scan.
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
-
-picomatch$6.scan = (input, options) => scan$2(input, options);
-
-/**
- * Compile a regular expression from the `state` object returned by the
- * [parse()](#parse) method.
- *
- * @param {Object} `state`
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
- * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
- * @return {RegExp}
- * @api public
- */
-
-picomatch$6.compileRe = (state, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) {
- return state.output;
- }
-
- const opts = options || {};
- const prepend = opts.contains ? '' : '^';
- const append = opts.contains ? '' : '$';
-
- let source = `${prepend}(?:${state.output})${append}`;
- if (state && state.negated === true) {
- source = `^(?!${source}).*$`;
- }
-
- const regex = picomatch$6.toRegex(source, options);
- if (returnState === true) {
- regex.state = state;
- }
-
- return regex;
-};
-
-/**
- * Create a regular expression from a parsed glob pattern.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const state = picomatch.parse('*.js');
- * // picomatch.compileRe(state[, options]);
- *
- * console.log(picomatch.compileRe(state));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `state` The object returned from the `.parse` method.
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
- * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
-
-picomatch$6.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== 'string') {
- throw new TypeError('Expected a non-empty string');
- }
-
- let parsed = { negated: false, fastpaths: true };
-
- if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
- parsed.output = parse$g.fastpaths(input, options);
- }
-
- if (!parsed.output) {
- parsed = parse$g(input, options);
- }
-
- return picomatch$6.compileRe(parsed, options, returnOutput, returnState);
-};
-
-/**
- * Create a regular expression from the given regex source string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.toRegex(source[, options]);
- *
- * const { output } = picomatch.parse('*.js');
- * console.log(picomatch.toRegex(output));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `source` Regular expression source string.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-picomatch$6.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
- } catch (err) {
- if (options && options.debug === true) throw err;
- return /$^/;
- }
-};
-
-/**
- * Picomatch constants.
- * @return {Object}
- */
-
-picomatch$6.constants = constants$6;
-
-/**
- * Expose "picomatch"
- */
-
-var picomatch_1$2 = picomatch$6;
-
-const pico = picomatch_1$2;
-const utils$9 = utils$d;
-
-function picomatch$4(glob, options, returnState = false) {
- // default to os.platform()
- if (options && (options.windows === null || options.windows === undefined)) {
- // don't mutate the original options object
- options = { ...options, windows: utils$9.isWindows() };
- }
-
- return pico(glob, options, returnState);
-}
-
-Object.assign(picomatch$4, pico);
-var picomatch_1$1 = picomatch$4;
-
-var picomatch$5 = /*@__PURE__*/getDefaultExportFromCjs(picomatch_1$1);
-
const VALID_ID_PREFIX = `/@id/`;
const NULL_BYTE_PLACEHOLDER = `__x00__`;
let SOURCEMAPPING_URL = "sourceMa";
@@ -2610,33 +533,33 @@ function ensureArray(thing) {
}
const normalizePathRegExp = new RegExp(`\\${win32.sep}`, 'g');
-const normalizePath$6 = function normalizePath(filename) {
+const normalizePath$5 = function normalizePath(filename) {
return filename.replace(normalizePathRegExp, posix.sep);
};
-function getMatcherString(id, resolutionBase) {
+function getMatcherString$1(id, resolutionBase) {
if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) {
- return normalizePath$6(id);
+ return normalizePath$5(id);
}
// resolve('') is valid and will default to process.cwd()
- const basePath = normalizePath$6(resolve$3(resolutionBase || ''))
+ const basePath = normalizePath$5(resolve$3(resolutionBase || ''))
// escape all possible (posix + win) path characters that might interfere with regex
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
// Note that we use posix.join because:
// 1. the basePath has been normalized to use /
// 2. the incoming glob (id) matcher, also uses /
// otherwise Node will force backslash (\) on windows
- return posix.join(basePath, normalizePath$6(id));
+ return posix.join(basePath, normalizePath$5(id));
}
-const createFilter$1 = function createFilter(include, exclude, options) {
+const createFilter$2 = function createFilter(include, exclude, options) {
const resolutionBase = options && options.resolve;
const getMatcher = (id) => id instanceof RegExp
? id
: {
test: (what) => {
// this refactor is a tad overly verbose but makes for easy debugging
- const pattern = getMatcherString(id, resolutionBase);
- const fn = picomatch$5(pattern, { dot: true });
+ const pattern = getMatcherString$1(id, resolutionBase);
+ const fn = picomatch$2(pattern, { dot: true });
const result = fn(what);
return result;
}
@@ -2650,7 +573,7 @@ const createFilter$1 = function createFilter(include, exclude, options) {
return false;
if (id.includes('\0'))
return false;
- const pathId = normalizePath$6(id);
+ const pathId = normalizePath$5(id);
for (let i = 0; i < excludeMatchers.length; ++i) {
const matcher = excludeMatchers[i];
if (matcher instanceof RegExp) {
@@ -2798,12 +721,12 @@ const dataToEsm = function dataToEsm(data, options = {}) {
return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`;
};
-var path$c = require$$0$2;
+var path$a = require$$0$2;
var commondir = function (basedir, relfiles) {
if (relfiles) {
var files = relfiles.map(function (r) {
- return path$c.resolve(basedir, r);
+ return path$a.resolve(basedir, r);
});
}
else {
@@ -2830,753 +753,6 @@ var commondir = function (basedir, relfiles) {
var getCommonDir = /*@__PURE__*/getDefaultExportFromCjs(commondir);
-var dist = {};
-
-var builder = {};
-
-var apiBuilder = {};
-
-var async = {};
-
-var walker = {};
-
-var utils$8 = {};
-
-Object.defineProperty(utils$8, "__esModule", { value: true });
-utils$8.normalizePath = utils$8.convertSlashes = utils$8.cleanPath = void 0;
-const path_1$4 = require$$0$2;
-function cleanPath(path) {
- let normalized = (0, path_1$4.normalize)(path);
- // we have to remove the last path separator
- // to account for / root path
- if (normalized.length > 1 && normalized[normalized.length - 1] === path_1$4.sep)
- normalized = normalized.substring(0, normalized.length - 1);
- return normalized;
-}
-utils$8.cleanPath = cleanPath;
-const SLASHES_REGEX = /[\\/]/g;
-function convertSlashes(path, separator) {
- return path.replace(SLASHES_REGEX, separator);
-}
-utils$8.convertSlashes = convertSlashes;
-function normalizePath$5(path, options) {
- const { resolvePaths, normalizePath, pathSeparator } = options;
- const pathNeedsCleaning = (process.platform === "win32" && path.includes("/")) ||
- path.startsWith(".");
- if (resolvePaths)
- path = (0, path_1$4.resolve)(path);
- if (normalizePath || pathNeedsCleaning)
- path = cleanPath(path);
- if (path === ".")
- return "";
- const needsSeperator = path[path.length - 1] !== pathSeparator;
- return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
-}
-utils$8.normalizePath = normalizePath$5;
-
-var joinPath$2 = {};
-
-Object.defineProperty(joinPath$2, "__esModule", { value: true });
-joinPath$2.build = joinPath$2.joinDirectoryPath = joinPath$2.joinPathWithBasePath = void 0;
-const path_1$3 = require$$0$2;
-const utils_1$1 = utils$8;
-function joinPathWithBasePath(filename, directoryPath) {
- return directoryPath + filename;
-}
-joinPath$2.joinPathWithBasePath = joinPathWithBasePath;
-function joinPathWithRelativePath(root, options) {
- return function (filename, directoryPath) {
- const sameRoot = directoryPath.startsWith(root);
- if (sameRoot)
- return directoryPath.replace(root, "") + filename;
- else
- return ((0, utils_1$1.convertSlashes)((0, path_1$3.relative)(root, directoryPath), options.pathSeparator) +
- options.pathSeparator +
- filename);
- };
-}
-function joinPath$1(filename) {
- return filename;
-}
-function joinDirectoryPath(filename, directoryPath, separator) {
- return directoryPath + filename + separator;
-}
-joinPath$2.joinDirectoryPath = joinDirectoryPath;
-function build$a(root, options) {
- const { relativePaths, includeBasePath } = options;
- return relativePaths && root
- ? joinPathWithRelativePath(root, options)
- : includeBasePath
- ? joinPathWithBasePath
- : joinPath$1;
-}
-joinPath$2.build = build$a;
-
-var pushDirectory$2 = {};
-
-Object.defineProperty(pushDirectory$2, "__esModule", { value: true });
-pushDirectory$2.build = void 0;
-function pushDirectoryWithRelativePath(root) {
- return function (directoryPath, paths) {
- paths.push(directoryPath.substring(root.length) || ".");
- };
-}
-function pushDirectoryFilterWithRelativePath(root) {
- return function (directoryPath, paths, filters) {
- const relativePath = directoryPath.substring(root.length) || ".";
- if (filters.every((filter) => filter(relativePath, true))) {
- paths.push(relativePath);
- }
- };
-}
-const pushDirectory$1 = (directoryPath, paths) => {
- paths.push(directoryPath || ".");
-};
-const pushDirectoryFilter = (directoryPath, paths, filters) => {
- const path = directoryPath || ".";
- if (filters.every((filter) => filter(path, true))) {
- paths.push(path);
- }
-};
-const empty$2 = () => { };
-function build$9(root, options) {
- const { includeDirs, filters, relativePaths } = options;
- if (!includeDirs)
- return empty$2;
- if (relativePaths)
- return filters && filters.length
- ? pushDirectoryFilterWithRelativePath(root)
- : pushDirectoryWithRelativePath(root);
- return filters && filters.length ? pushDirectoryFilter : pushDirectory$1;
-}
-pushDirectory$2.build = build$9;
-
-var pushFile$2 = {};
-
-Object.defineProperty(pushFile$2, "__esModule", { value: true });
-pushFile$2.build = void 0;
-const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
- if (filters.every((filter) => filter(filename, false)))
- counts.files++;
-};
-const pushFileFilter = (filename, paths, _counts, filters) => {
- if (filters.every((filter) => filter(filename, false)))
- paths.push(filename);
-};
-const pushFileCount = (_filename, _paths, counts, _filters) => {
- counts.files++;
-};
-const pushFile$1 = (filename, paths) => {
- paths.push(filename);
-};
-const empty$1 = () => { };
-function build$8(options) {
- const { excludeFiles, filters, onlyCounts } = options;
- if (excludeFiles)
- return empty$1;
- if (filters && filters.length) {
- return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
- }
- else if (onlyCounts) {
- return pushFileCount;
- }
- else {
- return pushFile$1;
- }
-}
-pushFile$2.build = build$8;
-
-var getArray$2 = {};
-
-Object.defineProperty(getArray$2, "__esModule", { value: true });
-getArray$2.build = void 0;
-const getArray$1 = (paths) => {
- return paths;
-};
-const getArrayGroup = () => {
- return [""].slice(0, 0);
-};
-function build$7(options) {
- return options.group ? getArrayGroup : getArray$1;
-}
-getArray$2.build = build$7;
-
-var groupFiles$2 = {};
-
-Object.defineProperty(groupFiles$2, "__esModule", { value: true });
-groupFiles$2.build = void 0;
-const groupFiles$1 = (groups, directory, files) => {
- groups.push({ directory, files, dir: directory });
-};
-const empty = () => { };
-function build$6(options) {
- return options.group ? groupFiles$1 : empty;
-}
-groupFiles$2.build = build$6;
-
-var resolveSymlink$1 = {};
-
-var __importDefault$1 = (resolveSymlink$1 && resolveSymlink$1.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(resolveSymlink$1, "__esModule", { value: true });
-resolveSymlink$1.build = void 0;
-const fs_1$1 = __importDefault$1(require$$0$3);
-const path_1$2 = require$$0$2;
-const resolveSymlinksAsync = function (path, state, callback) {
- const { queue, options: { suppressErrors }, } = state;
- queue.enqueue();
- fs_1$1.default.realpath(path, (error, resolvedPath) => {
- if (error)
- return queue.dequeue(suppressErrors ? null : error, state);
- fs_1$1.default.stat(resolvedPath, (error, stat) => {
- if (error)
- return queue.dequeue(suppressErrors ? null : error, state);
- if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
- return queue.dequeue(null, state);
- callback(stat, resolvedPath);
- queue.dequeue(null, state);
- });
- });
-};
-const resolveSymlinks = function (path, state, callback) {
- const { queue, options: { suppressErrors }, } = state;
- queue.enqueue();
- try {
- const resolvedPath = fs_1$1.default.realpathSync(path);
- const stat = fs_1$1.default.statSync(resolvedPath);
- if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
- return;
- callback(stat, resolvedPath);
- }
- catch (e) {
- if (!suppressErrors)
- throw e;
- }
-};
-function build$5(options, isSynchronous) {
- if (!options.resolveSymlinks || options.excludeSymlinks)
- return null;
- return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
-}
-resolveSymlink$1.build = build$5;
-function isRecursive(path, resolved, state) {
- if (state.options.useRealPaths)
- return isRecursiveUsingRealPaths(resolved, state);
- let parent = (0, path_1$2.dirname)(path);
- let depth = 1;
- while (parent !== state.root && depth < 2) {
- const resolvedPath = state.symlinks.get(parent);
- const isSameRoot = !!resolvedPath &&
- (resolvedPath === resolved ||
- resolvedPath.startsWith(resolved) ||
- resolved.startsWith(resolvedPath));
- if (isSameRoot)
- depth++;
- else
- parent = (0, path_1$2.dirname)(parent);
- }
- state.symlinks.set(path, resolved);
- return depth > 1;
-}
-function isRecursiveUsingRealPaths(resolved, state) {
- return state.visited.includes(resolved + state.options.pathSeparator);
-}
-
-var invokeCallback$1 = {};
-
-Object.defineProperty(invokeCallback$1, "__esModule", { value: true });
-invokeCallback$1.build = void 0;
-const onlyCountsSync = (state) => {
- return state.counts;
-};
-const groupsSync = (state) => {
- return state.groups;
-};
-const defaultSync = (state) => {
- return state.paths;
-};
-const limitFilesSync = (state) => {
- return state.paths.slice(0, state.options.maxFiles);
-};
-const onlyCountsAsync = (state, error, callback) => {
- report(error, callback, state.counts, state.options.suppressErrors);
- return null;
-};
-const defaultAsync = (state, error, callback) => {
- report(error, callback, state.paths, state.options.suppressErrors);
- return null;
-};
-const limitFilesAsync = (state, error, callback) => {
- report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
- return null;
-};
-const groupsAsync = (state, error, callback) => {
- report(error, callback, state.groups, state.options.suppressErrors);
- return null;
-};
-function report(error, callback, output, suppressErrors) {
- if (error && !suppressErrors)
- callback(error, output);
- else
- callback(null, output);
-}
-function build$4(options, isSynchronous) {
- const { onlyCounts, group, maxFiles } = options;
- if (onlyCounts)
- return isSynchronous
- ? onlyCountsSync
- : onlyCountsAsync;
- else if (group)
- return isSynchronous
- ? groupsSync
- : groupsAsync;
- else if (maxFiles)
- return isSynchronous
- ? limitFilesSync
- : limitFilesAsync;
- else
- return isSynchronous
- ? defaultSync
- : defaultAsync;
-}
-invokeCallback$1.build = build$4;
-
-var walkDirectory$1 = {};
-
-var __importDefault = (walkDirectory$1 && walkDirectory$1.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(walkDirectory$1, "__esModule", { value: true });
-walkDirectory$1.build = void 0;
-const fs_1 = __importDefault(require$$0$3);
-const readdirOpts = { withFileTypes: true };
-const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback) => {
- if (currentDepth < 0)
- return state.queue.dequeue(null, state);
- state.visited.push(crawlPath);
- state.counts.directories++;
- state.queue.enqueue();
- // Perf: Node >= 10 introduced withFileTypes that helps us
- // skip an extra fs.stat call.
- fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
- callback(entries, directoryPath, currentDepth);
- state.queue.dequeue(state.options.suppressErrors ? null : error, state);
- });
-};
-const walkSync = (state, crawlPath, directoryPath, currentDepth, callback) => {
- if (currentDepth < 0)
- return;
- state.visited.push(crawlPath);
- state.counts.directories++;
- let entries = [];
- try {
- entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
- }
- catch (e) {
- if (!state.options.suppressErrors)
- throw e;
- }
- callback(entries, directoryPath, currentDepth);
-};
-function build$3(isSynchronous) {
- return isSynchronous ? walkSync : walkAsync;
-}
-walkDirectory$1.build = build$3;
-
-var queue = {};
-
-Object.defineProperty(queue, "__esModule", { value: true });
-queue.Queue = void 0;
-/**
- * This is a custom stateless queue to track concurrent async fs calls.
- * It increments a counter whenever a call is queued and decrements it
- * as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
- */
-class Queue {
- onQueueEmpty;
- count = 0;
- constructor(onQueueEmpty) {
- this.onQueueEmpty = onQueueEmpty;
- }
- enqueue() {
- this.count++;
- }
- dequeue(error, output) {
- if (--this.count <= 0 || error)
- this.onQueueEmpty(error, output);
- }
-}
-queue.Queue = Queue;
-
-var counter = {};
-
-Object.defineProperty(counter, "__esModule", { value: true });
-counter.Counter = void 0;
-class Counter {
- _files = 0;
- _directories = 0;
- set files(num) {
- this._files = num;
- }
- get files() {
- return this._files;
- }
- set directories(num) {
- this._directories = num;
- }
- get directories() {
- return this._directories;
- }
- /**
- * @deprecated use `directories` instead
- */
- /* c8 ignore next 3 */
- get dirs() {
- return this._directories;
- }
-}
-counter.Counter = Counter;
-
-var __createBinding = (walker && walker.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (walker && walker.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (walker && walker.__importStar) || function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
-Object.defineProperty(walker, "__esModule", { value: true });
-walker.Walker = void 0;
-const path_1$1 = require$$0$2;
-const utils_1 = utils$8;
-const joinPath = __importStar(joinPath$2);
-const pushDirectory = __importStar(pushDirectory$2);
-const pushFile = __importStar(pushFile$2);
-const getArray = __importStar(getArray$2);
-const groupFiles = __importStar(groupFiles$2);
-const resolveSymlink = __importStar(resolveSymlink$1);
-const invokeCallback = __importStar(invokeCallback$1);
-const walkDirectory = __importStar(walkDirectory$1);
-const queue_1 = queue;
-const counter_1 = counter;
-class Walker {
- root;
- isSynchronous;
- state;
- joinPath;
- pushDirectory;
- pushFile;
- getArray;
- groupFiles;
- resolveSymlink;
- walkDirectory;
- callbackInvoker;
- constructor(root, options, callback) {
- this.isSynchronous = !callback;
- this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
- this.root = (0, utils_1.normalizePath)(root, options);
- this.state = {
- root: this.root.slice(0, -1),
- // Perf: we explicitly tell the compiler to optimize for String arrays
- paths: [""].slice(0, 0),
- groups: [],
- counts: new counter_1.Counter(),
- options,
- queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)),
- symlinks: new Map(),
- visited: [""].slice(0, 0),
- };
- /*
- * Perf: We conditionally change functions according to options. This gives a slight
- * performance boost. Since these functions are so small, they are automatically inlined
- * by the javascript engine so there's no function call overhead (in most cases).
- */
- this.joinPath = joinPath.build(this.root, options);
- this.pushDirectory = pushDirectory.build(this.root, options);
- this.pushFile = pushFile.build(options);
- this.getArray = getArray.build(options);
- this.groupFiles = groupFiles.build(options);
- this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
- this.walkDirectory = walkDirectory.build(this.isSynchronous);
- }
- start() {
- this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
- return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
- }
- walk = (entries, directoryPath, depth) => {
- const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator, }, } = this.state;
- if ((signal && signal.aborted) || (maxFiles && paths.length > maxFiles))
- return;
- this.pushDirectory(directoryPath, paths, filters);
- const files = this.getArray(this.state.paths);
- for (let i = 0; i < entries.length; ++i) {
- const entry = entries[i];
- if (entry.isFile() ||
- (entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks)) {
- const filename = this.joinPath(entry.name, directoryPath);
- this.pushFile(filename, files, this.state.counts, filters);
- }
- else if (entry.isDirectory()) {
- let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
- if (exclude && exclude(entry.name, path))
- continue;
- this.walkDirectory(this.state, path, path, depth - 1, this.walk);
- }
- else if (entry.isSymbolicLink() && this.resolveSymlink) {
- let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
- this.resolveSymlink(path, this.state, (stat, resolvedPath) => {
- if (stat.isDirectory()) {
- resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
- if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator))
- return;
- this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
- }
- else {
- resolvedPath = useRealPaths ? resolvedPath : path;
- const filename = (0, path_1$1.basename)(resolvedPath);
- const directoryPath = (0, utils_1.normalizePath)((0, path_1$1.dirname)(resolvedPath), this.state.options);
- resolvedPath = this.joinPath(filename, directoryPath);
- this.pushFile(resolvedPath, files, this.state.counts, filters);
- }
- });
- }
- }
- this.groupFiles(this.state.groups, directoryPath, files);
- };
-}
-walker.Walker = Walker;
-
-Object.defineProperty(async, "__esModule", { value: true });
-async.callback = async.promise = void 0;
-const walker_1$1 = walker;
-function promise(root, options) {
- return new Promise((resolve, reject) => {
- callback(root, options, (err, output) => {
- if (err)
- return reject(err);
- resolve(output);
- });
- });
-}
-async.promise = promise;
-function callback(root, options, callback) {
- let walker = new walker_1$1.Walker(root, options, callback);
- walker.start();
-}
-async.callback = callback;
-
-var sync$2 = {};
-
-Object.defineProperty(sync$2, "__esModule", { value: true });
-sync$2.sync = void 0;
-const walker_1 = walker;
-function sync$1(root, options) {
- const walker = new walker_1.Walker(root, options);
- return walker.start();
-}
-sync$2.sync = sync$1;
-
-Object.defineProperty(apiBuilder, "__esModule", { value: true });
-apiBuilder.APIBuilder = void 0;
-const async_1 = async;
-const sync_1 = sync$2;
-class APIBuilder {
- root;
- options;
- constructor(root, options) {
- this.root = root;
- this.options = options;
- }
- withPromise() {
- return (0, async_1.promise)(this.root, this.options);
- }
- withCallback(cb) {
- (0, async_1.callback)(this.root, this.options, cb);
- }
- sync() {
- return (0, sync_1.sync)(this.root, this.options);
- }
-}
-apiBuilder.APIBuilder = APIBuilder;
-
-Object.defineProperty(builder, "__esModule", { value: true });
-builder.Builder = void 0;
-const path_1 = require$$0$2;
-const api_builder_1 = apiBuilder;
-var pm = null;
-/* c8 ignore next 6 */
-try {
- require.resolve("picomatch");
- pm = picomatch_1$1;
-}
-catch (_e) {
- // do nothing
-}
-class Builder {
- globCache = {};
- options = {
- maxDepth: Infinity,
- suppressErrors: true,
- pathSeparator: path_1.sep,
- filters: [],
- };
- globFunction;
- constructor(options) {
- this.options = { ...this.options, ...options };
- this.globFunction = this.options.globFunction;
- }
- group() {
- this.options.group = true;
- return this;
- }
- withPathSeparator(separator) {
- this.options.pathSeparator = separator;
- return this;
- }
- withBasePath() {
- this.options.includeBasePath = true;
- return this;
- }
- withRelativePaths() {
- this.options.relativePaths = true;
- return this;
- }
- withDirs() {
- this.options.includeDirs = true;
- return this;
- }
- withMaxDepth(depth) {
- this.options.maxDepth = depth;
- return this;
- }
- withMaxFiles(limit) {
- this.options.maxFiles = limit;
- return this;
- }
- withFullPaths() {
- this.options.resolvePaths = true;
- this.options.includeBasePath = true;
- return this;
- }
- withErrors() {
- this.options.suppressErrors = false;
- return this;
- }
- withSymlinks({ resolvePaths = true } = {}) {
- this.options.resolveSymlinks = true;
- this.options.useRealPaths = resolvePaths;
- return this.withFullPaths();
- }
- withAbortSignal(signal) {
- this.options.signal = signal;
- return this;
- }
- normalize() {
- this.options.normalizePath = true;
- return this;
- }
- filter(predicate) {
- this.options.filters.push(predicate);
- return this;
- }
- onlyDirs() {
- this.options.excludeFiles = true;
- this.options.includeDirs = true;
- return this;
- }
- exclude(predicate) {
- this.options.exclude = predicate;
- return this;
- }
- onlyCounts() {
- this.options.onlyCounts = true;
- return this;
- }
- crawl(root) {
- return new api_builder_1.APIBuilder(root || ".", this.options);
- }
- withGlobFunction(fn) {
- // cast this since we don't have the new type params yet
- this.globFunction = fn;
- return this;
- }
- /**
- * @deprecated Pass options using the constructor instead:
- * ```ts
- * new fdir(options).crawl("/path/to/root");
- * ```
- * This method will be removed in v7.0
- */
- /* c8 ignore next 4 */
- crawlWithOptions(root, options) {
- this.options = { ...this.options, ...options };
- return new api_builder_1.APIBuilder(root || ".", this.options);
- }
- glob(...patterns) {
- if (this.globFunction) {
- return this.globWithOptions(patterns);
- }
- return this.globWithOptions(patterns, ...[{ dot: true }]);
- }
- globWithOptions(patterns, ...options) {
- const globFn = (this.globFunction || pm);
- /* c8 ignore next 5 */
- if (!globFn) {
- throw new Error('Please specify a glob function to use glob matching.');
- }
- var isMatch = this.globCache[patterns.join("\0")];
- if (!isMatch) {
- isMatch = globFn(patterns, ...options);
- this.globCache[patterns.join("\0")] = isMatch;
- }
- this.options.filters.push((path) => isMatch(path));
- return this;
- }
-}
-builder.Builder = Builder;
-
-var types = {};
-
-Object.defineProperty(types, "__esModule", { value: true });
-
-(function (exports) {
- var __createBinding = (dist && dist.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
- }) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
- }));
- var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.fdir = void 0;
- const builder_1 = builder;
- Object.defineProperty(exports, "fdir", { enumerable: true, get: function () { return builder_1.Builder; } });
- __exportStar(types, exports);
-} (dist));
-
const comma = ','.charCodeAt(0);
const semicolon = ';'.charCodeAt(0);
const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
@@ -4020,7 +1196,7 @@ function guessIndent(code) {
return new Array(min + 1).join(' ');
}
-function getRelativePath$1(from, to) {
+function getRelativePath(from, to) {
const fromParts = from.split(/[/\\]/);
const toParts = to.split(/[/\\]/);
@@ -4041,7 +1217,7 @@ function getRelativePath$1(from, to) {
const toString$1 = Object.prototype.toString;
-function isObject$3(thing) {
+function isObject$2(thing) {
return toString$1.call(thing) === '[object Object]';
}
@@ -4336,7 +1512,7 @@ class MagicString {
return {
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
sources: [
- options.source ? getRelativePath$1(options.file || '', options.source) : options.file || '',
+ options.source ? getRelativePath(options.file || '', options.source) : options.file || '',
],
sourcesContent: options.includeContent ? [this.original] : undefined,
names,
@@ -4368,7 +1544,7 @@ class MagicString {
indent(indentStr, options) {
const pattern = /^[^\r\n]/gm;
- if (isObject$3(indentStr)) {
+ if (isObject$2(indentStr)) {
options = indentStr;
indentStr = undefined;
}
@@ -5191,7 +2367,7 @@ function getStrictRequiresFilter({ strictRequires }) {
default:
if (typeof strictRequires === 'string' || Array.isArray(strictRequires)) {
return {
- strictRequiresFilter: createFilter$1(strictRequires),
+ strictRequiresFilter: createFilter$2(strictRequires),
detectCyclesAndConditional: false
};
}
@@ -5234,7 +2410,7 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
? dynamicRequireModules.delete(targetPath)
: dynamicRequireModules.set(targetPath, resolvedPath);
// eslint-disable-next-line new-cap
- for (const path of new dist.fdir()
+ for (const path of new fdir()
.withBasePath()
.withDirs()
.glob(isNegated ? pattern.substr(1) : pattern)
@@ -7100,7 +4276,7 @@ function commonjs(options = {}) {
esmExternals
} = options;
const extensions = options.extensions || ['.js'];
- const filter = createFilter$1(options.include, options.exclude);
+ const filter = createFilter$2(options.include, options.exclude);
const isPossibleCjsId = (id) => {
const extName = extname(id);
return extName === '.cjs' || (extensions.includes(extName) && filter(id));
@@ -8314,20 +5490,18 @@ function remapping(input, loader, options) {
return new SourceMap(traceMappings(tree), opts);
}
-var src$3 = {exports: {}};
-
-var browser$1 = {exports: {}};
+var node$1 = {exports: {}};
/**
* Helpers.
*/
var ms$1;
-var hasRequiredMs$1;
+var hasRequiredMs;
-function requireMs$1 () {
- if (hasRequiredMs$1) return ms$1;
- hasRequiredMs$1 = 1;
+function requireMs () {
+ if (hasRequiredMs) return ms$1;
+ hasRequiredMs = 1;
var s = 1000;
var m = s * 60;
var h = m * 60;
@@ -8507,7 +5681,7 @@ function requireCommon () {
createDebug.disable = disable;
createDebug.enable = enable;
createDebug.enabled = enabled;
- createDebug.humanize = requireMs$1();
+ createDebug.humanize = requireMs();
createDebug.destroy = destroy;
Object.keys(env).forEach(key => {
@@ -8789,576 +5963,274 @@ function requireCommon () {
return common$4;
}
-/* eslint-env browser */
-
-var hasRequiredBrowser$1;
-
-function requireBrowser$1 () {
- if (hasRequiredBrowser$1) return browser$1.exports;
- hasRequiredBrowser$1 = 1;
- (function (module, exports) {
- /**
- * This is the web browser implementation of `debug()`.
- */
-
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = localstorage();
- exports.destroy = (() => {
- let warned = false;
-
- return () => {
- if (!warned) {
- warned = true;
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
- };
- })();
-
- /**
- * Colors.
- */
-
- exports.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33'
- ];
-
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
- // eslint-disable-next-line complexity
- function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
-
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
-
- let m;
-
- // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- // eslint-disable-next-line no-return-assign
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // Is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
- // Double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
- }
-
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
- function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- args[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' + module.exports.humanize(this.diff);
-
- if (!this.useColors) {
- return;
- }
-
- const c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
-
- // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, match => {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- }
-
- /**
- * Invokes `console.debug()` when available.
- * No-op when `console.debug` is not a "function".
- * If `console.debug` is not available, falls back
- * to `console.log`.
- *
- * @api public
- */
- exports.log = console.debug || console.log || (() => {});
-
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
- function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
-
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
- function load() {
- let r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
-
- return r;
- }
-
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
- function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
-
- module.exports = requireCommon()(exports);
-
- const {formatters} = module.exports;
-
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
- formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
- };
- } (browser$1, browser$1.exports));
- return browser$1.exports;
-}
-
-var node$1 = {exports: {}};
-
/**
* Module dependencies.
*/
-var hasRequiredNode$1;
+(function (module, exports) {
+ const tty = require$$0$3;
+ const util = require$$1;
-function requireNode$1 () {
- if (hasRequiredNode$1) return node$1.exports;
- hasRequiredNode$1 = 1;
- (function (module, exports) {
- const tty = require$$0$4;
- const util = require$$1;
+ /**
+ * This is the Node.js implementation of `debug()`.
+ */
- /**
- * This is the Node.js implementation of `debug()`.
- */
+ exports.init = init;
+ exports.log = log;
+ exports.formatArgs = formatArgs;
+ exports.save = save;
+ exports.load = load;
+ exports.useColors = useColors;
+ exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+ );
- exports.init = init;
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.destroy = util.deprecate(
- () => {},
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
- );
+ /**
+ * Colors.
+ */
- /**
- * Colors.
- */
+ exports.colors = [6, 2, 3, 4, 5, 1];
- exports.colors = [6, 2, 3, 4, 5, 1];
+ try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = require('supports-color');
- try {
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
- // eslint-disable-next-line import/no-extraneous-dependencies
- const supportsColor = require('supports-color');
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+ } catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+ }
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
- exports.colors = [
- 20,
- 21,
- 26,
- 27,
- 32,
- 33,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 56,
- 57,
- 62,
- 63,
- 68,
- 69,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 92,
- 93,
- 98,
- 99,
- 112,
- 113,
- 128,
- 129,
- 134,
- 135,
- 148,
- 149,
- 160,
- 161,
- 162,
- 163,
- 164,
- 165,
- 166,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 178,
- 179,
- 184,
- 185,
- 196,
- 197,
- 198,
- 199,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 209,
- 214,
- 215,
- 220,
- 221
- ];
- }
- } catch (error) {
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+ /**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+ exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+ }).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
}
- /**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
+ obj[prop] = val;
+ return obj;
+ }, {});
- exports.inspectOpts = Object.keys(process.env).filter(key => {
- return /^debug_/i.test(key);
- }).reduce((obj, key) => {
- // Camel-case
- const prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, (_, k) => {
- return k.toUpperCase();
- });
+ /**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
- // Coerce string value into JS value
- let val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) {
- val = true;
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
- val = false;
- } else if (val === 'null') {
- val = null;
- } else {
- val = Number(val);
- }
+ function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+ }
- obj[prop] = val;
- return obj;
- }, {});
+ /**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
- /**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
+ function formatArgs(args) {
+ const {namespace: name, useColors} = this;
- function useColors() {
- return 'colors' in exports.inspectOpts ?
- Boolean(exports.inspectOpts.colors) :
- tty.isatty(process.stderr.fd);
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
}
+ }
- /**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
-
- function formatArgs(args) {
- const {namespace: name, useColors} = this;
-
- if (useColors) {
- const c = this.color;
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
-
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
- } else {
- args[0] = getDate() + name + ' ' + args[0];
- }
+ function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
}
+ return new Date().toISOString() + ' ';
+ }
- function getDate() {
- if (exports.inspectOpts.hideDate) {
- return '';
- }
- return new Date().toISOString() + ' ';
+ /**
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
+ */
+
+ function log(...args) {
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+ }
+
+ /**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+ function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
}
+ }
- /**
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
- */
+ /**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
- function log(...args) {
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+ function load() {
+ return process.env.DEBUG;
+ }
+
+ /**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+ function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
}
+ }
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
- function save(namespaces) {
- if (namespaces) {
- process.env.DEBUG = namespaces;
- } else {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- }
- }
+ module.exports = requireCommon()(exports);
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
+ const {formatters} = module.exports;
- function load() {
- return process.env.DEBUG;
- }
+ /**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
- /**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
+ formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
+ };
- function init(debug) {
- debug.inspectOpts = {};
+ /**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
- const keys = Object.keys(exports.inspectOpts);
- for (let i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
- }
+ formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+ };
+} (node$1, node$1.exports));
- module.exports = requireCommon()(exports);
-
- const {formatters} = module.exports;
-
- /**
- * Map %o to `util.inspect()`, all on a single line.
- */
-
- formatters.o = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n')
- .map(str => str.trim())
- .join(' ');
- };
-
- /**
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
- */
-
- formatters.O = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
- };
- } (node$1, node$1.exports));
- return node$1.exports;
-}
-
-/**
- * Detect Electron renderer / nwjs process, which is node, but we should
- * treat as a browser.
- */
-
-if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
- src$3.exports = requireBrowser$1();
-} else {
- src$3.exports = requireNode$1();
-}
-
-var srcExports$1 = src$3.exports;
-var debug$j = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1);
+var nodeExports$1 = node$1.exports;
+var debug$j = /*@__PURE__*/getDefaultExportFromCjs(nodeExports$1);
let pnp;
if (process.versions.pnp) {
@@ -9368,7 +6240,7 @@ if (process.versions.pnp) {
}
}
function invalidatePackageData(packageCache, pkgPath) {
- const pkgDir = normalizePath$3(path$d.dirname(pkgPath));
+ const pkgDir = normalizePath$3(path$b.dirname(pkgPath));
packageCache.forEach((pkg, cacheKey) => {
if (pkg.dir === pkgDir) {
packageCache.delete(cacheKey);
@@ -9384,7 +6256,7 @@ function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageC
considerBuiltins: false
});
if (!pkg) return null;
- const pkgData = loadPackageData(path$d.join(pkg, "package.json"));
+ const pkgData = loadPackageData(path$b.join(pkg, "package.json"));
packageCache?.set(cacheKey, pkgData);
return pkgData;
} catch {
@@ -9403,7 +6275,7 @@ function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageC
);
if (cached) return cached;
}
- const pkg = path$d.join(basedir, "node_modules", pkgName, "package.json");
+ const pkg = path$b.join(basedir, "node_modules", pkgName, "package.json");
try {
if (fs__default.existsSync(pkg)) {
const pkgPath = preserveSymlinks ? pkg : safeRealpathSync(pkg);
@@ -9422,7 +6294,7 @@ function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageC
}
} catch {
}
- const nextBasedir = path$d.dirname(basedir);
+ const nextBasedir = path$b.dirname(basedir);
if (nextBasedir === basedir) break;
basedir = nextBasedir;
}
@@ -9435,7 +6307,7 @@ function findNearestPackageData(basedir, packageCache) {
const cached = getFnpdCache(packageCache, basedir, originalBasedir);
if (cached) return cached;
}
- const pkgPath = path$d.join(basedir, "package.json");
+ const pkgPath = path$b.join(basedir, "package.json");
if (tryStatSync(pkgPath)?.isFile()) {
try {
const pkgData = loadPackageData(pkgPath);
@@ -9446,7 +6318,7 @@ function findNearestPackageData(basedir, packageCache) {
} catch {
}
}
- const nextBasedir = path$d.dirname(basedir);
+ const nextBasedir = path$b.dirname(basedir);
if (nextBasedir === basedir) break;
basedir = nextBasedir;
}
@@ -9455,13 +6327,13 @@ function findNearestPackageData(basedir, packageCache) {
function findNearestMainPackageData(basedir, packageCache) {
const nearestPackage = findNearestPackageData(basedir, packageCache);
return nearestPackage && (nearestPackage.data.name ? nearestPackage : findNearestMainPackageData(
- path$d.dirname(nearestPackage.dir),
+ path$b.dirname(nearestPackage.dir),
packageCache
));
}
function loadPackageData(pkgPath) {
const data = JSON.parse(stripBomTag(fs__default.readFileSync(pkgPath, "utf-8")));
- const pkgDir = normalizePath$3(path$d.dirname(pkgPath));
+ const pkgDir = normalizePath$3(path$b.dirname(pkgPath));
const { sideEffects } = data;
let hasSideEffects;
if (typeof sideEffects === "boolean") {
@@ -9476,7 +6348,7 @@ function loadPackageData(pkgPath) {
}
return `**/${sideEffect}`;
});
- hasSideEffects = createFilter(finalPackageSideEffects, null, {
+ hasSideEffects = createFilter$1(finalPackageSideEffects, null, {
resolve: pkgDir
});
}
@@ -9508,11 +6380,11 @@ function getResolveCacheKey(key, options) {
}
function findNearestNodeModules(basedir) {
while (basedir) {
- const pkgPath = path$d.join(basedir, "node_modules");
+ const pkgPath = path$b.join(basedir, "node_modules");
if (tryStatSync(pkgPath)?.isDirectory()) {
return pkgPath;
}
- const nextBasedir = path$d.dirname(basedir);
+ const nextBasedir = path$b.dirname(basedir);
if (nextBasedir === basedir) break;
basedir = nextBasedir;
}
@@ -9529,7 +6401,7 @@ function watchPackageDataPlugin(packageCache) {
packageCache.set = (id, pkg) => {
if (!isInNodeModules$1(pkg.dir) && !watchedDirs.has(pkg.dir)) {
watchedDirs.add(pkg.dir);
- watchFile(path$d.join(pkg.dir, "package.json"));
+ watchFile(path$b.join(pkg.dir, "package.json"));
}
return setPackageData(id, pkg);
};
@@ -9545,7 +6417,7 @@ function watchPackageDataPlugin(packageCache) {
},
watchChange(id) {
if (id.endsWith("/package.json")) {
- invalidatePackageData(packageCache, path$d.normalize(id));
+ invalidatePackageData(packageCache, path$b.normalize(id));
}
}
};
@@ -9591,11 +6463,11 @@ function getFnpdCacheKey(basedir) {
function traverseBetweenDirs(longerDir, shorterDir, cb) {
while (longerDir !== shorterDir) {
cb(longerDir);
- longerDir = path$d.dirname(longerDir);
+ longerDir = path$b.dirname(longerDir);
}
}
-const createFilter = createFilter$1;
+const createFilter$1 = createFilter$2;
const replaceSlashOrColonRE = /[/:]/g;
const replaceDotRE = /\./g;
const replaceNestedIdRE = /\s*>\s*/g;
@@ -9665,7 +6537,7 @@ function isOptimizable(id, optimizeDeps) {
const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/;
const deepImportRE = /^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//;
const _require$1 = createRequire$1(import.meta.url);
-const _dirname = path$d.dirname(fileURLToPath$1(import.meta.url));
+const _dirname = path$b.dirname(fileURLToPath$1(import.meta.url));
const rollupVersion = resolvePackageData("rollup", _dirname, true)?.data.version ?? "";
const filter = process.env.VITE_DEBUG_FILTER;
const DEBUG = process.env.DEBUG;
@@ -9716,7 +6588,7 @@ const urlCanParse = (
const isCaseInsensitiveFS = testCaseInsensitiveFS();
const VOLUME_RE = /^[A-Z]:/i;
function normalizePath$3(id) {
- return path$d.posix.normalize(isWindows$3 ? slash$1(id) : id);
+ return path$b.posix.normalize(isWindows$3 ? slash$1(id) : id);
}
function fsPathFromId(id) {
const fsPath = normalizePath$3(
@@ -9746,7 +6618,7 @@ const isJSRequest = (url) => {
if (knownJsSrcRE.test(url)) {
return true;
}
- if (!path$d.extname(url) && url[url.length - 1] !== "/") {
+ if (!path$b.extname(url) && url[url.length - 1] !== "/") {
return true;
}
return false;
@@ -9813,7 +6685,7 @@ function prettifyUrl(url, root) {
url = removeTimestampQuery(url);
const isAbsoluteFile = url.startsWith(root);
if (isAbsoluteFile || url.startsWith(FS_PREFIX)) {
- const file = path$d.posix.relative(
+ const file = path$b.posix.relative(
root,
isAbsoluteFile ? url : fsPathFromId(url)
);
@@ -9822,7 +6694,7 @@ function prettifyUrl(url, root) {
return colors$1.dim(url);
}
}
-function isObject$2(value) {
+function isObject$1(value) {
return Object.prototype.toString.call(value) === "[object Object]";
}
function isDefined(value) {
@@ -9837,10 +6709,10 @@ function tryStatSync(file) {
function lookupFile(dir, fileNames) {
while (dir) {
for (const fileName of fileNames) {
- const fullPath = path$d.join(dir, fileName);
+ const fullPath = path$b.join(dir, fileName);
if (tryStatSync(fullPath)?.isFile()) return fullPath;
}
- const parentDir = path$d.dirname(dir);
+ const parentDir = path$b.dirname(dir);
if (parentDir === dir) return;
dir = parentDir;
}
@@ -9852,7 +6724,7 @@ function isFilePathESM(filePath, packageCache) {
return false;
} else {
try {
- const pkg = findNearestPackageData(path$d.dirname(filePath), packageCache);
+ const pkg = findNearestPackageData(path$b.dirname(filePath), packageCache);
return pkg?.data.type === "module";
} catch {
return false;
@@ -9954,7 +6826,7 @@ function emptyDir(dir, skip) {
let nested = null;
if (skip?.length) {
for (const file of skip) {
- if (path$d.dirname(file) !== ".") {
+ if (path$b.dirname(file) !== ".") {
const matched = splitFirstDirRE.exec(file);
if (matched) {
nested ??= /* @__PURE__ */ new Map();
@@ -9978,20 +6850,20 @@ function emptyDir(dir, skip) {
continue;
}
if (nested?.has(file)) {
- emptyDir(path$d.resolve(dir, file), nested.get(file));
+ emptyDir(path$b.resolve(dir, file), nested.get(file));
} else {
- fs__default.rmSync(path$d.resolve(dir, file), { recursive: true, force: true });
+ fs__default.rmSync(path$b.resolve(dir, file), { recursive: true, force: true });
}
}
}
function copyDir(srcDir, destDir) {
fs__default.mkdirSync(destDir, { recursive: true });
for (const file of fs__default.readdirSync(srcDir)) {
- const srcFile = path$d.resolve(srcDir, file);
+ const srcFile = path$b.resolve(srcDir, file);
if (srcFile === destDir) {
continue;
}
- const destFile = path$d.resolve(destDir, file);
+ const destFile = path$b.resolve(destDir, file);
const stat = fs__default.statSync(srcFile);
if (stat.isDirectory()) {
copyDir(srcFile, destFile);
@@ -10023,7 +6895,7 @@ async function recursiveReaddir(dir) {
}
const files = await Promise.all(
dirents.map((dirent) => {
- const res = path$d.resolve(dir, dirent.name);
+ const res = path$b.resolve(dir, dirent.name);
return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath$3(res);
})
);
@@ -10056,7 +6928,7 @@ function optimizeSafeRealPathSync() {
return;
}
try {
- fs__default.realpathSync.native(path$d.resolve("./"));
+ fs__default.realpathSync.native(path$b.resolve("./"));
} catch (error) {
if (error.message.includes("EISDIR: illegal operation on a directory")) {
safeRealpathSync = fs__default.realpathSync;
@@ -10081,13 +6953,13 @@ function ensureWatchedFile(watcher, file, root) {
if (file && // only need to watch if out of root
!file.startsWith(withTrailingSlash(root)) && // some rollup plugins use null bytes for private resolved Ids
!file.includes("\0") && fs__default.existsSync(file)) {
- watcher.add(path$d.resolve(file));
+ watcher.add(path$b.resolve(file));
}
}
function joinSrcset(ret) {
return ret.map(({ url, descriptor }) => url + (descriptor ? ` ${descriptor}` : "")).join(", ");
}
-const imageCandidateRegex = /(?:^|\s)(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g;
+const imageCandidateRegex = /(?:^|\s|(?<=,))(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g;
const escapedSpaceCharacters = /(?: |\\t|\\n|\\f|\\r)+/g;
function parseSrcset(string) {
const matches = string.trim().replace(escapedSpaceCharacters, " ").replace(/\r?\n/, "").replace(/,\s+/, ", ").replaceAll(/\s+/g, " ").matchAll(imageCandidateRegex);
@@ -10334,7 +7206,7 @@ function deepClone(value) {
if (Array.isArray(value)) {
return value.map((v) => deepClone(v));
}
- if (isObject$2(value)) {
+ if (isObject$1(value)) {
const cloned = {};
for (const key in value) {
cloned[key] = deepClone(value[key]);
@@ -10362,7 +7234,7 @@ function mergeWithDefaultsRecursively(defaults, values) {
merged[key] = value;
continue;
}
- if (isObject$2(existing) && isObject$2(value)) {
+ if (isObject$1(existing) && isObject$1(value)) {
merged[key] = mergeWithDefaultsRecursively(existing, value);
continue;
}
@@ -10409,7 +7281,7 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
merged[key] = [...arraify(existing), ...arraify(value)];
continue;
}
- if (isObject$2(existing) && isObject$2(value)) {
+ if (isObject$1(existing) && isObject$1(value)) {
merged[key] = mergeConfigRecursively(
existing,
value,
@@ -10430,7 +7302,7 @@ function mergeConfig(defaults, overrides, isRoot = true) {
function mergeAlias(a, b) {
if (!a) return b;
if (!b) return a;
- if (isObject$2(a) && isObject$2(b)) {
+ if (isObject$1(a) && isObject$1(b)) {
return { ...a, ...b };
}
return [...normalizeAlias(b), ...normalizeAlias(a)];
@@ -10490,8 +7362,8 @@ function shouldServeFile(filePath, root) {
}
function hasCorrectCase(file, assets) {
if (file === assets) return true;
- const parent = path$d.dirname(file);
- if (fs__default.readdirSync(parent).includes(path$d.basename(file))) {
+ const parent = path$b.dirname(file);
+ if (fs__default.readdirSync(parent).includes(path$b.basename(file))) {
return hasCorrectCase(parent, assets);
}
return false;
@@ -10638,6 +7510,15 @@ const teardownSIGTERMListener = (callback) => {
}
}
};
+function getServerUrlByHost(server, host) {
+ if (typeof host !== "string") {
+ return server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0];
+ }
+ return [
+ ...server.resolvedUrls?.local ?? [],
+ ...server.resolvedUrls?.network ?? []
+ ].find((url) => url.includes(host));
+}
const LogLevels = {
silent: 0,
@@ -10785,13 +7666,13 @@ function buildReporterPlugin(config) {
};
const tty = process.stdout.isTTY && !process.env.CI;
const shouldLogInfo = LogLevels[config.logLevel || "info"] >= LogLevels.info;
- const modulesReporter = perEnvironmentState((environment) => {
+ const modulesReporter = shouldLogInfo ? perEnvironmentState((environment) => {
let hasTransformed = false;
let transformedCount = 0;
const logTransform = throttle((id) => {
writeLine(
`transforming (${transformedCount}) ${colors$1.dim(
- path$d.relative(config.root, id)
+ path$b.relative(config.root, id)
)}`
);
});
@@ -10801,30 +7682,26 @@ function buildReporterPlugin(config) {
},
register(id) {
transformedCount++;
- if (shouldLogInfo) {
- if (!tty) {
- if (!hasTransformed) {
- config.logger.info(`transforming...`);
- }
- } else {
- if (id.includes(`?`)) return;
- logTransform(id);
+ if (!tty) {
+ if (!hasTransformed) {
+ config.logger.info(`transforming...`);
}
- hasTransformed = true;
+ } else {
+ if (id.includes(`?`)) return;
+ logTransform(id);
}
+ hasTransformed = true;
},
log() {
- if (shouldLogInfo) {
- if (tty) {
- clearLine$1();
- }
- environment.logger.info(
- `${colors$1.green(`\u2713`)} ${transformedCount} modules transformed.`
- );
+ if (tty) {
+ clearLine$1();
}
+ environment.logger.info(
+ `${colors$1.green(`\u2713`)} ${transformedCount} modules transformed.`
+ );
}
};
- });
+ }) : void 0;
const chunksReporter = perEnvironmentState((environment) => {
let hasRenderedChunk = false;
let hasCompressChunk = false;
@@ -10919,15 +7796,15 @@ function buildReporterPlugin(config) {
const mapPad = displaySize(biggestMap).length;
const compressPad = displaySize(biggestCompressSize).length;
const relativeOutDir = normalizePath$3(
- path$d.relative(
+ path$b.relative(
config.root,
- path$d.resolve(
+ path$b.resolve(
config.root,
outDir ?? environment.config.build.outDir
)
)
);
- const assetsDir = path$d.join(environment.config.build.assetsDir, "/");
+ const assetsDir = path$b.join(environment.config.build.assetsDir, "/");
for (const group of groups) {
const filtered = entries.filter((e) => e.group === group.name);
if (!filtered.length) continue;
@@ -10980,15 +7857,17 @@ function buildReporterPlugin(config) {
name: "vite:reporter",
sharedDuringBuild: true,
perEnvironmentStartEndDuringDev: true,
- transform(_, id) {
- modulesReporter(this).register(id);
- },
- buildStart() {
- modulesReporter(this).reset();
- },
- buildEnd() {
- modulesReporter(this).log();
- },
+ ...modulesReporter ? {
+ transform(_, id) {
+ modulesReporter(this).register(id);
+ },
+ buildStart() {
+ modulesReporter(this).reset();
+ },
+ buildEnd() {
+ modulesReporter(this).log();
+ }
+ } : {},
renderStart() {
chunksReporter(this).reset();
},
@@ -11048,8 +7927,8 @@ function throttle(fn) {
};
}
-const POSIX_SEP_RE = new RegExp('\\' + path$d.posix.sep, 'g');
-const NATIVE_SEP_RE = new RegExp('\\' + path$d.sep, 'g');
+const POSIX_SEP_RE = new RegExp('\\' + path$b.posix.sep, 'g');
+const NATIVE_SEP_RE = new RegExp('\\' + path$b.sep, 'g');
/** @type {Map}*/
const PATTERN_REGEX_CACHE = new Map();
const GLOB_ALL_PATTERN = `**/*`;
@@ -11060,7 +7939,7 @@ const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring
const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join(
'|'
)})`;
-const IS_POSIX = path$d.posix.sep === path$d.sep;
+const IS_POSIX = path$b.posix.sep === path$b.sep;
/**
* @template T
@@ -11081,10 +7960,10 @@ function makePromise() {
* @returns {Promise}
*/
async function resolveTSConfigJson(filename, cache) {
- if (path$d.extname(filename) !== '.json') {
+ if (path$b.extname(filename) !== '.json') {
return; // ignore files that are not json
}
- const tsconfig = path$d.resolve(filename);
+ const tsconfig = path$b.resolve(filename);
if (cache && (cache.hasParseResult(tsconfig) || cache.hasParseResult(filename))) {
return tsconfig;
}
@@ -11118,7 +7997,7 @@ const isInNodeModules = IS_POSIX
*/
const posix2native = IS_POSIX
? (filename) => filename
- : (filename) => filename.replace(POSIX_SEP_RE, path$d.sep);
+ : (filename) => filename.replace(POSIX_SEP_RE, path$b.sep);
/**
* convert native separator to posix separator
@@ -11132,7 +8011,7 @@ const posix2native = IS_POSIX
*/
const native2posix = IS_POSIX
? (filename) => filename
- : (filename) => filename.replace(NATIVE_SEP_RE, path$d.posix.sep);
+ : (filename) => filename.replace(NATIVE_SEP_RE, path$b.posix.sep);
/**
* converts params to native separator, resolves path and converts native back to posix
@@ -11144,12 +8023,12 @@ const native2posix = IS_POSIX
* @returns string
*/
const resolve2posix = IS_POSIX
- ? (dir, filename) => (dir ? path$d.resolve(dir, filename) : path$d.resolve(filename))
+ ? (dir, filename) => (dir ? path$b.resolve(dir, filename) : path$b.resolve(filename))
: (dir, filename) =>
native2posix(
dir
- ? path$d.resolve(posix2native(dir), posix2native(filename))
- : path$d.resolve(posix2native(filename))
+ ? path$b.resolve(posix2native(dir), posix2native(filename))
+ : path$b.resolve(posix2native(filename))
);
/**
@@ -11159,11 +8038,11 @@ const resolve2posix = IS_POSIX
* @returns {string[]}
*/
function resolveReferencedTSConfigFiles(result, options) {
- const dir = path$d.dirname(result.tsconfigFile);
+ const dir = path$b.dirname(result.tsconfigFile);
return result.tsconfig.references.map((ref) => {
const refPath = ref.path.endsWith('.json')
? ref.path
- : path$d.join(ref.path, options?.configName ?? 'tsconfig.json');
+ : path$b.join(ref.path, options?.configName ?? 'tsconfig.json');
return resolve2posix(dir, refPath);
});
}
@@ -11198,7 +8077,7 @@ function resolveSolutionTSConfig(filename, result) {
* @returns {boolean}
*/
function isIncluded(filename, result) {
- const dir = native2posix(path$d.dirname(result.tsconfigFile));
+ const dir = native2posix(path$b.dirname(result.tsconfigFile));
const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file));
const absoluteFilename = resolve2posix(null, filename);
if (files.includes(filename)) {
@@ -11367,7 +8246,7 @@ function replaceTokens(result) {
result.tsconfig = JSON.parse(
JSON.stringify(result.tsconfig)
// replace ${configDir}
- .replaceAll(/"\${configDir}/g, `"${native2posix(path$d.dirname(result.tsconfigFile))}`)
+ .replaceAll(/"\${configDir}/g, `"${native2posix(path$b.dirname(result.tsconfigFile))}`)
);
}
}
@@ -11380,7 +8259,7 @@ function replaceTokens(result) {
* @returns {Promise} absolute path to closest tsconfig.json or null if not found
*/
async function find(filename, options) {
- let dir = path$d.dirname(path$d.resolve(filename));
+ let dir = path$b.dirname(path$b.resolve(filename));
if (isInNodeModules(dir)) {
return null;
}
@@ -11390,8 +8269,8 @@ async function find(filename, options) {
return cache.getConfigPath(dir, configName);
}
const { /** @type {Promise} */ promise, resolve, reject } = makePromise();
- if (options?.root && !path$d.isAbsolute(options.root)) {
- options.root = path$d.resolve(options.root);
+ if (options?.root && !path$b.isAbsolute(options.root)) {
+ options.root = path$b.resolve(options.root);
}
findUp(dir, { promise, resolve, reject }, options);
return promise;
@@ -11423,7 +8302,7 @@ function findUp(dir, { resolve, reject, promise }, options) {
cache.setConfigPath(dir, promise, configName);
}
}
- const tsconfig = path$d.join(dir, options?.configName ?? 'tsconfig.json');
+ const tsconfig = path$b.join(dir, options?.configName ?? 'tsconfig.json');
fs__default.stat(tsconfig, (err, stats) => {
if (stats && (stats.isFile() || stats.isFIFO())) {
resolve(tsconfig);
@@ -11431,7 +8310,7 @@ function findUp(dir, { resolve, reject, promise }, options) {
reject(err);
} else {
let parent;
- if (root === dir || (parent = path$d.dirname(dir)) === dir) {
+ if (root === dir || (parent = path$b.dirname(dir)) === dir) {
resolve(null);
} else {
findUp(parent, { promise, resolve, reject }, options);
@@ -11621,7 +8500,7 @@ const not_found_result = {
* @returns {Promise}
* @throws {TSConfckParseError}
*/
-async function parse$f(filename, options) {
+async function parse$e(filename, options) {
/** @type {import('./cache.js').TSConfckCache} */
const cache = options?.cache;
if (cache?.hasParseResult(filename)) {
@@ -11702,7 +8581,7 @@ async function parseFile$1(tsconfigFile, cache, skipCache) {
applyDefaults(parsed, tsconfigFile);
return {
tsconfigFile,
- tsconfig: normalizeTSConfig(parsed, path$d.dirname(tsconfigFile))
+ tsconfig: normalizeTSConfig(parsed, path$b.dirname(tsconfigFile))
};
})
.catch((e) => {
@@ -11731,7 +8610,7 @@ async function parseFile$1(tsconfigFile, cache, skipCache) {
function normalizeTSConfig(tsconfig, dir) {
// set baseUrl to absolute path
const baseUrl = tsconfig.compilerOptions?.baseUrl;
- if (baseUrl && !baseUrl.startsWith('${') && !path$d.isAbsolute(baseUrl)) {
+ if (baseUrl && !baseUrl.startsWith('${') && !path$b.isAbsolute(baseUrl)) {
tsconfig.compilerOptions.baseUrl = resolve2posix(dir, baseUrl);
}
return tsconfig;
@@ -11846,7 +8725,7 @@ function resolveExtends(extended, from) {
} catch (e) {
error = e;
}
- if (extended[0] !== '.' && !path$d.isAbsolute(extended)) {
+ if (extended[0] !== '.' && !path$b.isAbsolute(extended)) {
try {
return req.resolve(`${extended}/tsconfig.json`);
} catch (e) {
@@ -11884,7 +8763,7 @@ function extendTSConfig(extending, extended) {
const extendingConfig = extending.tsconfig;
const extendedConfig = extended.tsconfig;
const relativePath = native2posix(
- path$d.relative(path$d.dirname(extending.tsconfigFile), path$d.dirname(extended.tsconfigFile))
+ path$b.relative(path$b.dirname(extending.tsconfigFile), path$b.dirname(extended.tsconfigFile))
);
for (const key of Object.keys(extendedConfig).filter((key) => EXTENDABLE_KEYS.includes(key))) {
if (key === 'compilerOptions') {
@@ -11963,11 +8842,11 @@ function rebaseRelative(key, value, prependPath) {
* @returns {string}
*/
function rebasePath(value, prependPath) {
- if (path$d.isAbsolute(value) || value.startsWith('${configDir}')) {
+ if (path$b.isAbsolute(value) || value.startsWith('${configDir}')) {
return value;
} else {
// relative paths use posix syntax in tsconfig
- return path$d.posix.normalize(path$d.posix.join(prependPath, value));
+ return path$b.posix.normalize(path$b.posix.join(prependPath, value));
}
}
@@ -12032,7 +8911,7 @@ const DEFAULT_JSCONFIG_COMPILER_OPTIONS = {
* @param {string} configFileName
*/
function isJSConfig(configFileName) {
- return path$d.basename(configFileName) === 'jsconfig.json';
+ return path$b.basename(configFileName) === 'jsconfig.json';
}
/** @template T */
@@ -12176,7 +9055,7 @@ const defaultEsbuildSupported = {
async function transformWithEsbuild(code, filename, options, inMap, config, watcher) {
let loader = options?.loader;
if (!loader) {
- const ext = path$d.extname(validExtensionRE.test(filename) ? filename : cleanUrl(filename)).slice(1);
+ const ext = path$b.extname(validExtensionRE.test(filename) ? filename : cleanUrl(filename)).slice(1);
if (ext === "cjs" || ext === "mjs") {
loader = "js";
} else if (ext === "cts" || ext === "mts") {
@@ -12287,7 +9166,7 @@ async function transformWithEsbuild(code, filename, options, inMap, config, watc
function esbuildPlugin(config) {
const options = config.esbuild;
const { jsxInject, include, exclude, ...esbuildTransformOptions } = options;
- const filter = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/);
+ const filter = createFilter$1(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/);
const transformOptions = {
target: "esnext",
charset: "utf8",
@@ -12475,7 +9354,7 @@ function getTSConfckCache(config) {
return cache;
}
async function loadTsconfigJsonForFile(filename, config) {
- const { tsconfig, tsconfigFile } = await parse$f(filename, {
+ const { tsconfig, tsconfigFile } = await parse$e(filename, {
cache: getTSConfckCache(config)});
return { tsconfigFile, tsconfig };
}
@@ -13430,9 +10309,9 @@ function checkPublicFile(url, config) {
const fileName = cleanUrl(url);
const publicFiles = getPublicFiles(config);
if (publicFiles) {
- return publicFiles.has(fileName) ? normalizePath$3(path$d.join(publicDir, fileName)) : void 0;
+ return publicFiles.has(fileName) ? normalizePath$3(path$b.join(publicDir, fileName)) : void 0;
}
- const publicFile = normalizePath$3(path$d.join(publicDir, fileName));
+ const publicFile = normalizePath$3(path$b.join(publicDir, fileName));
if (!publicFile.startsWith(withTrailingSlash(publicDir))) {
return;
}
@@ -13508,44 +10387,48 @@ function assetPlugin(config) {
assetCache.set(this.environment, /* @__PURE__ */ new Map());
cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set());
},
- resolveId(id) {
- if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
- return;
- }
- const publicFile = checkPublicFile(id, config);
- if (publicFile) {
- return id;
- }
- },
- async load(id) {
- if (id[0] === "\0") {
- return;
- }
- if (rawRE$1.test(id)) {
- const file = checkPublicFile(id, config) || cleanUrl(id);
- this.addWatchFile(file);
- return `export default ${JSON.stringify(
- await fsp.readFile(file, "utf-8")
- )}`;
- }
- if (!urlRE$1.test(id) && !config.assetsInclude(cleanUrl(id))) {
- return;
- }
- id = removeUrlQuery(id);
- let url = await fileToUrl$1(this, id);
- if (!url.startsWith("data:") && this.environment.mode === "dev") {
- const mod = this.environment.moduleGraph.getModuleById(id);
- if (mod && mod.lastHMRTimestamp > 0) {
- url = injectQuery(url, `t=${mod.lastHMRTimestamp}`);
+ resolveId: {
+ handler(id) {
+ if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
+ return;
+ }
+ const publicFile = checkPublicFile(id, config);
+ if (publicFile) {
+ return id;
}
}
- return {
- code: `export default ${JSON.stringify(encodeURIPath(url))}`,
- // Force rollup to keep this module from being shared between other entry points if it's an entrypoint.
- // If the resulting chunk is empty, it will be removed in generateBundle.
- moduleSideEffects: config.command === "build" && this.getModuleInfo(id)?.isEntry ? "no-treeshake" : false,
- meta: config.command === "build" ? { "vite:asset": true } : void 0
- };
+ },
+ load: {
+ async handler(id) {
+ if (id[0] === "\0") {
+ return;
+ }
+ if (rawRE$1.test(id)) {
+ const file = checkPublicFile(id, config) || cleanUrl(id);
+ this.addWatchFile(file);
+ return `export default ${JSON.stringify(
+ await fsp.readFile(file, "utf-8")
+ )}`;
+ }
+ if (!urlRE$1.test(id) && !config.assetsInclude(cleanUrl(id))) {
+ return;
+ }
+ id = removeUrlQuery(id);
+ let url = await fileToUrl$1(this, id);
+ if (!url.startsWith("data:") && this.environment.mode === "dev") {
+ const mod = this.environment.moduleGraph.getModuleById(id);
+ if (mod && mod.lastHMRTimestamp > 0) {
+ url = injectQuery(url, `t=${mod.lastHMRTimestamp}`);
+ }
+ }
+ return {
+ code: `export default ${JSON.stringify(encodeURIPath(url))}`,
+ // Force rollup to keep this module from being shared between other entry points if it's an entrypoint.
+ // If the resulting chunk is empty, it will be removed in generateBundle.
+ moduleSideEffects: config.command === "build" && this.getModuleInfo(id)?.isEntry ? "no-treeshake" : false,
+ meta: config.command === "build" ? { "vite:asset": true } : void 0
+ };
+ }
},
renderChunk(code, chunk, opts) {
const s = renderAssetUrlInJS(this, chunk, opts, code);
@@ -13559,10 +10442,27 @@ function assetPlugin(config) {
}
},
generateBundle(_, bundle) {
+ let importedFiles;
for (const file in bundle) {
const chunk = bundle[file];
if (chunk.type === "chunk" && chunk.isEntry && chunk.moduleIds.length === 1 && config.assetsInclude(chunk.moduleIds[0]) && this.getModuleInfo(chunk.moduleIds[0])?.meta["vite:asset"]) {
- delete bundle[file];
+ if (!importedFiles) {
+ importedFiles = /* @__PURE__ */ new Set();
+ for (const file2 in bundle) {
+ const chunk2 = bundle[file2];
+ if (chunk2.type === "chunk") {
+ for (const importedFile of chunk2.imports) {
+ importedFiles.add(importedFile);
+ }
+ for (const importedFile of chunk2.dynamicImports) {
+ importedFiles.add(importedFile);
+ }
+ }
+ }
+ }
+ if (!importedFiles.has(file)) {
+ delete bundle[file];
+ }
}
}
if (config.command === "build" && !this.environment.config.build.emitAssets) {
@@ -13603,9 +10503,9 @@ async function fileToDevUrl(environment, id, skipBase = false) {
if (publicFile) {
rtn = id;
} else if (id.startsWith(withTrailingSlash(config.root))) {
- rtn = "/" + path$d.posix.relative(config.root, id);
+ rtn = "/" + path$b.posix.relative(config.root, id);
} else {
- rtn = path$d.posix.join(FS_PREFIX, id);
+ rtn = path$b.posix.join(FS_PREFIX, id);
}
if (skipBase) {
return rtn;
@@ -13663,12 +10563,12 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
url = assetToDataURL(environment, file, content);
} else {
const originalFileName = normalizePath$3(
- path$d.relative(environment.config.root, file)
+ path$b.relative(environment.config.root, file)
);
const referenceId = pluginContext.emitFile({
type: "asset",
// Ignore directory structure for asset file names
- name: path$d.basename(file),
+ name: path$b.basename(file),
originalFileName,
source: content
});
@@ -13682,7 +10582,7 @@ async function urlToBuiltUrl(pluginContext, url, importer, forceInline) {
if (checkPublicFile(url, topLevelConfig)) {
return publicFileToBuiltUrl(url, topLevelConfig);
}
- const file = url[0] === "/" ? path$d.join(topLevelConfig.root, url) : path$d.join(path$d.dirname(importer), url);
+ const file = url[0] === "/" ? path$b.join(topLevelConfig.root, url) : path$b.join(path$b.dirname(importer), url);
return fileToBuiltUrl(
pluginContext,
file,
@@ -13762,7 +10662,7 @@ function manifestPlugin() {
const { root } = this.environment.config;
const buildOptions = this.environment.config.build;
function getChunkName(chunk) {
- return getChunkOriginalFileName(chunk, root, format) ?? `_${path$d.basename(chunk.fileName)}`;
+ return getChunkOriginalFileName(chunk, root, format) ?? `_${path$b.basename(chunk.fileName)}`;
}
function getInternalImports(imports) {
const filteredImports = [];
@@ -13830,7 +10730,7 @@ function manifestPlugin() {
if (chunk.type === "chunk") {
manifest[getChunkName(chunk)] = createChunk(chunk);
} else if (chunk.type === "asset" && chunk.names.length > 0) {
- const src = chunk.originalFileNames.length > 0 ? chunk.originalFileNames[0] : `_${path$d.basename(chunk.fileName)}`;
+ const src = chunk.originalFileNames.length > 0 ? chunk.originalFileNames[0] : `_${path$b.basename(chunk.fileName)}`;
const isEntry = entryCssAssetFileNames.has(chunk.fileName);
const asset = createAsset(chunk, src, isEntry);
const file2 = manifest[src]?.file;
@@ -13860,9 +10760,9 @@ function manifestPlugin() {
}
function getChunkOriginalFileName(chunk, root, format) {
if (chunk.facadeModuleId) {
- let name = normalizePath$3(path$d.relative(root, chunk.facadeModuleId));
+ let name = normalizePath$3(path$b.relative(root, chunk.facadeModuleId));
if (format === "system" && !chunk.name.includes("-legacy")) {
- const ext = path$d.extname(name);
+ const ext = path$b.extname(name);
const endPos = ext.length !== 0 ? -ext.length : void 0;
name = `${name.slice(0, endPos)}-legacy${ext}`;
}
@@ -13912,7 +10812,7 @@ function dataURIPlugin() {
}
/* es-module-lexer 1.6.0 */
-var ImportType;!function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase";}(ImportType||(ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,w=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;w>0&&C.memory.grow(Math.ceil(w/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),w=C.ss(),K=C.se();let D;C.ip()&&(D=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),o.push({n:D,t:B,s:A,e:Q,ss:w,se:K,d:I,a:g});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),w=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===w||"'"===w?k(I):I,ln:'"'===o||"'"===o?k(K):K});}function k(A){try{return (0, eval)(A)}catch(A){}}return [o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C{return A="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","undefined"!=typeof Buffer?Buffer.from(A,"base64"):Uint8Array.from(atob(A),(A=>A.charCodeAt(0)));var A;};const init=WebAssembly.compile(E()).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));
+var ImportType;!function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase";}(ImportType||(ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$d(E,g="@"){if(!C)return init.then((()=>parse$d(E)));const I=E.length+1,w=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;w>0&&C.memory.grow(Math.ceil(w/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),w=C.ss(),K=C.se();let D;C.ip()&&(D=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),o.push({n:D,t:B,s:A,e:Q,ss:w,se:K,d:I,a:g});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),w=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===w||"'"===w?k(I):I,ln:'"'===o||"'"===o?k(K):K});}function k(A){try{return (0, eval)(A)}catch(A){}}return [o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C{return A="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","undefined"!=typeof Buffer?Buffer.from(A,"base64"):Uint8Array.from(atob(A),(A=>A.charCodeAt(0)));var A;};const init=WebAssembly.compile(E()).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));
var convertSourceMap$1 = {};
@@ -14161,7 +11061,7 @@ async function computeSourceRoute(map, file) {
let sourceRoot;
try {
sourceRoot = await fsp.realpath(
- path$d.resolve(path$d.dirname(file), map.sourceRoot || "")
+ path$b.resolve(path$b.dirname(file), map.sourceRoot || "")
);
} catch {
}
@@ -14181,7 +11081,7 @@ async function injectSourcesContent(map, file, logger) {
const sourceRoot = await sourceRootPromise;
let resolvedSourcePath = cleanUrl(decodeURI(sourcePath));
if (sourceRoot) {
- resolvedSourcePath = path$d.resolve(sourceRoot, resolvedSourcePath);
+ resolvedSourcePath = path$b.resolve(sourceRoot, resolvedSourcePath);
}
sourcesContent[index] = await fsp.readFile(resolvedSourcePath, "utf-8").catch(() => {
missingSources.push(resolvedSourcePath);
@@ -14230,7 +11130,7 @@ function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logge
const sourcePath = map.sources[sourcesIndex];
if (!sourcePath) continue;
const ignoreList = sourcemapIgnoreList(
- path$d.isAbsolute(sourcePath) ? sourcePath : path$d.resolve(path$d.dirname(sourcemapPath), sourcePath),
+ path$b.isAbsolute(sourcePath) ? sourcePath : path$b.resolve(path$b.dirname(sourcemapPath), sourcePath),
sourcemapPath
);
if (logger && typeof ignoreList !== "boolean") {
@@ -14259,17 +11159,17 @@ async function extractSourcemapFromFile(code, filePath) {
function createConvertSourceMapReadMap(originalFileName) {
return (filename) => {
return fsp.readFile(
- path$d.resolve(path$d.dirname(originalFileName), filename),
+ path$b.resolve(path$b.dirname(originalFileName), filename),
"utf-8"
);
};
}
-var src$2 = {};
+var src$1 = {};
// @ts-check
-const path$b = require$$0$2;
-const fs$7 = require$$0$3;
+const path$9 = require$$0$2;
+const fs$7 = require$$0$4;
const os$2 = require$$2;
const url$4 = require$$0$5;
@@ -14304,7 +11204,7 @@ function getDefaultSearchPlaces(name, sync) {
* And on Windows, this will never happen. ('C:\build' -> 'C:')
*/
function parentDir(p) {
- return path$b.dirname(p) || path$b.sep;
+ return path$9.dirname(p) || path$9.sep;
}
/** @type {import('./index').LoaderSync} */
@@ -14319,7 +11219,7 @@ const defaultLoadersSync = Object.freeze({
'.cjs': requireFunc,
noExt: jsonLoader,
});
-src$2.defaultLoadersSync = defaultLoadersSync;
+src$1.defaultLoadersSync = defaultLoadersSync;
/** @type {import('./index').Loader} */
const dynamicImport = async id => {
@@ -14354,7 +11254,7 @@ const defaultLoaders = Object.freeze({
'.json': jsonLoader,
noExt: jsonLoader,
});
-src$2.defaultLoaders = defaultLoaders;
+src$1.defaultLoaders = defaultLoaders;
/**
* @param {string} name
@@ -14378,7 +11278,7 @@ function getOptions(name, options, sync) {
},
};
conf.searchPlaces.forEach(place => {
- const key = path$b.extname(place) || 'noExt';
+ const key = path$9.extname(place) || 'noExt';
const loader = conf.loaders[key];
if (!loader) {
throw new Error(`Missing loader for extension "${place}"`);
@@ -14423,7 +11323,7 @@ const makeEmplace = enableCache => (c, filepath, res) => {
};
/** @type {import('./index').lilconfig} */
-src$2.lilconfig = function lilconfig(name, options) {
+src$1.lilconfig = function lilconfig(name, options) {
const {
ignoreEmptySearchPlaces,
loaders,
@@ -14459,14 +11359,14 @@ src$2.lilconfig = function lilconfig(name, options) {
}
for (const searchPlace of searchPlaces) {
- const filepath = path$b.join(dir, searchPlace);
+ const filepath = path$9.join(dir, searchPlace);
try {
await fs$7.promises.access(filepath);
} catch {
continue;
}
const content = String(await fsReadFileAsync(filepath));
- const loaderKey = path$b.extname(searchPlace) || 'noExt';
+ const loaderKey = path$9.extname(searchPlace) || 'noExt';
const loader = loaders[loaderKey];
// handle package.json
@@ -14514,11 +11414,11 @@ src$2.lilconfig = function lilconfig(name, options) {
},
async load(filepath) {
validateFilePath(filepath);
- const absPath = path$b.resolve(process.cwd(), filepath);
+ const absPath = path$9.resolve(process.cwd(), filepath);
if (cache && loadCache.has(absPath)) {
return loadCache.get(absPath);
}
- const {base, ext} = path$b.parse(absPath);
+ const {base, ext} = path$9.parse(absPath);
const loaderKey = ext || 'noExt';
const loader = loaders[loaderKey];
validateLoader(loader, loaderKey);
@@ -14578,7 +11478,7 @@ src$2.lilconfig = function lilconfig(name, options) {
};
/** @type {import('./index').lilconfigSync} */
-src$2.lilconfigSync = function lilconfigSync(name, options) {
+src$1.lilconfigSync = function lilconfigSync(name, options) {
const {
ignoreEmptySearchPlaces,
loaders,
@@ -14614,13 +11514,13 @@ src$2.lilconfigSync = function lilconfigSync(name, options) {
}
for (const searchPlace of searchPlaces) {
- const filepath = path$b.join(dir, searchPlace);
+ const filepath = path$9.join(dir, searchPlace);
try {
fs$7.accessSync(filepath);
} catch {
continue;
}
- const loaderKey = path$b.extname(searchPlace) || 'noExt';
+ const loaderKey = path$9.extname(searchPlace) || 'noExt';
const loader = loaders[loaderKey];
const content = String(fs$7.readFileSync(filepath));
@@ -14669,11 +11569,11 @@ src$2.lilconfigSync = function lilconfigSync(name, options) {
},
load(filepath) {
validateFilePath(filepath);
- const absPath = path$b.resolve(process.cwd(), filepath);
+ const absPath = path$9.resolve(process.cwd(), filepath);
if (cache && loadCache.has(absPath)) {
return loadCache.get(absPath);
}
- const {base, ext} = path$b.parse(absPath);
+ const {base, ext} = path$9.parse(absPath);
const loaderKey = ext || 'noExt';
const loader = loaders[loaderKey];
validateLoader(loader, loaderKey);
@@ -14931,9 +11831,9 @@ async function plugins(config, file) {
var plugins_1 = plugins;
// @ts-check
-const { resolve } = path$d;
+const { resolve } = path$b;
-const config$1 = src$2;
+const config$1 = src$1;
const loadOptions = options_1;
const loadPlugins = plugins_1;
@@ -15107,280 +12007,9 @@ function rc(ctx, path, options) {
* @requires ./options
* @requires ./plugins
*/
-var src$1 = rc;
+var src = rc;
-var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1);
-
-// src/index.ts
-var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
-function getPartialMatcher(patterns, options) {
- const patternsCount = patterns.length;
- const patternsParts = Array(patternsCount);
- const regexes = Array(patternsCount);
- for (let i = 0; i < patternsCount; i++) {
- const parts = splitPattern(patterns[i]);
- patternsParts[i] = parts;
- const partsCount = parts.length;
- const partRegexes = Array(partsCount);
- for (let j = 0; j < partsCount; j++) {
- partRegexes[j] = picomatch$5.makeRe(parts[j], options);
- }
- regexes[i] = partRegexes;
- }
- return (input) => {
- const inputParts = input.split("/");
- if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) {
- return true;
- }
- for (let i = 0; i < patterns.length; i++) {
- const patternParts = patternsParts[i];
- const regex = regexes[i];
- const inputPatternCount = inputParts.length;
- const minParts = Math.min(inputPatternCount, patternParts.length);
- let j = 0;
- while (j < minParts) {
- const part = patternParts[j];
- if (part.includes("/")) {
- return true;
- }
- const match = regex[j].test(inputParts[j]);
- if (!match) {
- break;
- }
- if (part === "**") {
- return true;
- }
- j++;
- }
- if (j === inputPatternCount) {
- return true;
- }
- }
- return false;
- };
-}
-var splitPatternOptions = { parts: true };
-function splitPattern(path2) {
- var _a;
- const result = picomatch$5.scan(path2, splitPatternOptions);
- return ((_a = result.parts) == null ? void 0 : _a.length) ? result.parts : [path2];
-}
-var isWin$2 = process.platform === "win32";
-var POSIX_UNESCAPED_GLOB_SYMBOLS = /(? path2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
-var escapeWin32Path = (path2) => path2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
-var escapePath = isWin$2 ? escapeWin32Path : escapePosixPath;
-function isDynamicPattern(pattern, options) {
- const scan = picomatch$5.scan(pattern);
- return scan.isGlob || scan.negated;
-}
-function log(...tasks) {
- console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
-}
-
-// src/index.ts
-var PARENT_DIRECTORY = /^(\/?\.\.)+/;
-var ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
-var BACKSLASHES = /\\/g;
-function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
- var _a;
- let result = pattern;
- if (pattern.endsWith("/")) {
- result = pattern.slice(0, -1);
- }
- if (!result.endsWith("*") && expandDirectories) {
- result += "/**";
- }
- if (require$$0$2.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) {
- result = posix.relative(escapePath(cwd), result);
- } else {
- result = posix.normalize(result);
- }
- const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
- if (parentDirectoryMatch == null ? void 0 : parentDirectoryMatch[0]) {
- const potentialRoot = posix.join(cwd, parentDirectoryMatch[0]);
- if (props.root.length > potentialRoot.length) {
- props.root = potentialRoot;
- props.depthOffset = -(parentDirectoryMatch[0].length + 1) / 3;
- }
- } else if (!isIgnore && props.depthOffset >= 0) {
- const parts = splitPattern(result);
- (_a = props.commonPath) != null ? _a : props.commonPath = parts;
- const newCommonPath = [];
- const length = Math.min(props.commonPath.length, parts.length);
- for (let i = 0; i < length; i++) {
- const part = parts[i];
- if (part === "**" && !parts[i + 1]) {
- newCommonPath.pop();
- break;
- }
- if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) {
- break;
- }
- newCommonPath.push(part);
- }
- props.depthOffset = newCommonPath.length;
- props.commonPath = newCommonPath;
- props.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd;
- }
- return result;
-}
-function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
- if (typeof patterns === "string") {
- patterns = [patterns];
- } else if (!patterns) {
- patterns = ["**/*"];
- }
- if (typeof ignore === "string") {
- ignore = [ignore];
- }
- const matchPatterns = [];
- const ignorePatterns = [];
- for (const pattern of ignore) {
- if (!pattern) {
- continue;
- }
- if (pattern[0] !== "!" || pattern[1] === "(") {
- ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));
- }
- }
- for (const pattern of patterns) {
- if (!pattern) {
- continue;
- }
- if (pattern[0] !== "!" || pattern[1] === "(") {
- matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));
- } else if (pattern[1] !== "!" || pattern[2] === "(") {
- ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));
- }
- }
- return { match: matchPatterns, ignore: ignorePatterns };
-}
-function getRelativePath(path2, cwd, root) {
- return posix.relative(cwd, `${root}/${path2}`) || ".";
-}
-function processPath(path2, cwd, root, isDirectory, absolute) {
- const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2;
- if (root === cwd) {
- return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
- }
- return getRelativePath(relativePath, cwd, root);
-}
-function formatPaths(paths, cwd, root) {
- for (let i = paths.length - 1; i >= 0; i--) {
- const path2 = paths[i];
- paths[i] = getRelativePath(path2, cwd, root) + (!path2 || path2.endsWith("/") ? "/" : "");
- }
- return paths;
-}
-function crawl(options, cwd, sync) {
- if (process.env.TINYGLOBBY_DEBUG) {
- options.debug = true;
- }
- if (options.debug) {
- log("globbing with options:", options, "cwd:", cwd);
- }
- if (Array.isArray(options.patterns) && options.patterns.length === 0) {
- return sync ? [] : Promise.resolve([]);
- }
- const props = {
- root: cwd,
- commonPath: null,
- depthOffset: 0
- };
- const processed = processPatterns(options, cwd, props);
- const nocase = options.caseSensitiveMatch === false;
- if (options.debug) {
- log("internal processing patterns:", processed);
- }
- const matcher = picomatch$5(processed.match, {
- dot: options.dot,
- nocase,
- ignore: processed.ignore
- });
- const ignore = picomatch$5(processed.ignore, {
- dot: options.dot,
- nocase
- });
- const partialMatcher = getPartialMatcher(processed.match, {
- dot: options.dot,
- nocase
- });
- const fdirOptions = {
- // use relative paths in the matcher
- filters: [
- options.debug ? (p, isDirectory) => {
- const path2 = processPath(p, cwd, props.root, isDirectory, options.absolute);
- const matches = matcher(path2);
- if (matches) {
- log(`matched ${path2}`);
- }
- return matches;
- } : (p, isDirectory) => matcher(processPath(p, cwd, props.root, isDirectory, options.absolute))
- ],
- exclude: options.debug ? (_, p) => {
- const relativePath = processPath(p, cwd, props.root, true, true);
- const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
- if (skipped) {
- log(`skipped ${p}`);
- } else {
- log(`crawling ${p}`);
- }
- return skipped;
- } : (_, p) => {
- const relativePath = processPath(p, cwd, props.root, true, true);
- return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
- },
- pathSeparator: "/",
- relativePaths: true,
- resolveSymlinks: true
- };
- if (options.deep) {
- fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
- }
- if (options.absolute) {
- fdirOptions.relativePaths = false;
- fdirOptions.resolvePaths = true;
- fdirOptions.includeBasePath = true;
- }
- if (options.followSymbolicLinks === false) {
- fdirOptions.resolveSymlinks = false;
- fdirOptions.excludeSymlinks = true;
- }
- if (options.onlyDirectories) {
- fdirOptions.excludeFiles = true;
- fdirOptions.includeDirs = true;
- } else if (options.onlyFiles === false) {
- fdirOptions.includeDirs = true;
- }
- props.root = props.root.replace(BACKSLASHES, "");
- const root = props.root;
- if (options.debug) {
- log("internal properties:", props);
- }
- const api = new dist.fdir(fdirOptions).crawl(root);
- if (cwd === root || options.absolute) {
- return sync ? api.sync() : api.withPromise();
- }
- return sync ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
-}
-async function glob(patternsOrOptions, options) {
- if (patternsOrOptions && (options == null ? void 0 : options.patterns)) {
- throw new Error("Cannot pass patterns as both an argument and an option");
- }
- const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions;
- const cwd = opts.cwd ? require$$0$2.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
- return crawl(opts, cwd, false);
-}
-function globSync(patternsOrOptions, options) {
- if (patternsOrOptions && (options == null ? void 0 : options.patterns)) {
- throw new Error("Cannot pass patterns as both an argument and an option");
- }
- const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions;
- const cwd = opts.cwd ? require$$0$2.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
- return crawl(opts, cwd, true);
-}
+var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src);
function matches$1(pattern, importee) {
if (pattern instanceof RegExp) {
@@ -15474,72 +12103,78 @@ const jsonLangs = `\\.(?:json|json5)(?:$|\\?)`;
const jsonLangRE = new RegExp(jsonLangs);
const isJSONRequest = (request) => jsonLangRE.test(request);
function jsonPlugin(options, isBuild) {
- return {
+ const plugin = {
name: "vite:json",
- transform(json, id) {
- if (!jsonExtRE.test(id)) return null;
- if (SPECIAL_QUERY_RE.test(id)) return null;
- if (inlineRE$3.test(id) || noInlineRE.test(id)) {
- this.warn(
- `
+ transform: {
+ handler(json, id) {
+ if (!jsonExtRE.test(id)) return null;
+ if (SPECIAL_QUERY_RE.test(id)) return null;
+ if (inlineRE$3.test(id) || noInlineRE.test(id)) {
+ this.warn(
+ `
Using ?inline or ?no-inline for JSON imports will have no effect.
Please use ?url&inline or ?url&no-inline to control JSON file inlining behavior.
`
- );
- }
- json = stripBomTag(json);
- try {
- if (options.stringify !== false) {
- if (options.namedExports && jsonObjRE.test(json)) {
- const parsed = JSON.parse(json);
- const keys = Object.keys(parsed);
- let code = "";
- let defaultObjectCode = "{\n";
- for (const key of keys) {
- if (key === makeLegalIdentifier(key)) {
- code += `export const ${key} = ${serializeValue(parsed[key])};
-`;
- defaultObjectCode += ` ${key},
-`;
- } else {
- defaultObjectCode += ` ${JSON.stringify(key)}: ${serializeValue(parsed[key])},
-`;
- }
- }
- defaultObjectCode += "}";
- code += `export default ${defaultObjectCode};
-`;
- return {
- code,
- map: { mappings: "" }
- };
- }
- if (options.stringify === true || // use 10kB as a threshold for 'auto'
- // https://v8.dev/blog/cost-of-javascript-2019#:~:text=A%20good%20rule%20of%20thumb%20is%20to%20apply%20this%20technique%20for%20objects%20of%2010%20kB%20or%20larger
- json.length > 10 * 1e3) {
- if (isBuild) {
- json = JSON.stringify(JSON.parse(json));
- }
- return {
- code: `export default /* #__PURE__ */ JSON.parse(${JSON.stringify(json)})`,
- map: { mappings: "" }
- };
- }
+ );
+ }
+ json = stripBomTag(json);
+ try {
+ if (options.stringify !== false) {
+ if (options.namedExports && jsonObjRE.test(json)) {
+ const parsed = JSON.parse(json);
+ const keys = Object.keys(parsed);
+ let code = "";
+ let defaultObjectCode = "{\n";
+ for (const key of keys) {
+ if (key === makeLegalIdentifier(key)) {
+ code += `export const ${key} = ${serializeValue(parsed[key])};
+`;
+ defaultObjectCode += ` ${key},
+`;
+ } else {
+ defaultObjectCode += ` ${JSON.stringify(key)}: ${serializeValue(parsed[key])},
+`;
+ }
+ }
+ defaultObjectCode += "}";
+ code += `export default ${defaultObjectCode};
+`;
+ return {
+ code,
+ map: { mappings: "" }
+ };
+ }
+ if (options.stringify === true || // use 10kB as a threshold for 'auto'
+ // https://v8.dev/blog/cost-of-javascript-2019#:~:text=A%20good%20rule%20of%20thumb%20is%20to%20apply%20this%20technique%20for%20objects%20of%2010%20kB%20or%20larger
+ json.length > 10 * 1e3) {
+ if (isBuild) {
+ json = JSON.stringify(JSON.parse(json));
+ }
+ return {
+ code: `export default /* #__PURE__ */ JSON.parse(${JSON.stringify(json)})`,
+ map: { mappings: "" }
+ };
+ }
+ }
+ return {
+ code: dataToEsm(JSON.parse(json), {
+ preferConst: true,
+ namedExports: options.namedExports
+ }),
+ map: { mappings: "" }
+ };
+ } catch (e) {
+ const position = extractJsonErrorPosition(e.message, json.length);
+ const msg = position ? `, invalid JSON syntax found at position ${position}` : `.`;
+ this.error(`Failed to parse JSON file` + msg, position);
}
- return {
- code: dataToEsm(JSON.parse(json), {
- preferConst: true,
- namedExports: options.namedExports
- }),
- map: { mappings: "" }
- };
- } catch (e) {
- const position = extractJsonErrorPosition(e.message, json.length);
- const msg = position ? `, invalid JSON syntax found at position ${position}` : `.`;
- this.error(`Failed to parse JSON file` + msg, position);
}
}
};
+ const handler = plugin.transform.handler;
+ plugin.transform = handler;
+ plugin.transform.handler = handler;
+ return plugin;
}
function serializeValue(value) {
const valueAsString = JSON.stringify(value);
@@ -16210,7 +12845,7 @@ function esbuildDepPlugin(environment, qualified, external) {
};
}
return {
- path: path$d.resolve(resolved)
+ path: path$b.resolve(resolved)
};
};
return {
@@ -16993,35 +13628,37 @@ function importGlobPlugin(config) {
buildStart() {
importGlobMaps.clear();
},
- async transform(code, id) {
- if (!code.includes("import.meta.glob")) return;
- const result = await transformGlobImport(
- code,
- id,
- config.root,
- (im, _, options) => this.resolve(im, id, options).then((i) => i?.id || im),
- config.experimental.importGlobRestoreExtension,
- config.logger
- );
- if (result) {
- const allGlobs = result.matches.map((i) => i.globsResolved);
- if (!importGlobMaps.has(this.environment)) {
- importGlobMaps.set(this.environment, /* @__PURE__ */ new Map());
- }
- const globMatchers = allGlobs.map((globs) => {
- const affirmed = [];
- const negated = [];
- for (const glob2 of globs) {
- (glob2[0] === "!" ? negated : affirmed).push(glob2);
+ transform: {
+ async handler(code, id) {
+ if (!code.includes("import.meta.glob")) return;
+ const result = await transformGlobImport(
+ code,
+ id,
+ config.root,
+ (im, _, options) => this.resolve(im, id, options).then((i) => i?.id || im),
+ config.experimental.importGlobRestoreExtension,
+ config.logger
+ );
+ if (result) {
+ const allGlobs = result.matches.map((i) => i.globsResolved);
+ if (!importGlobMaps.has(this.environment)) {
+ importGlobMaps.set(this.environment, /* @__PURE__ */ new Map());
}
- const affirmedMatcher = picomatch$5(affirmed);
- const negatedMatcher = picomatch$5(negated);
- return (file) => {
- return (affirmed.length === 0 || affirmedMatcher(file)) && !(negated.length > 0 && negatedMatcher(file));
- };
- });
- importGlobMaps.get(this.environment).set(id, globMatchers);
- return transformStableResult(result.s, id, config);
+ const globMatchers = allGlobs.map((globs) => {
+ const affirmed = [];
+ const negated = [];
+ for (const glob2 of globs) {
+ (glob2[0] === "!" ? negated : affirmed).push(glob2);
+ }
+ const affirmedMatcher = picomatch$2(affirmed);
+ const negatedMatcher = picomatch$2(negated);
+ return (file) => {
+ return (affirmed.length === 0 || affirmedMatcher(file)) && !(negated.length > 0 && negatedMatcher(file));
+ };
+ });
+ importGlobMaps.get(this.environment).set(id, globMatchers);
+ return transformStableResult(result.s, id, config);
+ }
}
},
hotUpdate({ type, file, modules: oldModules }) {
@@ -17402,7 +14039,7 @@ async function toAbsoluteGlob(glob2, root, importer, resolveId) {
}
function getCommonBase(globsResolved) {
const bases = globsResolved.filter((g) => g[0] !== "!").map((glob2) => {
- let { base } = picomatch$5.scan(glob2);
+ let { base } = picomatch$2.scan(glob2);
if (posix$1.basename(base).includes(".")) base = posix$1.dirname(base);
return base;
});
@@ -17592,7 +14229,7 @@ async function computeEntries(environment) {
entries = [await resolvePath(buildInput)];
} else if (Array.isArray(buildInput)) {
entries = await Promise.all(buildInput.map(resolvePath));
- } else if (isObject$2(buildInput)) {
+ } else if (isObject$1(buildInput)) {
entries = await Promise.all(Object.values(buildInput).map(resolvePath));
} else {
throw new Error("invalid rollupOptions.input value.");
@@ -17612,7 +14249,7 @@ async function prepareEsbuildScanner(environment, entries, deps, missing, scanCo
let tsconfigRaw = esbuildOptions.tsconfigRaw;
if (!tsconfigRaw && !esbuildOptions.tsconfig) {
const { tsconfig } = await loadTsconfigJsonForFile(
- path$d.join(environment.config.root, "_dummy.js")
+ path$b.join(environment.config.root, "_dummy.js")
);
if (tsconfig.compilerOptions?.experimentalDecorators) {
tsconfigRaw = { compilerOptions: { experimentalDecorators: true } };
@@ -17642,7 +14279,7 @@ function globEntries(pattern, environment) {
const resolvedPatterns = arraify(pattern);
if (resolvedPatterns.every((str) => !isDynamicPattern(str))) {
return resolvedPatterns.map(
- (p) => normalizePath$3(path$d.resolve(environment.config.root, p))
+ (p) => normalizePath$3(path$b.resolve(environment.config.root, p))
);
}
return glob(pattern, {
@@ -17673,7 +14310,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
);
}
const resolve = async (id, importer) => {
- const key = id + (importer && path$d.dirname(importer));
+ const key = id + (importer && path$b.dirname(importer));
if (seen.has(key)) {
return seen.get(key);
}
@@ -17778,7 +14415,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
loader: "js",
// since it is transpiled
contents: await doTransformGlobImport(contents, p, loader),
- resolveDir: normalizePath$3(path$d.dirname(p)),
+ resolveDir: normalizePath$3(path$b.dirname(p)),
pluginData: {
htmlType: { loader }
}
@@ -17787,7 +14424,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
scripts[key] = {
loader,
contents,
- resolveDir: normalizePath$3(path$d.dirname(p)),
+ resolveDir: normalizePath$3(path$b.dirname(p)),
pluginData: {
htmlType: { loader }
}
@@ -17855,7 +14492,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
} else if (isScannable(resolved, optimizeDepsOptions.extensions)) {
const namespace = htmlTypesRE.test(resolved) ? "html" : void 0;
return {
- path: path$d.resolve(resolved),
+ path: path$b.resolve(resolved),
namespace
};
} else {
@@ -17893,7 +14530,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
}
const namespace = htmlTypesRE.test(resolved) ? "html" : void 0;
return {
- path: path$d.resolve(cleanUrl(resolved)),
+ path: path$b.resolve(cleanUrl(resolved)),
namespace
};
} else {
@@ -17902,7 +14539,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
}
);
build.onLoad({ filter: JS_TYPES_RE }, async ({ path: id }) => {
- let ext = path$d.extname(id).slice(1);
+ let ext = path$b.extname(id).slice(1);
if (ext === "mjs") ext = "js";
const esbuildConfig = environment.config.esbuild;
let contents = await fsp.readFile(id, "utf-8");
@@ -17944,7 +14581,7 @@ import ${m[1]}`;
return js;
}
function shouldExternalizeDep(resolvedId, rawId) {
- if (!path$d.isAbsolute(resolvedId)) {
+ if (!path$b.isAbsolute(resolvedId)) {
return true;
}
if (resolvedId === rawId || resolvedId.includes("\0")) {
@@ -17953,7 +14590,7 @@ function shouldExternalizeDep(resolvedId, rawId) {
return false;
}
function isScannable(id, extensions) {
- return JS_TYPES_RE.test(id) || htmlTypesRE.test(id) || extensions?.includes(path$d.extname(id)) || false;
+ return JS_TYPES_RE.test(id) || htmlTypesRE.test(id) || extensions?.includes(path$b.extname(id)) || false;
}
function createOptimizeDepsIncludeResolver(environment) {
@@ -17978,7 +14615,7 @@ function createOptimizeDepsIncludeResolver(environment) {
return await resolve(
environment,
nestedPath,
- path$d.resolve(basedir, "package.json")
+ path$b.resolve(basedir, "package.json")
);
};
}
@@ -18041,7 +14678,8 @@ function expandGlobIds(id, config) {
}
}
}
- const matched = possibleExportPaths.filter(picomatch$5(pattern)).map((match) => path$d.posix.join(pkgName, match));
+ const isMatch = picomatch$2(pattern);
+ const matched = possibleExportPaths.filter((p) => isMatch(p)).map((match) => path$b.posix.join(pkgName, match));
matched.unshift(pkgName);
return matched;
} else {
@@ -18049,7 +14687,7 @@ function expandGlobIds(id, config) {
cwd: pkgData.dir,
expandDirectories: false,
ignore: ["node_modules"]
- }).map((match) => path$d.posix.join(pkgName, slash$1(match)));
+ }).map((match) => path$b.posix.join(pkgName, slash$1(match)));
matched.unshift(pkgName);
return matched;
}
@@ -18154,7 +14792,7 @@ async function loadCachedDepOptimizationMetadata(environment, force = environmen
if (!force) {
let cachedMetadata;
try {
- const cachedMetadataPath = path$d.join(depsCacheDir, METADATA_FILENAME);
+ const cachedMetadataPath = path$b.join(depsCacheDir, METADATA_FILENAME);
cachedMetadata = parseDepsOptimizerMetadata(
await fsp.readFile(cachedMetadataPath, "utf-8"),
depsCacheDir
@@ -18246,7 +14884,7 @@ function runOptimizeDeps(environment, depsInfo) {
fs__default.mkdirSync(processingCacheDir, { recursive: true });
debug$f?.(colors$1.green(`creating package.json in ${processingCacheDir}`));
fs__default.writeFileSync(
- path$d.resolve(processingCacheDir, "package.json"),
+ path$b.resolve(processingCacheDir, "package.json"),
`{
"type": "module"
}
@@ -18280,7 +14918,7 @@ function runOptimizeDeps(environment, depsInfo) {
);
}
committed = true;
- const dataPath = path$d.join(processingCacheDir, METADATA_FILENAME);
+ const dataPath = path$b.join(processingCacheDir, METADATA_FILENAME);
debug$f?.(
colors$1.green(`creating ${METADATA_FILENAME} in ${processingCacheDir}`)
);
@@ -18347,7 +14985,7 @@ function runOptimizeDeps(environment, depsInfo) {
}
return context.rebuild().then((result) => {
const meta = result.metafile;
- const processingCacheDirOutputPath = path$d.relative(
+ const processingCacheDirOutputPath = path$b.relative(
process.cwd(),
processingCacheDir
);
@@ -18378,7 +15016,7 @@ function runOptimizeDeps(environment, depsInfo) {
}
for (const o of Object.keys(meta.outputs)) {
if (!jsMapExtensionRE.test(o)) {
- const id = path$d.relative(processingCacheDirOutputPath, o).replace(jsExtensionRE, "");
+ const id = path$b.relative(processingCacheDirOutputPath, o).replace(jsExtensionRE, "");
const file = getOptimizedDepPath(environment, id);
if (!findOptimizedDepInfoInRecord(
metadata.optimized,
@@ -18394,7 +15032,7 @@ function runOptimizeDeps(environment, depsInfo) {
} else {
const output = meta.outputs[o];
if (output.bytes === 93) {
- const jsMapPath = path$d.resolve(o);
+ const jsMapPath = path$b.resolve(o);
const jsPath = jsMapPath.slice(0, -4);
if (fs__default.existsSync(jsPath) && fs__default.existsSync(jsMapPath)) {
const map = JSON.parse(fs__default.readFileSync(jsMapPath, "utf-8"));
@@ -18550,7 +15188,7 @@ function depsFromOptimizedDepInfo(depsInfo) {
}
function getOptimizedDepPath(environment, id) {
return normalizePath$3(
- path$d.resolve(getDepsCacheDir(environment), flattenId(id) + ".js")
+ path$b.resolve(getDepsCacheDir(environment), flattenId(id) + ".js")
);
}
function getDepsCacheSuffix(environment) {
@@ -18568,7 +15206,7 @@ function getTempSuffix() {
);
}
function getDepsCacheDirPrefix(environment) {
- return normalizePath$3(path$d.resolve(environment.config.cacheDir, "deps"));
+ return normalizePath$3(path$b.resolve(environment.config.cacheDir, "deps"));
}
function createIsOptimizedDepFile(environment) {
const depsCacheDirPrefix = getDepsCacheDirPrefix(environment);
@@ -18577,7 +15215,7 @@ function createIsOptimizedDepFile(environment) {
function createIsOptimizedDepUrl(environment) {
const { root } = environment.config;
const depsCacheDir = getDepsCacheDirPrefix(environment);
- const depsCacheDirRelative = normalizePath$3(path$d.relative(root, depsCacheDir));
+ const depsCacheDirRelative = normalizePath$3(path$b.relative(root, depsCacheDir));
const depsCacheDirPrefix = depsCacheDirRelative.startsWith("../") ? (
// if the cache directory is outside root, the url prefix would be something
// like '/@fs/absolute/path/to/node_modules/.vite'
@@ -18594,7 +15232,7 @@ function createIsOptimizedDepUrl(environment) {
function parseDepsOptimizerMetadata(jsonMetadata, depsCacheDir) {
const { hash, lockfileHash, configHash, browserHash, optimized, chunks } = JSON.parse(jsonMetadata, (key, value) => {
if (key === "file" || key === "src") {
- return normalizePath$3(path$d.resolve(depsCacheDir, value));
+ return normalizePath$3(path$b.resolve(depsCacheDir, value));
}
return value;
});
@@ -18655,7 +15293,7 @@ function stringifyDepsOptimizerMetadata(metadata, depsCacheDir) {
},
(key, value) => {
if (key === "file" || key === "src") {
- return normalizePath$3(path$d.relative(depsCacheDir, value));
+ return normalizePath$3(path$b.relative(depsCacheDir, value));
}
return value;
},
@@ -18666,14 +15304,14 @@ function esbuildOutputFromId(outputs, id, cacheDirOutputPath) {
const cwd = process.cwd();
const flatId = flattenId(id) + ".js";
const normalizedOutputPath = normalizePath$3(
- path$d.relative(cwd, path$d.join(cacheDirOutputPath, flatId))
+ path$b.relative(cwd, path$b.join(cacheDirOutputPath, flatId))
);
const output = outputs[normalizedOutputPath];
if (output) {
return output;
}
for (const [key, value] of Object.entries(outputs)) {
- if (normalizePath$3(path$d.relative(cwd, key)) === normalizedOutputPath) {
+ if (normalizePath$3(path$b.relative(cwd, key)) === normalizedOutputPath) {
return value;
}
}
@@ -18683,13 +15321,13 @@ async function extractExportsData(environment, filePath) {
const { optimizeDeps: optimizeDeps2 } = environment.config;
const esbuildOptions = optimizeDeps2.esbuildOptions ?? {};
if (optimizeDeps2.extensions?.some((ext) => filePath.endsWith(ext))) {
- const result = await build$b({
+ const result = await build$3({
...esbuildOptions,
entryPoints: [filePath],
write: false,
format: "esm"
});
- const [, exports2, , hasModuleSyntax2] = parse$e(result.outputFiles[0].text);
+ const [, exports2, , hasModuleSyntax2] = parse$d(result.outputFiles[0].text);
return {
hasModuleSyntax: hasModuleSyntax2,
exports: exports2.map((e) => e.n)
@@ -18699,9 +15337,9 @@ async function extractExportsData(environment, filePath) {
let usedJsxLoader = false;
const entryContent = await fsp.readFile(filePath, "utf-8");
try {
- parseResult = parse$e(entryContent);
+ parseResult = parse$d(entryContent);
} catch {
- const loader = esbuildOptions.loader?.[path$d.extname(filePath)] || "jsx";
+ const loader = esbuildOptions.loader?.[path$b.extname(filePath)] || "jsx";
debug$f?.(
`Unable to parse: ${filePath}.
Trying again with a ${loader} transform.`
@@ -18713,7 +15351,7 @@ async function extractExportsData(environment, filePath) {
void 0,
environment.config
);
- parseResult = parse$e(transformed.code);
+ parseResult = parse$d(transformed.code);
usedJsxLoader = true;
}
const [, exports, , hasModuleSyntax] = parseResult;
@@ -18831,7 +15469,7 @@ function getLockfileHash(environment) {
);
if (lockfileFormat.checkPatchesDir) {
const baseDir = lockfilePath.slice(0, -lockfileFormat.path.length);
- const fullPath = path$d.join(
+ const fullPath = path$b.join(
baseDir,
lockfileFormat.checkPatchesDir
);
@@ -18885,12 +15523,12 @@ async function optimizedDepNeedsInterop(environment, metadata, file) {
const MAX_TEMP_DIR_AGE_MS = 24 * 60 * 60 * 1e3;
async function cleanupDepsCacheStaleDirs(config) {
try {
- const cacheDir = path$d.resolve(config.cacheDir);
+ const cacheDir = path$b.resolve(config.cacheDir);
if (fs__default.existsSync(cacheDir)) {
const dirents = await fsp.readdir(cacheDir, { withFileTypes: true });
for (const dirent of dirents) {
if (dirent.isDirectory() && dirent.name.includes("_temp_")) {
- const tempDirPath = path$d.resolve(config.cacheDir, dirent.name);
+ const tempDirPath = path$b.resolve(config.cacheDir, dirent.name);
const stats = await fsp.stat(tempDirPath).catch(() => null);
if (stats?.mtime && Date.now() - stats.mtime.getTime() > MAX_TEMP_DIR_AGE_MS) {
debug$f?.(`removing stale cache temp dir ${tempDirPath}`);
@@ -18961,7 +15599,7 @@ function createIsConfiguredAsExternal(environment) {
const { config } = environment;
const { root, resolve } = config;
const { external, noExternal } = resolve;
- const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter(void 0, noExternal, { resolve: false });
+ const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter$1(void 0, noExternal, { resolve: false });
const targetConditions = resolve.externalConditions;
const resolveOptions = {
...resolve,
@@ -19034,7 +15672,7 @@ function createIsExternal(environment) {
return processedIds.get(id);
}
let isExternal = false;
- if (id[0] !== "." && !path$d.isAbsolute(id)) {
+ if (id[0] !== "." && !path$b.isAbsolute(id)) {
isExternal = isBuiltin(environment.config.resolve.builtins, id) || isConfiguredAsExternal(id, importer);
}
processedIds.set(id, isExternal);
@@ -19042,7 +15680,7 @@ function createIsExternal(environment) {
};
}
function canExternalizeFile(filePath) {
- const ext = path$d.extname(filePath);
+ const ext = path$b.extname(filePath);
return !ext || ext === ".js" || ext === ".mjs" || ext === ".cjs";
}
@@ -19058,7 +15696,7 @@ const debug$d = createDebugger("vite:resolve-details", {
});
function resolvePlugin(resolveOptions) {
const { root, isProduction, asSrc, preferRelative = false } = resolveOptions;
- const rootInRoot = tryStatSync(path$d.join(root, root))?.isDirectory() ?? false;
+ const rootInRoot = tryStatSync(path$b.join(root, root))?.isDirectory() ?? false;
return {
name: "vite:resolve",
async resolveId(id, importer, resolveOpts) {
@@ -19083,12 +15721,12 @@ function resolvePlugin(resolveOptions) {
if (resolvedImports) {
id = resolvedImports;
if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) {
- return normalizePath$3(path$d.join(root, id));
+ return normalizePath$3(path$b.join(root, id));
}
}
let res;
if (asSrc && depsOptimizer?.isOptimizedDepUrl(id)) {
- const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath$3(path$d.resolve(root, id.slice(1)));
+ const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath$3(path$b.resolve(root, id.slice(1)));
return optimizedPath;
}
if (asSrc && id.startsWith(FS_PREFIX)) {
@@ -19097,15 +15735,15 @@ function resolvePlugin(resolveOptions) {
return ensureVersionQuery(res, id, options, depsOptimizer);
}
if (asSrc && id[0] === "/" && (rootInRoot || !id.startsWith(withTrailingSlash(root)))) {
- const fsPath = path$d.resolve(root, id.slice(1));
+ const fsPath = path$b.resolve(root, id.slice(1));
if (res = tryFsResolve(fsPath, options)) {
debug$d?.(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
return ensureVersionQuery(res, id, options, depsOptimizer);
}
}
if (id[0] === "." || (preferRelative || importer?.endsWith(".html")) && startsWithWordCharRE.test(id)) {
- const basedir = importer ? path$d.dirname(importer) : process.cwd();
- const fsPath = path$d.resolve(basedir, id);
+ const basedir = importer ? path$b.dirname(importer) : process.cwd();
+ const fsPath = path$b.resolve(basedir, id);
const normalizedFsPath = normalizePath$3(fsPath);
if (depsOptimizer?.isOptimizedDepFile(normalizedFsPath)) {
if (!options.isBuild && !DEP_VERSION_RE.test(normalizedFsPath)) {
@@ -19127,7 +15765,7 @@ function resolvePlugin(resolveOptions) {
debug$d?.(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
if (!options.idOnly && !options.scan && options.isBuild) {
const resPkg = findNearestPackageData(
- path$d.dirname(res),
+ path$b.dirname(res),
options.packageCache
);
if (resPkg) {
@@ -19145,8 +15783,8 @@ function resolvePlugin(resolveOptions) {
id = fileURLToPath$1(file) + postfix;
}
if (isWindows$3 && id[0] === "/") {
- const basedir = importer ? path$d.dirname(importer) : process.cwd();
- const fsPath = path$d.resolve(basedir, id);
+ const basedir = importer ? path$b.dirname(importer) : process.cwd();
+ const fsPath = path$b.resolve(basedir, id);
if (res = tryFsResolve(fsPath, options)) {
debug$d?.(`[drive-relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
return ensureVersionQuery(res, id, options, depsOptimizer);
@@ -19191,7 +15829,7 @@ function resolvePlugin(resolveOptions) {
if (!(options.external === true || options.external.includes(id))) {
let message = `Automatically externalized node built-in module "${id}"`;
if (importer) {
- message += ` imported from "${path$d.relative(
+ message += ` imported from "${path$b.relative(
process.cwd(),
importer
)}"`;
@@ -19206,7 +15844,7 @@ function resolvePlugin(resolveOptions) {
(options.external === true || !options.external.includes(id))) {
let message = `Cannot bundle built-in module "${id}"`;
if (importer) {
- message += ` imported from "${path$d.relative(
+ message += ` imported from "${path$b.relative(
process.cwd(),
importer
)}"`;
@@ -19228,25 +15866,27 @@ function resolvePlugin(resolveOptions) {
}
debug$d?.(`[fallthrough] ${colors$1.dim(id)}`);
},
- load(id) {
- if (id.startsWith(browserExternalId)) {
- if (isProduction) {
- return `export default {}`;
- } else {
- id = id.slice(browserExternalId.length + 1);
- return `export default new Proxy({}, {
- get(_, key) {
- throw new Error(\`Module "${id}" has been externalized for browser compatibility. Cannot access "${id}.\${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`)
- }
-})`;
+ load: {
+ handler(id) {
+ if (id.startsWith(browserExternalId)) {
+ if (isProduction) {
+ return `export default {}`;
+ } else {
+ id = id.slice(browserExternalId.length + 1);
+ return ` export default new Proxy({}, {
+ get(_, key) {
+ throw new Error(\`Module "${id}" has been externalized for browser compatibility. Cannot access "${id}.\${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`)
+ }
+ })`;
+ }
}
- }
- if (id.startsWith(optionalPeerDepId)) {
- if (isProduction) {
- return `export default {}`;
- } else {
- const [, peerDep, parentDep] = id.split(":");
- return `throw new Error(\`Could not resolve "${peerDep}" imported by "${parentDep}". Is it installed?\`)`;
+ if (id.startsWith(optionalPeerDepId)) {
+ if (isProduction) {
+ return `export default {}`;
+ } else {
+ const [, peerDep, parentDep] = id.split(":");
+ return `throw new Error(\`Could not resolve "${peerDep}" imported by "${parentDep}". Is it installed?\`)`;
+ }
}
}
}
@@ -19254,7 +15894,7 @@ function resolvePlugin(resolveOptions) {
}
function resolveSubpathImports(id, importer, options) {
if (!importer || !id.startsWith(subpathImportsPrefix)) return;
- const basedir = path$d.dirname(importer);
+ const basedir = path$b.dirname(importer);
const pkgData = findNearestPackageData(basedir, options.packageCache);
if (!pkgData) return;
let { file: idWithoutPostfix, postfix } = splitFileAndPostfix(id.slice(1));
@@ -19266,7 +15906,7 @@ function resolveSubpathImports(id, importer, options) {
"imports"
);
if (importsPath?.[0] === ".") {
- importsPath = path$d.relative(basedir, path$d.join(pkgData.dir, importsPath));
+ importsPath = path$b.relative(basedir, path$b.join(pkgData.dir, importsPath));
if (importsPath[0] !== ".") {
importsPath = `./${importsPath}`;
}
@@ -19308,10 +15948,10 @@ function tryCleanFsResolve(file, options, tryIndex = true, skipPackageJson = fal
let res;
const possibleJsToTs = isPossibleTsOutput(file);
if (possibleJsToTs || options.extensions.length || tryPrefix) {
- const dirPath = path$d.dirname(file);
+ const dirPath = path$b.dirname(file);
if (isDirectory(dirPath)) {
if (possibleJsToTs) {
- const fileExt = path$d.extname(file);
+ const fileExt = path$b.extname(file);
const fileName = file.slice(0, -fileExt.length);
if (res = tryResolveRealFile(
fileName + fileExt.replace("js", "ts"),
@@ -19328,7 +15968,7 @@ function tryCleanFsResolve(file, options, tryIndex = true, skipPackageJson = fal
))
return res;
if (tryPrefix) {
- const prefixed = `${dirPath}/${options.tryPrefix}${path$d.basename(file)}`;
+ const prefixed = `${dirPath}/${options.tryPrefix}${path$b.basename(file)}`;
if (res = tryResolveRealFile(prefixed, preserveSymlinks)) return res;
if (res = tryResolveRealFileWithExtensions(
prefixed,
@@ -19379,9 +16019,9 @@ function tryNodeResolve(id, importer, options, depsOptimizer, externalize) {
let basedir;
if (dedupe.includes(pkgId)) {
basedir = root;
- } else if (importer && path$d.isAbsolute(importer) && // css processing appends `*` for importer
+ } else if (importer && path$b.isAbsolute(importer) && // css processing appends `*` for importer
(importer.endsWith("*") || fs__default.existsSync(cleanUrl(importer)))) {
- basedir = path$d.dirname(importer);
+ basedir = path$b.dirname(importer);
} else {
basedir = root;
}
@@ -19421,7 +16061,7 @@ function tryNodeResolve(id, importer, options, depsOptimizer, externalize) {
return resolved2;
}
let resolvedId = id;
- if (deepMatch && !pkg.data.exports && path$d.extname(id) !== path$d.extname(resolved2.id)) {
+ if (deepMatch && !pkg.data.exports && path$b.extname(id) !== path$b.extname(resolved2.id)) {
const index = resolved2.id.indexOf(id);
if (index > -1) {
resolvedId = resolved2.id.slice(index);
@@ -19515,16 +16155,16 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
const entryPoints = entryPoint ? [entryPoint] : ["index.js", "index.json", "index.node"];
for (let entry of entryPoints) {
let skipPackageJson = false;
- if (options.mainFields[0] === "sass" && !options.extensions.includes(path$d.extname(entry))) {
+ if (options.mainFields[0] === "sass" && !options.extensions.includes(path$b.extname(entry))) {
entry = "";
skipPackageJson = true;
} else {
const { browser: browserField } = data;
- if (options.mainFields.includes("browser") && isObject$2(browserField)) {
+ if (options.mainFields.includes("browser") && isObject$1(browserField)) {
entry = mapWithBrowserField(entry, browserField) || entry;
}
}
- const entryPointPath = path$d.join(dir, entry);
+ const entryPointPath = path$b.join(dir, entry);
const resolvedEntryPoint = tryFsResolve(
entryPointPath,
options,
@@ -19577,7 +16217,7 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
let relativeId = id;
const { exports: exportsField, browser: browserField } = data;
if (exportsField) {
- if (isObject$2(exportsField) && !Array.isArray(exportsField)) {
+ if (isObject$1(exportsField) && !Array.isArray(exportsField)) {
const { file, postfix } = splitFileAndPostfix(relativeId);
const exportsId = resolveExportsOrImports(data, file, options, "exports");
if (exportsId !== void 0) {
@@ -19590,10 +16230,10 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
}
if (!relativeId) {
throw new Error(
- `Package subpath '${relativeId}' is not defined by "exports" in ${path$d.join(dir, "package.json")}.`
+ `Package subpath '${relativeId}' is not defined by "exports" in ${path$b.join(dir, "package.json")}.`
);
}
- } else if (options.mainFields.includes("browser") && isObject$2(browserField)) {
+ } else if (options.mainFields.includes("browser") && isObject$1(browserField)) {
const { file, postfix } = splitFileAndPostfix(relativeId);
const mapped = mapWithBrowserField(file, browserField);
if (mapped) {
@@ -19605,7 +16245,7 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
}
if (relativeId) {
const resolved = tryFsResolve(
- path$d.join(dir, relativeId),
+ path$b.join(dir, relativeId),
options,
!exportsField
// try index only if no exports field
@@ -19621,9 +16261,9 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
}
function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize) {
let res;
- const pkg = importer && findNearestPackageData(path$d.dirname(importer), options.packageCache);
- if (pkg && isObject$2(pkg.data.browser)) {
- const mapId = isFilePath ? "./" + slash$1(path$d.relative(pkg.dir, id)) : id;
+ const pkg = importer && findNearestPackageData(path$b.dirname(importer), options.packageCache);
+ if (pkg && isObject$1(pkg.data.browser)) {
+ const mapId = isFilePath ? "./" + slash$1(path$b.relative(pkg.dir, id)) : id;
const browserMappedPath = mapWithBrowserField(mapId, pkg.data.browser);
if (browserMappedPath) {
if (res = bareImportRE.test(browserMappedPath) ? tryNodeResolve(
@@ -19632,7 +16272,7 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
options,
void 0,
void 0
- )?.id : tryFsResolve(path$d.join(pkg.dir, browserMappedPath), options)) {
+ )?.id : tryFsResolve(path$b.join(pkg.dir, browserMappedPath), options)) {
debug$d?.(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
let result = { id: res };
if (options.idOnly) {
@@ -19640,7 +16280,7 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
}
if (!options.scan && options.isBuild) {
const resPkg = findNearestPackageData(
- path$d.dirname(res),
+ path$b.dirname(res),
options.packageCache
);
if (resPkg) {
@@ -19658,11 +16298,11 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
}
}
function tryResolveBrowserEntry(dir, data, options) {
- const browserEntry = typeof data.browser === "string" ? data.browser : isObject$2(data.browser) && data.browser["."];
+ const browserEntry = typeof data.browser === "string" ? data.browser : isObject$1(data.browser) && data.browser["."];
if (browserEntry) {
if (!options.isRequire && options.mainFields.includes("module") && typeof data.module === "string" && data.module !== browserEntry) {
const resolvedBrowserEntry = tryFsResolve(
- path$d.join(dir, browserEntry),
+ path$b.join(dir, browserEntry),
options
);
if (resolvedBrowserEntry) {
@@ -19679,9 +16319,9 @@ function tryResolveBrowserEntry(dir, data, options) {
}
}
function mapWithBrowserField(relativePathInPkgDir, map) {
- const normalizedPath = path$d.posix.normalize(relativePathInPkgDir);
+ const normalizedPath = path$b.posix.normalize(relativePathInPkgDir);
for (const key in map) {
- const normalizedKey = path$d.posix.normalize(key);
+ const normalizedKey = path$b.posix.normalize(key);
if (normalizedPath === normalizedKey || equalWithoutSuffix(normalizedPath, normalizedKey, ".js") || equalWithoutSuffix(normalizedPath, normalizedKey, "/index.js")) {
return map[key];
}
@@ -19805,8 +16445,8 @@ var version$1 = "16.4.7";
var require$$4 = {
version: version$1};
-const fs$6 = require$$0$3;
-const path$a = require$$0$2;
+const fs$6 = require$$0$4;
+const path$8 = require$$0$2;
const os$1 = require$$2;
const crypto$1 = require$$3;
const packageJson = require$$4;
@@ -19816,7 +16456,7 @@ const version = packageJson.version;
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
// Parse src into an Object
-function parse$d (src) {
+function parse$c (src) {
const obj = {};
// Convert buffer to string
@@ -19980,7 +16620,7 @@ function _vaultPath (options) {
possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`;
}
} else {
- possibleVaultPath = path$a.resolve(process.cwd(), '.env.vault');
+ possibleVaultPath = path$8.resolve(process.cwd(), '.env.vault');
}
if (fs$6.existsSync(possibleVaultPath)) {
@@ -19991,7 +16631,7 @@ function _vaultPath (options) {
}
function _resolveHome (envPath) {
- return envPath[0] === '~' ? path$a.join(os$1.homedir(), envPath.slice(1)) : envPath
+ return envPath[0] === '~' ? path$8.join(os$1.homedir(), envPath.slice(1)) : envPath
}
function _configVault (options) {
@@ -20010,7 +16650,7 @@ function _configVault (options) {
}
function configDotenv (options) {
- const dotenvPath = path$a.resolve(process.cwd(), '.env');
+ const dotenvPath = path$8.resolve(process.cwd(), '.env');
let encoding = 'utf8';
const debug = Boolean(options && options.debug);
@@ -20153,7 +16793,7 @@ const DotenvModule = {
_parseVault,
config,
decrypt,
- parse: parse$d,
+ parse: parse$c,
populate
};
@@ -20162,7 +16802,7 @@ main.exports._configVault = DotenvModule._configVault;
main.exports._parseVault = DotenvModule._parseVault;
main.exports.config = DotenvModule.config;
main.exports.decrypt = DotenvModule.decrypt;
-var parse_1$3 = main.exports.parse = DotenvModule.parse;
+var parse_1$2 = main.exports.parse = DotenvModule.parse;
main.exports.populate = DotenvModule.populate;
main.exports = DotenvModule;
@@ -20268,16 +16908,19 @@ var expand_1$1 = expand$2;
const debug$b = createDebugger("vite:env");
function getEnvFilesForMode(mode, envDir) {
- return [
- /** default file */
- `.env`,
- /** local file */
- `.env.local`,
- /** mode file */
- `.env.${mode}`,
- /** mode local file */
- `.env.${mode}.local`
- ].map((file) => normalizePath$3(path$d.join(envDir, file)));
+ if (envDir !== false) {
+ return [
+ /** default file */
+ `.env`,
+ /** local file */
+ `.env.local`,
+ /** mode file */
+ `.env.${mode}`,
+ /** mode local file */
+ `.env.${mode}.local`
+ ].map((file) => normalizePath$3(path$b.join(envDir, file)));
+ }
+ return [];
}
function loadEnv(mode, envDir, prefixes = "VITE_") {
const start = performance.now();
@@ -20294,7 +16937,7 @@ function loadEnv(mode, envDir, prefixes = "VITE_") {
const parsed = Object.fromEntries(
envFiles.flatMap((filePath) => {
if (!tryStatSync(filePath)?.isFile()) return [];
- return Object.entries(parse_1$3(fs__default.readFileSync(filePath)));
+ return Object.entries(parse_1$2(fs__default.readFileSync(filePath)));
})
);
debug$b?.(`env files loaded in ${getTime()}`);
@@ -20441,7 +17084,7 @@ function errorMiddleware(server, allowNext = false) {
"\\u003c"
)}
try {
- const { ErrorOverlay } = await import(${JSON.stringify(path$d.posix.join(server.config.base, CLIENT_PUBLIC_PATH))})
+ const { ErrorOverlay } = await import(${JSON.stringify(path$b.posix.join(server.config.base, CLIENT_PUBLIC_PATH))})
document.body.appendChild(new ErrorOverlay(error))
} catch {
const h = (tag, text) => {
@@ -20464,9 +17107,7 @@ function errorMiddleware(server, allowNext = false) {
};
}
-var src = {exports: {}};
-
-var browser = {exports: {}};
+var node = {exports: {}};
var debug$a = {exports: {}};
@@ -20474,841 +17115,613 @@ var debug$a = {exports: {}};
* Helpers.
*/
-var ms;
-var hasRequiredMs;
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var y = d * 365.25;
-function requireMs () {
- if (hasRequiredMs) return ms;
- hasRequiredMs = 1;
- var s = 1000;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var y = d * 365.25;
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+var ms = function(val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse$b(val);
+ } else if (type === 'number' && isNaN(val) === false) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse$b(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ if (ms >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (ms >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (ms >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (ms >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ return plural(ms, d, 'day') ||
+ plural(ms, h, 'hour') ||
+ plural(ms, m, 'minute') ||
+ plural(ms, s, 'second') ||
+ ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, n, name) {
+ if (ms < n) {
+ return;
+ }
+ if (ms < n * 1.5) {
+ return Math.floor(ms / n) + ' ' + name;
+ }
+ return Math.ceil(ms / n) + ' ' + name + 's';
+}
+
+(function (module, exports) {
/**
- * Parse or format the given `val`.
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
*
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
+ * Expose `debug()` as the module.
*/
- ms = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isNaN(val) === false) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
- };
+ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+ exports.coerce = coerce;
+ exports.disable = disable;
+ exports.enable = enable;
+ exports.enabled = enabled;
+ exports.humanize = ms;
/**
- * Parse the given `str` and return milliseconds.
+ * The currently active debug mode names, and names to skip.
+ */
+
+ exports.names = [];
+ exports.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
*
- * @param {String} str
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+ exports.formatters = {};
+
+ /**
+ * Previous log timestamp.
+ */
+
+ var prevTime;
+
+ /**
+ * Select a color.
+ * @param {String} namespace
* @return {Number}
* @api private
*/
- function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
+ function selectColor(namespace) {
+ var hash = 0, i;
+
+ for (i in namespace) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
}
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
+
+ return exports.colors[Math.abs(hash) % exports.colors.length];
+ }
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+ function createDebug(namespace) {
+
+ function debug() {
+ // disabled?
+ if (!debug.enabled) return;
+
+ var self = debug;
+
+ // set `diff` timestamp
+ var curr = +new Date();
+ var ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ // turn the `arguments` into a proper Array
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ args[0] = exports.coerce(args[0]);
+
+ if ('string' !== typeof args[0]) {
+ // anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // apply any `formatters` transformations
+ var index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+ // if we encounter an escaped % then don't increase the array index
+ if (match === '%%') return match;
+ index++;
+ var formatter = exports.formatters[format];
+ if ('function' === typeof formatter) {
+ var val = args[index];
+ match = formatter.call(self, val);
+
+ // now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // apply env-specific formatting (colors, etc.)
+ exports.formatArgs.call(self, args);
+
+ var logFn = debug.log || exports.log || console.log.bind(console);
+ logFn.apply(self, args);
}
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
+
+ debug.namespace = namespace;
+ debug.enabled = exports.enabled(namespace);
+ debug.useColors = exports.useColors();
+ debug.color = selectColor(namespace);
+
+ // env-specific initialization logic for debug instances
+ if ('function' === typeof exports.init) {
+ exports.init(debug);
+ }
+
+ return debug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+ function enable(namespaces) {
+ exports.save(namespaces);
+
+ exports.names = [];
+ exports.skips = [];
+
+ var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+ var len = split.length;
+
+ for (var i = 0; i < len; i++) {
+ if (!split[i]) continue; // ignore empty strings
+ namespaces = split[i].replace(/\*/g, '.*?');
+ if (namespaces[0] === '-') {
+ exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+ } else {
+ exports.names.push(new RegExp('^' + namespaces + '$'));
+ }
}
}
/**
- * Short format for `ms`.
+ * Disable debug output.
*
- * @param {Number} ms
- * @return {String}
+ * @api public
+ */
+
+ function disable() {
+ exports.enable('');
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+ function enabled(name) {
+ var i, len;
+ for (i = 0, len = exports.skips.length; i < len; i++) {
+ if (exports.skips[i].test(name)) {
+ return false;
+ }
+ }
+ for (i = 0, len = exports.names.length; i < len; i++) {
+ if (exports.names[i].test(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
* @api private
*/
- function fmtShort(ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
- }
+ function coerce(val) {
+ if (val instanceof Error) return val.stack || val.message;
+ return val;
+ }
+} (debug$a, debug$a.exports));
- /**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
- function fmtLong(ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
- }
-
- /**
- * Pluralization helper.
- */
-
- function plural(ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
- }
- return ms;
-}
-
-var hasRequiredDebug;
-
-function requireDebug () {
- if (hasRequiredDebug) return debug$a.exports;
- hasRequiredDebug = 1;
- (function (module, exports) {
- /**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
- exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
- exports.coerce = coerce;
- exports.disable = disable;
- exports.enable = enable;
- exports.enabled = enabled;
- exports.humanize = requireMs();
-
- /**
- * The currently active debug mode names, and names to skip.
- */
-
- exports.names = [];
- exports.skips = [];
-
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
-
- exports.formatters = {};
-
- /**
- * Previous log timestamp.
- */
-
- var prevTime;
-
- /**
- * Select a color.
- * @param {String} namespace
- * @return {Number}
- * @api private
- */
-
- function selectColor(namespace) {
- var hash = 0, i;
-
- for (i in namespace) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
-
- return exports.colors[Math.abs(hash) % exports.colors.length];
- }
-
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
-
- function createDebug(namespace) {
-
- function debug() {
- // disabled?
- if (!debug.enabled) return;
-
- var self = debug;
-
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- // turn the `arguments` into a proper Array
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
-
- args[0] = exports.coerce(args[0]);
-
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %O
- args.unshift('%O');
- }
-
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
-
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- // apply env-specific formatting (colors, etc.)
- exports.formatArgs.call(self, args);
-
- var logFn = debug.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
-
- debug.namespace = namespace;
- debug.enabled = exports.enabled(namespace);
- debug.useColors = exports.useColors();
- debug.color = selectColor(namespace);
-
- // env-specific initialization logic for debug instances
- if ('function' === typeof exports.init) {
- exports.init(debug);
- }
-
- return debug;
- }
-
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
-
- function enable(namespaces) {
- exports.save(namespaces);
-
- exports.names = [];
- exports.skips = [];
-
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- var len = split.length;
-
- for (var i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- }
-
- /**
- * Disable debug output.
- *
- * @api public
- */
-
- function disable() {
- exports.enable('');
- }
-
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
- function enabled(name) {
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
-
- function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
- }
- } (debug$a, debug$a.exports));
- return debug$a.exports;
-}
-
-/**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-var hasRequiredBrowser;
-
-function requireBrowser () {
- if (hasRequiredBrowser) return browser.exports;
- hasRequiredBrowser = 1;
- (function (module, exports) {
- exports = module.exports = requireDebug();
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = 'undefined' != typeof chrome
- && 'undefined' != typeof chrome.storage
- ? chrome.storage.local
- : localstorage();
-
- /**
- * Colors.
- */
-
- exports.colors = [
- 'lightseagreen',
- 'forestgreen',
- 'goldenrod',
- 'dodgerblue',
- 'darkorchid',
- 'crimson'
- ];
-
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
- function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
- return true;
- }
-
- // is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
- // double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
- }
-
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
- exports.formatters.j = function(v) {
- try {
- return JSON.stringify(v);
- } catch (err) {
- return '[UnexpectedJSONParseError]: ' + err.message;
- }
- };
-
-
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
- function formatArgs(args) {
- var useColors = this.useColors;
-
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
-
- if (!useColors) return;
-
- var c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
-
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- }
-
- /**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
-
- function log() {
- // this hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return 'object' === typeof console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
- }
-
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
- function save(namespaces) {
- try {
- if (null == namespaces) {
- exports.storage.removeItem('debug');
- } else {
- exports.storage.debug = namespaces;
- }
- } catch(e) {}
- }
-
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
- function load() {
- var r;
- try {
- r = exports.storage.debug;
- } catch(e) {}
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
-
- return r;
- }
-
- /**
- * Enable namespaces listed in `localStorage.debug` initially.
- */
-
- exports.enable(load());
-
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
- function localstorage() {
- try {
- return window.localStorage;
- } catch (e) {}
- }
- } (browser, browser.exports));
- return browser.exports;
-}
-
-var node = {exports: {}};
+var debugExports = debug$a.exports;
/**
* Module dependencies.
*/
-var hasRequiredNode;
+(function (module, exports) {
+ var tty = require$$0$3;
+ var util = require$$1;
-function requireNode () {
- if (hasRequiredNode) return node.exports;
- hasRequiredNode = 1;
- (function (module, exports) {
- var tty = require$$0$4;
- var util = require$$1;
+ /**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
- /**
- * This is the Node.js implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
+ exports = module.exports = debugExports;
+ exports.init = init;
+ exports.log = log;
+ exports.formatArgs = formatArgs;
+ exports.save = save;
+ exports.load = load;
+ exports.useColors = useColors;
- exports = module.exports = requireDebug();
- exports.init = init;
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
+ /**
+ * Colors.
+ */
- /**
- * Colors.
- */
+ exports.colors = [6, 2, 3, 4, 5, 1];
- exports.colors = [6, 2, 3, 4, 5, 1];
+ /**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
- /**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
+ exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+ return /^debug_/i.test(key);
+ }).reduce(function (obj, key) {
+ // camel-case
+ var prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
- exports.inspectOpts = Object.keys(process.env).filter(function (key) {
- return /^debug_/i.test(key);
- }).reduce(function (obj, key) {
- // camel-case
- var prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+ // coerce string value into JS value
+ var val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+ else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+ else if (val === 'null') val = null;
+ else val = Number(val);
- // coerce string value into JS value
- var val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
- else if (val === 'null') val = null;
- else val = Number(val);
+ obj[prop] = val;
+ return obj;
+ }, {});
- obj[prop] = val;
- return obj;
- }, {});
+ /**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ * $ DEBUG_FD=3 node script.js 3>debug.log
+ */
- /**
- * The file descriptor to write the `debug()` calls to.
- * Set the `DEBUG_FD` env variable to override with another value. i.e.:
- *
- * $ DEBUG_FD=3 node script.js 3>debug.log
- */
+ var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
- var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+ if (1 !== fd && 2 !== fd) {
+ util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')();
+ }
- if (1 !== fd && 2 !== fd) {
- util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')();
- }
+ var stream = 1 === fd ? process.stdout :
+ 2 === fd ? process.stderr :
+ createWritableStdioStream(fd);
- var stream = 1 === fd ? process.stdout :
- 2 === fd ? process.stderr :
- createWritableStdioStream(fd);
+ /**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
- /**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
+ function useColors() {
+ return 'colors' in exports.inspectOpts
+ ? Boolean(exports.inspectOpts.colors)
+ : tty.isatty(fd);
+ }
- function useColors() {
- return 'colors' in exports.inspectOpts
- ? Boolean(exports.inspectOpts.colors)
- : tty.isatty(fd);
- }
+ /**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
- /**
- * Map %o to `util.inspect()`, all on a single line.
- */
+ exports.formatters.o = function(v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n').map(function(str) {
+ return str.trim()
+ }).join(' ');
+ };
- exports.formatters.o = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n').map(function(str) {
- return str.trim()
- }).join(' ');
- };
+ /**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
- /**
- * Map %o to `util.inspect()`, allowing multiple lines if needed.
- */
+ exports.formatters.O = function(v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+ };
- exports.formatters.O = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
- };
+ /**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
- /**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
+ function formatArgs(args) {
+ var name = this.namespace;
+ var useColors = this.useColors;
- function formatArgs(args) {
- var name = this.namespace;
- var useColors = this.useColors;
+ if (useColors) {
+ var c = this.color;
+ var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
- if (useColors) {
- var c = this.color;
- var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+ } else {
+ args[0] = new Date().toUTCString()
+ + ' ' + name + ' ' + args[0];
+ }
+ }
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
- } else {
- args[0] = new Date().toUTCString()
- + ' ' + name + ' ' + args[0];
- }
- }
+ /**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
- /**
- * Invokes `util.format()` with the specified arguments and writes to `stream`.
- */
+ function log() {
+ return stream.write(util.format.apply(util, arguments) + '\n');
+ }
- function log() {
- return stream.write(util.format.apply(util, arguments) + '\n');
- }
+ /**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
+ function save(namespaces) {
+ if (null == namespaces) {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ } else {
+ process.env.DEBUG = namespaces;
+ }
+ }
- function save(namespaces) {
- if (null == namespaces) {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- } else {
- process.env.DEBUG = namespaces;
- }
- }
+ /**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
+ function load() {
+ return process.env.DEBUG;
+ }
- function load() {
- return process.env.DEBUG;
- }
+ /**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
- /**
- * Copied from `node/src/node.js`.
- *
- * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
- * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
- */
+ function createWritableStdioStream (fd) {
+ var stream;
+ var tty_wrap = process.binding('tty_wrap');
- function createWritableStdioStream (fd) {
- var stream;
- var tty_wrap = process.binding('tty_wrap');
+ // Note stream._type is used for test-module-load-list.js
- // Note stream._type is used for test-module-load-list.js
+ switch (tty_wrap.guessHandleType(fd)) {
+ case 'TTY':
+ stream = new tty.WriteStream(fd);
+ stream._type = 'tty';
- switch (tty_wrap.guessHandleType(fd)) {
- case 'TTY':
- stream = new tty.WriteStream(fd);
- stream._type = 'tty';
+ // Hack to have stream not keep the event loop alive.
+ // See https://github.com/joyent/node/issues/1726
+ if (stream._handle && stream._handle.unref) {
+ stream._handle.unref();
+ }
+ break;
- // Hack to have stream not keep the event loop alive.
- // See https://github.com/joyent/node/issues/1726
- if (stream._handle && stream._handle.unref) {
- stream._handle.unref();
- }
- break;
+ case 'FILE':
+ var fs = require$$0$4;
+ stream = new fs.SyncWriteStream(fd, { autoClose: false });
+ stream._type = 'fs';
+ break;
- case 'FILE':
- var fs = require$$0$3;
- stream = new fs.SyncWriteStream(fd, { autoClose: false });
- stream._type = 'fs';
- break;
+ case 'PIPE':
+ case 'TCP':
+ var net = require$$4$1;
+ stream = new net.Socket({
+ fd: fd,
+ readable: false,
+ writable: true
+ });
- case 'PIPE':
- case 'TCP':
- var net = require$$4$1;
- stream = new net.Socket({
- fd: fd,
- readable: false,
- writable: true
- });
+ // FIXME Should probably have an option in net.Socket to create a
+ // stream from an existing fd which is writable only. But for now
+ // we'll just add this hack and set the `readable` member to false.
+ // Test: ./node test/fixtures/echo.js < /etc/passwd
+ stream.readable = false;
+ stream.read = null;
+ stream._type = 'pipe';
- // FIXME Should probably have an option in net.Socket to create a
- // stream from an existing fd which is writable only. But for now
- // we'll just add this hack and set the `readable` member to false.
- // Test: ./node test/fixtures/echo.js < /etc/passwd
- stream.readable = false;
- stream.read = null;
- stream._type = 'pipe';
+ // FIXME Hack to have stream not keep the event loop alive.
+ // See https://github.com/joyent/node/issues/1726
+ if (stream._handle && stream._handle.unref) {
+ stream._handle.unref();
+ }
+ break;
- // FIXME Hack to have stream not keep the event loop alive.
- // See https://github.com/joyent/node/issues/1726
- if (stream._handle && stream._handle.unref) {
- stream._handle.unref();
- }
- break;
+ default:
+ // Probably an error on in uv_guess_handle()
+ throw new Error('Implement me. Unknown stream file type!');
+ }
- default:
- // Probably an error on in uv_guess_handle()
- throw new Error('Implement me. Unknown stream file type!');
- }
+ // For supporting legacy API we put the FD here.
+ stream.fd = fd;
- // For supporting legacy API we put the FD here.
- stream.fd = fd;
+ stream._isStdio = true;
- stream._isStdio = true;
+ return stream;
+ }
- return stream;
- }
+ /**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
- /**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
+ function init (debug) {
+ debug.inspectOpts = {};
- function init (debug) {
- debug.inspectOpts = {};
+ var keys = Object.keys(exports.inspectOpts);
+ for (var i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+ }
- var keys = Object.keys(exports.inspectOpts);
- for (var i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
- }
+ /**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
- /**
- * Enable namespaces listed in `process.env.DEBUG` initially.
- */
+ exports.enable(load());
+} (node, node.exports));
- exports.enable(load());
- } (node, node.exports));
- return node.exports;
-}
-
-/**
- * Detect Electron renderer process, which is node, but we should
- * treat as a browser.
- */
-
-if (typeof process !== 'undefined' && process.type === 'renderer') {
- src.exports = requireBrowser();
-} else {
- src.exports = requireNode();
-}
-
-var srcExports = src.exports;
+var nodeExports = node.exports;
/*!
* encodeurl
@@ -21756,7 +18169,7 @@ var parseurl$1 = {exports: {}};
*/
var url$3 = require$$0$5;
-var parse$c = url$3.parse;
+var parse$a = url$3.parse;
var Url = url$3.Url;
/**
@@ -21835,7 +18248,7 @@ function originalurl (req) {
function fastparse (str) {
if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
- return parse$c(str)
+ return parse$a(str)
}
var pathname = str;
@@ -21862,7 +18275,7 @@ function fastparse (str) {
case 0x23: /* # */
case 0xa0:
case 0xfeff:
- return parse$c(str)
+ return parse$a(str)
}
}
@@ -22158,7 +18571,7 @@ function unpipe$1(stream) {
* @private
*/
-var debug$9 = srcExports('finalhandler');
+var debug$9 = nodeExports('finalhandler');
var encodeUrl = encodeurl;
var escapeHtml = escapeHtml_1;
var onFinished = onFinishedExports;
@@ -22520,7 +18933,7 @@ var utilsMergeExports = utilsMerge.exports;
* @private
*/
-var debug$8 = srcExports('connect:dispatcher');
+var debug$8 = nodeExports('connect:dispatcher');
var EventEmitter$3 = require$$0$7.EventEmitter;
var finalhandler = finalhandler_1;
var http$4 = require$$1$2;
@@ -22926,7 +19339,7 @@ function append$1 (header, field) {
// get fields array
var fields = !Array.isArray(field)
- ? parse$b(String(field))
+ ? parse$9(String(field))
: field;
// assert on invalid field names
@@ -22943,7 +19356,7 @@ function append$1 (header, field) {
// enumerate current values
var val = header;
- var vals = parse$b(header.toLowerCase());
+ var vals = parse$9(header.toLowerCase());
// unspecified vary
if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {
@@ -22973,7 +19386,7 @@ function append$1 (header, field) {
* @private
*/
-function parse$b (header) {
+function parse$9 (header) {
var end = 0;
var list = [];
var start = 0;
@@ -23272,2069 +19685,7 @@ var corsMiddleware = /*@__PURE__*/getDefaultExportFromCjs(libExports);
var chokidar = {};
-var utils$7 = {};
-
-const path$9 = require$$0$2;
-const WIN_SLASH = '\\\\/';
-const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
-
-/**
- * Posix glob regex
- */
-
-const DOT_LITERAL = '\\.';
-const PLUS_LITERAL = '\\+';
-const QMARK_LITERAL = '\\?';
-const SLASH_LITERAL = '\\/';
-const ONE_CHAR = '(?=.)';
-const QMARK = '[^/]';
-const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
-const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
-const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
-const NO_DOT = `(?!${DOT_LITERAL})`;
-const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
-const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
-const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
-const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
-const STAR$1 = `${QMARK}*?`;
-
-const POSIX_CHARS = {
- DOT_LITERAL,
- PLUS_LITERAL,
- QMARK_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- QMARK,
- END_ANCHOR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK_NO_DOT,
- STAR: STAR$1,
- START_ANCHOR
-};
-
-/**
- * Windows glob regex
- */
-
-const WINDOWS_CHARS = {
- ...POSIX_CHARS,
-
- SLASH_LITERAL: `[${WIN_SLASH}]`,
- QMARK: WIN_NO_SLASH,
- STAR: `${WIN_NO_SLASH}*?`,
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
-};
-
-/**
- * POSIX Bracket Regex
- */
-
-const POSIX_REGEX_SOURCE$1 = {
- alnum: 'a-zA-Z0-9',
- alpha: 'a-zA-Z',
- ascii: '\\x00-\\x7F',
- blank: ' \\t',
- cntrl: '\\x00-\\x1F\\x7F',
- digit: '0-9',
- graph: '\\x21-\\x7E',
- lower: 'a-z',
- print: '\\x20-\\x7E ',
- punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
- space: ' \\t\\r\\n\\v\\f',
- upper: 'A-Z',
- word: 'A-Za-z0-9_',
- xdigit: 'A-Fa-f0-9'
-};
-
-var constants$5 = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
-
- // regular expressions
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
-
- // Replace globs with equivalent patterns to reduce parsing time.
- REPLACEMENTS: {
- '***': '*',
- '**/**': '**',
- '**/**/**': '**'
- },
-
- // Digits
- CHAR_0: 48, /* 0 */
- CHAR_9: 57, /* 9 */
-
- // Alphabet chars.
- CHAR_UPPERCASE_A: 65, /* A */
- CHAR_LOWERCASE_A: 97, /* a */
- CHAR_UPPERCASE_Z: 90, /* Z */
- CHAR_LOWERCASE_Z: 122, /* z */
-
- CHAR_LEFT_PARENTHESES: 40, /* ( */
- CHAR_RIGHT_PARENTHESES: 41, /* ) */
-
- CHAR_ASTERISK: 42, /* * */
-
- // Non-alphabetic chars.
- CHAR_AMPERSAND: 38, /* & */
- CHAR_AT: 64, /* @ */
- CHAR_BACKWARD_SLASH: 92, /* \ */
- CHAR_CARRIAGE_RETURN: 13, /* \r */
- CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
- CHAR_COLON: 58, /* : */
- CHAR_COMMA: 44, /* , */
- CHAR_DOT: 46, /* . */
- CHAR_DOUBLE_QUOTE: 34, /* " */
- CHAR_EQUAL: 61, /* = */
- CHAR_EXCLAMATION_MARK: 33, /* ! */
- CHAR_FORM_FEED: 12, /* \f */
- CHAR_FORWARD_SLASH: 47, /* / */
- CHAR_GRAVE_ACCENT: 96, /* ` */
- CHAR_HASH: 35, /* # */
- CHAR_HYPHEN_MINUS: 45, /* - */
- CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
- CHAR_LEFT_CURLY_BRACE: 123, /* { */
- CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
- CHAR_LINE_FEED: 10, /* \n */
- CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
- CHAR_PERCENT: 37, /* % */
- CHAR_PLUS: 43, /* + */
- CHAR_QUESTION_MARK: 63, /* ? */
- CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
- CHAR_RIGHT_CURLY_BRACE: 125, /* } */
- CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
- CHAR_SEMICOLON: 59, /* ; */
- CHAR_SINGLE_QUOTE: 39, /* ' */
- CHAR_SPACE: 32, /* */
- CHAR_TAB: 9, /* \t */
- CHAR_UNDERSCORE: 95, /* _ */
- CHAR_VERTICAL_LINE: 124, /* | */
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
-
- SEP: path$9.sep,
-
- /**
- * Create EXTGLOB_CHARS
- */
-
- extglobChars(chars) {
- return {
- '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
- '?': { type: 'qmark', open: '(?:', close: ')?' },
- '+': { type: 'plus', open: '(?:', close: ')+' },
- '*': { type: 'star', open: '(?:', close: ')*' },
- '@': { type: 'at', open: '(?:', close: ')' }
- };
- },
-
- /**
- * Create GLOB_CHARS
- */
-
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
- }
-};
-
-(function (exports) {
-
- const path = require$$0$2;
- const win32 = process.platform === 'win32';
- const {
- REGEX_BACKSLASH,
- REGEX_REMOVE_BACKSLASH,
- REGEX_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_GLOBAL
- } = constants$5;
-
- exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
- exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
- exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
- exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
- exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
-
- exports.removeBackslashes = str => {
- return str.replace(REGEX_REMOVE_BACKSLASH, match => {
- return match === '\\' ? '' : match;
- });
- };
-
- exports.supportsLookbehinds = () => {
- const segs = process.version.slice(1).split('.').map(Number);
- if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
- return true;
- }
- return false;
- };
-
- exports.isWindows = options => {
- if (options && typeof options.windows === 'boolean') {
- return options.windows;
- }
- return win32 === true || path.sep === '\\';
- };
-
- exports.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1) return input;
- if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
- };
-
- exports.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith('./')) {
- output = output.slice(2);
- state.prefix = './';
- }
- return output;
- };
-
- exports.wrapOutput = (input, state = {}, options = {}) => {
- const prepend = options.contains ? '' : '^';
- const append = options.contains ? '' : '$';
-
- let output = `${prepend}(?:${input})${append}`;
- if (state.negated === true) {
- output = `(?:^(?!${output}).*$)`;
- }
- return output;
- };
-} (utils$7));
-
-const utils$6 = utils$7;
-const {
- CHAR_ASTERISK, /* * */
- CHAR_AT, /* @ */
- CHAR_BACKWARD_SLASH, /* \ */
- CHAR_COMMA: CHAR_COMMA$1, /* , */
- CHAR_DOT: CHAR_DOT$1, /* . */
- CHAR_EXCLAMATION_MARK, /* ! */
- CHAR_FORWARD_SLASH, /* / */
- CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, /* { */
- CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, /* ( */
- CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, /* [ */
- CHAR_PLUS, /* + */
- CHAR_QUESTION_MARK, /* ? */
- CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, /* } */
- CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, /* ) */
- CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1 /* ] */
-} = constants$5;
-
-const isPathSeparator = code => {
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
-};
-
-const depth = token => {
- if (token.isPrefix !== true) {
- token.depth = token.isGlobstar ? Infinity : 1;
- }
-};
-
-/**
- * Quickly scans a glob pattern and returns an object with a handful of
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
- * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
- * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
- *
- * ```js
- * const pm = require('picomatch');
- * console.log(pm.scan('foo/bar/*.js'));
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an object with tokens and regex source string.
- * @api public
- */
-
-const scan$1 = (input, options) => {
- const opts = options || {};
-
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
-
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let negatedExtglob = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = { value: '', depth: 0, isGlob: false };
-
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
-
- while (index < length) {
- code = advance();
- let next;
-
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
-
- if (code === CHAR_LEFT_CURLY_BRACE$1) {
- braceEscaped = true;
- }
- continue;
- }
-
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE$1) {
- braces++;
-
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (code === CHAR_LEFT_CURLY_BRACE$1) {
- braces++;
- continue;
- }
-
- if (braceEscaped !== true && code === CHAR_DOT$1 && (code = advance()) === CHAR_DOT$1) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (braceEscaped !== true && code === CHAR_COMMA$1) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_RIGHT_CURLY_BRACE$1) {
- braces--;
-
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_FORWARD_SLASH) {
- slashes.push(index);
- tokens.push(token);
- token = { value: '', depth: 0, isGlob: false };
-
- if (finished === true) continue;
- if (prev === CHAR_DOT$1 && index === (start + 1)) {
- start += 2;
- continue;
- }
-
- lastIndex = index + 1;
- continue;
- }
-
- if (opts.noext !== true) {
- const isExtglobChar = code === CHAR_PLUS
- || code === CHAR_AT
- || code === CHAR_ASTERISK
- || code === CHAR_QUESTION_MARK
- || code === CHAR_EXCLAMATION_MARK;
-
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES$1) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
- if (code === CHAR_EXCLAMATION_MARK && index === start) {
- negatedExtglob = true;
- }
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES$1) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
-
- if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_QUESTION_MARK) {
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_LEFT_SQUARE_BRACKET$1) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
-
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES$1) {
- isGlob = token.isGlob = true;
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES$1) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES$1) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
-
- if (isGlob === true) {
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
- }
-
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
-
- let base = str;
- let prefix = '';
- let glob = '';
-
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
-
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = '';
- glob = str;
- } else {
- base = str;
- }
-
- if (base && base !== '' && base !== '/' && base !== str) {
- if (isPathSeparator(base.charCodeAt(base.length - 1))) {
- base = base.slice(0, -1);
- }
- }
-
- if (opts.unescape === true) {
- if (glob) glob = utils$6.removeBackslashes(glob);
-
- if (base && backslashes === true) {
- base = utils$6.removeBackslashes(base);
- }
- }
-
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated,
- negatedExtglob
- };
-
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator(code)) {
- tokens.push(token);
- }
- state.tokens = tokens;
- }
-
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
-
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else {
- tokens[idx].value = value;
- }
- depth(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== '') {
- parts.push(value);
- }
- prevIndex = i;
- }
-
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
-
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
-
- state.slashes = slashes;
- state.parts = parts;
- }
-
- return state;
-};
-
-var scan_1 = scan$1;
-
-const constants$4 = constants$5;
-const utils$5 = utils$7;
-
-/**
- * Constants
- */
-
-const {
- MAX_LENGTH: MAX_LENGTH$1,
- POSIX_REGEX_SOURCE,
- REGEX_NON_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_BACKREF,
- REPLACEMENTS
-} = constants$4;
-
-/**
- * Helpers
- */
-
-const expandRange = (args, options) => {
- if (typeof options.expandRange === 'function') {
- return options.expandRange(...args, options);
- }
-
- args.sort();
- const value = `[${args.join('-')}]`;
-
- return value;
-};
-
-/**
- * Create the message for a syntax error
- */
-
-const syntaxError = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
-};
-
-/**
- * Parse the given input string.
- * @param {String} input
- * @param {Object} options
- * @return {Object}
- */
-
-const parse$a = (input, options) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- input = REPLACEMENTS[input] || input;
-
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
-
- let len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- const bos = { type: 'bos', value: '', output: opts.prepend || '' };
- const tokens = [bos];
-
- const capture = opts.capture ? '' : '?:';
- const win32 = utils$5.isWindows(options);
-
- // create constants based on platform, for windows or posix
- const PLATFORM_CHARS = constants$4.globChars(win32);
- const EXTGLOB_CHARS = constants$4.extglobChars(PLATFORM_CHARS);
-
- const {
- DOT_LITERAL,
- PLUS_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- } = PLATFORM_CHARS;
-
- const globstar = opts => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const nodot = opts.dot ? '' : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- // minimatch options support
- if (typeof opts.noext === 'boolean') {
- opts.noextglob = opts.noext;
- }
-
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: '',
- output: '',
- prefix: '',
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
-
- input = utils$5.removePrefix(input, state);
- len = input.length;
-
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
-
- /**
- * Tokenizing helpers
- */
-
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index] || '';
- const remaining = () => input.slice(state.index + 1);
- const consume = (value = '', num = 0) => {
- state.consumed += value;
- state.index += num;
- };
-
- const append = token => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
-
- const negate = () => {
- let count = 1;
-
- while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
- advance();
- state.start++;
- count++;
- }
-
- if (count % 2 === 0) {
- return false;
- }
-
- state.negated = true;
- state.start++;
- return true;
- };
-
- const increment = type => {
- state[type]++;
- stack.push(type);
- };
-
- const decrement = type => {
- state[type]--;
- stack.pop();
- };
-
- /**
- * Push tokens onto the tokens array. This helper speeds up
- * tokenizing by 1) helping us avoid backtracking as much as possible,
- * and 2) helping us avoid creating extra tokens when consecutive
- * characters are plain text. This improves performance and simplifies
- * lookbehinds.
- */
-
- const push = tok => {
- if (prev.type === 'globstar') {
- const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
- const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
-
- if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = 'star';
- prev.value = '*';
- prev.output = star;
- state.output += prev.output;
- }
- }
-
- if (extglobs.length && tok.type !== 'paren') {
- extglobs[extglobs.length - 1].inner += tok.value;
- }
-
- if (tok.value || tok.output) append(tok);
- if (prev && prev.type === 'text' && tok.type === 'text') {
- prev.value += tok.value;
- prev.output = (prev.output || '') + tok.value;
- return;
- }
-
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
-
- const extglobOpen = (type, value) => {
- const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
-
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? '(' : '') + token.open;
-
- increment('parens');
- push({ type, value, output: state.output ? '' : ONE_CHAR });
- push({ type: 'paren', extglob: true, value: advance(), output });
- extglobs.push(token);
- };
-
- const extglobClose = token => {
- let output = token.close + (opts.capture ? ')' : '');
- let rest;
-
- if (token.type === 'negate') {
- let extglobStar = star;
-
- if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
- extglobStar = globstar(opts);
- }
-
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
- output = token.close = `)$))${extglobStar}`;
- }
-
- if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
- // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
- // In this case, we need to parse the string and use it in the output of the original pattern.
- // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
- //
- // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
- const expression = parse$a(rest, { ...options, fastpaths: false }).output;
-
- output = token.close = `)${expression})${extglobStar})`;
- }
-
- if (token.prev.type === 'bos') {
- state.negatedExtglob = true;
- }
- }
-
- push({ type: 'paren', extglob: true, value, output });
- decrement('parens');
- };
-
- /**
- * Fast paths
- */
-
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
-
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
- if (first === '\\') {
- backslashes = true;
- return m;
- }
-
- if (first === '?') {
- if (esc) {
- return esc + first + (rest ? QMARK.repeat(rest.length) : '');
- }
- if (index === 0) {
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
- }
- return QMARK.repeat(chars.length);
- }
-
- if (first === '.') {
- return DOT_LITERAL.repeat(chars.length);
- }
-
- if (first === '*') {
- if (esc) {
- return esc + first + (rest ? star : '');
- }
- return star;
- }
- return esc ? m : `\\${m}`;
- });
-
- if (backslashes === true) {
- if (opts.unescape === true) {
- output = output.replace(/\\/g, '');
- } else {
- output = output.replace(/\\+/g, m => {
- return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
- });
- }
- }
-
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
-
- state.output = utils$5.wrapOutput(output, state, options);
- return state;
- }
-
- /**
- * Tokenize input until we reach end-of-string
- */
-
- while (!eos()) {
- value = advance();
-
- if (value === '\u0000') {
- continue;
- }
-
- /**
- * Escaped characters
- */
-
- if (value === '\\') {
- const next = peek();
-
- if (next === '/' && opts.bash !== true) {
- continue;
- }
-
- if (next === '.' || next === ';') {
- continue;
- }
-
- if (!next) {
- value += '\\';
- push({ type: 'text', value });
- continue;
- }
-
- // collapse slashes to reduce potential for exploits
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
-
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) {
- value += '\\';
- }
- }
-
- if (opts.unescape === true) {
- value = advance();
- } else {
- value += advance();
- }
-
- if (state.brackets === 0) {
- push({ type: 'text', value });
- continue;
- }
- }
-
- /**
- * If we're inside a regex character class, continue
- * until we reach the closing bracket.
- */
-
- if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
- if (opts.posix !== false && value === ':') {
- const inner = prev.value.slice(1);
- if (inner.includes('[')) {
- prev.posix = true;
-
- if (inner.includes(':')) {
- const idx = prev.value.lastIndexOf('[');
- const pre = prev.value.slice(0, idx);
- const rest = prev.value.slice(idx + 2);
- const posix = POSIX_REGEX_SOURCE[rest];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
-
- if (!bos.output && tokens.indexOf(prev) === 1) {
- bos.output = ONE_CHAR;
- }
- continue;
- }
- }
- }
- }
-
- if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
- value = `\\${value}`;
- }
-
- if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
- value = `\\${value}`;
- }
-
- if (opts.posix === true && value === '!' && prev.value === '[') {
- value = '^';
- }
-
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * If we're inside a quoted string, continue
- * until we reach the closing double quote.
- */
-
- if (state.quotes === 1 && value !== '"') {
- value = utils$5.escapeRegex(value);
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * Double quotes
- */
-
- if (value === '"') {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) {
- push({ type: 'text', value });
- }
- continue;
- }
-
- /**
- * Parentheses
- */
-
- if (value === '(') {
- increment('parens');
- push({ type: 'paren', value });
- continue;
- }
-
- if (value === ')') {
- if (state.parens === 0 && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '('));
- }
-
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
-
- push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
- decrement('parens');
- continue;
- }
-
- /**
- * Square brackets
- */
-
- if (value === '[') {
- if (opts.nobracket === true || !remaining().includes(']')) {
- if (opts.nobracket !== true && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('closing', ']'));
- }
-
- value = `\\${value}`;
- } else {
- increment('brackets');
- }
-
- push({ type: 'bracket', value });
- continue;
- }
-
- if (value === ']') {
- if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '['));
- }
-
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- decrement('brackets');
-
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
- value = `/${value}`;
- }
-
- prev.value += value;
- append({ value });
-
- // when literal brackets are explicitly disabled
- // assume we should match with a regex character class
- if (opts.literalBrackets === false || utils$5.hasRegexChars(prevValue)) {
- continue;
- }
-
- const escaped = utils$5.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
-
- // when literal brackets are explicitly enabled
- // assume we should escape the brackets to match literal characters
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
-
- // when the user specifies nothing, try to match both
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
-
- /**
- * Braces
- */
-
- if (value === '{' && opts.nobrace !== true) {
- increment('braces');
-
- const open = {
- type: 'brace',
- value,
- output: '(',
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
-
- braces.push(open);
- push(open);
- continue;
- }
-
- if (value === '}') {
- const brace = braces[braces.length - 1];
-
- if (opts.nobrace === true || !brace) {
- push({ type: 'text', value, output: value });
- continue;
- }
-
- let output = ')';
-
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
-
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === 'brace') {
- break;
- }
- if (arr[i].type !== 'dots') {
- range.unshift(arr[i].value);
- }
- }
-
- output = expandRange(range, opts);
- state.backtrack = true;
- }
-
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = '\\{';
- value = output = '\\}';
- state.output = out;
- for (const t of toks) {
- state.output += (t.output || t.value);
- }
- }
-
- push({ type: 'brace', value, output });
- decrement('braces');
- braces.pop();
- continue;
- }
-
- /**
- * Pipes
- */
-
- if (value === '|') {
- if (extglobs.length > 0) {
- extglobs[extglobs.length - 1].conditions++;
- }
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Commas
- */
-
- if (value === ',') {
- let output = value;
-
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === 'braces') {
- brace.comma = true;
- output = '|';
- }
-
- push({ type: 'comma', value, output });
- continue;
- }
-
- /**
- * Slashes
- */
-
- if (value === '/') {
- // if the beginning of the glob is "./", advance the start
- // to the current index, and don't add the "./" characters
- // to the state. This greatly simplifies lookbehinds when
- // checking for BOS characters like "!" and "." (not "./")
- if (prev.type === 'dot' && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = '';
- state.output = '';
- tokens.pop();
- prev = bos; // reset "prev" to the first token
- continue;
- }
-
- push({ type: 'slash', value, output: SLASH_LITERAL });
- continue;
- }
-
- /**
- * Dots
- */
-
- if (value === '.') {
- if (state.braces > 0 && prev.type === 'dot') {
- if (prev.value === '.') prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = 'dots';
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
-
- if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
- push({ type: 'text', value, output: DOT_LITERAL });
- continue;
- }
-
- push({ type: 'dot', value, output: DOT_LITERAL });
- continue;
- }
-
- /**
- * Question marks
- */
-
- if (value === '?') {
- const isGroup = prev && prev.value === '(';
- if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('qmark', value);
- continue;
- }
-
- if (prev && prev.type === 'paren') {
- const next = peek();
- let output = value;
-
- if (next === '<' && !utils$5.supportsLookbehinds()) {
- throw new Error('Node.js v10 or higher is required for regex lookbehinds');
- }
-
- if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
- output = `\\${value}`;
- }
-
- push({ type: 'text', value, output });
- continue;
- }
-
- if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
- push({ type: 'qmark', value, output: QMARK_NO_DOT });
- continue;
- }
-
- push({ type: 'qmark', value, output: QMARK });
- continue;
- }
-
- /**
- * Exclamation
- */
-
- if (value === '!') {
- if (opts.noextglob !== true && peek() === '(') {
- if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
- extglobOpen('negate', value);
- continue;
- }
- }
-
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
-
- /**
- * Plus
- */
-
- if (value === '+') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('plus', value);
- continue;
- }
-
- if ((prev && prev.value === '(') || opts.regex === false) {
- push({ type: 'plus', value, output: PLUS_LITERAL });
- continue;
- }
-
- if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
- push({ type: 'plus', value });
- continue;
- }
-
- push({ type: 'plus', value: PLUS_LITERAL });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value === '@') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- push({ type: 'at', extglob: true, value, output: '' });
- continue;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value !== '*') {
- if (value === '$' || value === '^') {
- value = `\\${value}`;
- }
-
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Stars
- */
-
- if (prev && (prev.type === 'globstar' || prev.star === true)) {
- prev.type = 'star';
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen('star', value);
- continue;
- }
-
- if (prev.type === 'star') {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
-
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === 'slash' || prior.type === 'bos';
- const afterStar = before && (before.type === 'star' || before.type === 'globstar');
-
- if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
- const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
- if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- // strip consecutive `/**/`
- while (rest.slice(0, 3) === '/**') {
- const after = input[state.index + 4];
- if (after && after !== '/') {
- break;
- }
- rest = rest.slice(3);
- consume('/**', 3);
- }
-
- if (prior.type === 'bos' && eos()) {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
- const end = rest[1] !== void 0 ? '|$' : '';
-
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
-
- state.output += prior.output + prev.output;
- state.globstar = true;
-
- consume(value + advance());
-
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- if (prior.type === 'bos' && rest[0] === '/') {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- // remove single star from output
- state.output = state.output.slice(0, -prev.output.length);
-
- // reset previous token to globstar
- prev.type = 'globstar';
- prev.output = globstar(opts);
- prev.value += value;
-
- // reset output with globstar
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- const token = { type: 'star', value, output: star };
-
- if (opts.bash === true) {
- token.output = '.*?';
- if (prev.type === 'bos' || prev.type === 'slash') {
- token.output = nodot + token.output;
- }
- push(token);
- continue;
- }
-
- if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
-
- if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
- if (prev.type === 'dot') {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
-
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
-
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
-
- if (peek() !== '*') {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
-
- push(token);
- }
-
- while (state.brackets > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
- state.output = utils$5.escapeLast(state.output, '[');
- decrement('brackets');
- }
-
- while (state.parens > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
- state.output = utils$5.escapeLast(state.output, '(');
- decrement('parens');
- }
-
- while (state.braces > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
- state.output = utils$5.escapeLast(state.output, '{');
- decrement('braces');
- }
-
- if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
- push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
- }
-
- // rebuild the output if we had to backtrack at any point
- if (state.backtrack === true) {
- state.output = '';
-
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
-
- if (token.suffix) {
- state.output += token.suffix;
- }
- }
- }
-
- return state;
-};
-
-/**
- * Fast paths for creating regular expressions for common glob patterns.
- * This can significantly speed up processing and has very little downside
- * impact when none of the fast paths match.
- */
-
-parse$a.fastpaths = (input, options) => {
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
- const len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- input = REPLACEMENTS[input] || input;
- const win32 = utils$5.isWindows(options);
-
- // create constants based on platform, for windows or posix
- const {
- DOT_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOTS_SLASH,
- STAR,
- START_ANCHOR
- } = constants$4.globChars(win32);
-
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? '' : '?:';
- const state = { negated: false, prefix: '' };
- let star = opts.bash === true ? '.*?' : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- const globstar = opts => {
- if (opts.noglobstar === true) return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const create = str => {
- switch (str) {
- case '*':
- return `${nodot}${ONE_CHAR}${star}`;
-
- case '.*':
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*.*':
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*/*':
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
-
- case '**':
- return nodot + globstar(opts);
-
- case '**/*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
-
- case '**/*.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '**/.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match) return;
-
- const source = create(match[1]);
- if (!source) return;
-
- return source + DOT_LITERAL + match[2];
- }
- }
- };
-
- const output = utils$5.removePrefix(input, state);
- let source = create(output);
-
- if (source && opts.strictSlashes !== true) {
- source += `${SLASH_LITERAL}?`;
- }
-
- return source;
-};
-
-var parse_1$2 = parse$a;
-
-const path$8 = require$$0$2;
-const scan = scan_1;
-const parse$9 = parse_1$2;
-const utils$4 = utils$7;
-const constants$3 = constants$5;
-const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
-
-/**
- * Creates a matcher function from one or more glob patterns. The
- * returned function takes a string to match as its first argument,
- * and returns true if the string is a match. The returned matcher
- * function also takes a boolean as the second argument that, when true,
- * returns an object with additional information.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch(glob[, options]);
- *
- * const isMatch = picomatch('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @name picomatch
- * @param {String|Array} `globs` One or more glob patterns.
- * @param {Object=} `options`
- * @return {Function=} Returns a matcher function.
- * @api public
- */
-
-const picomatch$3 = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map(input => picomatch$3(input, options, returnState));
- const arrayMatcher = str => {
- for (const isMatch of fns) {
- const state = isMatch(str);
- if (state) return state;
- }
- return false;
- };
- return arrayMatcher;
- }
-
- const isState = isObject$1(glob) && glob.tokens && glob.input;
-
- if (glob === '' || (typeof glob !== 'string' && !isState)) {
- throw new TypeError('Expected pattern to be a non-empty string');
- }
-
- const opts = options || {};
- const posix = utils$4.isWindows(options);
- const regex = isState
- ? picomatch$3.compileRe(glob, options)
- : picomatch$3.makeRe(glob, options, false, true);
-
- const state = regex.state;
- delete regex.state;
-
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
- isIgnored = picomatch$3(opts.ignore, ignoreOpts, returnState);
- }
-
- const matcher = (input, returnObject = false) => {
- const { isMatch, match, output } = picomatch$3.test(input, regex, options, { glob, posix });
- const result = { glob, state, regex, posix, input, output, match, isMatch };
-
- if (typeof opts.onResult === 'function') {
- opts.onResult(result);
- }
-
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === 'function') {
- opts.onIgnore(result);
- }
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (typeof opts.onMatch === 'function') {
- opts.onMatch(result);
- }
- return returnObject ? result : true;
- };
-
- if (returnState) {
- matcher.state = state;
- }
-
- return matcher;
-};
-
-/**
- * Test `input` with the given `regex`. This is used by the main
- * `picomatch()` function to test the input string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.test(input, regex[, options]);
- *
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp} `regex`
- * @return {Object} Returns an object with matching info.
- * @api public
- */
-
-picomatch$3.test = (input, regex, options, { glob, posix } = {}) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected input to be a string');
- }
-
- if (input === '') {
- return { isMatch: false, output: '' };
- }
-
- const opts = options || {};
- const format = opts.format || (posix ? utils$4.toPosixSlashes : null);
- let match = input === glob;
- let output = (match && format) ? format(input) : input;
-
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
-
- if (match === false || opts.capture === true) {
- if (opts.matchBase === true || opts.basename === true) {
- match = picomatch$3.matchBase(input, regex, options, posix);
- } else {
- match = regex.exec(output);
- }
- }
-
- return { isMatch: Boolean(match), match, output };
-};
-
-/**
- * Match the basename of a filepath.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.matchBase(input, glob[, options]);
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
- * @return {Boolean}
- * @api public
- */
-
-picomatch$3.matchBase = (input, glob, options, posix = utils$4.isWindows(options)) => {
- const regex = glob instanceof RegExp ? glob : picomatch$3.makeRe(glob, options);
- return regex.test(path$8.basename(input));
-};
-
-/**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.isMatch(string, patterns[, options]);
- *
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String|Array} str The string to test.
- * @param {String|Array} patterns One or more glob patterns to use for matching.
- * @param {Object} [options] See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-picomatch$3.isMatch = (str, patterns, options) => picomatch$3(patterns, options)(str);
-
-/**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const result = picomatch.parse(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
- * @api public
- */
-
-picomatch$3.parse = (pattern, options) => {
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$3.parse(p, options));
- return parse$9(pattern, { ...options, fastpaths: false });
-};
-
-/**
- * Scan a glob pattern to separate the pattern into segments.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.scan(input[, options]);
- *
- * const result = picomatch.scan('!./foo/*.js');
- * console.log(result);
- * { prefix: '!./',
- * input: '!./foo/*.js',
- * start: 3,
- * base: 'foo',
- * glob: '*.js',
- * isBrace: false,
- * isBracket: false,
- * isGlob: true,
- * isExtglob: false,
- * isGlobstar: false,
- * negated: true }
- * ```
- * @param {String} `input` Glob pattern to scan.
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
-
-picomatch$3.scan = (input, options) => scan(input, options);
-
-/**
- * Compile a regular expression from the `state` object returned by the
- * [parse()](#parse) method.
- *
- * @param {Object} `state`
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
- * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
- * @return {RegExp}
- * @api public
- */
-
-picomatch$3.compileRe = (state, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) {
- return state.output;
- }
-
- const opts = options || {};
- const prepend = opts.contains ? '' : '^';
- const append = opts.contains ? '' : '$';
-
- let source = `${prepend}(?:${state.output})${append}`;
- if (state && state.negated === true) {
- source = `^(?!${source}).*$`;
- }
-
- const regex = picomatch$3.toRegex(source, options);
- if (returnState === true) {
- regex.state = state;
- }
-
- return regex;
-};
-
-/**
- * Create a regular expression from a parsed glob pattern.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const state = picomatch.parse('*.js');
- * // picomatch.compileRe(state[, options]);
- *
- * console.log(picomatch.compileRe(state));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `state` The object returned from the `.parse` method.
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
- * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
-
-picomatch$3.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== 'string') {
- throw new TypeError('Expected a non-empty string');
- }
-
- let parsed = { negated: false, fastpaths: true };
-
- if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
- parsed.output = parse$9.fastpaths(input, options);
- }
-
- if (!parsed.output) {
- parsed = parse$9(input, options);
- }
-
- return picomatch$3.compileRe(parsed, options, returnOutput, returnState);
-};
-
-/**
- * Create a regular expression from the given regex source string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.toRegex(source[, options]);
- *
- * const { output } = picomatch.parse('*.js');
- * console.log(picomatch.toRegex(output));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `source` Regular expression source string.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-picomatch$3.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
- } catch (err) {
- if (options && options.debug === true) throw err;
- return /$^/;
- }
-};
-
-/**
- * Picomatch constants.
- * @return {Object}
- */
-
-picomatch$3.constants = constants$3;
-
-/**
- * Expose "picomatch"
- */
-
-var picomatch_1 = picomatch$3;
-
-var picomatch$2 = picomatch_1;
-
-const fs$5 = require$$0$3;
+const fs$5 = require$$0$4;
const { Readable } = require$$0$8;
const sysPath$3 = require$$0$2;
const { promisify: promisify$3 } = require$$1;
@@ -25367,7 +19718,7 @@ const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code);
const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10));
const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5));
-const normalizeFilter = filter => {
+const normalizeFilter$1 = filter => {
if (filter === undefined) return;
if (typeof filter === 'function') return filter;
@@ -25423,8 +19774,8 @@ class ReaddirpStream extends Readable {
const opts = { ...ReaddirpStream.defaultOptions, ...options };
const { root, type } = opts;
- this._fileFilter = normalizeFilter(opts.fileFilter);
- this._directoryFilter = normalizeFilter(opts.directoryFilter);
+ this._fileFilter = normalizeFilter$1(opts.fileFilter);
+ this._directoryFilter = normalizeFilter$1(opts.directoryFilter);
const statMethod = opts.lstat ? lstat$2 : stat$3;
// Use bigint stats if it's windows and stat() supports options (node 10+).
@@ -27718,7 +22069,7 @@ var constants$1 = {};
exports.isIBMi = os.type() === 'OS400';
} (constants$1));
-const fs$4 = require$$0$3;
+const fs$4 = require$$0$4;
const sysPath$2 = require$$0$2;
const { promisify: promisify$2 } = require$$1;
const isBinaryPath = isBinaryPath$1;
@@ -28363,7 +22714,7 @@ var nodefsHandler = NodeFsHandler$1;
var fseventsHandler = {exports: {}};
-const fs$3 = require$$0$3;
+const fs$3 = require$$0$4;
const sysPath$1 = require$$0$2;
const { promisify: promisify$1 } = require$$1;
@@ -28892,7 +23243,7 @@ fseventsHandler.exports.canUse = canUse;
var fseventsHandlerExports = fseventsHandler.exports;
const { EventEmitter: EventEmitter$2 } = require$$0$7;
-const fs$2 = require$$0$3;
+const fs$2 = require$$0$4;
const sysPath = require$$0$2;
const { promisify } = require$$1;
const readdirp = readdirp_1;
@@ -30405,7 +24756,7 @@ var getArgs = function getArgumentsForPosition (
* Modified by Yuxi Evan You
*/
-const fs$1 = require$$0$3;
+const fs$1 = require$$0$4;
const os = require$$2;
const path$4 = require$$0$2;
const colors = picocolorsExports;
@@ -30651,7 +25002,7 @@ async function resolveHttpsConfig(https) {
}
async function readFileIfExists(value) {
if (typeof value === "string") {
- return fsp.readFile(path$d.resolve(value)).catch(() => value);
+ return fsp.readFile(path$b.resolve(value)).catch(() => value);
}
return value;
}
@@ -30733,7 +25084,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
return input;
}
const trimmedVarName = varName?.trim();
- const sourceFile = path$d.resolve(path$d.dirname(id), pos.source);
+ const sourceFile = path$b.resolve(path$b.dirname(id), pos.source);
const source = `${sourceFile}:${pos.line}:${pos.column + 1}`;
if (!trimmedVarName || trimmedVarName === "eval") {
return ` at ${source}`;
@@ -31289,11 +25640,11 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
}
return importId;
}
- function defineExport(position, name, local = name) {
+ function defineExport(name, local = name) {
s.appendLeft(
- position,
- `
-Object.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, { enumerable: true, configurable: true, get(){ return ${local} }});`
+ fileStartIndex,
+ `Object.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, { enumerable: true, configurable: true, get(){ return ${local} }});
+`
);
}
const imports = [];
@@ -31337,12 +25688,12 @@ Object.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, { enumera
if (node.type === "ExportNamedDeclaration") {
if (node.declaration) {
if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
- defineExport(node.end, node.declaration.id.name);
+ defineExport(node.declaration.id.name);
} else {
for (const declaration of node.declaration.declarations) {
const names = extract_names(declaration.id);
for (const name of names) {
- defineExport(node.end, name);
+ defineExport(name);
}
}
}
@@ -31364,14 +25715,9 @@ Object.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, { enumera
spec.exported
);
if (spec.local.type === "Identifier") {
- defineExport(
- node.end,
- exportedAs,
- `${importId}.${spec.local.name}`
- );
+ defineExport(exportedAs, `${importId}.${spec.local.name}`);
} else {
defineExport(
- node.end,
exportedAs,
`${importId}[${JSON.stringify(spec.local.value)}]`
);
@@ -31384,7 +25730,7 @@ Object.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, { enumera
const exportedAs = getIdentifierNameOrLiteralValue$1(
spec.exported
);
- defineExport(node.end, exportedAs, binding || local);
+ defineExport(exportedAs, binding || local);
}
}
}
@@ -31416,7 +25762,7 @@ Object.defineProperty(${ssrModuleExportsKey}, "default", { enumerable: true, con
const exportedAs = getIdentifierNameOrLiteralValue$1(
node.exported
);
- defineExport(node.end, exportedAs, `${importId}`);
+ defineExport(exportedAs, `${importId}`);
} else {
s.appendLeft(node.end, `${ssrExportAllKey}(${importId});
`);
@@ -31475,7 +25821,7 @@ Object.defineProperty(${ssrModuleExportsKey}, "default", { enumerable: true, con
map = inMap;
} else {
map = s.generateMap({ hires: "boundary" });
- map.sources = [path$d.basename(url)];
+ map.sources = [path$b.basename(url)];
map.sourcesContent = [originalCode];
if (inMap && inMap.mappings && "sources" in inMap && inMap.sources.length > 0) {
map = combineSourcemaps(url, [
@@ -31876,8 +26222,8 @@ async function defaultBrowser() {
}
// Path to included `xdg-open`.
-const __dirname = path$d.dirname(fileURLToPath$1(import.meta.url));
-const localXdgOpenPath = path$d.join(__dirname, 'xdg-open');
+const __dirname = path$b.dirname(fileURLToPath$1(import.meta.url));
+const localXdgOpenPath = path$b.join(__dirname, 'xdg-open');
const {platform, arch} = process$1;
@@ -31904,7 +26250,7 @@ const getWslDrivesMountPoint = (() => {
let isConfigFileExists = false;
try {
- await fsp.access(configFilePath, constants$9.F_OK);
+ await fsp.access(configFilePath, constants$3.F_OK);
isConfigFileExists = true;
} catch {}
@@ -32083,7 +26429,7 @@ const baseOpen = async options => {
// Check if local `xdg-open` exists and is executable.
let exeLocalXdgOpen = false;
try {
- await fsp.access(localXdgOpenPath, constants$9.X_OK);
+ await fsp.access(localXdgOpenPath, constants$3.X_OK);
exeLocalXdgOpen = true;
} catch {}
@@ -32216,7 +26562,7 @@ function requireWindows () {
windows = isexe;
isexe.sync = sync;
- var fs = require$$0$3;
+ var fs = require$$0$4;
function checkPathExt (path, options) {
var pathext = options.pathExt !== undefined ?
@@ -32267,7 +26613,7 @@ function requireMode () {
mode = isexe;
isexe.sync = sync;
- var fs = require$$0$3;
+ var fs = require$$0$4;
function isexe (path, options, cb) {
fs.stat(path, function (er, stat) {
@@ -32630,7 +26976,7 @@ var shebangCommand$1 = (string = '') => {
return argument ? `${binary} ${argument}` : binary;
};
-const fs = require$$0$3;
+const fs = require$$0$4;
const shebangCommand = shebangCommand$1;
function readShebang$1(command) {
@@ -33040,11 +27386,11 @@ const BASE_PREVIEW_SHORTCUTS = [
];
function getResolvedOutDirs(root, outDir, outputOptions) {
- const resolvedOutDir = path$d.resolve(root, outDir);
+ const resolvedOutDir = path$b.resolve(root, outDir);
if (!outputOptions) return /* @__PURE__ */ new Set([resolvedOutDir]);
return new Set(
arraify(outputOptions).map(
- ({ dir }) => dir ? path$d.resolve(root, dir) : resolvedOutDir
+ ({ dir }) => dir ? path$b.resolve(root, dir) : resolvedOutDir
)
);
}
@@ -37922,7 +32268,7 @@ function createWebSocketServer(server, config, httpsOptions) {
};
}
let wsHttpServer = void 0;
- const hmr = isObject$2(config.server.hmr) && config.server.hmr;
+ const hmr = isObject$1(config.server.hmr) && config.server.hmr;
const hmrServer = hmr && hmr.server;
const hmrPort = hmr && hmr.port;
const portsAreCompatible = !hmrPort || hmrPort === config.server.port;
@@ -37966,7 +32312,7 @@ function createWebSocketServer(server, config, httpsOptions) {
let hmrBase = config.base;
const hmrPath = hmr ? hmr.path : void 0;
if (hmrPath) {
- hmrBase = path$d.posix.join(hmrBase, hmrPath);
+ hmrBase = path$b.posix.join(hmrBase, hmrPath);
}
hmrServerWsListener = (req, socket, head) => {
const protocol = req.headers["sec-websocket-protocol"];
@@ -38995,7 +33341,7 @@ var debug_1 = function () {
if (!debug$7) {
try {
/* eslint global-require: off */
- debug$7 = srcExports$1("follow-redirects");
+ debug$7 = nodeExports$1("follow-redirects");
}
catch (error) { /* */ }
if (typeof debug$7 !== "function") {
@@ -40512,14 +34858,14 @@ function htmlFallbackMiddleware(root, spaFallback) {
const url = cleanUrl(req.url);
const pathname = decodeURIComponent(url);
if (pathname.endsWith(".html")) {
- const filePath = path$d.join(root, pathname);
+ const filePath = path$b.join(root, pathname);
if (fs__default.existsSync(filePath)) {
debug$4?.(`Rewriting ${req.method} ${req.url} to ${url}`);
req.url = url;
return next();
}
} else if (pathname.endsWith("/")) {
- const filePath = path$d.join(root, pathname, "index.html");
+ const filePath = path$b.join(root, pathname, "index.html");
if (fs__default.existsSync(filePath)) {
const newUrl = url + "index.html";
debug$4?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`);
@@ -40527,7 +34873,7 @@ function htmlFallbackMiddleware(root, spaFallback) {
return next();
}
} else {
- const filePath = path$d.join(root, pathname + ".html");
+ const filePath = path$b.join(root, pathname + ".html");
if (fs__default.existsSync(filePath)) {
const newUrl = url + ".html";
debug$4?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`);
@@ -40562,7 +34908,7 @@ var etag_1 = etag;
*/
var crypto = require$$3;
-var Stats = require$$0$3.Stats;
+var Stats = require$$0$4.Stats;
/**
* Module variables.
@@ -40722,7 +35068,7 @@ function send$1(req, res, content, type, options) {
type,
code,
ms.generateMap({
- source: path$d.basename(urlWithoutTimestamp),
+ source: path$b.basename(urlWithoutTimestamp),
hires: "boundary",
includeContent: true
})
@@ -41033,7 +35379,7 @@ function serveStaticMiddleware(server) {
);
return function viteServeStaticMiddleware(req, res, next) {
const cleanedUrl = cleanUrl(req.url);
- if (cleanedUrl.endsWith("/") || path$d.extname(cleanedUrl) === ".html" || isInternalRequest(req.url) || // skip url starting with // as these will be interpreted as
+ if (cleanedUrl.endsWith("/") || path$b.extname(cleanedUrl) === ".html" || isInternalRequest(req.url) || // skip url starting with // as these will be interpreted as
// scheme relative URLs by new URL() and will not be a valid file path
req.url?.startsWith("//")) {
return next();
@@ -41054,7 +35400,7 @@ function serveStaticMiddleware(server) {
}
}
const resolvedPathname = redirectedPathname || pathname;
- let fileUrl = path$d.resolve(dir, removeLeadingSlash(resolvedPathname));
+ let fileUrl = path$b.resolve(dir, removeLeadingSlash(resolvedPathname));
if (resolvedPathname.endsWith("/") && fileUrl[fileUrl.length - 1] !== "/") {
fileUrl = withTrailingSlash(fileUrl);
}
@@ -41078,7 +35424,7 @@ function serveRawFsMiddleware(server) {
const url = new URL(req.url, "http://example.com");
const pathname = decodeURI(url.pathname);
if (!ensureServingAccess(
- slash$1(path$d.resolve(fsPathFromId(pathname))),
+ slash$1(path$b.resolve(fsPathFromId(pathname))),
server,
res,
next
@@ -41300,7 +35646,7 @@ ${e}`, {
}
} else {
debugLoad?.(`${timeFrom(loadStart)} [plugin] ${prettyUrl}`);
- if (isObject$2(loadResult)) {
+ if (isObject$1(loadResult)) {
code = loadResult.code;
map = loadResult.map;
} else {
@@ -41309,7 +35655,7 @@ ${e}`, {
}
if (code == null) {
const isPublicFile = checkPublicFile(url, environment.getTopLevelConfig());
- let publicDirName = path$d.relative(config.root, config.publicDir);
+ let publicDirName = path$b.relative(config.root, config.publicDir);
if (publicDirName[0] !== ".") publicDirName = "/" + publicDirName;
const msg = isPublicFile ? `This file is in ${publicDirName} and will be copied as-is during build without going through the plugin transforms, and therefore should not be imported from source code. It can only be referenced via HTML tags.` : `Does the file exist?`;
const importerMod = moduleGraph.idToModuleMap.get(id)?.importers.values().next().value;
@@ -41356,14 +35702,14 @@ ${e}`, {
config.server.sourcemapIgnoreList,
logger
);
- if (path$d.isAbsolute(mod.file)) {
+ if (path$b.isAbsolute(mod.file)) {
let modDirname;
for (let sourcesIndex = 0; sourcesIndex < normalizedMap.sources.length; ++sourcesIndex) {
const sourcePath = normalizedMap.sources[sourcesIndex];
if (sourcePath) {
- if (path$d.isAbsolute(sourcePath)) {
- modDirname ??= path$d.dirname(mod.file);
- normalizedMap.sources[sourcesIndex] = path$d.relative(
+ if (path$b.isAbsolute(sourcePath)) {
+ modDirname ??= path$b.dirname(mod.file);
+ normalizedMap.sources[sourcesIndex] = path$b.relative(
modDirname,
sourcePath
);
@@ -41404,7 +35750,7 @@ async function handleModuleSoftInvalidation(environment, mod, timestamp) {
await init;
const source = transformResult.code;
const s = new MagicString(source);
- const [imports] = parse$e(source, mod.id || void 0);
+ const [imports] = parse$d(source, mod.id || void 0);
for (const imp of imports) {
let rawUrl = source.slice(imp.s, imp.e);
if (rawUrl === "import.meta") continue;
@@ -41556,20 +35902,24 @@ function modulePreloadPolyfillPlugin(config) {
let polyfillString;
return {
name: "vite:modulepreload-polyfill",
- resolveId(id) {
- if (id === modulePreloadPolyfillId) {
- return resolvedModulePreloadPolyfillId;
+ resolveId: {
+ handler(id) {
+ if (id === modulePreloadPolyfillId) {
+ return resolvedModulePreloadPolyfillId;
+ }
}
},
- load(id) {
- if (id === resolvedModulePreloadPolyfillId) {
- if (config.command !== "build" || this.environment.config.consumer !== "client") {
- return "";
+ load: {
+ handler(id) {
+ if (id === resolvedModulePreloadPolyfillId) {
+ if (config.command !== "build" || this.environment.config.consumer !== "client") {
+ return "";
+ }
+ if (!polyfillString) {
+ polyfillString = `${isModernFlag}&&(${polyfill.toString()}());`;
+ }
+ return { code: polyfillString, moduleSideEffects: true };
}
- if (!polyfillString) {
- polyfillString = `${isModernFlag}&&(${polyfill.toString()}());`;
- }
- return { code: polyfillString, moduleSideEffects: true };
}
}
};
@@ -41612,8 +35962,8 @@ function polyfill() {
}
}
-const htmlProxyRE$1 = /\?html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/;
-const isHtmlProxyRE = /\?html-proxy\b/;
+const htmlProxyRE$1 = /[?&]html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/;
+const isHtmlProxyRE = /[?&]html-proxy\b/;
const inlineCSSRE$1 = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g;
const inlineImportRE = /(? publicBase + filename;
- const toOutputPublicFilePath = (url) => toOutputFilePathInHtml(
- url.slice(1),
- "public",
- relativeUrlPath,
- "html",
- config,
- publicToRelative
- );
- const nodeStartWithLeadingWhitespace = (node) => {
- const startOffset = node.sourceCodeLocation.startOffset;
- if (startOffset === 0) return 0;
- const lineStartOffset = startOffset - node.sourceCodeLocation.startCol;
- let isLineEmpty = false;
- try {
- const line = s.slice(Math.max(0, lineStartOffset), startOffset);
- isLineEmpty = !line.trim();
- } catch {
- }
- return isLineEmpty ? lineStartOffset : startOffset;
- };
- html = await applyHtmlTransforms(html, preHooks, {
- path: publicPath,
- filename: id
- });
- let js = "";
- const s = new MagicString(html);
- const scriptUrls = [];
- const styleUrls = [];
- let inlineModuleIndex = -1;
- let everyScriptIsAsync = true;
- let someScriptsAreAsync = false;
- let someScriptsAreDefer = false;
- const assetUrlsPromises = [];
- const namedOutput = Object.keys(config.build.rollupOptions.input || {});
- const processAssetUrl = async (url, shouldInline) => {
- if (url !== "" && // Empty attribute
- !namedOutput.includes(url) && // Direct reference to named output
- !namedOutput.includes(removeLeadingSlash(url))) {
+ transform: {
+ async handler(html, id) {
+ if (id.endsWith(".html")) {
+ id = normalizePath$3(id);
+ const relativeUrlPath = normalizePath$3(path$b.relative(config.root, id));
+ const publicPath = `/${relativeUrlPath}`;
+ const publicBase = getBaseInHTML(relativeUrlPath, config);
+ const publicToRelative = (filename) => publicBase + filename;
+ const toOutputPublicFilePath = (url) => toOutputFilePathInHtml(
+ url.slice(1),
+ "public",
+ relativeUrlPath,
+ "html",
+ config,
+ publicToRelative
+ );
+ const nodeStartWithLeadingWhitespace = (node) => {
+ const startOffset = node.sourceCodeLocation.startOffset;
+ if (startOffset === 0) return 0;
+ const lineStartOffset = startOffset - node.sourceCodeLocation.startCol;
+ let isLineEmpty = false;
try {
- return await urlToBuiltUrl(this, url, id, shouldInline);
- } catch (e) {
- if (e.code !== "ENOENT") {
- throw e;
+ const line = s.slice(Math.max(0, lineStartOffset), startOffset);
+ isLineEmpty = !line.trim();
+ } catch {
+ }
+ return isLineEmpty ? lineStartOffset : startOffset;
+ };
+ html = await applyHtmlTransforms(html, preHooks, {
+ path: publicPath,
+ filename: id
+ });
+ let js = "";
+ const s = new MagicString(html);
+ const scriptUrls = [];
+ const styleUrls = [];
+ let inlineModuleIndex = -1;
+ let everyScriptIsAsync = true;
+ let someScriptsAreAsync = false;
+ let someScriptsAreDefer = false;
+ const assetUrlsPromises = [];
+ const namedOutput = Object.keys(
+ config.build.rollupOptions.input || {}
+ );
+ const processAssetUrl = async (url, shouldInline) => {
+ if (url !== "" && // Empty attribute
+ !namedOutput.includes(url) && // Direct reference to named output
+ !namedOutput.includes(removeLeadingSlash(url))) {
+ try {
+ return await urlToBuiltUrl(this, url, id, shouldInline);
+ } catch (e) {
+ if (e.code !== "ENOENT") {
+ throw e;
+ }
}
}
- }
- return url;
- };
- const setModuleSideEffectPromises = [];
- await traverseHtml(html, id, (node) => {
- if (!nodeIsElement(node)) {
- return;
- }
- let shouldRemove = false;
- if (node.nodeName === "script") {
- const { src, srcSourceCodeLocation, isModule, isAsync, isIgnored } = getScriptInfo(node);
- if (isIgnored) {
- removeViteIgnoreAttr(s, node.sourceCodeLocation);
- } else {
- const url = src && src.value;
- const isPublicFile = !!(url && checkPublicFile(url, config));
- if (isPublicFile) {
- overwriteAttrValue(
- s,
- srcSourceCodeLocation,
- partialEncodeURIPath(toOutputPublicFilePath(url))
- );
- }
- if (isModule) {
- inlineModuleIndex++;
- if (url && !isExcludedUrl(url) && !isPublicFile) {
- setModuleSideEffectPromises.push(
- this.resolve(url, id).then((resolved) => {
- if (!resolved) {
- return Promise.reject(
- new Error(`Failed to resolve ${url} from ${id}`)
- );
- }
- const moduleInfo = this.getModuleInfo(resolved.id);
- if (moduleInfo) {
- moduleInfo.moduleSideEffects = true;
- } else if (!resolved.external) {
- return this.load(resolved).then((mod) => {
- mod.moduleSideEffects = true;
- });
- }
- })
+ return url;
+ };
+ const setModuleSideEffectPromises = [];
+ await traverseHtml(html, id, (node) => {
+ if (!nodeIsElement(node)) {
+ return;
+ }
+ let shouldRemove = false;
+ if (node.nodeName === "script") {
+ const {
+ src,
+ srcSourceCodeLocation,
+ isModule,
+ isAsync,
+ isIgnored
+ } = getScriptInfo(node);
+ if (isIgnored) {
+ removeViteIgnoreAttr(s, node.sourceCodeLocation);
+ } else {
+ const url = src && src.value;
+ const isPublicFile = !!(url && checkPublicFile(url, config));
+ if (isPublicFile) {
+ overwriteAttrValue(
+ s,
+ srcSourceCodeLocation,
+ partialEncodeURIPath(toOutputPublicFilePath(url))
);
- js += `
+ }
+ if (isModule) {
+ inlineModuleIndex++;
+ if (url && !isExcludedUrl(url) && !isPublicFile) {
+ setModuleSideEffectPromises.push(
+ this.resolve(url, id).then((resolved) => {
+ if (!resolved) {
+ return Promise.reject(
+ new Error(`Failed to resolve ${url} from ${id}`)
+ );
+ }
+ const moduleInfo = this.getModuleInfo(resolved.id);
+ if (moduleInfo) {
+ moduleInfo.moduleSideEffects = true;
+ } else if (!resolved.external) {
+ return this.load(resolved).then((mod) => {
+ mod.moduleSideEffects = true;
+ });
+ }
+ })
+ );
+ js += `
import ${JSON.stringify(url)}`;
- shouldRemove = true;
+ shouldRemove = true;
+ } else if (node.childNodes.length) {
+ const scriptNode = node.childNodes.pop();
+ const contents = scriptNode.value;
+ const filePath = id.replace(normalizePath$3(config.root), "");
+ addToHTMLProxyCache(config, filePath, inlineModuleIndex, {
+ code: contents
+ });
+ js += `
+import "${id}?html-proxy&index=${inlineModuleIndex}.js"`;
+ shouldRemove = true;
+ }
+ everyScriptIsAsync &&= isAsync;
+ someScriptsAreAsync ||= isAsync;
+ someScriptsAreDefer ||= !isAsync;
+ } else if (url && !isPublicFile) {
+ if (!isExcludedUrl(url)) {
+ config.logger.warn(
+ `