@dxos/cli 2.18.5-dev.5022f9cf → 2.19.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/README.md +2 -2
- package/dist/known-extensions.yml +10 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/extensions.d.ts +0 -6
- package/dist/src/extensions.d.ts.map +0 -1
- package/dist/src/extensions.js +0 -47
- package/dist/src/extensions.js.map +0 -1
- package/dist/src/modules/installation.d.ts +0 -5
- package/dist/src/modules/installation.d.ts.map +0 -1
- package/dist/src/modules/installation.js +0 -96
- package/dist/src/modules/installation.js.map +0 -1
- package/dist/src/modules/pluggable.d.ts +0 -14
- package/dist/src/modules/pluggable.d.ts.map +0 -1
- package/dist/src/modules/pluggable.js +0 -48
- package/dist/src/modules/pluggable.js.map +0 -1
- package/dist/src/pluggable.d.ts +0 -68
- package/dist/src/pluggable.d.ts.map +0 -1
- package/dist/src/pluggable.js +0 -238
- package/dist/src/pluggable.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "DXOS CLI",
|
|
5
5
|
"homepage": "https://github.com/dxos/cli/tree/master/packages/cli#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"verbose": false
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dxos/cli-core": "2.
|
|
32
|
+
"@dxos/cli-core": "2.19.0",
|
|
33
33
|
"@dxos/config": "~2.31.3",
|
|
34
34
|
"@dxos/debug": "~2.31.3",
|
|
35
35
|
"@dxos/random-access-multi-storage": "~2.31.3",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"lint": "eslint './src/**/*.{ts,js}'",
|
|
88
88
|
"test": "jest --rootDir ./src --verbose --passWithNoTests"
|
|
89
89
|
},
|
|
90
|
-
"readme": "# DXOS CLI\n\nGeneral information about DXOS CLI can be found [here](../../README.md)\n\n## Usage\n\n### Profiles\n\nTo use the CLI, a profile needs to be created and activated.\n\nThe CLI supports creating multiple profiles with different configurations from downloadable templates, and switching between them.\n\nTo create a profile from a template, pass a profile name and template URL.\n\nExample:\n\n```bash\ndx profile init --name devnet --template-url https://bit.ly/3M37HBT\n```\n\nProfiles are stored in the `~/.dx/profile` folder. To further customize a profile, edit the profile configuration file.\n\nTo activate/use a profile, do one of the following (highest to lowest precedence):\n\n1. Pass it as an argument to a command (`--profile <NAME>`), e.g. `dx --profile devnet extension list`\n2. export `DX_PROFILE` in the shell, with the name of the profile, e.g. `export DX_PROFILE=devnet`\n3. Set it as the default for the system, e.g. `dx profile set devnet`\n\nNote: The first profile created automatically becomes the system default.\n\nView the name of the active profile:\n\n```bash\ndx profile\n```\n\nView the configuration values for the active profile:\n\n```bash\ndx profile config\n```\n\nView the configuration values for a given profile:\n\n```bash\ndx profile config <NAME>\n```\n\nView the profile used for a command (using the `--dry-run` flag):\n\n```bash\ndx extension list --dry-run\nProfile: /Users/ashwinp/.dx/profile/devnet.yml\n```\n\nMultiple templates can be created and shared with others to use different configuration values. \nSome [sample templates](./profiles/README.md) are included in the repo.\n\n### Extensions\n\nIn order to install CLI extensions, one could leverage automatic installation mechanism (for DXOS extensions only):\n\n```bash\ndx dxns\n```\n\n```bash\ndx app\n```\n\nIn order to install arbitrary extension, `dx extension install` command could be used:\n\n```\ndx extension install @dxos/cli-ipfs\n\n✔ Installing @dxos/cli-ipfs\n```\n\nView installed extensions:\n\n```\ndx extension list\n\nextension command version description\n-------------- ------- ------------ -----------------------\n@dxos/cli-app app 2.12.0 Application management.\n@dxos/cli-bot bot 2.12.0 Bot operations.\n@dxos/cli-ipfs ipfs 2.12.0 IPFS operations.\n```\n\nUninstall extension:\n\n```\ndx extension uninstall @dxos/cli-ipfs\n\nFound Extension @dxos/cli-ipfs@1.0.1-beta.2 installed, do you wish to remove it? (Yes/No): y\n✔ Uninstalling @dxos/cli-ipfs\n```\n\n#### Available Extensions\n\n| Extension |\n| :------------ |\n| [App CLI](../cli-app/README.md) |\n| [Bot CLI](../cli-bot/README.md) |\n| [Chat CLI](../cli-chat/README.md) |\n| [Console CLI](../cli-console/README.md) |\n| [
|
|
90
|
+
"readme": "# DXOS CLI\n\nGeneral information about DXOS CLI can be found [here](../../README.md)\n\n## Usage\n\n### Profiles\n\nTo use the CLI, a profile needs to be created and activated.\n\nThe CLI supports creating multiple profiles with different configurations from downloadable templates, and switching between them.\n\nTo create a profile from a template, pass a profile name and template URL.\n\nExample:\n\n```bash\ndx profile init --name devnet --template-url https://bit.ly/3M37HBT\n```\n\nProfiles are stored in the `~/.dx/profile` folder. To further customize a profile, edit the profile configuration file.\n\nTo activate/use a profile, do one of the following (highest to lowest precedence):\n\n1. Pass it as an argument to a command (`--profile <NAME>`), e.g. `dx --profile devnet extension list`\n2. export `DX_PROFILE` in the shell, with the name of the profile, e.g. `export DX_PROFILE=devnet`\n3. Set it as the default for the system, e.g. `dx profile set devnet`\n\nNote: The first profile created automatically becomes the system default.\n\nView the name of the active profile:\n\n```bash\ndx profile\n```\n\nView the configuration values for the active profile:\n\n```bash\ndx profile config\n```\n\nView the configuration values for a given profile:\n\n```bash\ndx profile config <NAME>\n```\n\nView the profile used for a command (using the `--dry-run` flag):\n\n```bash\ndx extension list --dry-run\nProfile: /Users/ashwinp/.dx/profile/devnet.yml\n```\n\nMultiple templates can be created and shared with others to use different configuration values. \nSome [sample templates](./profiles/README.md) are included in the repo.\n\n### Extensions\n\nIn order to install CLI extensions, one could leverage automatic installation mechanism (for DXOS extensions only):\n\n```bash\ndx dxns\n```\n\n```bash\ndx app\n```\n\nIn order to install arbitrary extension, `dx extension install` command could be used:\n\n```\ndx extension install @dxos/cli-ipfs\n\n✔ Installing @dxos/cli-ipfs\n```\n\nView installed extensions:\n\n```\ndx extension list\n\nextension command version description\n-------------- ------- ------------ -----------------------\n@dxos/cli-app app 2.12.0 Application management.\n@dxos/cli-bot bot 2.12.0 Bot operations.\n@dxos/cli-ipfs ipfs 2.12.0 IPFS operations.\n```\n\nUninstall extension:\n\n```\ndx extension uninstall @dxos/cli-ipfs\n\nFound Extension @dxos/cli-ipfs@1.0.1-beta.2 installed, do you wish to remove it? (Yes/No): y\n✔ Uninstalling @dxos/cli-ipfs\n```\n\n#### Available Extensions\n\n| Extension |\n| :------------ |\n| [App CLI](../cli-app/README.md) |\n| [Bot CLI](../cli-bot/README.md) |\n| [Chat CLI](../cli-chat/README.md) |\n| [Console CLI](../cli-console/README.md) |\n| [Party CLI](../cli-party/README.md) |\n| [DXNS CLI](../cli-dxns/README.md) |\n| [ECHO CLI](../cli-echo/README.md) |\n| [HALO CLI](../cli-halo/README.md) |\n| [IPFS CLI](../cli-ipfs/README.md) |\n| [KUBE CLI](../cli-kube/README.md) |\n| [MDNS CLI](../cli-mdns/README.md) |\n| [Mesh CLI](../cli-mesh/README.md) |\n| [Signal CLI](../cli-signal/README.md) |\n\n#### Developing CLI extensions\n\nIn order to create a new CLI extension, existing CLI extension could be used as a boilerplate. \nWhile developing a new extension out of CLI Monorepo, make sure you add `@dxos/cli` as devDependency (and `@dxos/cli-party` as well if you are planning on using DXOS SDK Client).\n\n### Certification\n\nIn order for CLI to support custom certificate authorities, one would need to import root CA certificate using `dx cert import` command. For the case of XBOX, import command would look like:\n\n```bash\ndx cert import --url https://kube.local/kube.pem\n```\n\n<!--TODO(egor): Host cert on .well-known endpoint?-->\n\nCorresponding certificate would be downloaded to `~/.dx/certs` and considered by CLI as \"trusted\".\n\n## Development\n\n### Dependencies\n\n- [jq](https://stedolan.github.io/jq/)\n\n### Setup\n\n```bash\n# CLI is a yarn monorepo\n\n# Install dependencies\nrush update\n\n# Build all packages\nrush build\n```\n\n### Developing of a single extension\n\nWhile developing a specific cli extension as a package in the monorepo, `rushx build:watch` command is available from the root of this package.\n\n### Running commands locally\n\nDuring local development there is a need for testing of a newly created/modified commands. \nFor that purpose, any cli command could be called from the repo root via `pnpm run dx`, e.g.:\n\n> **Note:** Command arguments should be separated from the command via `--` for `pnpm` to pass it to executable.\n\n```bash\npnpm run dx dxns resource list -- --json\n```\n\nIf the command ought to be called from the specific path (e.g. during app deployent), \nan alias for the local dx binary coud be created by adding such to the shell profile:\n\n```bash\n`eval $(./scripts/dev.sh)`\n```\n\nThen run `rushx build:watch` in for all packages that are being edited.\n\nRun `dx info` to check if the local version is being run.\n\nSet the `DEBUG` environment variable to `true` to see full exception traces on error.\n\n```bash\nDEBUG=dxos:cli dx\n````\n\n### Environment Variables\n\nWhile the usage of ENV variables is minimized, in some edge cases CLI still uses ENV variables for configuration. \nThose variables are mapped to the canonical structure: [ENV mapping](../cli-core/src/env-map.json)\n\nENV variables are also used to pass configuration between CLI and spawned processes, but this happens transparently for CLI user.\n\n## Troubleshooting\n\nMost of the weirdness in CLI behaviour could be caused by any combination of previously installed CLIs and extensions, especially from the beta channel;\n\nCheck latest available version:\n\n```bash\nyarn info @dxos/cli versions --json | jq '.data[-1]'\n```\n\nCheck installed version:\n\n```bash\ndx version\n```\n\nIf those outputs are different, make sure to remove old versions of `dx`.\nRemove old CLI and extensions, installed globally.\n\nFor that purpose `dx uninstall` and `dx upgrade` commands are available.\n\nTo remove CLI and all extensions:\n\n```bash\ndx uninstall --npm-client yarn\n```\n\nTo force upgrade CLI and all installed extensions to the latest:\n\n```bash\ndx upgrade --npm-client yarn --force\n```\n\n`--version` attribute could be supplied in order to upgrade/downgrade to a specific version.\n"
|
|
91
91
|
}
|
package/dist/src/extensions.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const EXTENSIONS_CONFIG: ".dx/extensions.yml";
|
|
2
|
-
export function getInfo(name: any): Promise<any>;
|
|
3
|
-
export function addInstalled(name: any, info: any): Promise<void>;
|
|
4
|
-
export function removeInstalled(name: any): Promise<void>;
|
|
5
|
-
export function listInstalled(): Promise<any>;
|
|
6
|
-
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.js"],"names":[],"mappings":"AASA,qDAAsD;AAI/C,iDAGN;AAEM,kEAeN;AAEM,0DAIN;AAEM,8CAIN"}
|
package/dist/src/extensions.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.listInstalled = exports.removeInstalled = exports.addInstalled = exports.getInfo = exports.EXTENSIONS_CONFIG = void 0;
|
|
10
|
-
const os_1 = __importDefault(require("os"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const cli_core_1 = require("@dxos/cli-core");
|
|
13
|
-
exports.EXTENSIONS_CONFIG = '.dx/extensions.yml';
|
|
14
|
-
const filePath = path_1.default.join(os_1.default.homedir(), exports.EXTENSIONS_CONFIG);
|
|
15
|
-
const getInfo = async (name) => {
|
|
16
|
-
const { extensions = [] } = await (0, cli_core_1.readFile)(filePath, { absolute: true });
|
|
17
|
-
return extensions.find(({ moduleName }) => moduleName === name);
|
|
18
|
-
};
|
|
19
|
-
exports.getInfo = getInfo;
|
|
20
|
-
const addInstalled = async (name, info) => {
|
|
21
|
-
const { package: { version }, command, description, initRequired, destroyRequired } = info;
|
|
22
|
-
let { extensions = [] } = await (0, cli_core_1.readFile)(filePath, { absolute: true });
|
|
23
|
-
extensions = extensions.filter(({ moduleName }) => moduleName !== name);
|
|
24
|
-
extensions.push({
|
|
25
|
-
moduleName: name,
|
|
26
|
-
version,
|
|
27
|
-
describe: description,
|
|
28
|
-
command,
|
|
29
|
-
initRequired: !!initRequired,
|
|
30
|
-
destroyRequired: !!destroyRequired
|
|
31
|
-
});
|
|
32
|
-
return (0, cli_core_1.writeFile)({ extensions }, filePath, { absolute: true });
|
|
33
|
-
};
|
|
34
|
-
exports.addInstalled = addInstalled;
|
|
35
|
-
const removeInstalled = async (name) => {
|
|
36
|
-
let { extensions = [] } = await (0, cli_core_1.readFile)(filePath, { absolute: true });
|
|
37
|
-
extensions = extensions.filter(({ moduleName }) => moduleName !== name);
|
|
38
|
-
return (0, cli_core_1.writeFile)({ extensions }, filePath, { absolute: true });
|
|
39
|
-
};
|
|
40
|
-
exports.removeInstalled = removeInstalled;
|
|
41
|
-
const listInstalled = async () => {
|
|
42
|
-
const { extensions = [] } = await (0, cli_core_1.readFile)(filePath, { absolute: true });
|
|
43
|
-
extensions.sort(({ moduleName: a }, { moduleName: b }) => a > b ? 1 : a < b ? -1 : 0);
|
|
44
|
-
return extensions;
|
|
45
|
-
};
|
|
46
|
-
exports.listInstalled = listInstalled;
|
|
47
|
-
//# sourceMappingURL=extensions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../src/extensions.js"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,4CAAoB;AACpB,gDAAwB;AAExB,6CAAqD;AAExC,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,yBAAiB,CAAC,CAAC;AAErD,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IACpC,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,EA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,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B;AAEK,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACzE,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/modules/installation.js"],"names":[],"mappings":"AAoBO,mCAFM,MAAM,CA+BjB;AAMK;;IAFM,MAAM,CAiDjB"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.UpgradeModule = exports.UninstallModule = void 0;
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const read_pkg_up_1 = __importDefault(require("read-pkg-up"));
|
|
13
|
-
const cli_core_1 = require("@dxos/cli-core");
|
|
14
|
-
const debug_1 = require("@dxos/debug");
|
|
15
|
-
const extensions_1 = require("../extensions");
|
|
16
|
-
const pluggable_1 = require("../pluggable");
|
|
17
|
-
const pkg = read_pkg_up_1.default.sync({ cwd: path_1.default.join(__dirname, '../') });
|
|
18
|
-
/**
|
|
19
|
-
* Uninstall CLI module.
|
|
20
|
-
* @returns {object}
|
|
21
|
-
*/
|
|
22
|
-
const UninstallModule = () => ({
|
|
23
|
-
command: ['uninstall'],
|
|
24
|
-
describe: 'Uninstall CLI and extensions.',
|
|
25
|
-
builder: yargs => yargs
|
|
26
|
-
.version(false)
|
|
27
|
-
.option('npm-client'),
|
|
28
|
-
handler: (0, cli_core_1.asyncHandler)(async (argv) => {
|
|
29
|
-
const { npmClient } = argv;
|
|
30
|
-
const extensions = await (0, extensions_1.listInstalled)();
|
|
31
|
-
// Remove extensions.
|
|
32
|
-
if (extensions.length) {
|
|
33
|
-
(0, debug_1.log)(`Found extensions: ${extensions.map(({ moduleName }) => moduleName).join(', ')}`);
|
|
34
|
-
const pluggableModules = extensions.map(module => new pluggable_1.Pluggable(module));
|
|
35
|
-
for await (const pluggableModule of pluggableModules) {
|
|
36
|
-
const spinner = `Uninstalling ${pluggableModule.moduleName}`;
|
|
37
|
-
await pluggableModule.uninstallModule(npmClient, { spinner });
|
|
38
|
-
await (0, extensions_1.removeInstalled)(pluggableModule.moduleName);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Remove main cli.
|
|
42
|
-
const cli = new pluggable_1.Pluggable({ moduleName: pkg.package.name });
|
|
43
|
-
const spinner = `Uninstalling ${cli.moduleName}`;
|
|
44
|
-
await cli.uninstallModule(npmClient, { spinner });
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
exports.UninstallModule = UninstallModule;
|
|
48
|
-
/**
|
|
49
|
-
* Upgrade CLI module.
|
|
50
|
-
* @returns {object}
|
|
51
|
-
*/
|
|
52
|
-
const UpgradeModule = ({ config }) => ({
|
|
53
|
-
command: ['upgrade'],
|
|
54
|
-
describe: 'Upgrade CLI.',
|
|
55
|
-
builder: yargs => yargs
|
|
56
|
-
.version(false)
|
|
57
|
-
.option('npm-client')
|
|
58
|
-
.option('channel', { default: config.get('runtime.cli.channel') })
|
|
59
|
-
.option('force', { type: 'boolean', default: false })
|
|
60
|
-
.option('version'),
|
|
61
|
-
handler: (0, cli_core_1.asyncHandler)(async (argv) => {
|
|
62
|
-
const { channel, version, force, npmClient } = argv;
|
|
63
|
-
const newVersion = version || channel;
|
|
64
|
-
(0, assert_1.default)(newVersion, 'Invalid Version.');
|
|
65
|
-
const extensions = await (0, extensions_1.listInstalled)();
|
|
66
|
-
let modules = [];
|
|
67
|
-
if (force) {
|
|
68
|
-
if (extensions.length) {
|
|
69
|
-
(0, debug_1.log)(`Found extensions: ${extensions.map(({ moduleName }) => moduleName).join(', ')}`);
|
|
70
|
-
modules = extensions.map(({ moduleName }) => new pluggable_1.Pluggable({ moduleName, version: newVersion }));
|
|
71
|
-
}
|
|
72
|
-
modules.push(new pluggable_1.Pluggable({ moduleName: pkg.package.name, version: newVersion }));
|
|
73
|
-
}
|
|
74
|
-
// Remove old modules.
|
|
75
|
-
for await (const module of modules) {
|
|
76
|
-
const spinner = `Uninstalling ${module.moduleName}`;
|
|
77
|
-
try {
|
|
78
|
-
await module.uninstallModule(npmClient, { spinner });
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
(0, debug_1.log)(`Unable to uninstall ${module.moduleName}: ${error.message}`);
|
|
82
|
-
}
|
|
83
|
-
await (0, extensions_1.removeInstalled)(module.moduleName);
|
|
84
|
-
}
|
|
85
|
-
// Install new modules.
|
|
86
|
-
for await (const module of modules.reverse()) {
|
|
87
|
-
const spinner = `Installing ${module.moduleName}`;
|
|
88
|
-
await module.installModule(npmClient, { spinner });
|
|
89
|
-
if (module.moduleName !== pkg.package.name) {
|
|
90
|
-
await (0, extensions_1.addInstalled)(module.moduleName, module.getInfo());
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
exports.UpgradeModule = UpgradeModule;
|
|
96
|
-
//# sourceMappingURL=installation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/modules/installation.js"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,gDAAwB;AACxB,8DAAoC;AAEpC,6CAA8C;AAC9C,uCAAkC;AAElC,8CAA6E;AAC7E,4CAAyC;AAEzC,MAAM,GAAG,GAAG,qBAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAEjE;;;GAGG;AACI,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,QAAQ,EAAE,+BAA+B;IAEzC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK;SACpB,OAAO,CAAC,KAAK,CAAC;SACd,MAAM,CAAC,YAAY,CAAC;IAEvB,OAAO,EAAE,IAAA,uBAAY,EAAC,KAAK,EAAC,IAAI,EAAC,EAAE;QACjC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAE3B,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAa,GAAE,CAAC;QAEzC,qBAAqB;QACrB,IAAI,UAAU,CAAC,MAAM,EAAE;YACrB,IAAA,WAAG,EAAC,qBAAqB,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACtF,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,qBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YACzE,IAAI,KAAK,E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M,OAAO,GAAG,cAAc,MAAM,CAAC,UAAU,EAAE,CAAC;YAClD,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YACnD,IAAI,MAAM,CAAC,UAAU,KAAK,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;gBAC1C,MAAM,IAAA,yBAAY,EAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;aACzD;SACF;IACH,CAAC,CAAC;CACH,CAAC,CAAC;AA/CU,QAAA,aAAa,iBA+CvB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper class for CLI extension.
|
|
3
|
-
*/
|
|
4
|
-
export class PluggableModule {
|
|
5
|
-
constructor(config: any, state: any);
|
|
6
|
-
_pluggable: null;
|
|
7
|
-
_config: any;
|
|
8
|
-
_state: any;
|
|
9
|
-
get pluggable(): null;
|
|
10
|
-
init(): Promise<void>;
|
|
11
|
-
destroy(): Promise<void>;
|
|
12
|
-
export(): any;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=pluggable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluggable.d.ts","sourceRoot":"","sources":["../../../src/modules/pluggable.js"],"names":[],"mappings":"AAQA;;GAEG;AACH;IAGE,qCAGC;IALD,iBAAkB;IAGhB,aAAqB;IACrB,YAAmB;IAGrB,sBAMC;IAED,sBAIC;IAED,yBAIC;IAED,cAYC;CACF"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PluggableModule = void 0;
|
|
7
|
-
const cli_core_1 = require("@dxos/cli-core");
|
|
8
|
-
const pluggable_1 = require("../pluggable");
|
|
9
|
-
/**
|
|
10
|
-
* Wrapper class for CLI extension.
|
|
11
|
-
*/
|
|
12
|
-
class PluggableModule {
|
|
13
|
-
constructor(config, state) {
|
|
14
|
-
this._pluggable = null;
|
|
15
|
-
this._config = config;
|
|
16
|
-
this._state = state;
|
|
17
|
-
}
|
|
18
|
-
get pluggable() {
|
|
19
|
-
if (!this._pluggable) {
|
|
20
|
-
this._pluggable = pluggable_1.Pluggable.create(this._config);
|
|
21
|
-
}
|
|
22
|
-
return this._pluggable;
|
|
23
|
-
}
|
|
24
|
-
async init() {
|
|
25
|
-
if (this.pluggable.installed) {
|
|
26
|
-
await this.pluggable.init(this._state);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async destroy() {
|
|
30
|
-
if (this.pluggable.installed) {
|
|
31
|
-
await this.pluggable.destroy(this._state);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export() {
|
|
35
|
-
const { command, describe } = this._config;
|
|
36
|
-
return command.map(cmd => (() => ({
|
|
37
|
-
command: typeof cmd === 'object' ? cmd.command : cmd,
|
|
38
|
-
describe: typeof cmd === 'object' ? cmd.describe : describe,
|
|
39
|
-
builder: yargs => yargs.help(false).strict(false),
|
|
40
|
-
handler: (0, cli_core_1.asyncHandler)(async (argv) => {
|
|
41
|
-
return this.pluggable.run(this._state, argv);
|
|
42
|
-
})
|
|
43
|
-
// eslint-disable-next-line
|
|
44
|
-
})).bind(this));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.PluggableModule = PluggableModule;
|
|
48
|
-
//# sourceMappingURL=pluggable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluggable.js","sourceRoot":"","sources":["../../../src/modules/pluggable.js"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,6CAA8C;AAE9C,4CAAyC;AAEzC;;GAEG;AACH,MAAa,eAAe;IAG1B,YAAa,MAAM,EAAE,KAAK;QAF1B,eAAU,GAAG,IAAI,CA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AAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC/C,CAAC,CAAC;YACJ,2BAA2B;SAC1B,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClB,CAAC;CACF;AAzCD,0CAyCC"}
|
package/dist/src/pluggable.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pluggable CLI module.
|
|
3
|
-
*/
|
|
4
|
-
export class Pluggable {
|
|
5
|
-
/**
|
|
6
|
-
* Pluggable factory.
|
|
7
|
-
* @param {Object} options
|
|
8
|
-
*/
|
|
9
|
-
static create(options: Object): Pluggable;
|
|
10
|
-
/**
|
|
11
|
-
* @constructor
|
|
12
|
-
* @param {String} moduleName
|
|
13
|
-
* @param {String} version
|
|
14
|
-
*/
|
|
15
|
-
constructor({ moduleName, version }: string);
|
|
16
|
-
_modulePath: any;
|
|
17
|
-
_moduleName: any;
|
|
18
|
-
_version: any;
|
|
19
|
-
_workspaceRoot: any;
|
|
20
|
-
_workspacePackages: any;
|
|
21
|
-
_workspaceInfo: any;
|
|
22
|
-
_isInWorkspace: any;
|
|
23
|
-
_isInCWD: boolean;
|
|
24
|
-
_installed: boolean;
|
|
25
|
-
get moduleName(): any;
|
|
26
|
-
get version(): any;
|
|
27
|
-
get workspaceRoot(): any;
|
|
28
|
-
get installed(): boolean;
|
|
29
|
-
get isInWorkspace(): any;
|
|
30
|
-
get modulePath(): any;
|
|
31
|
-
get module(): any;
|
|
32
|
-
/**
|
|
33
|
-
* Checks if workspace is defined.
|
|
34
|
-
*/
|
|
35
|
-
isWorkspace(): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Checks if extension is installed.
|
|
38
|
-
*/
|
|
39
|
-
isInstalled(): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Install CLI extension.
|
|
42
|
-
*/
|
|
43
|
-
installModule(npmClient: any, options?: {}): Promise<any>;
|
|
44
|
-
/**
|
|
45
|
-
* Uninstall CLI extension.
|
|
46
|
-
*/
|
|
47
|
-
uninstallModule(npmClient: any, options?: {}): Promise<any>;
|
|
48
|
-
/**
|
|
49
|
-
* Init extension in a scope of main CLI.
|
|
50
|
-
* @param {Object} state
|
|
51
|
-
*/
|
|
52
|
-
init(state: Object): Promise<any>;
|
|
53
|
-
/**
|
|
54
|
-
* Destroy extension in a scope of main CLI.
|
|
55
|
-
* @param {Object} state
|
|
56
|
-
*/
|
|
57
|
-
destroy(state: Object): Promise<any>;
|
|
58
|
-
/**
|
|
59
|
-
* Runs command of an CLI extension.
|
|
60
|
-
* @param {Object} state
|
|
61
|
-
* @param {Object} argv
|
|
62
|
-
*/
|
|
63
|
-
run(state: Object, argv: Object): Promise<any>;
|
|
64
|
-
getInfo(): any;
|
|
65
|
-
getDockerCompose(): any;
|
|
66
|
-
_cleanCache(): void;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=pluggable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluggable.d.ts","sourceRoot":"","sources":["../../src/pluggable.js"],"names":[],"mappings":"AAiEA;;GAEG;AACH;IAGE;;;OAGG;IACH,uBAFW,MAAM,aAIhB;IAED;;;;OAIG;IACH,6CAYC;IA3BD,iBAAY;IAgBV,iBAA6B;IAC7B,cAAuB;IAEvB,oBAAiD;IACjD,wBAAgK;IAChK,oBAAgI;IAEhI,oBAA6H;IAC7H,kBAAuJ;IAEvJ,oBAAoC;IAGtC,sBAEC;IAED,mBAEC;IAED,yBAEC;IAED,yBAEC;IAED,yBAEC;IAED,sBAeC;IAED,kBAIC;IAED;;OAEG;IACH,uBAEC;IAED;;OAEG;IACH,uBAeC;IAED;;OAEG;IACH,0DAgBC;IAED;;OAEG;IACH,4DAeC;IAED;;;OAGG;IACH,YAFW,MAAM,gBAIhB;IAED;;;OAGG;IACH,eAFW,MAAM,gBAIhB;IAED;;;;OAIG;IACH,WAHW,MAAM,QACN,MAAM,gBAsBhB;IAED,eAGC;IAED,wBAGC;IAED,oBAEC;CACF"}
|
package/dist/src/pluggable.js
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Pluggable = void 0;
|
|
10
|
-
/* eslint import/no-dynamic-require: 0 */
|
|
11
|
-
/* eslint @typescript-eslint/no-var-requires: 0 */
|
|
12
|
-
/* eslint global-require: 0 */
|
|
13
|
-
const child_process_1 = require("child_process");
|
|
14
|
-
const find_root_1 = __importDefault(require("find-root"));
|
|
15
|
-
const fs_1 = __importDefault(require("fs"));
|
|
16
|
-
const ora_1 = __importDefault(require("ora"));
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
const read_pkg_up_1 = __importDefault(require("read-pkg-up"));
|
|
19
|
-
const strip_json_comments_1 = __importDefault(require("strip-json-comments"));
|
|
20
|
-
const cli_core_1 = require("@dxos/cli-core");
|
|
21
|
-
const extensions_1 = require("./extensions");
|
|
22
|
-
const pkg = read_pkg_up_1.default.sync({ cwd: path_1.default.join(__dirname, '../') });
|
|
23
|
-
/**
|
|
24
|
-
* @param {String} command
|
|
25
|
-
* @param {Array} args
|
|
26
|
-
* @param {Object} options
|
|
27
|
-
*/
|
|
28
|
-
const runCommand = async (command, args, options) => {
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
const { spinner: spinnerText } = options;
|
|
31
|
-
const spinner = (0, ora_1.default)(spinnerText);
|
|
32
|
-
spinner.start();
|
|
33
|
-
(0, child_process_1.exec)(`${(0, cli_core_1.prepareExec)(command)} ${args.join(' ')}`, (err) => {
|
|
34
|
-
if (err) {
|
|
35
|
-
spinner.fail();
|
|
36
|
-
reject(err);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
spinner.succeed();
|
|
40
|
-
spinner.clear();
|
|
41
|
-
resolve();
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Finds root dir of a workspace.
|
|
48
|
-
* @param {String} from
|
|
49
|
-
*/
|
|
50
|
-
const getWorkspaceRoot = from => {
|
|
51
|
-
try {
|
|
52
|
-
return (0, find_root_1.default)(from, dir => {
|
|
53
|
-
const pkgPath = path_1.default.join(dir, 'package.json');
|
|
54
|
-
if (fs_1.default.existsSync(pkgPath)) {
|
|
55
|
-
const { workspaces } = require(pkgPath);
|
|
56
|
-
return workspaces && (Array.isArray(workspaces) || workspaces.packages);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
return '';
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Pluggable CLI module.
|
|
66
|
-
*/
|
|
67
|
-
class Pluggable {
|
|
68
|
-
/**
|
|
69
|
-
* @constructor
|
|
70
|
-
* @param {String} moduleName
|
|
71
|
-
* @param {String} version
|
|
72
|
-
*/
|
|
73
|
-
constructor({ moduleName, version }) {
|
|
74
|
-
var _a;
|
|
75
|
-
this._moduleName = moduleName;
|
|
76
|
-
this._version = version;
|
|
77
|
-
this._workspaceRoot = getWorkspaceRoot(__dirname);
|
|
78
|
-
this._workspacePackages = this._workspaceRoot && JSON.parse((0, strip_json_comments_1.default)(fs_1.default.readFileSync(path_1.default.join(this._workspaceRoot, 'rush.json')).toString())).projects;
|
|
79
|
-
this._workspaceInfo = this._workspacePackages && this._workspacePackages.find(module => module.packageName === this._moduleName);
|
|
80
|
-
this._isInWorkspace = this._workspaceInfo && fs_1.default.existsSync(path_1.default.join(this._workspaceRoot, this._workspaceInfo.projectFolder));
|
|
81
|
-
this._isInCWD = fs_1.default.existsSync(path_1.default.join(process.cwd(), 'package.json')) && ((_a = require(path_1.default.join(process.cwd(), 'package.json'))) === null || _a === void 0 ? void 0 : _a.name) === this._moduleName;
|
|
82
|
-
this._installed = this.isInstalled();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Pluggable factory.
|
|
86
|
-
* @param {Object} options
|
|
87
|
-
*/
|
|
88
|
-
static create(options) {
|
|
89
|
-
return new Pluggable(options);
|
|
90
|
-
}
|
|
91
|
-
get moduleName() {
|
|
92
|
-
return this._moduleName;
|
|
93
|
-
}
|
|
94
|
-
get version() {
|
|
95
|
-
return this._version;
|
|
96
|
-
}
|
|
97
|
-
get workspaceRoot() {
|
|
98
|
-
return this._workspaceRoot;
|
|
99
|
-
}
|
|
100
|
-
get installed() {
|
|
101
|
-
return this._installed;
|
|
102
|
-
}
|
|
103
|
-
get isInWorkspace() {
|
|
104
|
-
return this._isInWorkspace;
|
|
105
|
-
}
|
|
106
|
-
get modulePath() {
|
|
107
|
-
if (!this._modulePath) {
|
|
108
|
-
let pkgPath;
|
|
109
|
-
if (this._isInCWD) {
|
|
110
|
-
pkgPath = path_1.default.join(process.cwd(), 'package.json');
|
|
111
|
-
}
|
|
112
|
-
else if (this._isInWorkspace) {
|
|
113
|
-
pkgPath = path_1.default.join(this._workspaceRoot, this._workspaceInfo.projectFolder, 'package.json');
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
pkgPath = `${this.moduleName}/package.json`;
|
|
117
|
-
}
|
|
118
|
-
const pkg = require(pkgPath);
|
|
119
|
-
this._modulePath = path_1.default.join(pkgPath.replace('package.json', ''), pkg.main);
|
|
120
|
-
}
|
|
121
|
-
return this._modulePath;
|
|
122
|
-
}
|
|
123
|
-
get module() {
|
|
124
|
-
var _a;
|
|
125
|
-
const module = require(this.modulePath);
|
|
126
|
-
const moduleCli = (_a = module.default) !== null && _a !== void 0 ? _a : module; // Difference between `module.exports` and `export default`.
|
|
127
|
-
return moduleCli;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Checks if workspace is defined.
|
|
131
|
-
*/
|
|
132
|
-
isWorkspace() {
|
|
133
|
-
return !!this.workspaceRoot;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Checks if extension is installed.
|
|
137
|
-
*/
|
|
138
|
-
isInstalled() {
|
|
139
|
-
const { moduleName } = this;
|
|
140
|
-
if (this._isInWorkspace || this._isInCWD) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
const pkgPath = require.resolve(`${moduleName}/package.json`);
|
|
145
|
-
const pkg = require(pkgPath);
|
|
146
|
-
// Check if module is installed and version matches cli version.
|
|
147
|
-
return !!pkg;
|
|
148
|
-
// TODO(egorgripasov): Extension compatibility. Semver?
|
|
149
|
-
// && pkg.version === this.version;
|
|
150
|
-
}
|
|
151
|
-
catch (err) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Install CLI extension.
|
|
157
|
-
*/
|
|
158
|
-
async installModule(npmClient, options = {}) {
|
|
159
|
-
const moduleName = this._moduleName;
|
|
160
|
-
const version = this._version;
|
|
161
|
-
if (this.isWorkspace()) {
|
|
162
|
-
console.error(`The module ${moduleName}@${version} has to be added to devDependencies.`);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const isYarn = npmClient ? npmClient === 'yarn' : await (0, cli_core_1.isGlobalYarn)(pkg.package.name);
|
|
166
|
-
const command = isYarn ? 'yarn' : 'npm';
|
|
167
|
-
const args = isYarn ? ['global', 'add'] : ['install', '-g'];
|
|
168
|
-
args.push(`${moduleName}${version ? `@${version}` : ''}`);
|
|
169
|
-
return runCommand(command, args, options);
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Uninstall CLI extension.
|
|
173
|
-
*/
|
|
174
|
-
async uninstallModule(npmClient, options = {}) {
|
|
175
|
-
const moduleName = this._moduleName;
|
|
176
|
-
if (this.isWorkspace()) {
|
|
177
|
-
console.error(`The module ${moduleName} has to be removed from devDependencies.`);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const isYarn = npmClient ? npmClient === 'yarn' : await (0, cli_core_1.isGlobalYarn)(pkg.package.name);
|
|
181
|
-
const command = isYarn ? 'yarn' : 'npm';
|
|
182
|
-
const args = isYarn ? ['global', 'remove'] : ['uninstall', '-g'];
|
|
183
|
-
args.push(`${moduleName}`);
|
|
184
|
-
return runCommand(command, args, options);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Init extension in a scope of main CLI.
|
|
188
|
-
* @param {Object} state
|
|
189
|
-
*/
|
|
190
|
-
async init(state) {
|
|
191
|
-
return this.module.init(state);
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Destroy extension in a scope of main CLI.
|
|
195
|
-
* @param {Object} state
|
|
196
|
-
*/
|
|
197
|
-
async destroy(state) {
|
|
198
|
-
return this.module.destroy(state);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Runs command of an CLI extension.
|
|
202
|
-
* @param {Object} state
|
|
203
|
-
* @param {Object} argv
|
|
204
|
-
*/
|
|
205
|
-
async run(state, argv) {
|
|
206
|
-
const { installed, moduleName, version } = this;
|
|
207
|
-
if (!installed) {
|
|
208
|
-
const spinner = `Installing ${moduleName}${version ? `@${version}` : ''}`;
|
|
209
|
-
try {
|
|
210
|
-
await this.installModule(null, { spinner });
|
|
211
|
-
await (0, extensions_1.addInstalled)(moduleName, this.getInfo());
|
|
212
|
-
const { init, destroy } = this.module;
|
|
213
|
-
if (init || destroy) {
|
|
214
|
-
console.log(`${moduleName} was successfully installed. Please run your command again.`);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
catch (err) {
|
|
219
|
-
console.error(err);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return this.module.runAsExtension(state, argv);
|
|
224
|
-
}
|
|
225
|
-
getInfo() {
|
|
226
|
-
this._cleanCache();
|
|
227
|
-
return this.module.info;
|
|
228
|
-
}
|
|
229
|
-
getDockerCompose() {
|
|
230
|
-
this._cleanCache();
|
|
231
|
-
return this.module.dockerCompose;
|
|
232
|
-
}
|
|
233
|
-
_cleanCache() {
|
|
234
|
-
delete require.cache[require.resolve(this.modulePath)];
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
exports.Pluggable = Pluggable;
|
|
238
|
-
//# sourceMappingURL=pluggable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluggable.js","sourceRoot":"","sources":["../../src/pluggable.js"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,yCAAyC;AACzC,kDAAkD;AAClD,8BAA8B;AAE9B,iDAAqC;AACrC,0DAAiC;AACjC,4CAAoB;AACpB,8CAAsB;AACtB,gDAAwB;AACxB,8DAAoC;AACpC,8EAAoD;AAEpD,6CAA2D;AAE3D,6CAA4C;AAE5C,MAAM,GAAG,GAAG,qBAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAEjE;;;;GAIG;AACH,MAAM,UAAU,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QAEzC,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,WAAW,CAAC,CAAC;QACjC,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,IAAA,oBAAI,EAAC,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EA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