@forge/cli 0.0.0-experimental-2b3dfe1 → 0.0.0-experimental-820808c
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 +12 -2
- package/npm-shrinkwrap.json +50 -1303
- package/out/storage/local-file-storage.d.ts +0 -2
- package/out/storage/local-file-storage.d.ts.map +1 -1
- package/out/storage/local-file-storage.js +1 -9
- package/package.json +2 -38
- package/out/autocomplete/index.d.ts +0 -5
- package/out/autocomplete/index.d.ts.map +0 -1
- package/out/autocomplete/index.js +0 -40
- package/out/autocomplete/types.d.ts +0 -14
- package/out/autocomplete/types.d.ts.map +0 -1
- package/out/autocomplete/types.js +0 -2
- package/out/autocomplete/util.d.ts +0 -6
- package/out/autocomplete/util.d.ts.map +0 -1
- package/out/autocomplete/util.js +0 -13
|
@@ -6,9 +6,7 @@ export interface Storage {
|
|
|
6
6
|
getAnalyticsEvent(file: string): Promise<AnalyticsMessage | undefined>;
|
|
7
7
|
}
|
|
8
8
|
export declare class LocalFileStorage implements Storage {
|
|
9
|
-
private static STORAGE_PATHS;
|
|
10
9
|
private static FOLDER;
|
|
11
|
-
constructor();
|
|
12
10
|
addAnalyticsEvent(message: AnalyticsMessage): void;
|
|
13
11
|
getAnalyticsEvent(file: string): Promise<AnalyticsMessage | undefined>;
|
|
14
12
|
getAnalytics(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-file-storage.d.ts","sourceRoot":"","sources":["../../src/storage/local-file-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-file-storage.d.ts","sourceRoot":"","sources":["../../src/storage/local-file-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAIjF,MAAM,WAAW,OAAO;IACtB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,YAAY,IAAI,MAAM,EAAE,CAAC;IACzB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;CACxE;AAGD,qBAAa,gBAAiB,YAAW,OAAO;IAC9C,OAAO,CAAC,MAAM,CAAC,MAAM,CAAM;IAE3B,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAQ5C,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAgB5E,YAAY,IAAI,MAAM,EAAE;IASlB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOxD"}
|
|
@@ -4,14 +4,7 @@ exports.LocalFileStorage = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
-
const env_paths_1 = tslib_1.__importDefault(require("env-paths"));
|
|
8
|
-
const mkdirp_1 = tslib_1.__importDefault(require("mkdirp"));
|
|
9
7
|
class LocalFileStorage {
|
|
10
|
-
constructor() {
|
|
11
|
-
if (!fs.existsSync(LocalFileStorage.FOLDER)) {
|
|
12
|
-
mkdirp_1.default.sync(LocalFileStorage.FOLDER);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
8
|
addAnalyticsEvent(message) {
|
|
16
9
|
try {
|
|
17
10
|
fs.writeFileSync(path_1.default.join(LocalFileStorage.FOLDER, `${message.id}.json`), JSON.stringify(message));
|
|
@@ -49,5 +42,4 @@ class LocalFileStorage {
|
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
44
|
exports.LocalFileStorage = LocalFileStorage;
|
|
52
|
-
LocalFileStorage.
|
|
53
|
-
LocalFileStorage.FOLDER = LocalFileStorage.STORAGE_PATHS.data;
|
|
45
|
+
LocalFileStorage.FOLDER = '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-820808c",
|
|
4
4
|
"description": "A command line interface for managing Atlassian-hosted apps",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -18,53 +18,17 @@
|
|
|
18
18
|
"postinstall": "node -e \"process.exitCode = fs.existsSync('./out/bin/postinstall.js')\" || node ./out/bin/postinstall.js"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"ajv": "^6.12.5",
|
|
22
|
-
"archiver": "^5.2.0",
|
|
23
|
-
"case": "^1.6.2",
|
|
24
|
-
"cheerio": "^0.22.0",
|
|
25
|
-
"cli-table3": "^0.6.1",
|
|
26
|
-
"command-exists": "^1.2.8",
|
|
27
|
-
"commander": "^7.0.0",
|
|
28
|
-
"cross-spawn": "^7.0.1",
|
|
29
|
-
"dayjs": "^1.9.7",
|
|
30
|
-
"didyoumean": "^1.2.1",
|
|
31
|
-
"env-paths": "^2.2.0",
|
|
32
|
-
"fs-extra": "^8.1.0",
|
|
33
|
-
"hidefile": "^3.0.0",
|
|
34
|
-
"latest-version": "^5.1.0",
|
|
35
|
-
"lodash": "^4.17.20",
|
|
36
|
-
"mkdirp": "^1.0.3",
|
|
37
|
-
"node-fetch": "2.6.1",
|
|
38
|
-
"node-machine-id": "^1.1.12",
|
|
39
|
-
"omelette": "^0.4.15-1",
|
|
40
|
-
"ora": "^4.0.3",
|
|
41
|
-
"portfinder": "^1.0.25",
|
|
42
|
-
"sanitize-filename": "^1.6.3",
|
|
43
|
-
"semver": "^6.3.0",
|
|
44
21
|
"tmp": "^0.1.0",
|
|
45
|
-
"tslib": "^1.11.0"
|
|
46
|
-
"uuid": "^3.4.0"
|
|
22
|
+
"tslib": "^1.11.0"
|
|
47
23
|
},
|
|
48
24
|
"devDependencies": {
|
|
49
|
-
"@types/archiver": "^5.1.0",
|
|
50
|
-
"@types/cheerio": "^0.22.21",
|
|
51
|
-
"@types/command-exists": "^1.2.0",
|
|
52
|
-
"@types/cross-spawn": "^6.0.1",
|
|
53
|
-
"@types/didyoumean": "^1.2.0",
|
|
54
|
-
"@types/fs-extra": "^8.0.1",
|
|
55
|
-
"@types/hidefile": "^3.0.0",
|
|
56
25
|
"@types/inquirer": "^6.5.0",
|
|
57
26
|
"@types/jest": "^26.0.0",
|
|
58
27
|
"@types/js-yaml": "^3.12.2",
|
|
59
28
|
"@types/minimatch": "^3.0.3",
|
|
60
|
-
"@types/mkdirp": "^1.0.0",
|
|
61
29
|
"@types/node": "^12.12.63",
|
|
62
|
-
"@types/node-fetch": "^2.5.7",
|
|
63
|
-
"@types/omelette": "^0.4.1",
|
|
64
|
-
"@types/semver": "^6.0.1",
|
|
65
30
|
"@types/tmp": "^0.1.0",
|
|
66
31
|
"@types/unzipper": "^0.10.1",
|
|
67
|
-
"@types/uuid": "^3.4.7",
|
|
68
32
|
"@types/webpack": "^5.28.0",
|
|
69
33
|
"jest-fixtures": "^0.6.0",
|
|
70
34
|
"memfs": "^3.4.1"
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import omelette from 'omelette';
|
|
2
|
-
import { AutocompleteConfig } from './types';
|
|
3
|
-
export declare const processAutocompleteFactory: (autocompleteConfig: AutocompleteConfig) => (_: any, { line, reply }: any) => void;
|
|
4
|
-
export declare const autocomplete: omelette.Instance;
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,0BAA0B,uBAAwB,kBAAkB,SAC/C,GAAG,mBAAmB,GAAG,SAuC1D,CAAC;AAEF,eAAO,MAAM,YAAY,mBAAsD,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.autocomplete = exports.processAutocompleteFactory = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const omelette_1 = tslib_1.__importDefault(require("omelette"));
|
|
6
|
-
const autocomplete_config_json_1 = tslib_1.__importDefault(require("./autocomplete-config.json"));
|
|
7
|
-
const util_1 = require("./util");
|
|
8
|
-
const autocompleteConfig = autocomplete_config_json_1.default;
|
|
9
|
-
exports.processAutocompleteFactory = (autocompleteConfig) => {
|
|
10
|
-
const processAutocomplete = (_, { line, reply }) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const splitLine = line.split(' ');
|
|
13
|
-
const numArgs = splitLine.length;
|
|
14
|
-
if (numArgs === 2) {
|
|
15
|
-
if (splitLine.slice(-1)[0].startsWith('-')) {
|
|
16
|
-
reply(Object.keys(autocompleteConfig.options));
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
reply(Object.keys(autocompleteConfig.commands));
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
const command = splitLine[1];
|
|
23
|
-
if (!autocompleteConfig.commands.hasOwnProperty(command)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const commandOptions = autocompleteConfig.commands[command];
|
|
27
|
-
const lastArg = splitLine.slice(-2, -1)[0];
|
|
28
|
-
if ((_a = commandOptions[lastArg]) === null || _a === void 0 ? void 0 : _a.requireUserArg) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const userOptionsSelected = util_1.getUserOptionsSelectedFromSplitLine(splitLine);
|
|
32
|
-
const remainingOptions = util_1.getRemainingOptions(commandOptions, userOptionsSelected);
|
|
33
|
-
reply(Object.keys(remainingOptions));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return processAutocomplete;
|
|
37
|
-
};
|
|
38
|
-
exports.autocomplete = omelette_1.default(process.env.AUTOCOMPLETE_ALIAS || 'forge');
|
|
39
|
-
exports.autocomplete.on('complete', exports.processAutocompleteFactory(autocompleteConfig));
|
|
40
|
-
exports.autocomplete.init();
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface Option {
|
|
2
|
-
requireUserArg: boolean;
|
|
3
|
-
}
|
|
4
|
-
export interface CommandOptions {
|
|
5
|
-
[key: string]: Option;
|
|
6
|
-
}
|
|
7
|
-
export interface CommandConfig {
|
|
8
|
-
[key: string]: CommandOptions;
|
|
9
|
-
}
|
|
10
|
-
export interface AutocompleteConfig {
|
|
11
|
-
commands: CommandConfig;
|
|
12
|
-
options: CommandOptions;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/autocomplete/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CommandOptions } from './types';
|
|
2
|
-
export declare const getUserOptionsSelectedFromSplitLine: (splitLine: string[]) => string[];
|
|
3
|
-
export declare const getRemainingOptions: (commandOptions: CommandOptions, userSelectedOptions: string[]) => {
|
|
4
|
-
[x: string]: import("./types").Option;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/autocomplete/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,mCAAmC,cAAe,MAAM,EAAE,aAEtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBAAoB,cAAc,uBAAuB,MAAM,EAAE;;CAQhG,CAAC"}
|
package/out/autocomplete/util.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRemainingOptions = exports.getUserOptionsSelectedFromSplitLine = void 0;
|
|
4
|
-
exports.getUserOptionsSelectedFromSplitLine = (splitLine) => {
|
|
5
|
-
return splitLine.slice(2).filter((o) => o.startsWith('--'));
|
|
6
|
-
};
|
|
7
|
-
exports.getRemainingOptions = (commandOptions, userSelectedOptions) => {
|
|
8
|
-
const commandOptionsClone = Object.assign({}, commandOptions);
|
|
9
|
-
for (const option of userSelectedOptions) {
|
|
10
|
-
delete commandOptionsClone[option];
|
|
11
|
-
}
|
|
12
|
-
return commandOptionsClone;
|
|
13
|
-
};
|