@forge/cli 0.0.0-experimental-2b3dfe1 → 0.0.0-experimental-034f51a

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.
@@ -1,4 +0,0 @@
1
- export declare type AttributeMapper<T> = (val: T) => T | undefined;
2
- export declare class AnalyticsClientReporter {
3
- }
4
- //# sourceMappingURL=analytics-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AAE3D,qBAAa,uBAAuB;CAAG"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyticsClientReporter = void 0;
4
- class AnalyticsClientReporter {
5
- }
6
- exports.AnalyticsClientReporter = AnalyticsClientReporter;
@@ -1,17 +0,0 @@
1
- export declare enum EventType {
2
- TRACK = "track",
3
- OPERATIONAL = "operational",
4
- UI = "ui"
5
- }
6
- export interface AnalyticsMessage {
7
- id: string;
8
- eventType: EventType;
9
- event: unknown;
10
- }
11
- export interface MessageHandler<T> {
12
- handleMessage(message: T): Promise<void>;
13
- }
14
- export declare class AnalyticsMessageHandler implements MessageHandler<AnalyticsMessage> {
15
- handleMessage: (message: AnalyticsMessage | undefined) => Promise<void>;
16
- }
17
- //# sourceMappingURL=analytics-message-handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,EAAE,OAAO;CACV;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,qBAAa,uBAAwB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAMvE,aAAa,YAAmB,gBAAgB,GAAG,SAAS,KAAG,OAAO,CAAC,IAAI,CAAC,CAAW;CAC/F"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyticsMessageHandler = exports.EventType = void 0;
4
- var EventType;
5
- (function (EventType) {
6
- EventType["TRACK"] = "track";
7
- EventType["OPERATIONAL"] = "operational";
8
- EventType["UI"] = "ui";
9
- })(EventType = exports.EventType || (exports.EventType = {}));
10
- class AnalyticsMessageHandler {
11
- constructor() {
12
- this.handleMessage = async (message) => void 0;
13
- }
14
- }
15
- exports.AnalyticsMessageHandler = AnalyticsMessageHandler;
@@ -1,3 +0,0 @@
1
- {
2
- "This file is auto generated at build time.": "You can find it in the out/ folder."
3
- }
@@ -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,2 +0,0 @@
1
- export declare function isSupportedShell(): boolean;
2
- //# sourceMappingURL=isSupportedShell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSupportedShell.d.ts","sourceRoot":"","sources":["../../src/autocomplete/isSupportedShell.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,OAAO,CAQ1C"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSupportedShell = void 0;
4
- function isSupportedShell() {
5
- const shell = process.env.SHELL;
6
- if (!shell) {
7
- return false;
8
- }
9
- return /bash/.test(shell) || /zsh/.test(shell) || /fish/.test(shell);
10
- }
11
- exports.isSupportedShell = isSupportedShell;
@@ -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,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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"}
@@ -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
- };
@@ -1 +0,0 @@
1
- //# sourceMappingURL=postinstall.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- console.log('postinstall');
@@ -1,17 +0,0 @@
1
- import { AnalyticsMessage } from '../analytics-client/analytics-message-handler';
2
- export interface Storage {
3
- addAnalyticsEvent(message: AnalyticsMessage): void;
4
- deleteAnalyticsEvent(file: string): Promise<void>;
5
- getAnalytics(): string[];
6
- getAnalyticsEvent(file: string): Promise<AnalyticsMessage | undefined>;
7
- }
8
- export declare class LocalFileStorage implements Storage {
9
- private static STORAGE_PATHS;
10
- private static FOLDER;
11
- constructor();
12
- addAnalyticsEvent(message: AnalyticsMessage): void;
13
- getAnalyticsEvent(file: string): Promise<AnalyticsMessage | undefined>;
14
- getAnalytics(): string[];
15
- deleteAnalyticsEvent(file: string): Promise<void>;
16
- }
17
- //# sourceMappingURL=local-file-storage.d.ts.map
@@ -1 +0,0 @@
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;AAMjF,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,aAAa,CAAyB;IACrD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAuC;;IAQ5D,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"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalFileStorage = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
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
- class LocalFileStorage {
10
- constructor() {
11
- if (!fs.existsSync(LocalFileStorage.FOLDER)) {
12
- mkdirp_1.default.sync(LocalFileStorage.FOLDER);
13
- }
14
- }
15
- addAnalyticsEvent(message) {
16
- try {
17
- fs.writeFileSync(path_1.default.join(LocalFileStorage.FOLDER, `${message.id}.json`), JSON.stringify(message));
18
- }
19
- catch (e) {
20
- }
21
- }
22
- async getAnalyticsEvent(file) {
23
- try {
24
- const content = await fs.promises.readFile(path_1.default.join(LocalFileStorage.FOLDER, file), {
25
- encoding: 'utf8'
26
- });
27
- const parsedContent = JSON.parse(content);
28
- parsedContent.event.timestamp = new Date(parsedContent.event.timestamp);
29
- return parsedContent;
30
- }
31
- catch (e) {
32
- return undefined;
33
- }
34
- }
35
- getAnalytics() {
36
- try {
37
- return fs.readdirSync(LocalFileStorage.FOLDER).filter((f) => f.endsWith('.json'));
38
- }
39
- catch (e) {
40
- return [];
41
- }
42
- }
43
- async deleteAnalyticsEvent(file) {
44
- try {
45
- await fs.promises.unlink(path_1.default.join(LocalFileStorage.FOLDER, file));
46
- }
47
- catch (e) {
48
- }
49
- }
50
- }
51
- exports.LocalFileStorage = LocalFileStorage;
52
- LocalFileStorage.STORAGE_PATHS = env_paths_1.default('forge-cli');
53
- LocalFileStorage.FOLDER = LocalFileStorage.STORAGE_PATHS.data;