@shopify/cli 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -3
- package/bin/shopify-dev.js +15 -0
- package/bin/shopify-run.cmd +1 -1
- package/bin/{shopify-run → shopify-run.js} +5 -4
- package/dist/commands/app/build.js +1 -11
- package/dist/commands/app/connect.js +1 -11
- package/dist/commands/app/dev.js +1 -11
- package/dist/commands/app/push.js +1 -11
- package/dist/commands/app/test.js +1 -11
- package/dist/commands/theme/check.js +1 -11
- package/dist/commands/theme/delete.js +1 -11
- package/dist/commands/theme/init.js +1 -11
- package/dist/commands/theme/language-server.js +1 -11
- package/dist/commands/theme/package.js +1 -11
- package/dist/commands/theme/publish.js +1 -11
- package/dist/commands/theme/pull.js +1 -11
- package/dist/commands/theme/push.js +1 -11
- package/dist/commands/theme/serve.js +1 -11
- package/dist/index.js +1 -12
- package/package.json +16 -31
- package/bin/shopify-dev +0 -17
- package/dist/@shopify/core/index.js +0 -524
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @shopify/cli
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b07c608: Rename @shopify/core to @shopify/cli-kit and finish up the create-app workflow
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [b07c608]
|
|
12
|
+
- @shopify/cli-kit@0.8.0
|
|
13
|
+
|
|
3
14
|
## 0.6.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -13,7 +24,7 @@
|
|
|
13
24
|
- Add @shopify/support and fix dependencies' setup
|
|
14
25
|
- Updated dependencies
|
|
15
26
|
- @shopify/app@0.5.2
|
|
16
|
-
- @shopify/
|
|
27
|
+
- @shopify/cli-kit@0.5.2
|
|
17
28
|
- @shopify/support@0.5.2
|
|
18
29
|
- @shopify/theme@0.5.2
|
|
19
30
|
|
|
@@ -48,7 +59,7 @@
|
|
|
48
59
|
- Updated dependencies
|
|
49
60
|
- @shopify/theme@0.3.0
|
|
50
61
|
- @shopify/@0.3.0
|
|
51
|
-
- @shopify/
|
|
62
|
+
- @shopify/cli-kit@0.3.0
|
|
52
63
|
- @shopify/cli-support@0.3.0
|
|
53
64
|
|
|
54
65
|
## 0.2.0
|
|
@@ -61,6 +72,6 @@
|
|
|
61
72
|
|
|
62
73
|
- Updated dependencies
|
|
63
74
|
- @shopify/@0.2.0
|
|
64
|
-
- @shopify/
|
|
75
|
+
- @shopify/cli-kit@0.2.0
|
|
65
76
|
- @shopify/cli-support@0.2.0
|
|
66
77
|
- @shopify/theme@0.2.0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { run, flush, Errors, settings } from '@oclif/core';
|
|
4
|
+
import { exec, execSync } from "child_process";
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
console.log("Bundling @shopify/cli-kit and @shopify/cli");
|
|
9
|
+
execSync("yarn build", {cwd: path.join(path.dirname(fileURLToPath(import.meta.url)), "../../cli-kit"), stdio: 'ignore'})
|
|
10
|
+
execSync("yarn build", {cwd: path.join(path.dirname(fileURLToPath(import.meta.url)), ".."), stdio: 'ignore'})
|
|
11
|
+
|
|
12
|
+
settings.debug = true;
|
|
13
|
+
|
|
14
|
+
// Start the CLI
|
|
15
|
+
run(void 0, import.meta.url).then(flush).catch(Errors.handle)
|
package/bin/shopify-run.cmd
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { run, flush, Errors } from '@oclif/core';
|
|
4
|
+
import Bugsnag from "@bugsnag/js";
|
|
5
5
|
|
|
6
6
|
// Set up error tracking
|
|
7
7
|
Bugsnag.start({apiKey: "9e1e6889176fd0c795d5c659225e0fae", logger: null})
|
|
8
8
|
|
|
9
9
|
// Start the CLI
|
|
10
|
-
|
|
10
|
+
run(void 0, import.meta.url).then(flush).catch((error) => {
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
12
12
|
Bugsnag.notify(error, null, resolve);
|
|
13
|
-
}).then(
|
|
13
|
+
}).then(Errors.handle(error));
|
|
14
14
|
})
|
|
15
|
+
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Build extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Build.description = "Build a block or an app";
|
|
10
|
-
|
|
11
|
-
module.exports = Build;
|
|
1
|
+
import{Command as o}from"@oclif/core";class a extends o{async run(){}}a.description="Build a block or an app";export{a as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Connect extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Connect.description = "Connect the local app to an app on Shopify";
|
|
10
|
-
|
|
11
|
-
module.exports = Connect;
|
|
1
|
+
import{Command as o}from"@oclif/core";class n extends o{async run(){}}n.description="Connect the local app to an app on Shopify";export{n as default};
|
package/dist/commands/app/dev.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Dev extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Dev.description = "Develop a block or an app";
|
|
10
|
-
|
|
11
|
-
module.exports = Dev;
|
|
1
|
+
import{Command as e}from"@oclif/core";class a extends e{async run(){}}a.description="Develop a block or an app";export{a as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Push extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Push.description = "Push an app to Shopify";
|
|
10
|
-
|
|
11
|
-
module.exports = Push;
|
|
1
|
+
import{Command as a}from"@oclif/core";class s extends a{async run(){}}s.description="Push an app to Shopify";export{s as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Test extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Test.description = "Run the tests for a given block or app";
|
|
10
|
-
|
|
11
|
-
module.exports = Test;
|
|
1
|
+
import{Command as s}from"@oclif/core";class e extends s{async run(){}}e.description="Run the tests for a given block or app";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Check extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Check.description = "Validate the theme";
|
|
10
|
-
|
|
11
|
-
module.exports = Check;
|
|
1
|
+
import{Command as t}from"@oclif/core";class e extends t{async run(){}}e.description="Validate the theme";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Delete extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Delete.description = "Delete a remote theme";
|
|
10
|
-
|
|
11
|
-
module.exports = Delete;
|
|
1
|
+
import{Command as t}from"@oclif/core";class e extends t{async run(){}}e.description="Delete a remote theme";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Init extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Init.description = "Create a new theme";
|
|
10
|
-
|
|
11
|
-
module.exports = Init;
|
|
1
|
+
import{Command as t}from"@oclif/core";class e extends t{async run(){}}e.description="Create a new theme";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class LanguageServer extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
LanguageServer.description = "Start a Language Server Protocol server.";
|
|
10
|
-
|
|
11
|
-
module.exports = LanguageServer;
|
|
1
|
+
import{Command as r}from"@oclif/core";class e extends r{async run(){}}e.description="Start a Language Server Protocol server.";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Package extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Package.description = "Package a theme to manually upload it to the Online Store.";
|
|
10
|
-
|
|
11
|
-
module.exports = Package;
|
|
1
|
+
import{Command as e}from"@oclif/core";class a extends e{async run(){}}a.description="Package a theme to manually upload it to the Online Store.";export{a as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Package extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Package.description = "Set a remote theme as the live theme.";
|
|
10
|
-
|
|
11
|
-
module.exports = Package;
|
|
1
|
+
import{Command as t}from"@oclif/core";class e extends t{async run(){}}e.description="Set a remote theme as the live theme.";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Pull extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Pull.description = "Download your remote theme files locally.";
|
|
10
|
-
|
|
11
|
-
module.exports = Pull;
|
|
1
|
+
import{Command as o}from"@oclif/core";class e extends o{async run(){}}e.description="Download your remote theme files locally.";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Push extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Push.description = "Uploads your local theme files to the connected store, overwriting the remote version if specified.";
|
|
10
|
-
|
|
11
|
-
module.exports = Push;
|
|
1
|
+
import{Command as o}from"@oclif/core";class e extends o{async run(){}}e.description="Uploads your local theme files to the connected store, overwriting the remote version if specified.";export{e as default};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@oclif/core');
|
|
4
|
-
|
|
5
|
-
class Push extends core.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
Push.description = "Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";
|
|
10
|
-
|
|
11
|
-
module.exports = Push;
|
|
1
|
+
import{Command as t}from"@oclif/core";class e extends t{async run(){}}e.description="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";export{e as default};
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var core = require('@oclif/core');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, 'run', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return core.run; }
|
|
12
|
-
});
|
|
1
|
+
import{run as e}from"@oclif/core";export{e as run};
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A CLI tool to build for the Shopify platform",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "src/index.js",
|
|
8
|
+
"module": "src/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./src/index.js"
|
|
11
|
+
},
|
|
6
12
|
"keywords": [
|
|
7
13
|
"shopify",
|
|
8
14
|
"shopify-cli",
|
|
@@ -10,7 +16,7 @@
|
|
|
10
16
|
],
|
|
11
17
|
"license": "MIT",
|
|
12
18
|
"bin": {
|
|
13
|
-
"shopify": "./bin/shopify-run"
|
|
19
|
+
"shopify": "./bin/shopify-run.js"
|
|
14
20
|
},
|
|
15
21
|
"files": [
|
|
16
22
|
"/bin",
|
|
@@ -25,13 +31,12 @@
|
|
|
25
31
|
"scripts": {
|
|
26
32
|
"clean": "shx rm -rf dist",
|
|
27
33
|
"build": "shx rm -rf dist && rollup -c",
|
|
28
|
-
"
|
|
29
|
-
"prepublishOnly": "yarn run build",
|
|
34
|
+
"prepublishOnly": "cross-env NODE_ENV=production yarn run build",
|
|
30
35
|
"lint": "prettier -c src/** && eslint src/**",
|
|
31
36
|
"lint:fix": "prettier src/** && eslint src/** --fix",
|
|
32
|
-
"test": "
|
|
33
|
-
"test:watch": "
|
|
34
|
-
"tsc": "tsc -b
|
|
37
|
+
"test": "shx rm -rf dist && vitest run",
|
|
38
|
+
"test:watch": "vitest watch",
|
|
39
|
+
"tsc": "tsc -b"
|
|
35
40
|
},
|
|
36
41
|
"eslintConfig": {
|
|
37
42
|
"extends": [
|
|
@@ -40,18 +45,12 @@
|
|
|
40
45
|
},
|
|
41
46
|
"dependencies": {
|
|
42
47
|
"@bugsnag/js": "^7.14.1",
|
|
43
|
-
"@oclif/core": "
|
|
44
|
-
"@
|
|
45
|
-
"@oclif/plugin-not-found": "^2.2.4"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@shopify/app": "0.5.2",
|
|
49
|
-
"@shopify/core": "0.5.2",
|
|
50
|
-
"@shopify/theme": "0.5.2"
|
|
48
|
+
"@oclif/core": "0.5.10",
|
|
49
|
+
"@shopify/cli-kit": "0.8.0"
|
|
51
50
|
},
|
|
52
51
|
"engine-strict": true,
|
|
53
52
|
"engines": {
|
|
54
|
-
"node": "
|
|
53
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
55
54
|
},
|
|
56
55
|
"os": [
|
|
57
56
|
"darwin",
|
|
@@ -61,20 +60,6 @@
|
|
|
61
60
|
"oclif": {
|
|
62
61
|
"bin": "shopify",
|
|
63
62
|
"commands": "dist/commands",
|
|
64
|
-
"plugins": [
|
|
65
|
-
"@shopify/theme",
|
|
66
|
-
"@shopify/app",
|
|
67
|
-
"@oclif/plugin-help",
|
|
68
|
-
"@oclif/plugin-not-found"
|
|
69
|
-
],
|
|
70
|
-
"topicSeparator": " ",
|
|
71
|
-
"topics": {
|
|
72
|
-
"theme": {
|
|
73
|
-
"description": "Commands for creating, building, and publishing themes"
|
|
74
|
-
},
|
|
75
|
-
"app": {
|
|
76
|
-
"description": "Commands for creating, building, and publishing app"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
63
|
+
"plugins": []
|
|
79
64
|
}
|
|
80
65
|
}
|
package/bin/shopify-dev
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const oclif = require('@oclif/core')
|
|
4
|
-
|
|
5
|
-
const path = require('path')
|
|
6
|
-
const project = path.join(__dirname, '..', 'tsconfig.dist.json')
|
|
7
|
-
|
|
8
|
-
// In dev mode -> use ts-node and dev plugins
|
|
9
|
-
process.env.NODE_ENV = 'development'
|
|
10
|
-
|
|
11
|
-
require('ts-node').register({project})
|
|
12
|
-
|
|
13
|
-
// In dev mode, always show stack traces
|
|
14
|
-
oclif.settings.debug = true;
|
|
15
|
-
|
|
16
|
-
// Start the CLI
|
|
17
|
-
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
|
@@ -1,524 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var path$1 = require('path');
|
|
6
|
-
var require$$1 = require('fs');
|
|
7
|
-
var require$$2 = require('util');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var path__default = /*#__PURE__*/_interopDefaultLegacy(path$1);
|
|
12
|
-
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
|
|
13
|
-
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
14
|
-
|
|
15
|
-
function normalizeWindowsPath(input = "") {
|
|
16
|
-
if (!input.includes("\\")) {
|
|
17
|
-
return input;
|
|
18
|
-
}
|
|
19
|
-
return input.replace(/\\/g, "/");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const _UNC_REGEX = /^[/][/]/;
|
|
23
|
-
const _UNC_DRIVE_REGEX = /^[/][/]([.]{1,2}[/])?([a-zA-Z]):[/]/;
|
|
24
|
-
const _IS_ABSOLUTE_RE = /^\/|^\\|^[a-zA-Z]:[/\\]/;
|
|
25
|
-
const sep = "/";
|
|
26
|
-
const delimiter = ":";
|
|
27
|
-
const normalize = function(path2) {
|
|
28
|
-
if (path2.length === 0) {
|
|
29
|
-
return ".";
|
|
30
|
-
}
|
|
31
|
-
path2 = normalizeWindowsPath(path2);
|
|
32
|
-
const isUNCPath = path2.match(_UNC_REGEX);
|
|
33
|
-
const hasUNCDrive = isUNCPath && path2.match(_UNC_DRIVE_REGEX);
|
|
34
|
-
const isPathAbsolute = isAbsolute(path2);
|
|
35
|
-
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
36
|
-
path2 = normalizeString(path2, !isPathAbsolute);
|
|
37
|
-
if (path2.length === 0) {
|
|
38
|
-
if (isPathAbsolute) {
|
|
39
|
-
return "/";
|
|
40
|
-
}
|
|
41
|
-
return trailingSeparator ? "./" : ".";
|
|
42
|
-
}
|
|
43
|
-
if (trailingSeparator) {
|
|
44
|
-
path2 += "/";
|
|
45
|
-
}
|
|
46
|
-
if (isUNCPath) {
|
|
47
|
-
if (hasUNCDrive) {
|
|
48
|
-
return `//./${path2}`;
|
|
49
|
-
}
|
|
50
|
-
return `//${path2}`;
|
|
51
|
-
}
|
|
52
|
-
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
53
|
-
};
|
|
54
|
-
const join = function(...args) {
|
|
55
|
-
if (args.length === 0) {
|
|
56
|
-
return ".";
|
|
57
|
-
}
|
|
58
|
-
let joined;
|
|
59
|
-
for (let i = 0; i < args.length; ++i) {
|
|
60
|
-
const arg = args[i];
|
|
61
|
-
if (arg.length > 0) {
|
|
62
|
-
if (joined === void 0) {
|
|
63
|
-
joined = arg;
|
|
64
|
-
} else {
|
|
65
|
-
joined += `/${arg}`;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (joined === void 0) {
|
|
70
|
-
return ".";
|
|
71
|
-
}
|
|
72
|
-
return normalize(joined);
|
|
73
|
-
};
|
|
74
|
-
const resolve = function(...args) {
|
|
75
|
-
args = args.map((arg) => normalizeWindowsPath(arg));
|
|
76
|
-
let resolvedPath = "";
|
|
77
|
-
let resolvedAbsolute = false;
|
|
78
|
-
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
79
|
-
const path2 = i >= 0 ? args[i] : process.cwd();
|
|
80
|
-
if (path2.length === 0) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
resolvedPath = `${path2}/${resolvedPath}`;
|
|
84
|
-
resolvedAbsolute = isAbsolute(path2);
|
|
85
|
-
}
|
|
86
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
87
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
88
|
-
return `/${resolvedPath}`;
|
|
89
|
-
}
|
|
90
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
91
|
-
};
|
|
92
|
-
function normalizeString(path2, allowAboveRoot) {
|
|
93
|
-
let res = "";
|
|
94
|
-
let lastSegmentLength = 0;
|
|
95
|
-
let lastSlash = -1;
|
|
96
|
-
let dots = 0;
|
|
97
|
-
let char = null;
|
|
98
|
-
for (let i = 0; i <= path2.length; ++i) {
|
|
99
|
-
if (i < path2.length) {
|
|
100
|
-
char = path2[i];
|
|
101
|
-
} else if (char === "/") {
|
|
102
|
-
break;
|
|
103
|
-
} else {
|
|
104
|
-
char = "/";
|
|
105
|
-
}
|
|
106
|
-
if (char === "/") {
|
|
107
|
-
if (lastSlash === i - 1 || dots === 1) ; else if (dots === 2) {
|
|
108
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
109
|
-
if (res.length > 2) {
|
|
110
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
111
|
-
if (lastSlashIndex === -1) {
|
|
112
|
-
res = "";
|
|
113
|
-
lastSegmentLength = 0;
|
|
114
|
-
} else {
|
|
115
|
-
res = res.slice(0, lastSlashIndex);
|
|
116
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
117
|
-
}
|
|
118
|
-
lastSlash = i;
|
|
119
|
-
dots = 0;
|
|
120
|
-
continue;
|
|
121
|
-
} else if (res.length !== 0) {
|
|
122
|
-
res = "";
|
|
123
|
-
lastSegmentLength = 0;
|
|
124
|
-
lastSlash = i;
|
|
125
|
-
dots = 0;
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (allowAboveRoot) {
|
|
130
|
-
res += res.length > 0 ? "/.." : "..";
|
|
131
|
-
lastSegmentLength = 2;
|
|
132
|
-
}
|
|
133
|
-
} else {
|
|
134
|
-
if (res.length > 0) {
|
|
135
|
-
res += `/${path2.slice(lastSlash + 1, i)}`;
|
|
136
|
-
} else {
|
|
137
|
-
res = path2.slice(lastSlash + 1, i);
|
|
138
|
-
}
|
|
139
|
-
lastSegmentLength = i - lastSlash - 1;
|
|
140
|
-
}
|
|
141
|
-
lastSlash = i;
|
|
142
|
-
dots = 0;
|
|
143
|
-
} else if (char === "." && dots !== -1) {
|
|
144
|
-
++dots;
|
|
145
|
-
} else {
|
|
146
|
-
dots = -1;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return res;
|
|
150
|
-
}
|
|
151
|
-
const isAbsolute = function(p) {
|
|
152
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
153
|
-
};
|
|
154
|
-
const toNamespacedPath = function(p) {
|
|
155
|
-
return normalizeWindowsPath(p);
|
|
156
|
-
};
|
|
157
|
-
const extname = function(p) {
|
|
158
|
-
return path__default["default"].posix.extname(normalizeWindowsPath(p));
|
|
159
|
-
};
|
|
160
|
-
const relative = function(from, to) {
|
|
161
|
-
return path__default["default"].posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
|
|
162
|
-
};
|
|
163
|
-
const dirname = function(p) {
|
|
164
|
-
return path__default["default"].posix.dirname(normalizeWindowsPath(p));
|
|
165
|
-
};
|
|
166
|
-
const format = function(p) {
|
|
167
|
-
return normalizeWindowsPath(path__default["default"].posix.format(p));
|
|
168
|
-
};
|
|
169
|
-
const basename = function(p, ext) {
|
|
170
|
-
return path__default["default"].posix.basename(normalizeWindowsPath(p), ext);
|
|
171
|
-
};
|
|
172
|
-
const parse = function(p) {
|
|
173
|
-
return path__default["default"].posix.parse(normalizeWindowsPath(p));
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const _path = /*#__PURE__*/Object.freeze({
|
|
177
|
-
__proto__: null,
|
|
178
|
-
sep: sep,
|
|
179
|
-
delimiter: delimiter,
|
|
180
|
-
normalize: normalize,
|
|
181
|
-
join: join,
|
|
182
|
-
resolve: resolve,
|
|
183
|
-
normalizeString: normalizeString,
|
|
184
|
-
isAbsolute: isAbsolute,
|
|
185
|
-
toNamespacedPath: toNamespacedPath,
|
|
186
|
-
extname: extname,
|
|
187
|
-
relative: relative,
|
|
188
|
-
dirname: dirname,
|
|
189
|
-
format: format,
|
|
190
|
-
basename: basename,
|
|
191
|
-
parse: parse
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
const index = {
|
|
195
|
-
..._path
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
var findUp$1 = {exports: {}};
|
|
199
|
-
|
|
200
|
-
var locatePath = {exports: {}};
|
|
201
|
-
|
|
202
|
-
var pLocate$2 = {exports: {}};
|
|
203
|
-
|
|
204
|
-
var pLimit$2 = {exports: {}};
|
|
205
|
-
|
|
206
|
-
var pTry$2 = {exports: {}};
|
|
207
|
-
|
|
208
|
-
const pTry$1 = (fn, ...arguments_) => new Promise(resolve => {
|
|
209
|
-
resolve(fn(...arguments_));
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
pTry$2.exports = pTry$1;
|
|
213
|
-
// TODO: remove this in the next major version
|
|
214
|
-
pTry$2.exports.default = pTry$1;
|
|
215
|
-
|
|
216
|
-
const pTry = pTry$2.exports;
|
|
217
|
-
|
|
218
|
-
const pLimit$1 = concurrency => {
|
|
219
|
-
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
220
|
-
return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up'));
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const queue = [];
|
|
224
|
-
let activeCount = 0;
|
|
225
|
-
|
|
226
|
-
const next = () => {
|
|
227
|
-
activeCount--;
|
|
228
|
-
|
|
229
|
-
if (queue.length > 0) {
|
|
230
|
-
queue.shift()();
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
const run = (fn, resolve, ...args) => {
|
|
235
|
-
activeCount++;
|
|
236
|
-
|
|
237
|
-
const result = pTry(fn, ...args);
|
|
238
|
-
|
|
239
|
-
resolve(result);
|
|
240
|
-
|
|
241
|
-
result.then(next, next);
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
245
|
-
if (activeCount < concurrency) {
|
|
246
|
-
run(fn, resolve, ...args);
|
|
247
|
-
} else {
|
|
248
|
-
queue.push(run.bind(null, fn, resolve, ...args));
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args));
|
|
253
|
-
Object.defineProperties(generator, {
|
|
254
|
-
activeCount: {
|
|
255
|
-
get: () => activeCount
|
|
256
|
-
},
|
|
257
|
-
pendingCount: {
|
|
258
|
-
get: () => queue.length
|
|
259
|
-
},
|
|
260
|
-
clearQueue: {
|
|
261
|
-
value: () => {
|
|
262
|
-
queue.length = 0;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
return generator;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
pLimit$2.exports = pLimit$1;
|
|
271
|
-
pLimit$2.exports.default = pLimit$1;
|
|
272
|
-
|
|
273
|
-
const pLimit = pLimit$2.exports;
|
|
274
|
-
|
|
275
|
-
class EndError extends Error {
|
|
276
|
-
constructor(value) {
|
|
277
|
-
super();
|
|
278
|
-
this.value = value;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// The input can also be a promise, so we await it
|
|
283
|
-
const testElement = async (element, tester) => tester(await element);
|
|
284
|
-
|
|
285
|
-
// The input can also be a promise, so we `Promise.all()` them both
|
|
286
|
-
const finder = async element => {
|
|
287
|
-
const values = await Promise.all(element);
|
|
288
|
-
if (values[1] === true) {
|
|
289
|
-
throw new EndError(values[0]);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return false;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
const pLocate$1 = async (iterable, tester, options) => {
|
|
296
|
-
options = {
|
|
297
|
-
concurrency: Infinity,
|
|
298
|
-
preserveOrder: true,
|
|
299
|
-
...options
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
const limit = pLimit(options.concurrency);
|
|
303
|
-
|
|
304
|
-
// Start all the promises concurrently with optional limit
|
|
305
|
-
const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);
|
|
306
|
-
|
|
307
|
-
// Check the promises either serially or concurrently
|
|
308
|
-
const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
|
|
309
|
-
|
|
310
|
-
try {
|
|
311
|
-
await Promise.all(items.map(element => checkLimit(finder, element)));
|
|
312
|
-
} catch (error) {
|
|
313
|
-
if (error instanceof EndError) {
|
|
314
|
-
return error.value;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
throw error;
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
pLocate$2.exports = pLocate$1;
|
|
322
|
-
// TODO: Remove this for the next major release
|
|
323
|
-
pLocate$2.exports.default = pLocate$1;
|
|
324
|
-
|
|
325
|
-
const path = path__default["default"];
|
|
326
|
-
const fs$1 = require$$1__default["default"];
|
|
327
|
-
const {promisify: promisify$1} = require$$2__default["default"];
|
|
328
|
-
const pLocate = pLocate$2.exports;
|
|
329
|
-
|
|
330
|
-
const fsStat = promisify$1(fs$1.stat);
|
|
331
|
-
const fsLStat = promisify$1(fs$1.lstat);
|
|
332
|
-
|
|
333
|
-
const typeMappings = {
|
|
334
|
-
directory: 'isDirectory',
|
|
335
|
-
file: 'isFile'
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
function checkType({type}) {
|
|
339
|
-
if (type in typeMappings) {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
throw new Error(`Invalid type specified: ${type}`);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
const matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();
|
|
347
|
-
|
|
348
|
-
locatePath.exports = async (paths, options) => {
|
|
349
|
-
options = {
|
|
350
|
-
cwd: process.cwd(),
|
|
351
|
-
type: 'file',
|
|
352
|
-
allowSymlinks: true,
|
|
353
|
-
...options
|
|
354
|
-
};
|
|
355
|
-
checkType(options);
|
|
356
|
-
const statFn = options.allowSymlinks ? fsStat : fsLStat;
|
|
357
|
-
|
|
358
|
-
return pLocate(paths, async path_ => {
|
|
359
|
-
try {
|
|
360
|
-
const stat = await statFn(path.resolve(options.cwd, path_));
|
|
361
|
-
return matchType(options.type, stat);
|
|
362
|
-
} catch (_) {
|
|
363
|
-
return false;
|
|
364
|
-
}
|
|
365
|
-
}, options);
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
locatePath.exports.sync = (paths, options) => {
|
|
369
|
-
options = {
|
|
370
|
-
cwd: process.cwd(),
|
|
371
|
-
allowSymlinks: true,
|
|
372
|
-
type: 'file',
|
|
373
|
-
...options
|
|
374
|
-
};
|
|
375
|
-
checkType(options);
|
|
376
|
-
const statFn = options.allowSymlinks ? fs$1.statSync : fs$1.lstatSync;
|
|
377
|
-
|
|
378
|
-
for (const path_ of paths) {
|
|
379
|
-
try {
|
|
380
|
-
const stat = statFn(path.resolve(options.cwd, path_));
|
|
381
|
-
|
|
382
|
-
if (matchType(options.type, stat)) {
|
|
383
|
-
return path_;
|
|
384
|
-
}
|
|
385
|
-
} catch (_) {
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
var pathExists = {exports: {}};
|
|
391
|
-
|
|
392
|
-
const fs = require$$1__default["default"];
|
|
393
|
-
const {promisify} = require$$2__default["default"];
|
|
394
|
-
|
|
395
|
-
const pAccess = promisify(fs.access);
|
|
396
|
-
|
|
397
|
-
pathExists.exports = async path => {
|
|
398
|
-
try {
|
|
399
|
-
await pAccess(path);
|
|
400
|
-
return true;
|
|
401
|
-
} catch (_) {
|
|
402
|
-
return false;
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
pathExists.exports.sync = path => {
|
|
407
|
-
try {
|
|
408
|
-
fs.accessSync(path);
|
|
409
|
-
return true;
|
|
410
|
-
} catch (_) {
|
|
411
|
-
return false;
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
(function (module) {
|
|
416
|
-
const path = path__default["default"];
|
|
417
|
-
const locatePath$1 = locatePath.exports;
|
|
418
|
-
const pathExists$1 = pathExists.exports;
|
|
419
|
-
|
|
420
|
-
const stop = Symbol('findUp.stop');
|
|
421
|
-
|
|
422
|
-
module.exports = async (name, options = {}) => {
|
|
423
|
-
let directory = path.resolve(options.cwd || '');
|
|
424
|
-
const {root} = path.parse(directory);
|
|
425
|
-
const paths = [].concat(name);
|
|
426
|
-
|
|
427
|
-
const runMatcher = async locateOptions => {
|
|
428
|
-
if (typeof name !== 'function') {
|
|
429
|
-
return locatePath$1(paths, locateOptions);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const foundPath = await name(locateOptions.cwd);
|
|
433
|
-
if (typeof foundPath === 'string') {
|
|
434
|
-
return locatePath$1([foundPath], locateOptions);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
return foundPath;
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
// eslint-disable-next-line no-constant-condition
|
|
441
|
-
while (true) {
|
|
442
|
-
// eslint-disable-next-line no-await-in-loop
|
|
443
|
-
const foundPath = await runMatcher({...options, cwd: directory});
|
|
444
|
-
|
|
445
|
-
if (foundPath === stop) {
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
if (foundPath) {
|
|
450
|
-
return path.resolve(directory, foundPath);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
if (directory === root) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
directory = path.dirname(directory);
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
|
|
461
|
-
module.exports.sync = (name, options = {}) => {
|
|
462
|
-
let directory = path.resolve(options.cwd || '');
|
|
463
|
-
const {root} = path.parse(directory);
|
|
464
|
-
const paths = [].concat(name);
|
|
465
|
-
|
|
466
|
-
const runMatcher = locateOptions => {
|
|
467
|
-
if (typeof name !== 'function') {
|
|
468
|
-
return locatePath$1.sync(paths, locateOptions);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
const foundPath = name(locateOptions.cwd);
|
|
472
|
-
if (typeof foundPath === 'string') {
|
|
473
|
-
return locatePath$1.sync([foundPath], locateOptions);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
return foundPath;
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
// eslint-disable-next-line no-constant-condition
|
|
480
|
-
while (true) {
|
|
481
|
-
const foundPath = runMatcher({...options, cwd: directory});
|
|
482
|
-
|
|
483
|
-
if (foundPath === stop) {
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
if (foundPath) {
|
|
488
|
-
return path.resolve(directory, foundPath);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
if (directory === root) {
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
directory = path.dirname(directory);
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
module.exports.exists = pathExists$1;
|
|
500
|
-
|
|
501
|
-
module.exports.sync.exists = pathExists$1.sync;
|
|
502
|
-
|
|
503
|
-
module.exports.stop = stop;
|
|
504
|
-
}(findUp$1));
|
|
505
|
-
|
|
506
|
-
var findUp = findUp$1.exports;
|
|
507
|
-
|
|
508
|
-
function findPathUp(path, from, type) {
|
|
509
|
-
return findUp(path, { cwd: from, type });
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
class FatalError extends Error {
|
|
513
|
-
constructor(message, tryMessage = null) {
|
|
514
|
-
super(message);
|
|
515
|
-
this.tryMessage = tryMessage;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
class BugError extends FatalError {
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
exports.BugError = BugError;
|
|
522
|
-
exports.FatalError = FatalError;
|
|
523
|
-
exports.findPathUp = findPathUp;
|
|
524
|
-
exports.path = index;
|