├── .github └── workflows │ ├── ci.yaml │ └── release.yaml ├── .gitignore ├── .npmignore ├── README.md ├── dist ├── binarypath.js ├── install.js ├── run.js ├── set-version.js └── uninstall.js ├── package.json ├── run.js ├── src ├── binarypath.ts ├── install.ts ├── run.ts ├── set-version.ts └── uninstall.ts ├── tsconfig.json └── yarn.lock /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | pull_request: 4 | push: 5 | tags-ignore: 6 | - '**' 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: actions/setup-node@v2 14 | with: 15 | node-version: 'lts/*' 16 | cache: 'yarn' 17 | - run: yarn 18 | - run: yarn check -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: publish 2 | on: 3 | release: 4 | types: [created] 5 | jobs: 6 | publish: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: actions/setup-node@v2 11 | with: 12 | node-version: 'lts/*' 13 | cache: 'yarn' 14 | registry-url: 'https://registry.npmjs.org' 15 | scope: '@wundergraph' 16 | - run: yarn 17 | - run: yarn set-version 18 | - run: yarn build 19 | - run: yarn publish --access public --tags next 20 | env: 21 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | *.log 4 | .cache -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | .cache 3 | .github 4 | node_modules 5 | .gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > **Warning**: This repository is deprecated. Please see [wundergraph](https://github.com/wundergraph/wundergraph). 2 | 3 | # wunderctl - The WunderGraph Command Line Interface 4 | 5 | You can use `wunderctl` to initialize new WunderGraph Applications and develop locally. 6 | The CLI contains the Hyperfast Engine of WunderGraph, written in Golang and easy to use with the TypeScript SDK. 7 | 8 | The WunderGraph SDK is the easiest way to configure your WunderGraph applications. 9 | It's written in TypeScript and allows you to configure every aspect of your WunderGraph applications via Code. 10 | 11 | WunderGraph follows best practices for infrastructure as code. 12 | Instead of complex configurations via graphical user interfaces, 13 | WunderGraph applications are primarily configured using code. 14 | 15 | Your configuration can be stored alongside your application code in the `.wundergraph` directory, 16 | keeping your application code and the API configurations in sync. 17 | 18 | Using your CI-CD system of choice, you can deploy your WunderGraph APIs at the same time you're deploying your application code. 19 | Go from development to production without touching a single button, 20 | simply git push and everything gets deployed. 21 | 22 | Both SDK and CLI build the perfect team to help you develop and ship WunderGraph applications. 23 | 24 | ## Getting Started 25 | 26 | ### Install the CLI 27 | 28 | ```shell 29 | npm install -g @wundergraph/wunderctl 30 | or 31 | yarn global add @wundergraph/wunderctl 32 | ``` 33 | 34 | ### Initialize a new Project 35 | 36 | ```shell 37 | # default project without frameworks 38 | wunderctl init 39 | 40 | # nextjs starter 41 | wunderctl init --template nextjs-starter 42 | 43 | # nextjs with postgresql starter 44 | wunderctl init --template nextjs-postgresql-starter 45 | 46 | # you can also install the templates to a custom directory 47 | wunderctl init -o /custom/dir 48 | ``` 49 | 50 | ### Run 51 | 52 | Once the CLI is installed and you've got a project initialized, 53 | it's time to start it up. 54 | 55 | ```shell 56 | # change into your wundergraph directory 57 | # in case you've used the default template, there is no .wundergraph directory 58 | cd .wundergraph 59 | 60 | # run wunderctl 61 | wunderctl up 62 | 63 | # you can also start in debug mode to get more verbose logs 64 | wunderctl up --debug 65 | ``` 66 | 67 | ## Docs 68 | 69 | WunderGraph Features Overview: 70 | https://wundergraph.com/docs/overview/features/overview 71 | 72 | A complete guide to building your first WunderGraph Application: 73 | https://wundergraph.com/docs/guides/your_first_wundergraph_application/overview 74 | 75 | Overview of all supported DataSources: 76 | https://wundergraph.com/docs/overview/datasources/overview 77 | 78 | Overview of all custom WunderGraph Directives and how to use them: 79 | https://wundergraph.com/docs/reference/directives/overview 80 | 81 | Reference Documentation on how to configure your `wundergraph.config.ts`: 82 | https://wundergraph.com/docs/reference/wundergraph_config_ts/overview 83 | 84 | The `wundergraph.config.ts` file is the central point of configuration for your WunderGraph Applications. 85 | 86 | Reference Documentation on how to configure your `wundergraph.operations.ts`: 87 | https://wundergraph.com/docs/reference/wundergraph_operations_ts/overview 88 | 89 | The `wundergraph.operations.ts` is a separate configure file, 90 | dedicated to configuring your Operations. 91 | Learn more on how [Operations work in WunderGraph](https://wundergraph.com/docs/overview/features/json_rpc). 92 | 93 | Reference Documentation on how to configure your `wundergraph.hooks.ts`, 94 | the file to define custom Hooks to extend your WunderGraph Application with custom business logic and side effects: 95 | https://wundergraph.com/docs/reference/wundergraph_hooks_ts/overview 96 | 97 | ## Examples 98 | 99 | NextJS TypeScript Realtime Chat: 100 | https://github.com/wundergraph/nextjs-typescript-postgresql-graphql-realtime-chat 101 | 102 | Demo using Apollo Federation, REST, GraphQL & Mock APIs, all in one: 103 | https://github.com/wundergraph/wundergraph-demo 104 | 105 | Demonstration of Polyglot persistence, using the exact same API with two different data stores, PostgreSQL or MySQL: https://github.com/wundergraph/polyglot-persistence-postgresql-mysql-graphql 106 | 107 | ## Development 108 | 109 | 1. Clone the repository: https://github.com/wundergraph/sdk 110 | 2. Initialize a new project with `wunderctl init -o .wundergraph` from the root of the sdk 111 | 3. Change the directory to `.wundergraph` and install the dependencies using `yarn or npm install` 112 | 4. Open the file `.wundergraph/wundergraph.config.ts`, the imports will point to `@wundergraph/sdk` 113 | 5. Change the imports from `@wundergraph/sdk` to `../src` so that you use your local sdk instead of the npm sdk 114 | 6. From the directory `.wundergraph`, run `wunderctl up` to start WunderGraph using your local sdk 115 | 116 | ### Notes 117 | 118 | When changing the handlebars templates for the Code Generator, a build step is required, 119 | otherwise you will not see your changes when running `wunderctl up` again. 120 | 121 | Run `yarn build` from the root of the sdk to update the templates in the `dist` directory. 122 | -------------------------------------------------------------------------------- /dist/binarypath.js: -------------------------------------------------------------------------------- 1 | var __create = Object.create; 2 | var __defProp = Object.defineProperty; 3 | var __getProtoOf = Object.getPrototypeOf; 4 | var __hasOwnProp = Object.prototype.hasOwnProperty; 5 | var __getOwnPropNames = Object.getOwnPropertyNames; 6 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 | var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); 8 | var __export = (target, all) => { 9 | __markAsModule(target); 10 | for (var name in all) 11 | __defProp(target, name, {get: all[name], enumerable: true}); 12 | }; 13 | var __exportStar = (target, module2, desc) => { 14 | __markAsModule(target); 15 | if (module2 && typeof module2 === "object" || typeof module2 === "function") { 16 | for (let key of __getOwnPropNames(module2)) 17 | if (!__hasOwnProp.call(target, key) && key !== "default") 18 | __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); 19 | } 20 | return target; 21 | }; 22 | var __toModule = (module2) => { 23 | if (module2 && module2.__esModule) 24 | return module2; 25 | return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2); 26 | }; 27 | 28 | // src/binarypath.ts 29 | __export(exports, { 30 | downloadURL: () => downloadURL, 31 | wunderGraphDir: () => wunderGraphDir, 32 | wunderctlPath: () => wunderctlPath 33 | }); 34 | var os = __toModule(require("os")); 35 | var import_path = __toModule(require("path")); 36 | var downloadURL = (version) => { 37 | const osType = os.type(); 38 | const osArch = os.arch(); 39 | switch (osType) { 40 | case "Darwin": 41 | switch (osArch) { 42 | case "arm64": 43 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Darwin_arm64.tar.gz`; 44 | case "x64": 45 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Darwin_x86_64.tar.gz`; 46 | default: 47 | throw new Error(`os arch unsupported: ${osType} ${osArch}`); 48 | } 49 | case "Linux": 50 | switch (osArch) { 51 | case "x64": 52 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Linux_x86_64.tar.gz`; 53 | case "x32": 54 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Linux_i386.tar.gz`; 55 | default: 56 | throw new Error(`os arch unsupported: ${osType} ${osArch}`); 57 | } 58 | case "Windows_NT": 59 | switch (osArch) { 60 | case "x64": 61 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Windows_x86_64.tar.gz`; 62 | case "x32": 63 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Windows_i386.tar.gz`; 64 | default: 65 | throw new Error(`os arch unsupported: ${osType} ${osArch}`); 66 | } 67 | default: 68 | throw new Error(`os type unsupported: ${osType}`); 69 | } 70 | }; 71 | var wunderctlPath = () => { 72 | return import_path.default.join(wunderGraphDir(), "wunderctl"); 73 | }; 74 | var wunderGraphDir = () => { 75 | return import_path.default.join(os.homedir(), ".wundergraph"); 76 | }; 77 | -------------------------------------------------------------------------------- /dist/run.js: -------------------------------------------------------------------------------- 1 | var __create = Object.create; 2 | var __defProp = Object.defineProperty; 3 | var __getProtoOf = Object.getPrototypeOf; 4 | var __hasOwnProp = Object.prototype.hasOwnProperty; 5 | var __getOwnPropNames = Object.getOwnPropertyNames; 6 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 | var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); 8 | var __export = (target, all) => { 9 | __markAsModule(target); 10 | for (var name in all) 11 | __defProp(target, name, {get: all[name], enumerable: true}); 12 | }; 13 | var __exportStar = (target, module2, desc) => { 14 | __markAsModule(target); 15 | if (module2 && typeof module2 === "object" || typeof module2 === "function") { 16 | for (let key of __getOwnPropNames(module2)) 17 | if (!__hasOwnProp.call(target, key) && key !== "default") 18 | __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); 19 | } 20 | return target; 21 | }; 22 | var __toModule = (module2) => { 23 | if (module2 && module2.__esModule) 24 | return module2; 25 | return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2); 26 | }; 27 | 28 | // src/run.ts 29 | __export(exports, { 30 | default: () => run_default 31 | }); 32 | 33 | // src/binarypath.ts 34 | var os = __toModule(require("os")); 35 | var import_path = __toModule(require("path")); 36 | var wunderctlPath = () => { 37 | return import_path.default.join(wunderGraphDir(), "wunderctl"); 38 | }; 39 | var wunderGraphDir = () => { 40 | return import_path.default.join(os.homedir(), ".wundergraph"); 41 | }; 42 | 43 | // src/run.ts 44 | var fs = __toModule(require("fs")); 45 | var import_child_process = __toModule(require("child_process")); 46 | var run = () => { 47 | const executablePath = wunderctlPath(); 48 | if (!fs.existsSync(executablePath)) { 49 | error(`You must install wunderctl before you can run it: 50 | npm i -g @wundergraph/wunderctl`); 51 | } 52 | const [, , ...args] = process.argv; 53 | const result = import_child_process.spawnSync(executablePath, args, { 54 | cwd: process.cwd(), 55 | stdio: "inherit" 56 | }); 57 | if (result.error) { 58 | error(result.error.message); 59 | } 60 | process.exit(result.status || 0); 61 | }; 62 | var error = (msg) => { 63 | console.error(msg); 64 | process.exit(1); 65 | }; 66 | var run_default = run; 67 | -------------------------------------------------------------------------------- /dist/set-version.js: -------------------------------------------------------------------------------- 1 | var __create = Object.create; 2 | var __defProp = Object.defineProperty; 3 | var __getProtoOf = Object.getPrototypeOf; 4 | var __hasOwnProp = Object.prototype.hasOwnProperty; 5 | var __getOwnPropNames = Object.getOwnPropertyNames; 6 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 | var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); 8 | var __export = (target, all) => { 9 | __markAsModule(target); 10 | for (var name in all) 11 | __defProp(target, name, {get: all[name], enumerable: true}); 12 | }; 13 | var __exportStar = (target, module2, desc) => { 14 | __markAsModule(target); 15 | if (module2 && typeof module2 === "object" || typeof module2 === "function") { 16 | for (let key of __getOwnPropNames(module2)) 17 | if (!__hasOwnProp.call(target, key) && key !== "default") 18 | __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); 19 | } 20 | return target; 21 | }; 22 | var __toModule = (module2) => { 23 | if (module2 && module2.__esModule) 24 | return module2; 25 | return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2); 26 | }; 27 | 28 | // src/set-version.ts 29 | __export(exports, { 30 | default: () => set_version_default 31 | }); 32 | var fs = __toModule(require("fs")); 33 | var setVersion = () => { 34 | const githubRef = "" + process.env.GITHUB_REF; 35 | if (githubRef === "") { 36 | console.log(`cannot set version, env var missing: GITHUB_REF`); 37 | process.exit(1); 38 | return; 39 | } 40 | const version = githubRef.substring("refs/tags/v".length); 41 | console.log(`detected version: ${version}`); 42 | try { 43 | const packageJSON = JSON.parse(fs.readFileSync("package.json").toString()); 44 | packageJSON["version"] = version; 45 | fs.writeFileSync("package.json", JSON.stringify(packageJSON, null, " ")); 46 | console.log("version updated successfully"); 47 | } catch (e) { 48 | console.log(`error updating package.json: ${e.message}`); 49 | } 50 | }; 51 | var set_version_default = setVersion(); 52 | -------------------------------------------------------------------------------- /dist/uninstall.js: -------------------------------------------------------------------------------- 1 | var __create = Object.create; 2 | var __defProp = Object.defineProperty; 3 | var __getProtoOf = Object.getPrototypeOf; 4 | var __hasOwnProp = Object.prototype.hasOwnProperty; 5 | var __getOwnPropNames = Object.getOwnPropertyNames; 6 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 | var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); 8 | var __commonJS = (callback, module2) => () => { 9 | if (!module2) { 10 | module2 = {exports: {}}; 11 | callback(module2.exports, module2); 12 | } 13 | return module2.exports; 14 | }; 15 | var __export = (target, all) => { 16 | __markAsModule(target); 17 | for (var name in all) 18 | __defProp(target, name, {get: all[name], enumerable: true}); 19 | }; 20 | var __exportStar = (target, module2, desc) => { 21 | __markAsModule(target); 22 | if (module2 && typeof module2 === "object" || typeof module2 === "function") { 23 | for (let key of __getOwnPropNames(module2)) 24 | if (!__hasOwnProp.call(target, key) && key !== "default") 25 | __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); 26 | } 27 | return target; 28 | }; 29 | var __toModule = (module2) => { 30 | if (module2 && module2.__esModule) 31 | return module2; 32 | return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2); 33 | }; 34 | 35 | // node_modules/fs.realpath/old.js 36 | var require_old = __commonJS((exports2) => { 37 | var pathModule = require("path"); 38 | var isWindows = process.platform === "win32"; 39 | var fs2 = require("fs"); 40 | var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); 41 | function rethrow() { 42 | var callback; 43 | if (DEBUG) { 44 | var backtrace = new Error(); 45 | callback = debugCallback; 46 | } else 47 | callback = missingCallback; 48 | return callback; 49 | function debugCallback(err) { 50 | if (err) { 51 | backtrace.message = err.message; 52 | err = backtrace; 53 | missingCallback(err); 54 | } 55 | } 56 | function missingCallback(err) { 57 | if (err) { 58 | if (process.throwDeprecation) 59 | throw err; 60 | else if (!process.noDeprecation) { 61 | var msg = "fs: missing callback " + (err.stack || err.message); 62 | if (process.traceDeprecation) 63 | console.trace(msg); 64 | else 65 | console.error(msg); 66 | } 67 | } 68 | } 69 | } 70 | function maybeCallback(cb) { 71 | return typeof cb === "function" ? cb : rethrow(); 72 | } 73 | var normalize = pathModule.normalize; 74 | if (isWindows) { 75 | nextPartRe = /(.*?)(?:[\/\\]+|$)/g; 76 | } else { 77 | nextPartRe = /(.*?)(?:[\/]+|$)/g; 78 | } 79 | var nextPartRe; 80 | if (isWindows) { 81 | splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; 82 | } else { 83 | splitRootRe = /^[\/]*/; 84 | } 85 | var splitRootRe; 86 | exports2.realpathSync = function realpathSync(p, cache) { 87 | p = pathModule.resolve(p); 88 | if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { 89 | return cache[p]; 90 | } 91 | var original = p, seenLinks = {}, knownHard = {}; 92 | var pos; 93 | var current; 94 | var base; 95 | var previous; 96 | start(); 97 | function start() { 98 | var m = splitRootRe.exec(p); 99 | pos = m[0].length; 100 | current = m[0]; 101 | base = m[0]; 102 | previous = ""; 103 | if (isWindows && !knownHard[base]) { 104 | fs2.lstatSync(base); 105 | knownHard[base] = true; 106 | } 107 | } 108 | while (pos < p.length) { 109 | nextPartRe.lastIndex = pos; 110 | var result = nextPartRe.exec(p); 111 | previous = current; 112 | current += result[0]; 113 | base = previous + result[1]; 114 | pos = nextPartRe.lastIndex; 115 | if (knownHard[base] || cache && cache[base] === base) { 116 | continue; 117 | } 118 | var resolvedLink; 119 | if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { 120 | resolvedLink = cache[base]; 121 | } else { 122 | var stat = fs2.lstatSync(base); 123 | if (!stat.isSymbolicLink()) { 124 | knownHard[base] = true; 125 | if (cache) 126 | cache[base] = base; 127 | continue; 128 | } 129 | var linkTarget = null; 130 | if (!isWindows) { 131 | var id = stat.dev.toString(32) + ":" + stat.ino.toString(32); 132 | if (seenLinks.hasOwnProperty(id)) { 133 | linkTarget = seenLinks[id]; 134 | } 135 | } 136 | if (linkTarget === null) { 137 | fs2.statSync(base); 138 | linkTarget = fs2.readlinkSync(base); 139 | } 140 | resolvedLink = pathModule.resolve(previous, linkTarget); 141 | if (cache) 142 | cache[base] = resolvedLink; 143 | if (!isWindows) 144 | seenLinks[id] = linkTarget; 145 | } 146 | p = pathModule.resolve(resolvedLink, p.slice(pos)); 147 | start(); 148 | } 149 | if (cache) 150 | cache[original] = p; 151 | return p; 152 | }; 153 | exports2.realpath = function realpath(p, cache, cb) { 154 | if (typeof cb !== "function") { 155 | cb = maybeCallback(cache); 156 | cache = null; 157 | } 158 | p = pathModule.resolve(p); 159 | if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { 160 | return process.nextTick(cb.bind(null, null, cache[p])); 161 | } 162 | var original = p, seenLinks = {}, knownHard = {}; 163 | var pos; 164 | var current; 165 | var base; 166 | var previous; 167 | start(); 168 | function start() { 169 | var m = splitRootRe.exec(p); 170 | pos = m[0].length; 171 | current = m[0]; 172 | base = m[0]; 173 | previous = ""; 174 | if (isWindows && !knownHard[base]) { 175 | fs2.lstat(base, function(err) { 176 | if (err) 177 | return cb(err); 178 | knownHard[base] = true; 179 | LOOP(); 180 | }); 181 | } else { 182 | process.nextTick(LOOP); 183 | } 184 | } 185 | function LOOP() { 186 | if (pos >= p.length) { 187 | if (cache) 188 | cache[original] = p; 189 | return cb(null, p); 190 | } 191 | nextPartRe.lastIndex = pos; 192 | var result = nextPartRe.exec(p); 193 | previous = current; 194 | current += result[0]; 195 | base = previous + result[1]; 196 | pos = nextPartRe.lastIndex; 197 | if (knownHard[base] || cache && cache[base] === base) { 198 | return process.nextTick(LOOP); 199 | } 200 | if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { 201 | return gotResolvedLink(cache[base]); 202 | } 203 | return fs2.lstat(base, gotStat); 204 | } 205 | function gotStat(err, stat) { 206 | if (err) 207 | return cb(err); 208 | if (!stat.isSymbolicLink()) { 209 | knownHard[base] = true; 210 | if (cache) 211 | cache[base] = base; 212 | return process.nextTick(LOOP); 213 | } 214 | if (!isWindows) { 215 | var id = stat.dev.toString(32) + ":" + stat.ino.toString(32); 216 | if (seenLinks.hasOwnProperty(id)) { 217 | return gotTarget(null, seenLinks[id], base); 218 | } 219 | } 220 | fs2.stat(base, function(err2) { 221 | if (err2) 222 | return cb(err2); 223 | fs2.readlink(base, function(err3, target) { 224 | if (!isWindows) 225 | seenLinks[id] = target; 226 | gotTarget(err3, target); 227 | }); 228 | }); 229 | } 230 | function gotTarget(err, target, base2) { 231 | if (err) 232 | return cb(err); 233 | var resolvedLink = pathModule.resolve(previous, target); 234 | if (cache) 235 | cache[base2] = resolvedLink; 236 | gotResolvedLink(resolvedLink); 237 | } 238 | function gotResolvedLink(resolvedLink) { 239 | p = pathModule.resolve(resolvedLink, p.slice(pos)); 240 | start(); 241 | } 242 | }; 243 | }); 244 | 245 | // node_modules/fs.realpath/index.js 246 | var require_fs = __commonJS((exports2, module2) => { 247 | module2.exports = realpath; 248 | realpath.realpath = realpath; 249 | realpath.sync = realpathSync; 250 | realpath.realpathSync = realpathSync; 251 | realpath.monkeypatch = monkeypatch; 252 | realpath.unmonkeypatch = unmonkeypatch; 253 | var fs2 = require("fs"); 254 | var origRealpath = fs2.realpath; 255 | var origRealpathSync = fs2.realpathSync; 256 | var version = process.version; 257 | var ok = /^v[0-5]\./.test(version); 258 | var old = require_old(); 259 | function newError(er) { 260 | return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); 261 | } 262 | function realpath(p, cache, cb) { 263 | if (ok) { 264 | return origRealpath(p, cache, cb); 265 | } 266 | if (typeof cache === "function") { 267 | cb = cache; 268 | cache = null; 269 | } 270 | origRealpath(p, cache, function(er, result) { 271 | if (newError(er)) { 272 | old.realpath(p, cache, cb); 273 | } else { 274 | cb(er, result); 275 | } 276 | }); 277 | } 278 | function realpathSync(p, cache) { 279 | if (ok) { 280 | return origRealpathSync(p, cache); 281 | } 282 | try { 283 | return origRealpathSync(p, cache); 284 | } catch (er) { 285 | if (newError(er)) { 286 | return old.realpathSync(p, cache); 287 | } else { 288 | throw er; 289 | } 290 | } 291 | } 292 | function monkeypatch() { 293 | fs2.realpath = realpath; 294 | fs2.realpathSync = realpathSync; 295 | } 296 | function unmonkeypatch() { 297 | fs2.realpath = origRealpath; 298 | fs2.realpathSync = origRealpathSync; 299 | } 300 | }); 301 | 302 | // node_modules/concat-map/index.js 303 | var require_concat_map = __commonJS((exports2, module2) => { 304 | module2.exports = function(xs, fn) { 305 | var res = []; 306 | for (var i = 0; i < xs.length; i++) { 307 | var x = fn(xs[i], i); 308 | if (isArray(x)) 309 | res.push.apply(res, x); 310 | else 311 | res.push(x); 312 | } 313 | return res; 314 | }; 315 | var isArray = Array.isArray || function(xs) { 316 | return Object.prototype.toString.call(xs) === "[object Array]"; 317 | }; 318 | }); 319 | 320 | // node_modules/balanced-match/index.js 321 | var require_balanced_match = __commonJS((exports2, module2) => { 322 | "use strict"; 323 | module2.exports = balanced; 324 | function balanced(a, b, str) { 325 | if (a instanceof RegExp) 326 | a = maybeMatch(a, str); 327 | if (b instanceof RegExp) 328 | b = maybeMatch(b, str); 329 | var r = range(a, b, str); 330 | return r && { 331 | start: r[0], 332 | end: r[1], 333 | pre: str.slice(0, r[0]), 334 | body: str.slice(r[0] + a.length, r[1]), 335 | post: str.slice(r[1] + b.length) 336 | }; 337 | } 338 | function maybeMatch(reg, str) { 339 | var m = str.match(reg); 340 | return m ? m[0] : null; 341 | } 342 | balanced.range = range; 343 | function range(a, b, str) { 344 | var begs, beg, left, right, result; 345 | var ai = str.indexOf(a); 346 | var bi = str.indexOf(b, ai + 1); 347 | var i = ai; 348 | if (ai >= 0 && bi > 0) { 349 | begs = []; 350 | left = str.length; 351 | while (i >= 0 && !result) { 352 | if (i == ai) { 353 | begs.push(i); 354 | ai = str.indexOf(a, i + 1); 355 | } else if (begs.length == 1) { 356 | result = [begs.pop(), bi]; 357 | } else { 358 | beg = begs.pop(); 359 | if (beg < left) { 360 | left = beg; 361 | right = bi; 362 | } 363 | bi = str.indexOf(b, i + 1); 364 | } 365 | i = ai < bi && ai >= 0 ? ai : bi; 366 | } 367 | if (begs.length) { 368 | result = [left, right]; 369 | } 370 | } 371 | return result; 372 | } 373 | }); 374 | 375 | // node_modules/brace-expansion/index.js 376 | var require_brace_expansion = __commonJS((exports2, module2) => { 377 | var concatMap = require_concat_map(); 378 | var balanced = require_balanced_match(); 379 | module2.exports = expandTop; 380 | var escSlash = "\0SLASH" + Math.random() + "\0"; 381 | var escOpen = "\0OPEN" + Math.random() + "\0"; 382 | var escClose = "\0CLOSE" + Math.random() + "\0"; 383 | var escComma = "\0COMMA" + Math.random() + "\0"; 384 | var escPeriod = "\0PERIOD" + Math.random() + "\0"; 385 | function numeric(str) { 386 | return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); 387 | } 388 | function escapeBraces(str) { 389 | return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); 390 | } 391 | function unescapeBraces(str) { 392 | return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); 393 | } 394 | function parseCommaParts(str) { 395 | if (!str) 396 | return [""]; 397 | var parts = []; 398 | var m = balanced("{", "}", str); 399 | if (!m) 400 | return str.split(","); 401 | var pre = m.pre; 402 | var body = m.body; 403 | var post = m.post; 404 | var p = pre.split(","); 405 | p[p.length - 1] += "{" + body + "}"; 406 | var postParts = parseCommaParts(post); 407 | if (post.length) { 408 | p[p.length - 1] += postParts.shift(); 409 | p.push.apply(p, postParts); 410 | } 411 | parts.push.apply(parts, p); 412 | return parts; 413 | } 414 | function expandTop(str) { 415 | if (!str) 416 | return []; 417 | if (str.substr(0, 2) === "{}") { 418 | str = "\\{\\}" + str.substr(2); 419 | } 420 | return expand(escapeBraces(str), true).map(unescapeBraces); 421 | } 422 | function embrace(str) { 423 | return "{" + str + "}"; 424 | } 425 | function isPadded(el) { 426 | return /^-?0\d/.test(el); 427 | } 428 | function lte(i, y) { 429 | return i <= y; 430 | } 431 | function gte(i, y) { 432 | return i >= y; 433 | } 434 | function expand(str, isTop) { 435 | var expansions = []; 436 | var m = balanced("{", "}", str); 437 | if (!m || /\$$/.test(m.pre)) 438 | return [str]; 439 | var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); 440 | var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); 441 | var isSequence = isNumericSequence || isAlphaSequence; 442 | var isOptions = m.body.indexOf(",") >= 0; 443 | if (!isSequence && !isOptions) { 444 | if (m.post.match(/,.*\}/)) { 445 | str = m.pre + "{" + m.body + escClose + m.post; 446 | return expand(str); 447 | } 448 | return [str]; 449 | } 450 | var n; 451 | if (isSequence) { 452 | n = m.body.split(/\.\./); 453 | } else { 454 | n = parseCommaParts(m.body); 455 | if (n.length === 1) { 456 | n = expand(n[0], false).map(embrace); 457 | if (n.length === 1) { 458 | var post = m.post.length ? expand(m.post, false) : [""]; 459 | return post.map(function(p) { 460 | return m.pre + n[0] + p; 461 | }); 462 | } 463 | } 464 | } 465 | var pre = m.pre; 466 | var post = m.post.length ? expand(m.post, false) : [""]; 467 | var N; 468 | if (isSequence) { 469 | var x = numeric(n[0]); 470 | var y = numeric(n[1]); 471 | var width = Math.max(n[0].length, n[1].length); 472 | var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; 473 | var test = lte; 474 | var reverse = y < x; 475 | if (reverse) { 476 | incr *= -1; 477 | test = gte; 478 | } 479 | var pad = n.some(isPadded); 480 | N = []; 481 | for (var i = x; test(i, y); i += incr) { 482 | var c; 483 | if (isAlphaSequence) { 484 | c = String.fromCharCode(i); 485 | if (c === "\\") 486 | c = ""; 487 | } else { 488 | c = String(i); 489 | if (pad) { 490 | var need = width - c.length; 491 | if (need > 0) { 492 | var z = new Array(need + 1).join("0"); 493 | if (i < 0) 494 | c = "-" + z + c.slice(1); 495 | else 496 | c = z + c; 497 | } 498 | } 499 | } 500 | N.push(c); 501 | } 502 | } else { 503 | N = concatMap(n, function(el) { 504 | return expand(el, false); 505 | }); 506 | } 507 | for (var j = 0; j < N.length; j++) { 508 | for (var k = 0; k < post.length; k++) { 509 | var expansion = pre + N[j] + post[k]; 510 | if (!isTop || isSequence || expansion) 511 | expansions.push(expansion); 512 | } 513 | } 514 | return expansions; 515 | } 516 | }); 517 | 518 | // node_modules/minimatch/minimatch.js 519 | var require_minimatch = __commonJS((exports2, module2) => { 520 | module2.exports = minimatch; 521 | minimatch.Minimatch = Minimatch; 522 | var path2 = {sep: "/"}; 523 | try { 524 | path2 = require("path"); 525 | } catch (er) { 526 | } 527 | var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; 528 | var expand = require_brace_expansion(); 529 | var plTypes = { 530 | "!": {open: "(?:(?!(?:", close: "))[^/]*?)"}, 531 | "?": {open: "(?:", close: ")?"}, 532 | "+": {open: "(?:", close: ")+"}, 533 | "*": {open: "(?:", close: ")*"}, 534 | "@": {open: "(?:", close: ")"} 535 | }; 536 | var qmark = "[^/]"; 537 | var star = qmark + "*?"; 538 | var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; 539 | var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; 540 | var reSpecials = charSet("().*{}+?[]^$\\!"); 541 | function charSet(s) { 542 | return s.split("").reduce(function(set, c) { 543 | set[c] = true; 544 | return set; 545 | }, {}); 546 | } 547 | var slashSplit = /\/+/; 548 | minimatch.filter = filter; 549 | function filter(pattern, options) { 550 | options = options || {}; 551 | return function(p, i, list) { 552 | return minimatch(p, pattern, options); 553 | }; 554 | } 555 | function ext(a, b) { 556 | a = a || {}; 557 | b = b || {}; 558 | var t = {}; 559 | Object.keys(b).forEach(function(k) { 560 | t[k] = b[k]; 561 | }); 562 | Object.keys(a).forEach(function(k) { 563 | t[k] = a[k]; 564 | }); 565 | return t; 566 | } 567 | minimatch.defaults = function(def) { 568 | if (!def || !Object.keys(def).length) 569 | return minimatch; 570 | var orig = minimatch; 571 | var m = function minimatch2(p, pattern, options) { 572 | return orig.minimatch(p, pattern, ext(def, options)); 573 | }; 574 | m.Minimatch = function Minimatch2(pattern, options) { 575 | return new orig.Minimatch(pattern, ext(def, options)); 576 | }; 577 | return m; 578 | }; 579 | Minimatch.defaults = function(def) { 580 | if (!def || !Object.keys(def).length) 581 | return Minimatch; 582 | return minimatch.defaults(def).Minimatch; 583 | }; 584 | function minimatch(p, pattern, options) { 585 | if (typeof pattern !== "string") { 586 | throw new TypeError("glob pattern string required"); 587 | } 588 | if (!options) 589 | options = {}; 590 | if (!options.nocomment && pattern.charAt(0) === "#") { 591 | return false; 592 | } 593 | if (pattern.trim() === "") 594 | return p === ""; 595 | return new Minimatch(pattern, options).match(p); 596 | } 597 | function Minimatch(pattern, options) { 598 | if (!(this instanceof Minimatch)) { 599 | return new Minimatch(pattern, options); 600 | } 601 | if (typeof pattern !== "string") { 602 | throw new TypeError("glob pattern string required"); 603 | } 604 | if (!options) 605 | options = {}; 606 | pattern = pattern.trim(); 607 | if (path2.sep !== "/") { 608 | pattern = pattern.split(path2.sep).join("/"); 609 | } 610 | this.options = options; 611 | this.set = []; 612 | this.pattern = pattern; 613 | this.regexp = null; 614 | this.negate = false; 615 | this.comment = false; 616 | this.empty = false; 617 | this.make(); 618 | } 619 | Minimatch.prototype.debug = function() { 620 | }; 621 | Minimatch.prototype.make = make; 622 | function make() { 623 | if (this._made) 624 | return; 625 | var pattern = this.pattern; 626 | var options = this.options; 627 | if (!options.nocomment && pattern.charAt(0) === "#") { 628 | this.comment = true; 629 | return; 630 | } 631 | if (!pattern) { 632 | this.empty = true; 633 | return; 634 | } 635 | this.parseNegate(); 636 | var set = this.globSet = this.braceExpand(); 637 | if (options.debug) 638 | this.debug = console.error; 639 | this.debug(this.pattern, set); 640 | set = this.globParts = set.map(function(s) { 641 | return s.split(slashSplit); 642 | }); 643 | this.debug(this.pattern, set); 644 | set = set.map(function(s, si, set2) { 645 | return s.map(this.parse, this); 646 | }, this); 647 | this.debug(this.pattern, set); 648 | set = set.filter(function(s) { 649 | return s.indexOf(false) === -1; 650 | }); 651 | this.debug(this.pattern, set); 652 | this.set = set; 653 | } 654 | Minimatch.prototype.parseNegate = parseNegate; 655 | function parseNegate() { 656 | var pattern = this.pattern; 657 | var negate = false; 658 | var options = this.options; 659 | var negateOffset = 0; 660 | if (options.nonegate) 661 | return; 662 | for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { 663 | negate = !negate; 664 | negateOffset++; 665 | } 666 | if (negateOffset) 667 | this.pattern = pattern.substr(negateOffset); 668 | this.negate = negate; 669 | } 670 | minimatch.braceExpand = function(pattern, options) { 671 | return braceExpand(pattern, options); 672 | }; 673 | Minimatch.prototype.braceExpand = braceExpand; 674 | function braceExpand(pattern, options) { 675 | if (!options) { 676 | if (this instanceof Minimatch) { 677 | options = this.options; 678 | } else { 679 | options = {}; 680 | } 681 | } 682 | pattern = typeof pattern === "undefined" ? this.pattern : pattern; 683 | if (typeof pattern === "undefined") { 684 | throw new TypeError("undefined pattern"); 685 | } 686 | if (options.nobrace || !pattern.match(/\{.*\}/)) { 687 | return [pattern]; 688 | } 689 | return expand(pattern); 690 | } 691 | Minimatch.prototype.parse = parse; 692 | var SUBPARSE = {}; 693 | function parse(pattern, isSub) { 694 | if (pattern.length > 1024 * 64) { 695 | throw new TypeError("pattern is too long"); 696 | } 697 | var options = this.options; 698 | if (!options.noglobstar && pattern === "**") 699 | return GLOBSTAR; 700 | if (pattern === "") 701 | return ""; 702 | var re = ""; 703 | var hasMagic = !!options.nocase; 704 | var escaping = false; 705 | var patternListStack = []; 706 | var negativeLists = []; 707 | var stateChar; 708 | var inClass = false; 709 | var reClassStart = -1; 710 | var classStart = -1; 711 | var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; 712 | var self = this; 713 | function clearStateChar() { 714 | if (stateChar) { 715 | switch (stateChar) { 716 | case "*": 717 | re += star; 718 | hasMagic = true; 719 | break; 720 | case "?": 721 | re += qmark; 722 | hasMagic = true; 723 | break; 724 | default: 725 | re += "\\" + stateChar; 726 | break; 727 | } 728 | self.debug("clearStateChar %j %j", stateChar, re); 729 | stateChar = false; 730 | } 731 | } 732 | for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { 733 | this.debug("%s %s %s %j", pattern, i, re, c); 734 | if (escaping && reSpecials[c]) { 735 | re += "\\" + c; 736 | escaping = false; 737 | continue; 738 | } 739 | switch (c) { 740 | case "/": 741 | return false; 742 | case "\\": 743 | clearStateChar(); 744 | escaping = true; 745 | continue; 746 | case "?": 747 | case "*": 748 | case "+": 749 | case "@": 750 | case "!": 751 | this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); 752 | if (inClass) { 753 | this.debug(" in class"); 754 | if (c === "!" && i === classStart + 1) 755 | c = "^"; 756 | re += c; 757 | continue; 758 | } 759 | self.debug("call clearStateChar %j", stateChar); 760 | clearStateChar(); 761 | stateChar = c; 762 | if (options.noext) 763 | clearStateChar(); 764 | continue; 765 | case "(": 766 | if (inClass) { 767 | re += "("; 768 | continue; 769 | } 770 | if (!stateChar) { 771 | re += "\\("; 772 | continue; 773 | } 774 | patternListStack.push({ 775 | type: stateChar, 776 | start: i - 1, 777 | reStart: re.length, 778 | open: plTypes[stateChar].open, 779 | close: plTypes[stateChar].close 780 | }); 781 | re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; 782 | this.debug("plType %j %j", stateChar, re); 783 | stateChar = false; 784 | continue; 785 | case ")": 786 | if (inClass || !patternListStack.length) { 787 | re += "\\)"; 788 | continue; 789 | } 790 | clearStateChar(); 791 | hasMagic = true; 792 | var pl = patternListStack.pop(); 793 | re += pl.close; 794 | if (pl.type === "!") { 795 | negativeLists.push(pl); 796 | } 797 | pl.reEnd = re.length; 798 | continue; 799 | case "|": 800 | if (inClass || !patternListStack.length || escaping) { 801 | re += "\\|"; 802 | escaping = false; 803 | continue; 804 | } 805 | clearStateChar(); 806 | re += "|"; 807 | continue; 808 | case "[": 809 | clearStateChar(); 810 | if (inClass) { 811 | re += "\\" + c; 812 | continue; 813 | } 814 | inClass = true; 815 | classStart = i; 816 | reClassStart = re.length; 817 | re += c; 818 | continue; 819 | case "]": 820 | if (i === classStart + 1 || !inClass) { 821 | re += "\\" + c; 822 | escaping = false; 823 | continue; 824 | } 825 | if (inClass) { 826 | var cs = pattern.substring(classStart + 1, i); 827 | try { 828 | RegExp("[" + cs + "]"); 829 | } catch (er) { 830 | var sp = this.parse(cs, SUBPARSE); 831 | re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; 832 | hasMagic = hasMagic || sp[1]; 833 | inClass = false; 834 | continue; 835 | } 836 | } 837 | hasMagic = true; 838 | inClass = false; 839 | re += c; 840 | continue; 841 | default: 842 | clearStateChar(); 843 | if (escaping) { 844 | escaping = false; 845 | } else if (reSpecials[c] && !(c === "^" && inClass)) { 846 | re += "\\"; 847 | } 848 | re += c; 849 | } 850 | } 851 | if (inClass) { 852 | cs = pattern.substr(classStart + 1); 853 | sp = this.parse(cs, SUBPARSE); 854 | re = re.substr(0, reClassStart) + "\\[" + sp[0]; 855 | hasMagic = hasMagic || sp[1]; 856 | } 857 | for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { 858 | var tail = re.slice(pl.reStart + pl.open.length); 859 | this.debug("setting tail", re, pl); 860 | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { 861 | if (!$2) { 862 | $2 = "\\"; 863 | } 864 | return $1 + $1 + $2 + "|"; 865 | }); 866 | this.debug("tail=%j\n %s", tail, tail, pl, re); 867 | var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; 868 | hasMagic = true; 869 | re = re.slice(0, pl.reStart) + t + "\\(" + tail; 870 | } 871 | clearStateChar(); 872 | if (escaping) { 873 | re += "\\\\"; 874 | } 875 | var addPatternStart = false; 876 | switch (re.charAt(0)) { 877 | case ".": 878 | case "[": 879 | case "(": 880 | addPatternStart = true; 881 | } 882 | for (var n = negativeLists.length - 1; n > -1; n--) { 883 | var nl = negativeLists[n]; 884 | var nlBefore = re.slice(0, nl.reStart); 885 | var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); 886 | var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); 887 | var nlAfter = re.slice(nl.reEnd); 888 | nlLast += nlAfter; 889 | var openParensBefore = nlBefore.split("(").length - 1; 890 | var cleanAfter = nlAfter; 891 | for (i = 0; i < openParensBefore; i++) { 892 | cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); 893 | } 894 | nlAfter = cleanAfter; 895 | var dollar = ""; 896 | if (nlAfter === "" && isSub !== SUBPARSE) { 897 | dollar = "$"; 898 | } 899 | var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; 900 | re = newRe; 901 | } 902 | if (re !== "" && hasMagic) { 903 | re = "(?=.)" + re; 904 | } 905 | if (addPatternStart) { 906 | re = patternStart + re; 907 | } 908 | if (isSub === SUBPARSE) { 909 | return [re, hasMagic]; 910 | } 911 | if (!hasMagic) { 912 | return globUnescape(pattern); 913 | } 914 | var flags = options.nocase ? "i" : ""; 915 | try { 916 | var regExp = new RegExp("^" + re + "$", flags); 917 | } catch (er) { 918 | return new RegExp("$."); 919 | } 920 | regExp._glob = pattern; 921 | regExp._src = re; 922 | return regExp; 923 | } 924 | minimatch.makeRe = function(pattern, options) { 925 | return new Minimatch(pattern, options || {}).makeRe(); 926 | }; 927 | Minimatch.prototype.makeRe = makeRe; 928 | function makeRe() { 929 | if (this.regexp || this.regexp === false) 930 | return this.regexp; 931 | var set = this.set; 932 | if (!set.length) { 933 | this.regexp = false; 934 | return this.regexp; 935 | } 936 | var options = this.options; 937 | var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; 938 | var flags = options.nocase ? "i" : ""; 939 | var re = set.map(function(pattern) { 940 | return pattern.map(function(p) { 941 | return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; 942 | }).join("\\/"); 943 | }).join("|"); 944 | re = "^(?:" + re + ")$"; 945 | if (this.negate) 946 | re = "^(?!" + re + ").*$"; 947 | try { 948 | this.regexp = new RegExp(re, flags); 949 | } catch (ex) { 950 | this.regexp = false; 951 | } 952 | return this.regexp; 953 | } 954 | minimatch.match = function(list, pattern, options) { 955 | options = options || {}; 956 | var mm = new Minimatch(pattern, options); 957 | list = list.filter(function(f) { 958 | return mm.match(f); 959 | }); 960 | if (mm.options.nonull && !list.length) { 961 | list.push(pattern); 962 | } 963 | return list; 964 | }; 965 | Minimatch.prototype.match = match; 966 | function match(f, partial) { 967 | this.debug("match", f, this.pattern); 968 | if (this.comment) 969 | return false; 970 | if (this.empty) 971 | return f === ""; 972 | if (f === "/" && partial) 973 | return true; 974 | var options = this.options; 975 | if (path2.sep !== "/") { 976 | f = f.split(path2.sep).join("/"); 977 | } 978 | f = f.split(slashSplit); 979 | this.debug(this.pattern, "split", f); 980 | var set = this.set; 981 | this.debug(this.pattern, "set", set); 982 | var filename; 983 | var i; 984 | for (i = f.length - 1; i >= 0; i--) { 985 | filename = f[i]; 986 | if (filename) 987 | break; 988 | } 989 | for (i = 0; i < set.length; i++) { 990 | var pattern = set[i]; 991 | var file = f; 992 | if (options.matchBase && pattern.length === 1) { 993 | file = [filename]; 994 | } 995 | var hit = this.matchOne(file, pattern, partial); 996 | if (hit) { 997 | if (options.flipNegate) 998 | return true; 999 | return !this.negate; 1000 | } 1001 | } 1002 | if (options.flipNegate) 1003 | return false; 1004 | return this.negate; 1005 | } 1006 | Minimatch.prototype.matchOne = function(file, pattern, partial) { 1007 | var options = this.options; 1008 | this.debug("matchOne", {this: this, file, pattern}); 1009 | this.debug("matchOne", file.length, pattern.length); 1010 | for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { 1011 | this.debug("matchOne loop"); 1012 | var p = pattern[pi]; 1013 | var f = file[fi]; 1014 | this.debug(pattern, p, f); 1015 | if (p === false) 1016 | return false; 1017 | if (p === GLOBSTAR) { 1018 | this.debug("GLOBSTAR", [pattern, p, f]); 1019 | var fr = fi; 1020 | var pr = pi + 1; 1021 | if (pr === pl) { 1022 | this.debug("** at the end"); 1023 | for (; fi < fl; fi++) { 1024 | if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") 1025 | return false; 1026 | } 1027 | return true; 1028 | } 1029 | while (fr < fl) { 1030 | var swallowee = file[fr]; 1031 | this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); 1032 | if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { 1033 | this.debug("globstar found match!", fr, fl, swallowee); 1034 | return true; 1035 | } else { 1036 | if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { 1037 | this.debug("dot detected!", file, fr, pattern, pr); 1038 | break; 1039 | } 1040 | this.debug("globstar swallow a segment, and continue"); 1041 | fr++; 1042 | } 1043 | } 1044 | if (partial) { 1045 | this.debug("\n>>> no match, partial?", file, fr, pattern, pr); 1046 | if (fr === fl) 1047 | return true; 1048 | } 1049 | return false; 1050 | } 1051 | var hit; 1052 | if (typeof p === "string") { 1053 | if (options.nocase) { 1054 | hit = f.toLowerCase() === p.toLowerCase(); 1055 | } else { 1056 | hit = f === p; 1057 | } 1058 | this.debug("string match", p, f, hit); 1059 | } else { 1060 | hit = f.match(p); 1061 | this.debug("pattern match", p, f, hit); 1062 | } 1063 | if (!hit) 1064 | return false; 1065 | } 1066 | if (fi === fl && pi === pl) { 1067 | return true; 1068 | } else if (fi === fl) { 1069 | return partial; 1070 | } else if (pi === pl) { 1071 | var emptyFileEnd = fi === fl - 1 && file[fi] === ""; 1072 | return emptyFileEnd; 1073 | } 1074 | throw new Error("wtf?"); 1075 | }; 1076 | function globUnescape(s) { 1077 | return s.replace(/\\(.)/g, "$1"); 1078 | } 1079 | function regExpEscape(s) { 1080 | return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); 1081 | } 1082 | }); 1083 | 1084 | // node_modules/inherits/inherits_browser.js 1085 | var require_inherits_browser = __commonJS((exports2, module2) => { 1086 | if (typeof Object.create === "function") { 1087 | module2.exports = function inherits(ctor, superCtor) { 1088 | if (superCtor) { 1089 | ctor.super_ = superCtor; 1090 | ctor.prototype = Object.create(superCtor.prototype, { 1091 | constructor: { 1092 | value: ctor, 1093 | enumerable: false, 1094 | writable: true, 1095 | configurable: true 1096 | } 1097 | }); 1098 | } 1099 | }; 1100 | } else { 1101 | module2.exports = function inherits(ctor, superCtor) { 1102 | if (superCtor) { 1103 | ctor.super_ = superCtor; 1104 | var TempCtor = function() { 1105 | }; 1106 | TempCtor.prototype = superCtor.prototype; 1107 | ctor.prototype = new TempCtor(); 1108 | ctor.prototype.constructor = ctor; 1109 | } 1110 | }; 1111 | } 1112 | }); 1113 | 1114 | // node_modules/inherits/inherits.js 1115 | var require_inherits = __commonJS((exports2, module2) => { 1116 | try { 1117 | util = require("util"); 1118 | if (typeof util.inherits !== "function") 1119 | throw ""; 1120 | module2.exports = util.inherits; 1121 | } catch (e) { 1122 | module2.exports = require_inherits_browser(); 1123 | } 1124 | var util; 1125 | }); 1126 | 1127 | // node_modules/path-is-absolute/index.js 1128 | var require_path_is_absolute = __commonJS((exports2, module2) => { 1129 | "use strict"; 1130 | function posix(path2) { 1131 | return path2.charAt(0) === "/"; 1132 | } 1133 | function win32(path2) { 1134 | var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; 1135 | var result = splitDeviceRe.exec(path2); 1136 | var device = result[1] || ""; 1137 | var isUnc = Boolean(device && device.charAt(1) !== ":"); 1138 | return Boolean(result[2] || isUnc); 1139 | } 1140 | module2.exports = process.platform === "win32" ? win32 : posix; 1141 | module2.exports.posix = posix; 1142 | module2.exports.win32 = win32; 1143 | }); 1144 | 1145 | // node_modules/glob/common.js 1146 | var require_common = __commonJS((exports2) => { 1147 | exports2.alphasort = alphasort; 1148 | exports2.alphasorti = alphasorti; 1149 | exports2.setopts = setopts; 1150 | exports2.ownProp = ownProp; 1151 | exports2.makeAbs = makeAbs; 1152 | exports2.finish = finish; 1153 | exports2.mark = mark; 1154 | exports2.isIgnored = isIgnored; 1155 | exports2.childrenIgnored = childrenIgnored; 1156 | function ownProp(obj, field) { 1157 | return Object.prototype.hasOwnProperty.call(obj, field); 1158 | } 1159 | var path2 = require("path"); 1160 | var minimatch = require_minimatch(); 1161 | var isAbsolute = require_path_is_absolute(); 1162 | var Minimatch = minimatch.Minimatch; 1163 | function alphasorti(a, b) { 1164 | return a.toLowerCase().localeCompare(b.toLowerCase()); 1165 | } 1166 | function alphasort(a, b) { 1167 | return a.localeCompare(b); 1168 | } 1169 | function setupIgnores(self, options) { 1170 | self.ignore = options.ignore || []; 1171 | if (!Array.isArray(self.ignore)) 1172 | self.ignore = [self.ignore]; 1173 | if (self.ignore.length) { 1174 | self.ignore = self.ignore.map(ignoreMap); 1175 | } 1176 | } 1177 | function ignoreMap(pattern) { 1178 | var gmatcher = null; 1179 | if (pattern.slice(-3) === "/**") { 1180 | var gpattern = pattern.replace(/(\/\*\*)+$/, ""); 1181 | gmatcher = new Minimatch(gpattern, {dot: true}); 1182 | } 1183 | return { 1184 | matcher: new Minimatch(pattern, {dot: true}), 1185 | gmatcher 1186 | }; 1187 | } 1188 | function setopts(self, pattern, options) { 1189 | if (!options) 1190 | options = {}; 1191 | if (options.matchBase && pattern.indexOf("/") === -1) { 1192 | if (options.noglobstar) { 1193 | throw new Error("base matching requires globstar"); 1194 | } 1195 | pattern = "**/" + pattern; 1196 | } 1197 | self.silent = !!options.silent; 1198 | self.pattern = pattern; 1199 | self.strict = options.strict !== false; 1200 | self.realpath = !!options.realpath; 1201 | self.realpathCache = options.realpathCache || Object.create(null); 1202 | self.follow = !!options.follow; 1203 | self.dot = !!options.dot; 1204 | self.mark = !!options.mark; 1205 | self.nodir = !!options.nodir; 1206 | if (self.nodir) 1207 | self.mark = true; 1208 | self.sync = !!options.sync; 1209 | self.nounique = !!options.nounique; 1210 | self.nonull = !!options.nonull; 1211 | self.nosort = !!options.nosort; 1212 | self.nocase = !!options.nocase; 1213 | self.stat = !!options.stat; 1214 | self.noprocess = !!options.noprocess; 1215 | self.absolute = !!options.absolute; 1216 | self.maxLength = options.maxLength || Infinity; 1217 | self.cache = options.cache || Object.create(null); 1218 | self.statCache = options.statCache || Object.create(null); 1219 | self.symlinks = options.symlinks || Object.create(null); 1220 | setupIgnores(self, options); 1221 | self.changedCwd = false; 1222 | var cwd = process.cwd(); 1223 | if (!ownProp(options, "cwd")) 1224 | self.cwd = cwd; 1225 | else { 1226 | self.cwd = path2.resolve(options.cwd); 1227 | self.changedCwd = self.cwd !== cwd; 1228 | } 1229 | self.root = options.root || path2.resolve(self.cwd, "/"); 1230 | self.root = path2.resolve(self.root); 1231 | if (process.platform === "win32") 1232 | self.root = self.root.replace(/\\/g, "/"); 1233 | self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd); 1234 | if (process.platform === "win32") 1235 | self.cwdAbs = self.cwdAbs.replace(/\\/g, "/"); 1236 | self.nomount = !!options.nomount; 1237 | options.nonegate = true; 1238 | options.nocomment = true; 1239 | self.minimatch = new Minimatch(pattern, options); 1240 | self.options = self.minimatch.options; 1241 | } 1242 | function finish(self) { 1243 | var nou = self.nounique; 1244 | var all = nou ? [] : Object.create(null); 1245 | for (var i = 0, l = self.matches.length; i < l; i++) { 1246 | var matches = self.matches[i]; 1247 | if (!matches || Object.keys(matches).length === 0) { 1248 | if (self.nonull) { 1249 | var literal = self.minimatch.globSet[i]; 1250 | if (nou) 1251 | all.push(literal); 1252 | else 1253 | all[literal] = true; 1254 | } 1255 | } else { 1256 | var m = Object.keys(matches); 1257 | if (nou) 1258 | all.push.apply(all, m); 1259 | else 1260 | m.forEach(function(m2) { 1261 | all[m2] = true; 1262 | }); 1263 | } 1264 | } 1265 | if (!nou) 1266 | all = Object.keys(all); 1267 | if (!self.nosort) 1268 | all = all.sort(self.nocase ? alphasorti : alphasort); 1269 | if (self.mark) { 1270 | for (var i = 0; i < all.length; i++) { 1271 | all[i] = self._mark(all[i]); 1272 | } 1273 | if (self.nodir) { 1274 | all = all.filter(function(e) { 1275 | var notDir = !/\/$/.test(e); 1276 | var c = self.cache[e] || self.cache[makeAbs(self, e)]; 1277 | if (notDir && c) 1278 | notDir = c !== "DIR" && !Array.isArray(c); 1279 | return notDir; 1280 | }); 1281 | } 1282 | } 1283 | if (self.ignore.length) 1284 | all = all.filter(function(m2) { 1285 | return !isIgnored(self, m2); 1286 | }); 1287 | self.found = all; 1288 | } 1289 | function mark(self, p) { 1290 | var abs = makeAbs(self, p); 1291 | var c = self.cache[abs]; 1292 | var m = p; 1293 | if (c) { 1294 | var isDir = c === "DIR" || Array.isArray(c); 1295 | var slash = p.slice(-1) === "/"; 1296 | if (isDir && !slash) 1297 | m += "/"; 1298 | else if (!isDir && slash) 1299 | m = m.slice(0, -1); 1300 | if (m !== p) { 1301 | var mabs = makeAbs(self, m); 1302 | self.statCache[mabs] = self.statCache[abs]; 1303 | self.cache[mabs] = self.cache[abs]; 1304 | } 1305 | } 1306 | return m; 1307 | } 1308 | function makeAbs(self, f) { 1309 | var abs = f; 1310 | if (f.charAt(0) === "/") { 1311 | abs = path2.join(self.root, f); 1312 | } else if (isAbsolute(f) || f === "") { 1313 | abs = f; 1314 | } else if (self.changedCwd) { 1315 | abs = path2.resolve(self.cwd, f); 1316 | } else { 1317 | abs = path2.resolve(f); 1318 | } 1319 | if (process.platform === "win32") 1320 | abs = abs.replace(/\\/g, "/"); 1321 | return abs; 1322 | } 1323 | function isIgnored(self, path3) { 1324 | if (!self.ignore.length) 1325 | return false; 1326 | return self.ignore.some(function(item) { 1327 | return item.matcher.match(path3) || !!(item.gmatcher && item.gmatcher.match(path3)); 1328 | }); 1329 | } 1330 | function childrenIgnored(self, path3) { 1331 | if (!self.ignore.length) 1332 | return false; 1333 | return self.ignore.some(function(item) { 1334 | return !!(item.gmatcher && item.gmatcher.match(path3)); 1335 | }); 1336 | } 1337 | }); 1338 | 1339 | // node_modules/glob/sync.js 1340 | var require_sync = __commonJS((exports2, module2) => { 1341 | module2.exports = globSync; 1342 | globSync.GlobSync = GlobSync; 1343 | var fs2 = require("fs"); 1344 | var rp = require_fs(); 1345 | var minimatch = require_minimatch(); 1346 | var Minimatch = minimatch.Minimatch; 1347 | var Glob = require_glob().Glob; 1348 | var util = require("util"); 1349 | var path2 = require("path"); 1350 | var assert = require("assert"); 1351 | var isAbsolute = require_path_is_absolute(); 1352 | var common = require_common(); 1353 | var alphasort = common.alphasort; 1354 | var alphasorti = common.alphasorti; 1355 | var setopts = common.setopts; 1356 | var ownProp = common.ownProp; 1357 | var childrenIgnored = common.childrenIgnored; 1358 | var isIgnored = common.isIgnored; 1359 | function globSync(pattern, options) { 1360 | if (typeof options === "function" || arguments.length === 3) 1361 | throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); 1362 | return new GlobSync(pattern, options).found; 1363 | } 1364 | function GlobSync(pattern, options) { 1365 | if (!pattern) 1366 | throw new Error("must provide pattern"); 1367 | if (typeof options === "function" || arguments.length === 3) 1368 | throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); 1369 | if (!(this instanceof GlobSync)) 1370 | return new GlobSync(pattern, options); 1371 | setopts(this, pattern, options); 1372 | if (this.noprocess) 1373 | return this; 1374 | var n = this.minimatch.set.length; 1375 | this.matches = new Array(n); 1376 | for (var i = 0; i < n; i++) { 1377 | this._process(this.minimatch.set[i], i, false); 1378 | } 1379 | this._finish(); 1380 | } 1381 | GlobSync.prototype._finish = function() { 1382 | assert(this instanceof GlobSync); 1383 | if (this.realpath) { 1384 | var self = this; 1385 | this.matches.forEach(function(matchset, index) { 1386 | var set = self.matches[index] = Object.create(null); 1387 | for (var p in matchset) { 1388 | try { 1389 | p = self._makeAbs(p); 1390 | var real = rp.realpathSync(p, self.realpathCache); 1391 | set[real] = true; 1392 | } catch (er) { 1393 | if (er.syscall === "stat") 1394 | set[self._makeAbs(p)] = true; 1395 | else 1396 | throw er; 1397 | } 1398 | } 1399 | }); 1400 | } 1401 | common.finish(this); 1402 | }; 1403 | GlobSync.prototype._process = function(pattern, index, inGlobStar) { 1404 | assert(this instanceof GlobSync); 1405 | var n = 0; 1406 | while (typeof pattern[n] === "string") { 1407 | n++; 1408 | } 1409 | var prefix; 1410 | switch (n) { 1411 | case pattern.length: 1412 | this._processSimple(pattern.join("/"), index); 1413 | return; 1414 | case 0: 1415 | prefix = null; 1416 | break; 1417 | default: 1418 | prefix = pattern.slice(0, n).join("/"); 1419 | break; 1420 | } 1421 | var remain = pattern.slice(n); 1422 | var read; 1423 | if (prefix === null) 1424 | read = "."; 1425 | else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { 1426 | if (!prefix || !isAbsolute(prefix)) 1427 | prefix = "/" + prefix; 1428 | read = prefix; 1429 | } else 1430 | read = prefix; 1431 | var abs = this._makeAbs(read); 1432 | if (childrenIgnored(this, read)) 1433 | return; 1434 | var isGlobStar = remain[0] === minimatch.GLOBSTAR; 1435 | if (isGlobStar) 1436 | this._processGlobStar(prefix, read, abs, remain, index, inGlobStar); 1437 | else 1438 | this._processReaddir(prefix, read, abs, remain, index, inGlobStar); 1439 | }; 1440 | GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) { 1441 | var entries = this._readdir(abs, inGlobStar); 1442 | if (!entries) 1443 | return; 1444 | var pn = remain[0]; 1445 | var negate = !!this.minimatch.negate; 1446 | var rawGlob = pn._glob; 1447 | var dotOk = this.dot || rawGlob.charAt(0) === "."; 1448 | var matchedEntries = []; 1449 | for (var i = 0; i < entries.length; i++) { 1450 | var e = entries[i]; 1451 | if (e.charAt(0) !== "." || dotOk) { 1452 | var m; 1453 | if (negate && !prefix) { 1454 | m = !e.match(pn); 1455 | } else { 1456 | m = e.match(pn); 1457 | } 1458 | if (m) 1459 | matchedEntries.push(e); 1460 | } 1461 | } 1462 | var len = matchedEntries.length; 1463 | if (len === 0) 1464 | return; 1465 | if (remain.length === 1 && !this.mark && !this.stat) { 1466 | if (!this.matches[index]) 1467 | this.matches[index] = Object.create(null); 1468 | for (var i = 0; i < len; i++) { 1469 | var e = matchedEntries[i]; 1470 | if (prefix) { 1471 | if (prefix.slice(-1) !== "/") 1472 | e = prefix + "/" + e; 1473 | else 1474 | e = prefix + e; 1475 | } 1476 | if (e.charAt(0) === "/" && !this.nomount) { 1477 | e = path2.join(this.root, e); 1478 | } 1479 | this._emitMatch(index, e); 1480 | } 1481 | return; 1482 | } 1483 | remain.shift(); 1484 | for (var i = 0; i < len; i++) { 1485 | var e = matchedEntries[i]; 1486 | var newPattern; 1487 | if (prefix) 1488 | newPattern = [prefix, e]; 1489 | else 1490 | newPattern = [e]; 1491 | this._process(newPattern.concat(remain), index, inGlobStar); 1492 | } 1493 | }; 1494 | GlobSync.prototype._emitMatch = function(index, e) { 1495 | if (isIgnored(this, e)) 1496 | return; 1497 | var abs = this._makeAbs(e); 1498 | if (this.mark) 1499 | e = this._mark(e); 1500 | if (this.absolute) { 1501 | e = abs; 1502 | } 1503 | if (this.matches[index][e]) 1504 | return; 1505 | if (this.nodir) { 1506 | var c = this.cache[abs]; 1507 | if (c === "DIR" || Array.isArray(c)) 1508 | return; 1509 | } 1510 | this.matches[index][e] = true; 1511 | if (this.stat) 1512 | this._stat(e); 1513 | }; 1514 | GlobSync.prototype._readdirInGlobStar = function(abs) { 1515 | if (this.follow) 1516 | return this._readdir(abs, false); 1517 | var entries; 1518 | var lstat; 1519 | var stat; 1520 | try { 1521 | lstat = fs2.lstatSync(abs); 1522 | } catch (er) { 1523 | if (er.code === "ENOENT") { 1524 | return null; 1525 | } 1526 | } 1527 | var isSym = lstat && lstat.isSymbolicLink(); 1528 | this.symlinks[abs] = isSym; 1529 | if (!isSym && lstat && !lstat.isDirectory()) 1530 | this.cache[abs] = "FILE"; 1531 | else 1532 | entries = this._readdir(abs, false); 1533 | return entries; 1534 | }; 1535 | GlobSync.prototype._readdir = function(abs, inGlobStar) { 1536 | var entries; 1537 | if (inGlobStar && !ownProp(this.symlinks, abs)) 1538 | return this._readdirInGlobStar(abs); 1539 | if (ownProp(this.cache, abs)) { 1540 | var c = this.cache[abs]; 1541 | if (!c || c === "FILE") 1542 | return null; 1543 | if (Array.isArray(c)) 1544 | return c; 1545 | } 1546 | try { 1547 | return this._readdirEntries(abs, fs2.readdirSync(abs)); 1548 | } catch (er) { 1549 | this._readdirError(abs, er); 1550 | return null; 1551 | } 1552 | }; 1553 | GlobSync.prototype._readdirEntries = function(abs, entries) { 1554 | if (!this.mark && !this.stat) { 1555 | for (var i = 0; i < entries.length; i++) { 1556 | var e = entries[i]; 1557 | if (abs === "/") 1558 | e = abs + e; 1559 | else 1560 | e = abs + "/" + e; 1561 | this.cache[e] = true; 1562 | } 1563 | } 1564 | this.cache[abs] = entries; 1565 | return entries; 1566 | }; 1567 | GlobSync.prototype._readdirError = function(f, er) { 1568 | switch (er.code) { 1569 | case "ENOTSUP": 1570 | case "ENOTDIR": 1571 | var abs = this._makeAbs(f); 1572 | this.cache[abs] = "FILE"; 1573 | if (abs === this.cwdAbs) { 1574 | var error = new Error(er.code + " invalid cwd " + this.cwd); 1575 | error.path = this.cwd; 1576 | error.code = er.code; 1577 | throw error; 1578 | } 1579 | break; 1580 | case "ENOENT": 1581 | case "ELOOP": 1582 | case "ENAMETOOLONG": 1583 | case "UNKNOWN": 1584 | this.cache[this._makeAbs(f)] = false; 1585 | break; 1586 | default: 1587 | this.cache[this._makeAbs(f)] = false; 1588 | if (this.strict) 1589 | throw er; 1590 | if (!this.silent) 1591 | console.error("glob error", er); 1592 | break; 1593 | } 1594 | }; 1595 | GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) { 1596 | var entries = this._readdir(abs, inGlobStar); 1597 | if (!entries) 1598 | return; 1599 | var remainWithoutGlobStar = remain.slice(1); 1600 | var gspref = prefix ? [prefix] : []; 1601 | var noGlobStar = gspref.concat(remainWithoutGlobStar); 1602 | this._process(noGlobStar, index, false); 1603 | var len = entries.length; 1604 | var isSym = this.symlinks[abs]; 1605 | if (isSym && inGlobStar) 1606 | return; 1607 | for (var i = 0; i < len; i++) { 1608 | var e = entries[i]; 1609 | if (e.charAt(0) === "." && !this.dot) 1610 | continue; 1611 | var instead = gspref.concat(entries[i], remainWithoutGlobStar); 1612 | this._process(instead, index, true); 1613 | var below = gspref.concat(entries[i], remain); 1614 | this._process(below, index, true); 1615 | } 1616 | }; 1617 | GlobSync.prototype._processSimple = function(prefix, index) { 1618 | var exists = this._stat(prefix); 1619 | if (!this.matches[index]) 1620 | this.matches[index] = Object.create(null); 1621 | if (!exists) 1622 | return; 1623 | if (prefix && isAbsolute(prefix) && !this.nomount) { 1624 | var trail = /[\/\\]$/.test(prefix); 1625 | if (prefix.charAt(0) === "/") { 1626 | prefix = path2.join(this.root, prefix); 1627 | } else { 1628 | prefix = path2.resolve(this.root, prefix); 1629 | if (trail) 1630 | prefix += "/"; 1631 | } 1632 | } 1633 | if (process.platform === "win32") 1634 | prefix = prefix.replace(/\\/g, "/"); 1635 | this._emitMatch(index, prefix); 1636 | }; 1637 | GlobSync.prototype._stat = function(f) { 1638 | var abs = this._makeAbs(f); 1639 | var needDir = f.slice(-1) === "/"; 1640 | if (f.length > this.maxLength) 1641 | return false; 1642 | if (!this.stat && ownProp(this.cache, abs)) { 1643 | var c = this.cache[abs]; 1644 | if (Array.isArray(c)) 1645 | c = "DIR"; 1646 | if (!needDir || c === "DIR") 1647 | return c; 1648 | if (needDir && c === "FILE") 1649 | return false; 1650 | } 1651 | var exists; 1652 | var stat = this.statCache[abs]; 1653 | if (!stat) { 1654 | var lstat; 1655 | try { 1656 | lstat = fs2.lstatSync(abs); 1657 | } catch (er) { 1658 | if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { 1659 | this.statCache[abs] = false; 1660 | return false; 1661 | } 1662 | } 1663 | if (lstat && lstat.isSymbolicLink()) { 1664 | try { 1665 | stat = fs2.statSync(abs); 1666 | } catch (er) { 1667 | stat = lstat; 1668 | } 1669 | } else { 1670 | stat = lstat; 1671 | } 1672 | } 1673 | this.statCache[abs] = stat; 1674 | var c = true; 1675 | if (stat) 1676 | c = stat.isDirectory() ? "DIR" : "FILE"; 1677 | this.cache[abs] = this.cache[abs] || c; 1678 | if (needDir && c === "FILE") 1679 | return false; 1680 | return c; 1681 | }; 1682 | GlobSync.prototype._mark = function(p) { 1683 | return common.mark(this, p); 1684 | }; 1685 | GlobSync.prototype._makeAbs = function(f) { 1686 | return common.makeAbs(this, f); 1687 | }; 1688 | }); 1689 | 1690 | // node_modules/wrappy/wrappy.js 1691 | var require_wrappy = __commonJS((exports2, module2) => { 1692 | module2.exports = wrappy; 1693 | function wrappy(fn, cb) { 1694 | if (fn && cb) 1695 | return wrappy(fn)(cb); 1696 | if (typeof fn !== "function") 1697 | throw new TypeError("need wrapper function"); 1698 | Object.keys(fn).forEach(function(k) { 1699 | wrapper[k] = fn[k]; 1700 | }); 1701 | return wrapper; 1702 | function wrapper() { 1703 | var args = new Array(arguments.length); 1704 | for (var i = 0; i < args.length; i++) { 1705 | args[i] = arguments[i]; 1706 | } 1707 | var ret = fn.apply(this, args); 1708 | var cb2 = args[args.length - 1]; 1709 | if (typeof ret === "function" && ret !== cb2) { 1710 | Object.keys(cb2).forEach(function(k) { 1711 | ret[k] = cb2[k]; 1712 | }); 1713 | } 1714 | return ret; 1715 | } 1716 | } 1717 | }); 1718 | 1719 | // node_modules/once/once.js 1720 | var require_once = __commonJS((exports2, module2) => { 1721 | var wrappy = require_wrappy(); 1722 | module2.exports = wrappy(once); 1723 | module2.exports.strict = wrappy(onceStrict); 1724 | once.proto = once(function() { 1725 | Object.defineProperty(Function.prototype, "once", { 1726 | value: function() { 1727 | return once(this); 1728 | }, 1729 | configurable: true 1730 | }); 1731 | Object.defineProperty(Function.prototype, "onceStrict", { 1732 | value: function() { 1733 | return onceStrict(this); 1734 | }, 1735 | configurable: true 1736 | }); 1737 | }); 1738 | function once(fn) { 1739 | var f = function() { 1740 | if (f.called) 1741 | return f.value; 1742 | f.called = true; 1743 | return f.value = fn.apply(this, arguments); 1744 | }; 1745 | f.called = false; 1746 | return f; 1747 | } 1748 | function onceStrict(fn) { 1749 | var f = function() { 1750 | if (f.called) 1751 | throw new Error(f.onceError); 1752 | f.called = true; 1753 | return f.value = fn.apply(this, arguments); 1754 | }; 1755 | var name = fn.name || "Function wrapped with `once`"; 1756 | f.onceError = name + " shouldn't be called more than once"; 1757 | f.called = false; 1758 | return f; 1759 | } 1760 | }); 1761 | 1762 | // node_modules/inflight/inflight.js 1763 | var require_inflight = __commonJS((exports2, module2) => { 1764 | var wrappy = require_wrappy(); 1765 | var reqs = Object.create(null); 1766 | var once = require_once(); 1767 | module2.exports = wrappy(inflight); 1768 | function inflight(key, cb) { 1769 | if (reqs[key]) { 1770 | reqs[key].push(cb); 1771 | return null; 1772 | } else { 1773 | reqs[key] = [cb]; 1774 | return makeres(key); 1775 | } 1776 | } 1777 | function makeres(key) { 1778 | return once(function RES() { 1779 | var cbs = reqs[key]; 1780 | var len = cbs.length; 1781 | var args = slice(arguments); 1782 | try { 1783 | for (var i = 0; i < len; i++) { 1784 | cbs[i].apply(null, args); 1785 | } 1786 | } finally { 1787 | if (cbs.length > len) { 1788 | cbs.splice(0, len); 1789 | process.nextTick(function() { 1790 | RES.apply(null, args); 1791 | }); 1792 | } else { 1793 | delete reqs[key]; 1794 | } 1795 | } 1796 | }); 1797 | } 1798 | function slice(args) { 1799 | var length = args.length; 1800 | var array = []; 1801 | for (var i = 0; i < length; i++) 1802 | array[i] = args[i]; 1803 | return array; 1804 | } 1805 | }); 1806 | 1807 | // node_modules/glob/glob.js 1808 | var require_glob = __commonJS((exports2, module2) => { 1809 | module2.exports = glob; 1810 | var fs2 = require("fs"); 1811 | var rp = require_fs(); 1812 | var minimatch = require_minimatch(); 1813 | var Minimatch = minimatch.Minimatch; 1814 | var inherits = require_inherits(); 1815 | var EE = require("events").EventEmitter; 1816 | var path2 = require("path"); 1817 | var assert = require("assert"); 1818 | var isAbsolute = require_path_is_absolute(); 1819 | var globSync = require_sync(); 1820 | var common = require_common(); 1821 | var alphasort = common.alphasort; 1822 | var alphasorti = common.alphasorti; 1823 | var setopts = common.setopts; 1824 | var ownProp = common.ownProp; 1825 | var inflight = require_inflight(); 1826 | var util = require("util"); 1827 | var childrenIgnored = common.childrenIgnored; 1828 | var isIgnored = common.isIgnored; 1829 | var once = require_once(); 1830 | function glob(pattern, options, cb) { 1831 | if (typeof options === "function") 1832 | cb = options, options = {}; 1833 | if (!options) 1834 | options = {}; 1835 | if (options.sync) { 1836 | if (cb) 1837 | throw new TypeError("callback provided to sync glob"); 1838 | return globSync(pattern, options); 1839 | } 1840 | return new Glob(pattern, options, cb); 1841 | } 1842 | glob.sync = globSync; 1843 | var GlobSync = glob.GlobSync = globSync.GlobSync; 1844 | glob.glob = glob; 1845 | function extend(origin, add) { 1846 | if (add === null || typeof add !== "object") { 1847 | return origin; 1848 | } 1849 | var keys = Object.keys(add); 1850 | var i = keys.length; 1851 | while (i--) { 1852 | origin[keys[i]] = add[keys[i]]; 1853 | } 1854 | return origin; 1855 | } 1856 | glob.hasMagic = function(pattern, options_) { 1857 | var options = extend({}, options_); 1858 | options.noprocess = true; 1859 | var g = new Glob(pattern, options); 1860 | var set = g.minimatch.set; 1861 | if (!pattern) 1862 | return false; 1863 | if (set.length > 1) 1864 | return true; 1865 | for (var j = 0; j < set[0].length; j++) { 1866 | if (typeof set[0][j] !== "string") 1867 | return true; 1868 | } 1869 | return false; 1870 | }; 1871 | glob.Glob = Glob; 1872 | inherits(Glob, EE); 1873 | function Glob(pattern, options, cb) { 1874 | if (typeof options === "function") { 1875 | cb = options; 1876 | options = null; 1877 | } 1878 | if (options && options.sync) { 1879 | if (cb) 1880 | throw new TypeError("callback provided to sync glob"); 1881 | return new GlobSync(pattern, options); 1882 | } 1883 | if (!(this instanceof Glob)) 1884 | return new Glob(pattern, options, cb); 1885 | setopts(this, pattern, options); 1886 | this._didRealPath = false; 1887 | var n = this.minimatch.set.length; 1888 | this.matches = new Array(n); 1889 | if (typeof cb === "function") { 1890 | cb = once(cb); 1891 | this.on("error", cb); 1892 | this.on("end", function(matches) { 1893 | cb(null, matches); 1894 | }); 1895 | } 1896 | var self = this; 1897 | this._processing = 0; 1898 | this._emitQueue = []; 1899 | this._processQueue = []; 1900 | this.paused = false; 1901 | if (this.noprocess) 1902 | return this; 1903 | if (n === 0) 1904 | return done(); 1905 | var sync = true; 1906 | for (var i = 0; i < n; i++) { 1907 | this._process(this.minimatch.set[i], i, false, done); 1908 | } 1909 | sync = false; 1910 | function done() { 1911 | --self._processing; 1912 | if (self._processing <= 0) { 1913 | if (sync) { 1914 | process.nextTick(function() { 1915 | self._finish(); 1916 | }); 1917 | } else { 1918 | self._finish(); 1919 | } 1920 | } 1921 | } 1922 | } 1923 | Glob.prototype._finish = function() { 1924 | assert(this instanceof Glob); 1925 | if (this.aborted) 1926 | return; 1927 | if (this.realpath && !this._didRealpath) 1928 | return this._realpath(); 1929 | common.finish(this); 1930 | this.emit("end", this.found); 1931 | }; 1932 | Glob.prototype._realpath = function() { 1933 | if (this._didRealpath) 1934 | return; 1935 | this._didRealpath = true; 1936 | var n = this.matches.length; 1937 | if (n === 0) 1938 | return this._finish(); 1939 | var self = this; 1940 | for (var i = 0; i < this.matches.length; i++) 1941 | this._realpathSet(i, next); 1942 | function next() { 1943 | if (--n === 0) 1944 | self._finish(); 1945 | } 1946 | }; 1947 | Glob.prototype._realpathSet = function(index, cb) { 1948 | var matchset = this.matches[index]; 1949 | if (!matchset) 1950 | return cb(); 1951 | var found = Object.keys(matchset); 1952 | var self = this; 1953 | var n = found.length; 1954 | if (n === 0) 1955 | return cb(); 1956 | var set = this.matches[index] = Object.create(null); 1957 | found.forEach(function(p, i) { 1958 | p = self._makeAbs(p); 1959 | rp.realpath(p, self.realpathCache, function(er, real) { 1960 | if (!er) 1961 | set[real] = true; 1962 | else if (er.syscall === "stat") 1963 | set[p] = true; 1964 | else 1965 | self.emit("error", er); 1966 | if (--n === 0) { 1967 | self.matches[index] = set; 1968 | cb(); 1969 | } 1970 | }); 1971 | }); 1972 | }; 1973 | Glob.prototype._mark = function(p) { 1974 | return common.mark(this, p); 1975 | }; 1976 | Glob.prototype._makeAbs = function(f) { 1977 | return common.makeAbs(this, f); 1978 | }; 1979 | Glob.prototype.abort = function() { 1980 | this.aborted = true; 1981 | this.emit("abort"); 1982 | }; 1983 | Glob.prototype.pause = function() { 1984 | if (!this.paused) { 1985 | this.paused = true; 1986 | this.emit("pause"); 1987 | } 1988 | }; 1989 | Glob.prototype.resume = function() { 1990 | if (this.paused) { 1991 | this.emit("resume"); 1992 | this.paused = false; 1993 | if (this._emitQueue.length) { 1994 | var eq = this._emitQueue.slice(0); 1995 | this._emitQueue.length = 0; 1996 | for (var i = 0; i < eq.length; i++) { 1997 | var e = eq[i]; 1998 | this._emitMatch(e[0], e[1]); 1999 | } 2000 | } 2001 | if (this._processQueue.length) { 2002 | var pq = this._processQueue.slice(0); 2003 | this._processQueue.length = 0; 2004 | for (var i = 0; i < pq.length; i++) { 2005 | var p = pq[i]; 2006 | this._processing--; 2007 | this._process(p[0], p[1], p[2], p[3]); 2008 | } 2009 | } 2010 | } 2011 | }; 2012 | Glob.prototype._process = function(pattern, index, inGlobStar, cb) { 2013 | assert(this instanceof Glob); 2014 | assert(typeof cb === "function"); 2015 | if (this.aborted) 2016 | return; 2017 | this._processing++; 2018 | if (this.paused) { 2019 | this._processQueue.push([pattern, index, inGlobStar, cb]); 2020 | return; 2021 | } 2022 | var n = 0; 2023 | while (typeof pattern[n] === "string") { 2024 | n++; 2025 | } 2026 | var prefix; 2027 | switch (n) { 2028 | case pattern.length: 2029 | this._processSimple(pattern.join("/"), index, cb); 2030 | return; 2031 | case 0: 2032 | prefix = null; 2033 | break; 2034 | default: 2035 | prefix = pattern.slice(0, n).join("/"); 2036 | break; 2037 | } 2038 | var remain = pattern.slice(n); 2039 | var read; 2040 | if (prefix === null) 2041 | read = "."; 2042 | else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { 2043 | if (!prefix || !isAbsolute(prefix)) 2044 | prefix = "/" + prefix; 2045 | read = prefix; 2046 | } else 2047 | read = prefix; 2048 | var abs = this._makeAbs(read); 2049 | if (childrenIgnored(this, read)) 2050 | return cb(); 2051 | var isGlobStar = remain[0] === minimatch.GLOBSTAR; 2052 | if (isGlobStar) 2053 | this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb); 2054 | else 2055 | this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb); 2056 | }; 2057 | Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) { 2058 | var self = this; 2059 | this._readdir(abs, inGlobStar, function(er, entries) { 2060 | return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb); 2061 | }); 2062 | }; 2063 | Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { 2064 | if (!entries) 2065 | return cb(); 2066 | var pn = remain[0]; 2067 | var negate = !!this.minimatch.negate; 2068 | var rawGlob = pn._glob; 2069 | var dotOk = this.dot || rawGlob.charAt(0) === "."; 2070 | var matchedEntries = []; 2071 | for (var i = 0; i < entries.length; i++) { 2072 | var e = entries[i]; 2073 | if (e.charAt(0) !== "." || dotOk) { 2074 | var m; 2075 | if (negate && !prefix) { 2076 | m = !e.match(pn); 2077 | } else { 2078 | m = e.match(pn); 2079 | } 2080 | if (m) 2081 | matchedEntries.push(e); 2082 | } 2083 | } 2084 | var len = matchedEntries.length; 2085 | if (len === 0) 2086 | return cb(); 2087 | if (remain.length === 1 && !this.mark && !this.stat) { 2088 | if (!this.matches[index]) 2089 | this.matches[index] = Object.create(null); 2090 | for (var i = 0; i < len; i++) { 2091 | var e = matchedEntries[i]; 2092 | if (prefix) { 2093 | if (prefix !== "/") 2094 | e = prefix + "/" + e; 2095 | else 2096 | e = prefix + e; 2097 | } 2098 | if (e.charAt(0) === "/" && !this.nomount) { 2099 | e = path2.join(this.root, e); 2100 | } 2101 | this._emitMatch(index, e); 2102 | } 2103 | return cb(); 2104 | } 2105 | remain.shift(); 2106 | for (var i = 0; i < len; i++) { 2107 | var e = matchedEntries[i]; 2108 | var newPattern; 2109 | if (prefix) { 2110 | if (prefix !== "/") 2111 | e = prefix + "/" + e; 2112 | else 2113 | e = prefix + e; 2114 | } 2115 | this._process([e].concat(remain), index, inGlobStar, cb); 2116 | } 2117 | cb(); 2118 | }; 2119 | Glob.prototype._emitMatch = function(index, e) { 2120 | if (this.aborted) 2121 | return; 2122 | if (isIgnored(this, e)) 2123 | return; 2124 | if (this.paused) { 2125 | this._emitQueue.push([index, e]); 2126 | return; 2127 | } 2128 | var abs = isAbsolute(e) ? e : this._makeAbs(e); 2129 | if (this.mark) 2130 | e = this._mark(e); 2131 | if (this.absolute) 2132 | e = abs; 2133 | if (this.matches[index][e]) 2134 | return; 2135 | if (this.nodir) { 2136 | var c = this.cache[abs]; 2137 | if (c === "DIR" || Array.isArray(c)) 2138 | return; 2139 | } 2140 | this.matches[index][e] = true; 2141 | var st = this.statCache[abs]; 2142 | if (st) 2143 | this.emit("stat", e, st); 2144 | this.emit("match", e); 2145 | }; 2146 | Glob.prototype._readdirInGlobStar = function(abs, cb) { 2147 | if (this.aborted) 2148 | return; 2149 | if (this.follow) 2150 | return this._readdir(abs, false, cb); 2151 | var lstatkey = "lstat\0" + abs; 2152 | var self = this; 2153 | var lstatcb = inflight(lstatkey, lstatcb_); 2154 | if (lstatcb) 2155 | fs2.lstat(abs, lstatcb); 2156 | function lstatcb_(er, lstat) { 2157 | if (er && er.code === "ENOENT") 2158 | return cb(); 2159 | var isSym = lstat && lstat.isSymbolicLink(); 2160 | self.symlinks[abs] = isSym; 2161 | if (!isSym && lstat && !lstat.isDirectory()) { 2162 | self.cache[abs] = "FILE"; 2163 | cb(); 2164 | } else 2165 | self._readdir(abs, false, cb); 2166 | } 2167 | }; 2168 | Glob.prototype._readdir = function(abs, inGlobStar, cb) { 2169 | if (this.aborted) 2170 | return; 2171 | cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); 2172 | if (!cb) 2173 | return; 2174 | if (inGlobStar && !ownProp(this.symlinks, abs)) 2175 | return this._readdirInGlobStar(abs, cb); 2176 | if (ownProp(this.cache, abs)) { 2177 | var c = this.cache[abs]; 2178 | if (!c || c === "FILE") 2179 | return cb(); 2180 | if (Array.isArray(c)) 2181 | return cb(null, c); 2182 | } 2183 | var self = this; 2184 | fs2.readdir(abs, readdirCb(this, abs, cb)); 2185 | }; 2186 | function readdirCb(self, abs, cb) { 2187 | return function(er, entries) { 2188 | if (er) 2189 | self._readdirError(abs, er, cb); 2190 | else 2191 | self._readdirEntries(abs, entries, cb); 2192 | }; 2193 | } 2194 | Glob.prototype._readdirEntries = function(abs, entries, cb) { 2195 | if (this.aborted) 2196 | return; 2197 | if (!this.mark && !this.stat) { 2198 | for (var i = 0; i < entries.length; i++) { 2199 | var e = entries[i]; 2200 | if (abs === "/") 2201 | e = abs + e; 2202 | else 2203 | e = abs + "/" + e; 2204 | this.cache[e] = true; 2205 | } 2206 | } 2207 | this.cache[abs] = entries; 2208 | return cb(null, entries); 2209 | }; 2210 | Glob.prototype._readdirError = function(f, er, cb) { 2211 | if (this.aborted) 2212 | return; 2213 | switch (er.code) { 2214 | case "ENOTSUP": 2215 | case "ENOTDIR": 2216 | var abs = this._makeAbs(f); 2217 | this.cache[abs] = "FILE"; 2218 | if (abs === this.cwdAbs) { 2219 | var error = new Error(er.code + " invalid cwd " + this.cwd); 2220 | error.path = this.cwd; 2221 | error.code = er.code; 2222 | this.emit("error", error); 2223 | this.abort(); 2224 | } 2225 | break; 2226 | case "ENOENT": 2227 | case "ELOOP": 2228 | case "ENAMETOOLONG": 2229 | case "UNKNOWN": 2230 | this.cache[this._makeAbs(f)] = false; 2231 | break; 2232 | default: 2233 | this.cache[this._makeAbs(f)] = false; 2234 | if (this.strict) { 2235 | this.emit("error", er); 2236 | this.abort(); 2237 | } 2238 | if (!this.silent) 2239 | console.error("glob error", er); 2240 | break; 2241 | } 2242 | return cb(); 2243 | }; 2244 | Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) { 2245 | var self = this; 2246 | this._readdir(abs, inGlobStar, function(er, entries) { 2247 | self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb); 2248 | }); 2249 | }; 2250 | Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { 2251 | if (!entries) 2252 | return cb(); 2253 | var remainWithoutGlobStar = remain.slice(1); 2254 | var gspref = prefix ? [prefix] : []; 2255 | var noGlobStar = gspref.concat(remainWithoutGlobStar); 2256 | this._process(noGlobStar, index, false, cb); 2257 | var isSym = this.symlinks[abs]; 2258 | var len = entries.length; 2259 | if (isSym && inGlobStar) 2260 | return cb(); 2261 | for (var i = 0; i < len; i++) { 2262 | var e = entries[i]; 2263 | if (e.charAt(0) === "." && !this.dot) 2264 | continue; 2265 | var instead = gspref.concat(entries[i], remainWithoutGlobStar); 2266 | this._process(instead, index, true, cb); 2267 | var below = gspref.concat(entries[i], remain); 2268 | this._process(below, index, true, cb); 2269 | } 2270 | cb(); 2271 | }; 2272 | Glob.prototype._processSimple = function(prefix, index, cb) { 2273 | var self = this; 2274 | this._stat(prefix, function(er, exists) { 2275 | self._processSimple2(prefix, index, er, exists, cb); 2276 | }); 2277 | }; 2278 | Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { 2279 | if (!this.matches[index]) 2280 | this.matches[index] = Object.create(null); 2281 | if (!exists) 2282 | return cb(); 2283 | if (prefix && isAbsolute(prefix) && !this.nomount) { 2284 | var trail = /[\/\\]$/.test(prefix); 2285 | if (prefix.charAt(0) === "/") { 2286 | prefix = path2.join(this.root, prefix); 2287 | } else { 2288 | prefix = path2.resolve(this.root, prefix); 2289 | if (trail) 2290 | prefix += "/"; 2291 | } 2292 | } 2293 | if (process.platform === "win32") 2294 | prefix = prefix.replace(/\\/g, "/"); 2295 | this._emitMatch(index, prefix); 2296 | cb(); 2297 | }; 2298 | Glob.prototype._stat = function(f, cb) { 2299 | var abs = this._makeAbs(f); 2300 | var needDir = f.slice(-1) === "/"; 2301 | if (f.length > this.maxLength) 2302 | return cb(); 2303 | if (!this.stat && ownProp(this.cache, abs)) { 2304 | var c = this.cache[abs]; 2305 | if (Array.isArray(c)) 2306 | c = "DIR"; 2307 | if (!needDir || c === "DIR") 2308 | return cb(null, c); 2309 | if (needDir && c === "FILE") 2310 | return cb(); 2311 | } 2312 | var exists; 2313 | var stat = this.statCache[abs]; 2314 | if (stat !== void 0) { 2315 | if (stat === false) 2316 | return cb(null, stat); 2317 | else { 2318 | var type2 = stat.isDirectory() ? "DIR" : "FILE"; 2319 | if (needDir && type2 === "FILE") 2320 | return cb(); 2321 | else 2322 | return cb(null, type2, stat); 2323 | } 2324 | } 2325 | var self = this; 2326 | var statcb = inflight("stat\0" + abs, lstatcb_); 2327 | if (statcb) 2328 | fs2.lstat(abs, statcb); 2329 | function lstatcb_(er, lstat) { 2330 | if (lstat && lstat.isSymbolicLink()) { 2331 | return fs2.stat(abs, function(er2, stat2) { 2332 | if (er2) 2333 | self._stat2(f, abs, null, lstat, cb); 2334 | else 2335 | self._stat2(f, abs, er2, stat2, cb); 2336 | }); 2337 | } else { 2338 | self._stat2(f, abs, er, lstat, cb); 2339 | } 2340 | } 2341 | }; 2342 | Glob.prototype._stat2 = function(f, abs, er, stat, cb) { 2343 | if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { 2344 | this.statCache[abs] = false; 2345 | return cb(); 2346 | } 2347 | var needDir = f.slice(-1) === "/"; 2348 | this.statCache[abs] = stat; 2349 | if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) 2350 | return cb(null, false, stat); 2351 | var c = true; 2352 | if (stat) 2353 | c = stat.isDirectory() ? "DIR" : "FILE"; 2354 | this.cache[abs] = this.cache[abs] || c; 2355 | if (needDir && c === "FILE") 2356 | return cb(); 2357 | return cb(null, c, stat); 2358 | }; 2359 | }); 2360 | 2361 | // node_modules/rimraf/rimraf.js 2362 | var require_rimraf = __commonJS((exports2, module2) => { 2363 | var assert = require("assert"); 2364 | var path2 = require("path"); 2365 | var fs2 = require("fs"); 2366 | var glob = void 0; 2367 | try { 2368 | glob = require_glob(); 2369 | } catch (_err) { 2370 | } 2371 | var defaultGlobOpts = { 2372 | nosort: true, 2373 | silent: true 2374 | }; 2375 | var timeout = 0; 2376 | var isWindows = process.platform === "win32"; 2377 | var defaults = (options) => { 2378 | const methods = [ 2379 | "unlink", 2380 | "chmod", 2381 | "stat", 2382 | "lstat", 2383 | "rmdir", 2384 | "readdir" 2385 | ]; 2386 | methods.forEach((m) => { 2387 | options[m] = options[m] || fs2[m]; 2388 | m = m + "Sync"; 2389 | options[m] = options[m] || fs2[m]; 2390 | }); 2391 | options.maxBusyTries = options.maxBusyTries || 3; 2392 | options.emfileWait = options.emfileWait || 1e3; 2393 | if (options.glob === false) { 2394 | options.disableGlob = true; 2395 | } 2396 | if (options.disableGlob !== true && glob === void 0) { 2397 | throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); 2398 | } 2399 | options.disableGlob = options.disableGlob || false; 2400 | options.glob = options.glob || defaultGlobOpts; 2401 | }; 2402 | var rimraf2 = (p, options, cb) => { 2403 | if (typeof options === "function") { 2404 | cb = options; 2405 | options = {}; 2406 | } 2407 | assert(p, "rimraf: missing path"); 2408 | assert.equal(typeof p, "string", "rimraf: path should be a string"); 2409 | assert.equal(typeof cb, "function", "rimraf: callback function required"); 2410 | assert(options, "rimraf: invalid options argument provided"); 2411 | assert.equal(typeof options, "object", "rimraf: options should be object"); 2412 | defaults(options); 2413 | let busyTries = 0; 2414 | let errState = null; 2415 | let n = 0; 2416 | const next = (er) => { 2417 | errState = errState || er; 2418 | if (--n === 0) 2419 | cb(errState); 2420 | }; 2421 | const afterGlob = (er, results) => { 2422 | if (er) 2423 | return cb(er); 2424 | n = results.length; 2425 | if (n === 0) 2426 | return cb(); 2427 | results.forEach((p2) => { 2428 | const CB = (er2) => { 2429 | if (er2) { 2430 | if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { 2431 | busyTries++; 2432 | return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100); 2433 | } 2434 | if (er2.code === "EMFILE" && timeout < options.emfileWait) { 2435 | return setTimeout(() => rimraf_(p2, options, CB), timeout++); 2436 | } 2437 | if (er2.code === "ENOENT") 2438 | er2 = null; 2439 | } 2440 | timeout = 0; 2441 | next(er2); 2442 | }; 2443 | rimraf_(p2, options, CB); 2444 | }); 2445 | }; 2446 | if (options.disableGlob || !glob.hasMagic(p)) 2447 | return afterGlob(null, [p]); 2448 | options.lstat(p, (er, stat) => { 2449 | if (!er) 2450 | return afterGlob(null, [p]); 2451 | glob(p, options.glob, afterGlob); 2452 | }); 2453 | }; 2454 | var rimraf_ = (p, options, cb) => { 2455 | assert(p); 2456 | assert(options); 2457 | assert(typeof cb === "function"); 2458 | options.lstat(p, (er, st) => { 2459 | if (er && er.code === "ENOENT") 2460 | return cb(null); 2461 | if (er && er.code === "EPERM" && isWindows) 2462 | fixWinEPERM(p, options, er, cb); 2463 | if (st && st.isDirectory()) 2464 | return rmdir(p, options, er, cb); 2465 | options.unlink(p, (er2) => { 2466 | if (er2) { 2467 | if (er2.code === "ENOENT") 2468 | return cb(null); 2469 | if (er2.code === "EPERM") 2470 | return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); 2471 | if (er2.code === "EISDIR") 2472 | return rmdir(p, options, er2, cb); 2473 | } 2474 | return cb(er2); 2475 | }); 2476 | }); 2477 | }; 2478 | var fixWinEPERM = (p, options, er, cb) => { 2479 | assert(p); 2480 | assert(options); 2481 | assert(typeof cb === "function"); 2482 | options.chmod(p, 438, (er2) => { 2483 | if (er2) 2484 | cb(er2.code === "ENOENT" ? null : er); 2485 | else 2486 | options.stat(p, (er3, stats) => { 2487 | if (er3) 2488 | cb(er3.code === "ENOENT" ? null : er); 2489 | else if (stats.isDirectory()) 2490 | rmdir(p, options, er, cb); 2491 | else 2492 | options.unlink(p, cb); 2493 | }); 2494 | }); 2495 | }; 2496 | var fixWinEPERMSync = (p, options, er) => { 2497 | assert(p); 2498 | assert(options); 2499 | try { 2500 | options.chmodSync(p, 438); 2501 | } catch (er2) { 2502 | if (er2.code === "ENOENT") 2503 | return; 2504 | else 2505 | throw er; 2506 | } 2507 | let stats; 2508 | try { 2509 | stats = options.statSync(p); 2510 | } catch (er3) { 2511 | if (er3.code === "ENOENT") 2512 | return; 2513 | else 2514 | throw er; 2515 | } 2516 | if (stats.isDirectory()) 2517 | rmdirSync(p, options, er); 2518 | else 2519 | options.unlinkSync(p); 2520 | }; 2521 | var rmdir = (p, options, originalEr, cb) => { 2522 | assert(p); 2523 | assert(options); 2524 | assert(typeof cb === "function"); 2525 | options.rmdir(p, (er) => { 2526 | if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) 2527 | rmkids(p, options, cb); 2528 | else if (er && er.code === "ENOTDIR") 2529 | cb(originalEr); 2530 | else 2531 | cb(er); 2532 | }); 2533 | }; 2534 | var rmkids = (p, options, cb) => { 2535 | assert(p); 2536 | assert(options); 2537 | assert(typeof cb === "function"); 2538 | options.readdir(p, (er, files) => { 2539 | if (er) 2540 | return cb(er); 2541 | let n = files.length; 2542 | if (n === 0) 2543 | return options.rmdir(p, cb); 2544 | let errState; 2545 | files.forEach((f) => { 2546 | rimraf2(path2.join(p, f), options, (er2) => { 2547 | if (errState) 2548 | return; 2549 | if (er2) 2550 | return cb(errState = er2); 2551 | if (--n === 0) 2552 | options.rmdir(p, cb); 2553 | }); 2554 | }); 2555 | }); 2556 | }; 2557 | var rimrafSync = (p, options) => { 2558 | options = options || {}; 2559 | defaults(options); 2560 | assert(p, "rimraf: missing path"); 2561 | assert.equal(typeof p, "string", "rimraf: path should be a string"); 2562 | assert(options, "rimraf: missing options"); 2563 | assert.equal(typeof options, "object", "rimraf: options should be object"); 2564 | let results; 2565 | if (options.disableGlob || !glob.hasMagic(p)) { 2566 | results = [p]; 2567 | } else { 2568 | try { 2569 | options.lstatSync(p); 2570 | results = [p]; 2571 | } catch (er) { 2572 | results = glob.sync(p, options.glob); 2573 | } 2574 | } 2575 | if (!results.length) 2576 | return; 2577 | for (let i = 0; i < results.length; i++) { 2578 | const p2 = results[i]; 2579 | let st; 2580 | try { 2581 | st = options.lstatSync(p2); 2582 | } catch (er) { 2583 | if (er.code === "ENOENT") 2584 | return; 2585 | if (er.code === "EPERM" && isWindows) 2586 | fixWinEPERMSync(p2, options, er); 2587 | } 2588 | try { 2589 | if (st && st.isDirectory()) 2590 | rmdirSync(p2, options, null); 2591 | else 2592 | options.unlinkSync(p2); 2593 | } catch (er) { 2594 | if (er.code === "ENOENT") 2595 | return; 2596 | if (er.code === "EPERM") 2597 | return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er); 2598 | if (er.code !== "EISDIR") 2599 | throw er; 2600 | rmdirSync(p2, options, er); 2601 | } 2602 | } 2603 | }; 2604 | var rmdirSync = (p, options, originalEr) => { 2605 | assert(p); 2606 | assert(options); 2607 | try { 2608 | options.rmdirSync(p); 2609 | } catch (er) { 2610 | if (er.code === "ENOENT") 2611 | return; 2612 | if (er.code === "ENOTDIR") 2613 | throw originalEr; 2614 | if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") 2615 | rmkidsSync(p, options); 2616 | } 2617 | }; 2618 | var rmkidsSync = (p, options) => { 2619 | assert(p); 2620 | assert(options); 2621 | options.readdirSync(p).forEach((f) => rimrafSync(path2.join(p, f), options)); 2622 | const retries = isWindows ? 100 : 1; 2623 | let i = 0; 2624 | do { 2625 | let threw = true; 2626 | try { 2627 | const ret = options.rmdirSync(p, options); 2628 | threw = false; 2629 | return ret; 2630 | } finally { 2631 | if (++i < retries && threw) 2632 | continue; 2633 | } 2634 | } while (true); 2635 | }; 2636 | module2.exports = rimraf2; 2637 | rimraf2.sync = rimrafSync; 2638 | }); 2639 | 2640 | // src/uninstall.ts 2641 | __export(exports, { 2642 | default: () => uninstall_default 2643 | }); 2644 | var fs = __toModule(require("fs")); 2645 | var import_rimraf = __toModule(require_rimraf()); 2646 | 2647 | // src/binarypath.ts 2648 | var os = __toModule(require("os")); 2649 | var import_path = __toModule(require("path")); 2650 | var wunderctlPath = () => { 2651 | return import_path.default.join(wunderGraphDir(), "wunderctl"); 2652 | }; 2653 | var wunderGraphDir = () => { 2654 | return import_path.default.join(os.homedir(), ".wundergraph"); 2655 | }; 2656 | 2657 | // src/uninstall.ts 2658 | var uninstall = () => { 2659 | console.log("uninstalling wunderctl"); 2660 | const binaryPath = wunderctlPath(); 2661 | const exists = fs.existsSync(binaryPath); 2662 | if (!exists) { 2663 | console.log("wunderctl not found at install dir, skipping uninstall"); 2664 | return; 2665 | } 2666 | import_rimraf.default(binaryPath, (e) => { 2667 | if (e) { 2668 | console.log("failed uninstalling wunderctl: " + e.message); 2669 | return; 2670 | } 2671 | console.log("wunderctl uninstalled"); 2672 | }); 2673 | }; 2674 | var uninstall_default = uninstall(); 2675 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@wundergraph/wunderctl", 3 | "version": "0.0.3", 4 | "description": "WunderGraph Command Line Interface", 5 | "main": "run.js", 6 | "license": "MIT", 7 | "bin": { 8 | "wunderctl": "run.js" 9 | }, 10 | "scripts": { 11 | "build": "esbuild ./src/*** --bundle --platform=node --outdir=./dist", 12 | "check": "tsc --noEmit", 13 | "set-version": "node dist/set-version.js", 14 | "devinstall": "ts-node src/install.ts", 15 | "postinstall": "node dist/install.js", 16 | "postuninstall": "node dist/uninstall.js" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/wundergraph/wunderctl.git" 21 | }, 22 | "author": "", 23 | "bugs": { 24 | "url": "https://github.com/wundergraph/wunderctl/issues" 25 | }, 26 | "homepage": "https://github.com/wundergraph/wunderctl#readme", 27 | "devDependencies": { 28 | "@types/axios": "^0.14.0", 29 | "@types/node": "^14.14.20", 30 | "@types/rimraf": "^3.0.0", 31 | "@types/tar": "^4.0.4", 32 | "axios": "^0.21.1", 33 | "esbuild": "^0.8.31", 34 | "os": "^0.1.1", 35 | "rimraf": "^3.0.2", 36 | "tar": "^6.0.5", 37 | "ts-node": "^9.1.1", 38 | "typescript": "^4.1.3" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /run.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("./dist/run").default(); -------------------------------------------------------------------------------- /src/binarypath.ts: -------------------------------------------------------------------------------- 1 | import * as os from "os"; 2 | import path from "path"; 3 | 4 | const isWin = process.platform === "win32" 5 | 6 | export const downloadURL = (version: string) :string => { 7 | const osType = os.type(); 8 | const osArch = os.arch(); 9 | switch (osType){ 10 | case "Darwin": 11 | switch (osArch){ 12 | case "arm64": 13 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Darwin_arm64.tar.gz` 14 | case "x64": 15 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Darwin_x86_64.tar.gz` 16 | default: 17 | throw new Error(`os arch unsupported: ${osType} ${osArch}`) 18 | } 19 | case "Linux": 20 | switch (osArch){ 21 | case "x64": 22 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Linux_x86_64.tar.gz` 23 | case "x32": 24 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Linux_i386.tar.gz` 25 | default: 26 | throw new Error(`os arch unsupported: ${osType} ${osArch}`) 27 | } 28 | case "Windows_NT": 29 | switch (osArch){ 30 | case "x64": 31 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Windows_x86_64.tar.gz` 32 | case "x32": 33 | return `https://github.com/wundergraph/wunderctl/releases/download/v${version}/wunderctl_${version}_Windows_i386.tar.gz` 34 | default: 35 | throw new Error(`os arch unsupported: ${osType} ${osArch}`) 36 | } 37 | default: 38 | throw new Error(`os type unsupported: ${osType}`) 39 | } 40 | } 41 | 42 | export const wunderctlPath = () :string => { 43 | let binaryName = "wunderctl" 44 | if (isWin) { 45 | binaryName = "wunderctl.exe" 46 | } 47 | return path.join(wunderGraphDir(),binaryName) 48 | } 49 | 50 | export const wunderGraphDir = () :string => { 51 | return path.join(os.homedir(),".wundergraph") 52 | } -------------------------------------------------------------------------------- /src/install.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import {x} from "tar"; 3 | import {downloadURL, wunderctlPath, wunderGraphDir} from "./binarypath"; 4 | import * as fs from "fs"; 5 | import rimraf from "rimraf"; 6 | 7 | const install = async () => { 8 | 9 | const installDir = wunderGraphDir(); 10 | 11 | console.log(`installing wunderctl to: ${installDir}`); 12 | const version = JSON.parse(fs.readFileSync("package.json").toString()).version; 13 | 14 | if (!fs.existsSync(installDir)){ 15 | fs.mkdirSync(installDir,{recursive: true}) 16 | } 17 | 18 | const binaryPath = wunderctlPath(); 19 | if (fs.existsSync(binaryPath)){ 20 | rimraf(binaryPath,(err) => { 21 | if (err){ 22 | console.log("error uninstalling previous version") 23 | return 24 | } 25 | console.log("previous version uninstalled"); 26 | }) 27 | } 28 | 29 | try { 30 | const res = await axios({url: downloadURL(version), responseType: "stream"}); 31 | const outStream = x({ C: installDir }); 32 | res.data.pipe(outStream); 33 | outStream.addListener("finish",() => { 34 | console.log(`wunderctl v${version} installed/updated`); 35 | }); 36 | outStream.addListener("error",(err => { 37 | console.log("Error installing wunderctl: " + err.message) 38 | })) 39 | } catch (e) { 40 | console.log("Error installing wunderctl: " + e.message) 41 | } 42 | } 43 | 44 | export default install() -------------------------------------------------------------------------------- /src/run.ts: -------------------------------------------------------------------------------- 1 | import {wunderctlPath} from "./binarypath"; 2 | import * as fs from "fs"; 3 | import {spawnSync} from "child_process"; 4 | 5 | const run = () => { 6 | const executablePath = wunderctlPath(); 7 | if (!fs.existsSync(executablePath)) { 8 | error(`You must install wunderctl before you can run it:\nnpm i -g @wundergraph/wunderctl`); 9 | } 10 | 11 | const [, , ...args] = process.argv; 12 | 13 | const result = spawnSync(executablePath, args, { 14 | cwd: process.cwd(), 15 | stdio: "inherit" 16 | }, 17 | ); 18 | 19 | if (result.error) { 20 | error(result.error.message); 21 | } 22 | 23 | process.exit(result.status || 0); 24 | } 25 | 26 | const error = (msg: string) => { 27 | console.error(msg); 28 | process.exit(1); 29 | }; 30 | 31 | export default run; -------------------------------------------------------------------------------- /src/set-version.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | 3 | const setVersion = () => { 4 | const githubRef = "" + process.env.GITHUB_REF; 5 | if (githubRef === ""){ 6 | console.log(`cannot set version, env var missing: GITHUB_REF`); 7 | process.exit(1); 8 | return 9 | } 10 | const version = githubRef.substring("refs/tags/v".length); 11 | console.log(`detected version: ${version}`); 12 | try { 13 | const packageJSON = JSON.parse(fs.readFileSync("package.json").toString()); 14 | packageJSON["version"] = version; 15 | fs.writeFileSync("package.json",JSON.stringify(packageJSON,null," ")); 16 | console.log("version updated successfully"); 17 | } catch (e) { 18 | console.log(`error updating package.json: ${e.message}`) 19 | } 20 | } 21 | 22 | export default setVersion(); -------------------------------------------------------------------------------- /src/uninstall.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | import rimraf from "rimraf"; 3 | import {wunderctlPath} from "./binarypath"; 4 | 5 | const uninstall = () => { 6 | console.log("uninstalling wunderctl"); 7 | const binaryPath = wunderctlPath(); 8 | const exists = fs.existsSync(binaryPath); 9 | if (!exists){ 10 | console.log("wunderctl not found at install dir, skipping uninstall"); 11 | return 12 | } 13 | rimraf(binaryPath,(e) => { 14 | if (e){ 15 | console.log("failed uninstalling wunderctl: " + e.message); 16 | return 17 | } 18 | console.log("wunderctl uninstalled"); 19 | }); 20 | } 21 | 22 | export default uninstall() -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "commonjs", 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "esModuleInterop": true, 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "typeRoots": [ 16 | "./node_modules/@types" 17 | ], 18 | "declaration": true, 19 | "declarationDir": "./dist", 20 | "outDir": "./dist" 21 | }, 22 | "baseUrl": "./src", 23 | "paths": { 24 | "~*": [ 25 | "./*" 26 | ] 27 | }, 28 | "include": [ 29 | "src/**/*" 30 | ], 31 | "exclude": [ 32 | "node_modules", 33 | "dist" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/axios@^0.14.0": 6 | version "0.14.0" 7 | resolved "https://registry.yarnpkg.com/@types/axios/-/axios-0.14.0.tgz#ec2300fbe7d7dddd7eb9d3abf87999964cafce46" 8 | integrity sha1-7CMA++fX3d1+udOr+HmZlkyvzkY= 9 | dependencies: 10 | axios "*" 11 | 12 | "@types/glob@*": 13 | version "7.1.3" 14 | resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" 15 | integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== 16 | dependencies: 17 | "@types/minimatch" "*" 18 | "@types/node" "*" 19 | 20 | "@types/minimatch@*": 21 | version "3.0.3" 22 | resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" 23 | integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== 24 | 25 | "@types/minipass@*": 26 | version "2.2.0" 27 | resolved "https://registry.yarnpkg.com/@types/minipass/-/minipass-2.2.0.tgz#51ad404e8eb1fa961f75ec61205796807b6f9651" 28 | integrity sha512-wuzZksN4w4kyfoOv/dlpov4NOunwutLA/q7uc00xU02ZyUY+aoM5PWIXEKBMnm0NHd4a+N71BMjq+x7+2Af1fg== 29 | dependencies: 30 | "@types/node" "*" 31 | 32 | "@types/node@*", "@types/node@^14.14.20": 33 | version "14.14.20" 34 | resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340" 35 | integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A== 36 | 37 | "@types/rimraf@^3.0.0": 38 | version "3.0.0" 39 | resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.0.tgz#b9d03f090ece263671898d57bb7bb007023ac19f" 40 | integrity sha512-7WhJ0MdpFgYQPXlF4Dx+DhgvlPCfz/x5mHaeDQAKhcenvQP1KCpLQ18JklAqeGMYSAT2PxLpzd0g2/HE7fj7hQ== 41 | dependencies: 42 | "@types/glob" "*" 43 | "@types/node" "*" 44 | 45 | "@types/tar@^4.0.4": 46 | version "4.0.4" 47 | resolved "https://registry.yarnpkg.com/@types/tar/-/tar-4.0.4.tgz#d680de60855e7778a51c672b755869a3b8d2889f" 48 | integrity sha512-0Xv+xcmkTsOZdIF4yCnd7RkOOyfyqPaqJ7RZFKnwdxfDbkN3eAAE9sHl8zJFqBz4VhxolW9EErbjR1oyH7jK2A== 49 | dependencies: 50 | "@types/minipass" "*" 51 | "@types/node" "*" 52 | 53 | arg@^4.1.0: 54 | version "4.1.3" 55 | resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" 56 | integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== 57 | 58 | axios@*, axios@^0.21.1: 59 | version "0.21.1" 60 | resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" 61 | integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== 62 | dependencies: 63 | follow-redirects "^1.10.0" 64 | 65 | balanced-match@^1.0.0: 66 | version "1.0.0" 67 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 68 | integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= 69 | 70 | brace-expansion@^1.1.7: 71 | version "1.1.11" 72 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 73 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 74 | dependencies: 75 | balanced-match "^1.0.0" 76 | concat-map "0.0.1" 77 | 78 | buffer-from@^1.0.0: 79 | version "1.1.1" 80 | resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 81 | integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== 82 | 83 | chownr@^2.0.0: 84 | version "2.0.0" 85 | resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" 86 | integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== 87 | 88 | concat-map@0.0.1: 89 | version "0.0.1" 90 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 91 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 92 | 93 | create-require@^1.1.0: 94 | version "1.1.1" 95 | resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" 96 | integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== 97 | 98 | diff@^4.0.1: 99 | version "4.0.2" 100 | resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" 101 | integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== 102 | 103 | esbuild@^0.8.31: 104 | version "0.8.31" 105 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.31.tgz#c21e7adb3ad283c951a53de7ad64a5ae2df2ed34" 106 | integrity sha512-7EIU0VdUxltwivjVezX3HgeNzeIVR1snkrAo57WdUnuBMykdzin5rTrxwCDM6xQqj0RL/HjOEm3wFr2ijHKeaA== 107 | 108 | follow-redirects@^1.10.0: 109 | version "1.13.1" 110 | resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" 111 | integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg== 112 | 113 | fs-minipass@^2.0.0: 114 | version "2.1.0" 115 | resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" 116 | integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== 117 | dependencies: 118 | minipass "^3.0.0" 119 | 120 | fs.realpath@^1.0.0: 121 | version "1.0.0" 122 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 123 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 124 | 125 | glob@^7.1.3: 126 | version "7.1.6" 127 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" 128 | integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== 129 | dependencies: 130 | fs.realpath "^1.0.0" 131 | inflight "^1.0.4" 132 | inherits "2" 133 | minimatch "^3.0.4" 134 | once "^1.3.0" 135 | path-is-absolute "^1.0.0" 136 | 137 | inflight@^1.0.4: 138 | version "1.0.6" 139 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 140 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 141 | dependencies: 142 | once "^1.3.0" 143 | wrappy "1" 144 | 145 | inherits@2: 146 | version "2.0.4" 147 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 148 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 149 | 150 | make-error@^1.1.1: 151 | version "1.3.6" 152 | resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" 153 | integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== 154 | 155 | minimatch@^3.0.4: 156 | version "3.0.4" 157 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 158 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== 159 | dependencies: 160 | brace-expansion "^1.1.7" 161 | 162 | minipass@^3.0.0: 163 | version "3.1.3" 164 | resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" 165 | integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg== 166 | dependencies: 167 | yallist "^4.0.0" 168 | 169 | minizlib@^2.1.1: 170 | version "2.1.2" 171 | resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" 172 | integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== 173 | dependencies: 174 | minipass "^3.0.0" 175 | yallist "^4.0.0" 176 | 177 | mkdirp@^1.0.3: 178 | version "1.0.4" 179 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" 180 | integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== 181 | 182 | once@^1.3.0: 183 | version "1.4.0" 184 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 185 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 186 | dependencies: 187 | wrappy "1" 188 | 189 | os@^0.1.1: 190 | version "0.1.1" 191 | resolved "https://registry.yarnpkg.com/os/-/os-0.1.1.tgz#208845e89e193ad4d971474b93947736a56d13f3" 192 | integrity sha1-IIhF6J4ZOtTZcUdLk5R3NqVtE/M= 193 | 194 | path-is-absolute@^1.0.0: 195 | version "1.0.1" 196 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 197 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 198 | 199 | rimraf@^3.0.2: 200 | version "3.0.2" 201 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" 202 | integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== 203 | dependencies: 204 | glob "^7.1.3" 205 | 206 | source-map-support@^0.5.17: 207 | version "0.5.19" 208 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" 209 | integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== 210 | dependencies: 211 | buffer-from "^1.0.0" 212 | source-map "^0.6.0" 213 | 214 | source-map@^0.6.0: 215 | version "0.6.1" 216 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 217 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 218 | 219 | tar@^6.0.5: 220 | version "6.0.5" 221 | resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.5.tgz#bde815086e10b39f1dcd298e89d596e1535e200f" 222 | integrity sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg== 223 | dependencies: 224 | chownr "^2.0.0" 225 | fs-minipass "^2.0.0" 226 | minipass "^3.0.0" 227 | minizlib "^2.1.1" 228 | mkdirp "^1.0.3" 229 | yallist "^4.0.0" 230 | 231 | ts-node@^9.1.1: 232 | version "9.1.1" 233 | resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" 234 | integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== 235 | dependencies: 236 | arg "^4.1.0" 237 | create-require "^1.1.0" 238 | diff "^4.0.1" 239 | make-error "^1.1.1" 240 | source-map-support "^0.5.17" 241 | yn "3.1.1" 242 | 243 | typescript@^4.1.3: 244 | version "4.1.3" 245 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" 246 | integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== 247 | 248 | wrappy@1: 249 | version "1.0.2" 250 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 251 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 252 | 253 | yallist@^4.0.0: 254 | version "4.0.0" 255 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" 256 | integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== 257 | 258 | yn@3.1.1: 259 | version "3.1.1" 260 | resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" 261 | integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== 262 | --------------------------------------------------------------------------------