@forge/cli-shared 10.0.0-next.13 → 10.0.0-next.15
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 +13 -0
- package/out/app-logs/graphql-client.d.ts +2 -2
- package/out/app-logs/graphql-client.d.ts.map +1 -1
- package/out/app-logs/graphql-client.js +9 -17
- package/out/app-logs/index.d.ts +2 -2
- package/out/app-logs/index.d.ts.map +1 -1
- package/out/app-logs/index.js +2 -5
- package/out/app-logs/view-logs.d.ts +4 -4
- package/out/app-logs/view-logs.d.ts.map +1 -1
- package/out/app-logs/view-logs.js +8 -12
- package/out/apps/app-config.d.ts +2 -2
- package/out/apps/app-config.d.ts.map +1 -1
- package/out/apps/app-config.js +13 -20
- package/out/apps/create-an-app.d.ts +4 -4
- package/out/apps/create-an-app.d.ts.map +1 -1
- package/out/apps/create-an-app.js +6 -11
- package/out/apps/create-app-graphql-client.d.ts +2 -2
- package/out/apps/create-app-graphql-client.d.ts.map +1 -1
- package/out/apps/create-app-graphql-client.js +9 -14
- package/out/apps/get-app-owner.d.ts +4 -4
- package/out/apps/get-app-owner.d.ts.map +1 -1
- package/out/apps/get-app-owner.js +8 -13
- package/out/apps/index.d.ts +9 -9
- package/out/apps/index.d.ts.map +1 -1
- package/out/apps/index.js +9 -12
- package/out/apps/package-installer.d.ts +1 -1
- package/out/apps/package-installer.d.ts.map +1 -1
- package/out/apps/package-installer.js +9 -14
- package/out/apps/register-app.d.ts +4 -4
- package/out/apps/register-app.d.ts.map +1 -1
- package/out/apps/register-app.js +9 -13
- package/out/apps/sites.js +1 -4
- package/out/apps/template-module.js +27 -33
- package/out/apps/template.d.ts +3 -3
- package/out/apps/template.d.ts.map +1 -1
- package/out/apps/template.js +36 -47
- package/out/ari/ari.js +48 -63
- package/out/ari/index.d.ts +1 -1
- package/out/ari/index.d.ts.map +1 -1
- package/out/ari/index.js +1 -4
- package/out/auth/authenticator.js +2 -6
- package/out/auth/index.d.ts +3 -3
- package/out/auth/index.d.ts.map +1 -1
- package/out/auth/index.js +3 -6
- package/out/auth/instruction.js +3 -6
- package/out/auth/personal/credential-store.d.ts +2 -2
- package/out/auth/personal/credential-store.d.ts.map +1 -1
- package/out/auth/personal/credential-store.js +48 -57
- package/out/auth/personal/index.d.ts +6 -6
- package/out/auth/personal/index.d.ts.map +1 -1
- package/out/auth/personal/index.js +6 -9
- package/out/auth/personal/login.d.ts +3 -3
- package/out/auth/personal/login.d.ts.map +1 -1
- package/out/auth/personal/login.js +1 -5
- package/out/auth/personal/logout.d.ts +1 -1
- package/out/auth/personal/logout.d.ts.map +1 -1
- package/out/auth/personal/logout.js +1 -5
- package/out/auth/personal/me-graphql-client.d.ts +3 -3
- package/out/auth/personal/me-graphql-client.d.ts.map +1 -1
- package/out/auth/personal/me-graphql-client.js +7 -12
- package/out/auth/personal/token-authenticator.d.ts +3 -3
- package/out/auth/personal/token-authenticator.d.ts.map +1 -1
- package/out/auth/personal/token-authenticator.js +10 -14
- package/out/auth/personal/user-repository.d.ts +4 -4
- package/out/auth/personal/user-repository.d.ts.map +1 -1
- package/out/auth/personal/user-repository.js +5 -9
- package/out/cache/cached-conf.d.ts.map +1 -1
- package/out/cache/cached-conf.js +5 -10
- package/out/cache/index.d.ts +1 -1
- package/out/cache/index.d.ts.map +1 -1
- package/out/cache/index.js +1 -4
- package/out/config/config-codec-types.js +1 -2
- package/out/config/config-file-section-reader.d.ts +3 -3
- package/out/config/config-file-section-reader.d.ts.map +1 -1
- package/out/config/config-file-section-reader.js +4 -10
- package/out/config/config-file-section-writer.d.ts +3 -3
- package/out/config/config-file-section-writer.d.ts.map +1 -1
- package/out/config/config-file-section-writer.js +2 -7
- package/out/config/config-file.d.ts +3 -3
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +40 -49
- package/out/config/config-section.js +4 -11
- package/out/config/config.d.ts +1 -1
- package/out/config/config.d.ts.map +1 -1
- package/out/config/config.js +7 -13
- package/out/config/index.d.ts +6 -6
- package/out/config/index.d.ts.map +1 -1
- package/out/config/index.js +6 -9
- package/out/file-system/archiver.d.ts +2 -2
- package/out/file-system/archiver.d.ts.map +1 -1
- package/out/file-system/archiver.js +20 -29
- package/out/file-system/file-system-reader.d.ts.map +1 -1
- package/out/file-system/file-system-reader.js +21 -26
- package/out/file-system/file-system-writer.js +5 -10
- package/out/file-system/index.d.ts +5 -5
- package/out/file-system/index.d.ts.map +1 -1
- package/out/file-system/index.js +5 -8
- package/out/file-system/util.js +1 -4
- package/out/file-system/zip-accessor.js +3 -8
- package/out/graphql/app-environment-graphql-client.d.ts +2 -2
- package/out/graphql/app-environment-graphql-client.d.ts.map +1 -1
- package/out/graphql/app-environment-graphql-client.js +10 -16
- package/out/graphql/app-oauth-client-id-graphql-client.d.ts +1 -1
- package/out/graphql/app-oauth-client-id-graphql-client.d.ts.map +1 -1
- package/out/graphql/app-oauth-client-id-graphql-client.js +6 -10
- package/out/graphql/debugging-graphql-runner.d.ts +2 -2
- package/out/graphql/debugging-graphql-runner.d.ts.map +1 -1
- package/out/graphql/debugging-graphql-runner.js +5 -10
- package/out/graphql/gateway.js +15 -23
- package/out/graphql/get-mutation-error.js +4 -8
- package/out/graphql/gql/gql.d.ts +82 -82
- package/out/graphql/gql/gql.d.ts.map +1 -1
- package/out/graphql/gql/gql.js +2 -6
- package/out/graphql/gql/graphql.d.ts +214 -12
- package/out/graphql/gql/graphql.d.ts.map +1 -1
- package/out/graphql/gql/graphql.js +83 -88
- package/out/graphql/gql/index.d.ts +1 -1
- package/out/graphql/gql/index.d.ts.map +1 -1
- package/out/graphql/gql/index.js +1 -4
- package/out/graphql/graphql-client.js +1 -2
- package/out/graphql/graphql-domain-types.d.ts +1 -1
- package/out/graphql/graphql-domain-types.d.ts.map +1 -1
- package/out/graphql/graphql-domain-types.js +1 -2
- package/out/graphql/graphql-runtime-enums.js +16 -19
- package/out/graphql/index.d.ts +12 -12
- package/out/graphql/index.d.ts.map +1 -1
- package/out/graphql/index.js +12 -17
- package/out/graphql/minimal-graphql-runner.d.ts +4 -4
- package/out/graphql/minimal-graphql-runner.d.ts.map +1 -1
- package/out/graphql/minimal-graphql-runner.js +31 -40
- package/out/graphql/mutation-aware-graphql-client.d.ts +2 -2
- package/out/graphql/mutation-aware-graphql-client.d.ts.map +1 -1
- package/out/graphql/mutation-aware-graphql-client.js +4 -10
- package/out/graphql/path-based-graphql-client-resolver.d.ts +1 -1
- package/out/graphql/path-based-graphql-client-resolver.d.ts.map +1 -1
- package/out/graphql/path-based-graphql-client-resolver.js +3 -7
- package/out/http-client/feedback-post-client.js +1 -5
- package/out/http-client/file-uploader.d.ts +1 -1
- package/out/http-client/file-uploader.d.ts.map +1 -1
- package/out/http-client/file-uploader.js +11 -18
- package/out/http-client/global-edge-http-client.js +8 -14
- package/out/http-client/index.d.ts +5 -5
- package/out/http-client/index.d.ts.map +1 -1
- package/out/http-client/index.js +5 -8
- package/out/http-client/node-request.js +10 -16
- package/out/http-client/trace.js +1 -4
- package/out/index.d.ts +13 -13
- package/out/index.d.ts.map +1 -1
- package/out/index.js +13 -16
- package/out/service/bridge-script-service.js +5 -9
- package/out/service/i18n-resource-bundling-service.js +24 -30
- package/out/service/iframe-resizer-script-service.js +5 -9
- package/out/service/index.d.ts +5 -5
- package/out/service/index.d.ts.map +1 -1
- package/out/service/index.js +5 -8
- package/out/service/statsig-service.d.ts +1 -1
- package/out/service/statsig-service.d.ts.map +1 -1
- package/out/service/statsig-service.js +9 -15
- package/out/service/supported-products-service.d.ts +2 -2
- package/out/service/supported-products-service.d.ts.map +1 -1
- package/out/service/supported-products-service.js +13 -18
- package/out/shared/assertUnreachable.js +1 -4
- package/out/shared/assistant-cli.d.ts +1 -1
- package/out/shared/assistant-cli.d.ts.map +1 -1
- package/out/shared/assistant-cli.js +15 -24
- package/out/shared/cli-details.js +6 -11
- package/out/shared/developer-console.js +12 -18
- package/out/shared/directories.js +4 -8
- package/out/shared/environment.d.ts +1 -1
- package/out/shared/environment.d.ts.map +1 -1
- package/out/shared/environment.js +19 -25
- package/out/shared/error-handling.d.ts +1 -1
- package/out/shared/error-handling.d.ts.map +1 -1
- package/out/shared/error-handling.js +24 -44
- package/out/shared/forge-cli-attribution.js +6 -11
- package/out/shared/index.d.ts +13 -13
- package/out/shared/index.d.ts.map +1 -1
- package/out/shared/index.js +13 -16
- package/out/shared/installations.js +1 -4
- package/out/shared/pause.js +1 -5
- package/out/shared/product.d.ts.map +1 -1
- package/out/shared/product.js +5 -10
- package/out/shared/read-app-config-files.d.ts +1 -1
- package/out/shared/read-app-config-files.d.ts.map +1 -1
- package/out/shared/read-app-config-files.js +6 -12
- package/out/shared/runner-signals.js +1 -5
- package/out/shared/test.d.ts +1 -1
- package/out/shared/test.d.ts.map +1 -1
- package/out/shared/test.js +24 -29
- package/out/tunnel/docker-compose-lifecycle.d.ts +3 -3
- package/out/tunnel/docker-compose-lifecycle.d.ts.map +1 -1
- package/out/tunnel/docker-compose-lifecycle.js +53 -70
- package/out/tunnel/index.d.ts +2 -2
- package/out/tunnel/index.d.ts.map +1 -1
- package/out/tunnel/index.js +2 -5
- package/out/tunnel/tunnel-options.js +13 -18
- package/out/ui/command-line-ui.d.ts +2 -2
- package/out/ui/command-line-ui.d.ts.map +1 -1
- package/out/ui/command-line-ui.js +53 -58
- package/out/ui/hint-rotation.d.ts +2 -2
- package/out/ui/hint-rotation.d.ts.map +1 -1
- package/out/ui/hint-rotation.js +2 -6
- package/out/ui/index.d.ts +8 -8
- package/out/ui/index.d.ts.map +1 -1
- package/out/ui/index.js +8 -11
- package/out/ui/log-color.js +16 -20
- package/out/ui/log-symbols.js +10 -13
- package/out/ui/logger.js +2 -6
- package/out/ui/multiple-table-prompt.d.ts +1 -1
- package/out/ui/multiple-table-prompt.d.ts.map +1 -1
- package/out/ui/multiple-table-prompt.js +13 -20
- package/out/ui/runtime-log.js +12 -16
- package/out/ui/single-table-prompt.d.ts +1 -1
- package/out/ui/single-table-prompt.d.ts.map +1 -1
- package/out/ui/single-table-prompt.js +12 -19
- package/out/ui/table-prompt.d.ts +1 -1
- package/out/ui/table-prompt.d.ts.map +1 -1
- package/out/ui/table-prompt.js +11 -16
- package/out/ui/table.d.ts.map +1 -1
- package/out/ui/table.js +4 -7
- package/out/ui/text.d.ts +1 -1
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +208 -214
- package/out/ui/ui.d.ts +2 -2
- package/out/ui/ui.d.ts.map +1 -1
- package/out/ui/ui.js +1 -2
- package/package.json +3 -2
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
-
const typescript_1 = require("typescript");
|
|
7
|
-
const listGitIgnoreFiles = async (fileSystemReader, gitIgnorePath = '.gitignore') => {
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { readConfigFile } from 'typescript';
|
|
3
|
+
export const listGitIgnoreFiles = async (fileSystemReader, gitIgnorePath = '.gitignore') => {
|
|
8
4
|
const gitignoreContents = fileSystemReader
|
|
9
5
|
.readFile(gitIgnorePath)
|
|
10
6
|
?.trim()
|
|
@@ -19,16 +15,15 @@ const listGitIgnoreFiles = async (fileSystemReader, gitIgnorePath = '.gitignore'
|
|
|
19
15
|
}
|
|
20
16
|
}))).flat();
|
|
21
17
|
};
|
|
22
|
-
exports.listGitIgnoreFiles = listGitIgnoreFiles;
|
|
23
18
|
const processTSConfigGlobList = async (fileSystemReader, globList) => {
|
|
24
19
|
if (!globList) {
|
|
25
20
|
return [];
|
|
26
21
|
}
|
|
27
22
|
const relativePaths = await Promise.all(globList.map((pattern) => fileSystemReader.readGlob({ pattern })));
|
|
28
|
-
return relativePaths.flatMap((pathsFromSingleGlob) => pathsFromSingleGlob.map((relativePath) =>
|
|
23
|
+
return relativePaths.flatMap((pathsFromSingleGlob) => pathsFromSingleGlob.map((relativePath) => path.resolve('./', relativePath)));
|
|
29
24
|
};
|
|
30
|
-
const listTSConfigIncludeExclude = async (fileSystemReader, tsConfigPath = 'tsconfig.json') => {
|
|
31
|
-
const { config } =
|
|
25
|
+
export const listTSConfigIncludeExclude = async (fileSystemReader, tsConfigPath = 'tsconfig.json') => {
|
|
26
|
+
const { config } = readConfigFile(tsConfigPath, fileSystemReader.readFile);
|
|
32
27
|
if (!config) {
|
|
33
28
|
return { include: [], exclude: [] };
|
|
34
29
|
}
|
|
@@ -37,4 +32,3 @@ const listTSConfigIncludeExclude = async (fileSystemReader, tsConfigPath = 'tsco
|
|
|
37
32
|
exclude: await processTSConfigGlobList(fileSystemReader, config?.exclude)
|
|
38
33
|
};
|
|
39
34
|
};
|
|
40
|
-
exports.listTSConfigIncludeExclude = listTSConfigIncludeExclude;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readRunnerSignals = void 0;
|
|
4
|
-
const readRunnerSignals = (isAgent, isCI) => {
|
|
1
|
+
export const readRunnerSignals = (isAgent, isCI) => {
|
|
5
2
|
const isTerminal = Boolean(process.stdin.isTTY);
|
|
6
3
|
return {
|
|
7
4
|
isTerminal,
|
|
8
5
|
isUnrecognizedNonTTY: !isTerminal && !isAgent && !isCI
|
|
9
6
|
};
|
|
10
7
|
};
|
|
11
|
-
exports.readRunnerSignals = readRunnerSignals;
|
package/out/shared/test.d.ts
CHANGED
package/out/shared/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/shared/test.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/shared/test.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAU/E;AAED,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC;AAEF,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,gBAA0B,EAC1B,iBAAwB,EACxB,QAAQ,EACR,cAAsB,EACvB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CA8CnB"}
|
package/out/shared/test.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
-
const manifest_1 = require("@forge/manifest");
|
|
9
|
-
const fs_extra_1 = require("fs-extra");
|
|
10
|
-
const directories_1 = require("./directories");
|
|
11
|
-
function mockLogger(traceEnabled, debugEnabled) {
|
|
1
|
+
import { writeFile } from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { SOURCE_DIRECTORY } from '@forge/manifest';
|
|
4
|
+
import { ensureDir, ensureSymlink } from 'fs-extra';
|
|
5
|
+
import { tmpDir } from './directories.js';
|
|
6
|
+
export function mockLogger(traceEnabled, debugEnabled) {
|
|
12
7
|
return {
|
|
13
8
|
traceEnabled,
|
|
14
9
|
debugEnabled,
|
|
@@ -19,38 +14,38 @@ function mockLogger(traceEnabled, debugEnabled) {
|
|
|
19
14
|
error: jest.fn()
|
|
20
15
|
};
|
|
21
16
|
}
|
|
22
|
-
async function createTestApp({ userCode, userCodeFilename = 'index', userCodeExtension = 'ts', packages, withI18nBundle = false }) {
|
|
23
|
-
const appDirectory =
|
|
24
|
-
const userCodeDir =
|
|
25
|
-
const userCodeBaseName =
|
|
26
|
-
await
|
|
27
|
-
const userCodePath =
|
|
28
|
-
await
|
|
29
|
-
await
|
|
17
|
+
export async function createTestApp({ userCode, userCodeFilename = 'index', userCodeExtension = 'ts', packages, withI18nBundle = false }) {
|
|
18
|
+
const appDirectory = tmpDir();
|
|
19
|
+
const userCodeDir = path.join(appDirectory, SOURCE_DIRECTORY, path.dirname(userCodeFilename));
|
|
20
|
+
const userCodeBaseName = path.basename(userCodeFilename);
|
|
21
|
+
await ensureDir(userCodeDir);
|
|
22
|
+
const userCodePath = path.join(userCodeDir, `${userCodeBaseName}.${userCodeExtension}`);
|
|
23
|
+
await writeFile(userCodePath, userCode);
|
|
24
|
+
await writeFile(path.join(appDirectory, 'tsconfig.json'), JSON.stringify({}));
|
|
30
25
|
const allPackages = ['@types/node', 'undici-types', ...(packages ?? [])];
|
|
31
|
-
await
|
|
26
|
+
await writeFile(path.join(appDirectory, 'package.json'), JSON.stringify({
|
|
32
27
|
dependencies: Object.fromEntries(allPackages.map((pkg) => [pkg, '*']))
|
|
33
28
|
}));
|
|
34
|
-
const monorepoNodeModules =
|
|
35
|
-
const monorepoPackages =
|
|
29
|
+
const monorepoNodeModules = path.join(import.meta.dirname, '..', '..', '..', '..', 'node_modules');
|
|
30
|
+
const monorepoPackages = path.join(import.meta.dirname, '..', '..', '..', '..', 'packages');
|
|
36
31
|
for (const pkg of allPackages) {
|
|
37
32
|
let src;
|
|
38
33
|
if (pkg.startsWith('@forge/')) {
|
|
39
|
-
src =
|
|
34
|
+
src = path.join(monorepoPackages, pkg.replace('@forge/', 'forge-'));
|
|
40
35
|
}
|
|
41
36
|
else {
|
|
42
|
-
src =
|
|
37
|
+
src = path.join(monorepoNodeModules, pkg);
|
|
43
38
|
}
|
|
44
|
-
const dest =
|
|
45
|
-
await
|
|
39
|
+
const dest = path.join(appDirectory, 'node_modules', pkg);
|
|
40
|
+
await ensureSymlink(src, dest);
|
|
46
41
|
}
|
|
47
42
|
if (withI18nBundle) {
|
|
48
43
|
const localeFolder = 'locales';
|
|
49
|
-
await
|
|
50
|
-
await
|
|
44
|
+
await ensureDir(path.join(appDirectory, localeFolder));
|
|
45
|
+
await writeFile(path.join(appDirectory, localeFolder, 'en-US.json'), JSON.stringify({ title: 'i18n' }));
|
|
51
46
|
}
|
|
52
47
|
return {
|
|
53
48
|
appDirectory,
|
|
54
|
-
entryPoints: [{ name: userCodeFilename, path:
|
|
49
|
+
entryPoints: [{ name: userCodeFilename, path: path.join(userCodeDir, userCodeBaseName) }]
|
|
55
50
|
};
|
|
56
51
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UserError } from '../shared';
|
|
2
|
-
import { ConfigFile } from '../config/config-file';
|
|
3
|
-
import { Logger } from '../ui/logger';
|
|
1
|
+
import { UserError } from '../shared/index.js';
|
|
2
|
+
import { ConfigFile } from '../config/config-file.js';
|
|
3
|
+
import { Logger } from '../ui/logger.js';
|
|
4
4
|
import { Services } from '@forge/manifest';
|
|
5
5
|
import { ChildProcess } from 'child_process';
|
|
6
6
|
export declare const PROXY_SIDECAR_VOLUME_DIR = "/forge/container";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker-compose-lifecycle.d.ts","sourceRoot":"","sources":["../../src/tunnel/docker-compose-lifecycle.ts"],"names":[],"mappings":"AAUA,OAAO,EAAmB,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"docker-compose-lifecycle.d.ts","sourceRoot":"","sources":["../../src/tunnel/docker-compose-lifecycle.ts"],"names":[],"mappings":"AAUA,OAAO,EAAmB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,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sB,GACjC,YAAY,UAAU,EACtB,QAAQ,MAAM,EACd,eAAe,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,kBAmCtC,CAAC;AAgCF,eAAO,MAAM,2BAA2B,GAAU,cAAc,YAAY,kBAW3E,CAAC"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const docker_compose_1 = require("docker-compose");
|
|
10
|
-
const shared_1 = require("../shared");
|
|
11
|
-
const text_1 = require("../ui/text");
|
|
12
|
-
const tunnel_options_1 = require("./tunnel-options");
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as yaml from 'yaml';
|
|
4
|
+
import * as http from 'http';
|
|
5
|
+
import { pullOne, downAll, execCompose } from 'docker-compose';
|
|
6
|
+
import { FORGE_DIRECTORY, UserError } from '../shared/index.js';
|
|
7
|
+
import { Text } from '../ui/text.js';
|
|
8
|
+
import { DEFAULT_PROXY_HEALTHCHECK_PORT, DEFAULT_PROXY_HEALTHCHECK_PORT_HOST_MACHINE, DEFAULT_PROXY_INGRESS_PORT, getServicePort } from './tunnel-options.js';
|
|
13
9
|
const SERVICES_DIR_NAME = 'services';
|
|
14
|
-
const HIDDEN_DIR = path.join(
|
|
15
|
-
|
|
10
|
+
const HIDDEN_DIR = path.join(FORGE_DIRECTORY, SERVICES_DIR_NAME);
|
|
11
|
+
export const PROXY_SIDECAR_VOLUME_DIR = '/forge/container';
|
|
16
12
|
const CONTAINER_SERVICE_ASSETS_DIR_NAME = 'container-service-assets';
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export const CONTAINER_SERVICE_ASSETS = path.join(FORGE_DIRECTORY, CONTAINER_SERVICE_ASSETS_DIR_NAME);
|
|
14
|
+
export const K8S_AUTH_TOKEN_FILENAME = 'local-account';
|
|
19
15
|
const PROXY_SIDECAR_SERVICE_NAME = 'proxy-sidecar';
|
|
20
16
|
const PROXY_SIDECAR_IMAGE_PATH = 'forge-platform/proxy-sidecar:latest';
|
|
21
17
|
const PROXY_SIDECAR_REGISTRIES = {
|
|
@@ -30,57 +26,50 @@ const LIFECYCLE_PATTERNS = [
|
|
|
30
26
|
/Volume .* (Creating|Created|Removing|Removed)/,
|
|
31
27
|
/\[[\+\-]\] Running/
|
|
32
28
|
];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class InvalidContainerServicePort extends
|
|
29
|
+
export const STARTUP_TIMER_MS = 30 * 1000;
|
|
30
|
+
export const STARTUP_TIMER_BUFFER_MS = 5 * 1000;
|
|
31
|
+
export class InvalidContainerServicePort extends UserError {
|
|
36
32
|
constructor(serviceKey) {
|
|
37
|
-
super(
|
|
33
|
+
super(Text.error.invalidServicePort(serviceKey));
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
class DockerUnableToPullProxySidecarImage extends shared_1.UserError {
|
|
36
|
+
export class DockerUnableToPullProxySidecarImage extends UserError {
|
|
42
37
|
constructor(err) {
|
|
43
|
-
super(
|
|
38
|
+
super(Text.tunnel.unableToPullProxySidecarImage(err?.message ?? 'Unknown Error Occurred.'));
|
|
44
39
|
}
|
|
45
40
|
}
|
|
46
|
-
|
|
47
|
-
class DockerUnableToStartError extends shared_1.UserError {
|
|
41
|
+
export class DockerUnableToStartError extends UserError {
|
|
48
42
|
constructor(err) {
|
|
49
|
-
super(
|
|
43
|
+
super(Text.tunnel.unableToStartDockerComposeStack(err?.message ?? 'Unknown Error Occurred.'));
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
|
-
|
|
53
|
-
class UnableToParseDockerComposeFileError extends shared_1.UserError {
|
|
46
|
+
export class UnableToParseDockerComposeFileError extends UserError {
|
|
54
47
|
constructor(serviceKey, err) {
|
|
55
|
-
super(
|
|
48
|
+
super(Text.tunnel.UnableToParseDockerComposeFileError(serviceKey, err?.message ?? 'Unknown Error Occurred.'));
|
|
56
49
|
}
|
|
57
50
|
}
|
|
58
|
-
|
|
59
|
-
class MissingImageOrBuildContextError extends shared_1.UserError {
|
|
51
|
+
export class MissingImageOrBuildContextError extends UserError {
|
|
60
52
|
constructor(containerKey) {
|
|
61
|
-
super(
|
|
53
|
+
super(Text.tunnel.missingImageOrBuildContext(containerKey));
|
|
62
54
|
}
|
|
63
55
|
}
|
|
64
|
-
|
|
65
|
-
class CannotUseBothImageAndBuildContextError extends shared_1.UserError {
|
|
56
|
+
export class CannotUseBothImageAndBuildContextError extends UserError {
|
|
66
57
|
constructor(containerKey) {
|
|
67
|
-
super(
|
|
58
|
+
super(Text.tunnel.cannotUseBothImageAndBuildContext(containerKey));
|
|
68
59
|
}
|
|
69
60
|
}
|
|
70
|
-
|
|
71
|
-
class DockerAuthenticationError extends shared_1.UserError {
|
|
61
|
+
export class DockerAuthenticationError extends UserError {
|
|
72
62
|
constructor(errCode) {
|
|
73
|
-
super(
|
|
63
|
+
super(Text.tunnel.unableToAuthenticateDocker(errCode));
|
|
74
64
|
}
|
|
75
65
|
}
|
|
76
|
-
|
|
77
|
-
const generateContainersDockerComposeFile = async (services, appId, envId) => {
|
|
66
|
+
export const generateContainersDockerComposeFile = async (services, appId, envId) => {
|
|
78
67
|
const filesGenerated = {};
|
|
79
68
|
for (const [serviceIndex, service] of services.entries()) {
|
|
80
69
|
const { key: serviceKey, containers } = service;
|
|
81
70
|
const containersWithTunnelConfig = containers.filter((container) => !!container.tunnel);
|
|
82
71
|
if (containersWithTunnelConfig.length > 0) {
|
|
83
|
-
const port = await
|
|
72
|
+
const port = await getServicePort(services, serviceKey);
|
|
84
73
|
if (!port || port < 1024 || port > 49152) {
|
|
85
74
|
throw new InvalidContainerServicePort(serviceKey);
|
|
86
75
|
}
|
|
@@ -129,7 +118,6 @@ const generateContainersDockerComposeFile = async (services, appId, envId) => {
|
|
|
129
118
|
}
|
|
130
119
|
return filesGenerated;
|
|
131
120
|
};
|
|
132
|
-
exports.generateContainersDockerComposeFile = generateContainersDockerComposeFile;
|
|
133
121
|
const relativeComposePath = (from, to) => path.relative(from, to).split(path.sep).join('/');
|
|
134
122
|
const adjustFilePath = (filePath) => {
|
|
135
123
|
if (path.isAbsolute(filePath)) {
|
|
@@ -162,13 +150,13 @@ const getProxySidecarConfig = async (serviceKey, containerKeys, port, appId, env
|
|
|
162
150
|
`ENV_ID=ari:cloud:ecosystem::environment/${appIdShort}/${envId}`,
|
|
163
151
|
`JWKS_URL=${jwksUrl}`,
|
|
164
152
|
`IS_LOCAL_DEV=true`,
|
|
165
|
-
`K8S_AUTH_TOKEN_PATH=${
|
|
153
|
+
`K8S_AUTH_TOKEN_PATH=${PROXY_SIDECAR_VOLUME_DIR}/${K8S_AUTH_TOKEN_FILENAME}`,
|
|
166
154
|
`${containerKeys[0]}_CONTAINER_HEALTHCHECK=http://${containerKeys[0]}:8080${healthEndpointPath}`
|
|
167
155
|
],
|
|
168
|
-
volumes: [`${adjustFilePath(
|
|
156
|
+
volumes: [`${adjustFilePath(CONTAINER_SERVICE_ASSETS)}:${PROXY_SIDECAR_VOLUME_DIR}:ro`],
|
|
169
157
|
ports: [
|
|
170
|
-
`${port}:${
|
|
171
|
-
`${
|
|
158
|
+
`${port}:${DEFAULT_PROXY_INGRESS_PORT}`,
|
|
159
|
+
`${DEFAULT_PROXY_HEALTHCHECK_PORT_HOST_MACHINE + serviceIndex}:${DEFAULT_PROXY_HEALTHCHECK_PORT}`
|
|
172
160
|
]
|
|
173
161
|
}
|
|
174
162
|
};
|
|
@@ -183,7 +171,7 @@ const getContainerDockerComposePath = (serviceKey) => {
|
|
|
183
171
|
}
|
|
184
172
|
return path.join(hiddenDir, `docker-compose-${serviceKey}.yml`);
|
|
185
173
|
};
|
|
186
|
-
const deleteDockerComposeFile = async (composeFile) => {
|
|
174
|
+
export const deleteDockerComposeFile = async (composeFile) => {
|
|
187
175
|
if (fs.existsSync(composeFile)) {
|
|
188
176
|
fs.unlinkSync(composeFile);
|
|
189
177
|
}
|
|
@@ -195,22 +183,20 @@ const deleteDockerComposeFile = async (composeFile) => {
|
|
|
195
183
|
}
|
|
196
184
|
}
|
|
197
185
|
};
|
|
198
|
-
|
|
199
|
-
const startDockerComposeStack = async (dockerComposeFilePath, serviceKey, logger) => {
|
|
186
|
+
export const startDockerComposeStack = async (dockerComposeFilePath, serviceKey, logger) => {
|
|
200
187
|
const pullOptions = {
|
|
201
188
|
cwd: path.dirname(dockerComposeFilePath),
|
|
202
189
|
log: true,
|
|
203
190
|
config: dockerComposeFilePath
|
|
204
191
|
};
|
|
205
192
|
try {
|
|
206
|
-
await
|
|
193
|
+
await pullOne(PROXY_SIDECAR_SERVICE_NAME, pullOptions);
|
|
207
194
|
}
|
|
208
195
|
catch (pullError) {
|
|
209
196
|
throw new DockerUnableToPullProxySidecarImage(new Error(getDockerComposeErrorMessage(pullError)));
|
|
210
197
|
}
|
|
211
198
|
await waitForContainersToStart(dockerComposeFilePath, serviceKey, logger);
|
|
212
199
|
};
|
|
213
|
-
exports.startDockerComposeStack = startDockerComposeStack;
|
|
214
200
|
const getDockerComposeErrorMessage = (error) => {
|
|
215
201
|
if (error && typeof error === 'object') {
|
|
216
202
|
const dockerComposeError = error;
|
|
@@ -218,7 +204,7 @@ const getDockerComposeErrorMessage = (error) => {
|
|
|
218
204
|
}
|
|
219
205
|
return error != null ? String(error) : 'Unknown Error Occurred.';
|
|
220
206
|
};
|
|
221
|
-
const determineComposeFlags = async (dockerComposeFilePath, serviceKey, logger) => {
|
|
207
|
+
export const determineComposeFlags = async (dockerComposeFilePath, serviceKey, logger) => {
|
|
222
208
|
const flags = ['--build', '--quiet-pull'];
|
|
223
209
|
try {
|
|
224
210
|
const composeConfig = getComposeConfig(dockerComposeFilePath);
|
|
@@ -231,7 +217,6 @@ const determineComposeFlags = async (dockerComposeFilePath, serviceKey, logger)
|
|
|
231
217
|
catch (_) { }
|
|
232
218
|
return flags;
|
|
233
219
|
};
|
|
234
|
-
exports.determineComposeFlags = determineComposeFlags;
|
|
235
220
|
const getComposeConfig = (dockerComposeFilePath) => {
|
|
236
221
|
try {
|
|
237
222
|
const composeContent = fs.readFileSync(dockerComposeFilePath, 'utf8');
|
|
@@ -251,7 +236,7 @@ const extractProxySidecarHealthcheckUrl = (composeConfig) => {
|
|
|
251
236
|
if (proxySidecarService && proxySidecarService.ports && proxySidecarService.ports.length > 0) {
|
|
252
237
|
const portMapping = proxySidecarService.ports.find((portMapping) => {
|
|
253
238
|
const parts = portMapping.split(':');
|
|
254
|
-
return parts[1] ===
|
|
239
|
+
return parts[1] === DEFAULT_PROXY_HEALTHCHECK_PORT.toString();
|
|
255
240
|
});
|
|
256
241
|
if (portMapping) {
|
|
257
242
|
healthCheckHostPort = portMapping.split(':')[0];
|
|
@@ -279,7 +264,7 @@ const checkContainerHealth = async (url) => {
|
|
|
279
264
|
});
|
|
280
265
|
};
|
|
281
266
|
const pollContainerHealth = async (proxySidecarHealthEndpointUrl, logger) => {
|
|
282
|
-
const maxAttempts =
|
|
267
|
+
const maxAttempts = STARTUP_TIMER_MS / 1000 - STARTUP_TIMER_BUFFER_MS / 1000;
|
|
283
268
|
const pollInterval = 1000;
|
|
284
269
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
285
270
|
const isHealthy = await checkContainerHealth(proxySidecarHealthEndpointUrl);
|
|
@@ -288,7 +273,7 @@ const pollContainerHealth = async (proxySidecarHealthEndpointUrl, logger) => {
|
|
|
288
273
|
return true;
|
|
289
274
|
}
|
|
290
275
|
if (attempt === maxAttempts) {
|
|
291
|
-
logger.warn(`Containers did not become healthy within ${
|
|
276
|
+
logger.warn(`Containers did not become healthy within ${STARTUP_TIMER_MS / 1000}s`);
|
|
292
277
|
return false;
|
|
293
278
|
}
|
|
294
279
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
@@ -296,7 +281,7 @@ const pollContainerHealth = async (proxySidecarHealthEndpointUrl, logger) => {
|
|
|
296
281
|
return false;
|
|
297
282
|
};
|
|
298
283
|
const waitForContainersToStart = async (dockerComposeFilePath, serviceKey, logger) => {
|
|
299
|
-
const composeFlags = await
|
|
284
|
+
const composeFlags = await determineComposeFlags(dockerComposeFilePath, serviceKey, logger);
|
|
300
285
|
let proxySidecarHealthEndpointUrl;
|
|
301
286
|
try {
|
|
302
287
|
const composeConfig = getComposeConfig(dockerComposeFilePath);
|
|
@@ -310,10 +295,10 @@ const waitForContainersToStart = async (dockerComposeFilePath, serviceKey, logge
|
|
|
310
295
|
const startupTimer = setTimeout(() => {
|
|
311
296
|
if (!containersStarted) {
|
|
312
297
|
containersStarted = true;
|
|
313
|
-
logger.info(`Startup timeout reached (${
|
|
298
|
+
logger.info(`Startup timeout reached (${STARTUP_TIMER_MS / 1000}s). Starting up the forge tunnel...`);
|
|
314
299
|
resolve();
|
|
315
300
|
}
|
|
316
|
-
},
|
|
301
|
+
}, STARTUP_TIMER_MS);
|
|
317
302
|
const logFilter = (chunk) => {
|
|
318
303
|
const output = chunk.toString();
|
|
319
304
|
const lines = output.split('\n');
|
|
@@ -325,7 +310,7 @@ const waitForContainersToStart = async (dockerComposeFilePath, serviceKey, logge
|
|
|
325
310
|
}
|
|
326
311
|
});
|
|
327
312
|
};
|
|
328
|
-
|
|
313
|
+
execCompose('up', composeFlags, {
|
|
329
314
|
cwd: path.dirname(dockerComposeFilePath),
|
|
330
315
|
log: false,
|
|
331
316
|
config: dockerComposeFilePath,
|
|
@@ -358,10 +343,10 @@ const waitForContainersToStart = async (dockerComposeFilePath, serviceKey, logge
|
|
|
358
343
|
catch (err) {
|
|
359
344
|
logger.warn(`Health check polling failed: ${err.message}. Relying on startup timeout...`);
|
|
360
345
|
}
|
|
361
|
-
},
|
|
346
|
+
}, STARTUP_TIMER_BUFFER_MS);
|
|
362
347
|
});
|
|
363
348
|
};
|
|
364
|
-
const stopDockerComposeStack = async (configFile, logger, composeFiles) => {
|
|
349
|
+
export const stopDockerComposeStack = async (configFile, logger, composeFiles) => {
|
|
365
350
|
if (!composeFiles || Object.keys(composeFiles).length === 0)
|
|
366
351
|
return;
|
|
367
352
|
const { services } = await configFile.readConfig();
|
|
@@ -372,22 +357,21 @@ const stopDockerComposeStack = async (configFile, logger, composeFiles) => {
|
|
|
372
357
|
return;
|
|
373
358
|
await Promise.all(Object.entries(composeFiles).map(async ([serviceKey, file]) => {
|
|
374
359
|
try {
|
|
375
|
-
await
|
|
360
|
+
await downAll({
|
|
376
361
|
cwd: '.',
|
|
377
362
|
log: false,
|
|
378
363
|
config: file,
|
|
379
364
|
composeOptions: [`-p${serviceKey}`],
|
|
380
365
|
callback: createCustomLogFilter(logger)
|
|
381
366
|
});
|
|
382
|
-
await
|
|
367
|
+
await deleteDockerComposeFile(file);
|
|
383
368
|
}
|
|
384
369
|
catch (err) {
|
|
385
|
-
throw new Error(
|
|
370
|
+
throw new Error(Text.tunnel.unableToStopDockerComposeStack(serviceKey, err.message ?? 'Unknown Error Occurred.'));
|
|
386
371
|
}
|
|
387
372
|
}));
|
|
388
373
|
deleteContainerServiceAssetsDir();
|
|
389
374
|
};
|
|
390
|
-
exports.stopDockerComposeStack = stopDockerComposeStack;
|
|
391
375
|
const createCustomLogFilter = (logger) => {
|
|
392
376
|
let buffer = '';
|
|
393
377
|
return (chunk) => {
|
|
@@ -403,7 +387,7 @@ const createCustomLogFilter = (logger) => {
|
|
|
403
387
|
});
|
|
404
388
|
};
|
|
405
389
|
};
|
|
406
|
-
const processDockerAuthentication = async (childProcess) => {
|
|
390
|
+
export const processDockerAuthentication = async (childProcess) => {
|
|
407
391
|
await new Promise((resolve, reject) => {
|
|
408
392
|
childProcess.on('close', (code) => {
|
|
409
393
|
if (code === 0) {
|
|
@@ -416,11 +400,10 @@ const processDockerAuthentication = async (childProcess) => {
|
|
|
416
400
|
childProcess.on('error', reject);
|
|
417
401
|
});
|
|
418
402
|
};
|
|
419
|
-
exports.processDockerAuthentication = processDockerAuthentication;
|
|
420
403
|
const deleteContainerServiceAssetsDir = () => {
|
|
421
|
-
const dirPath = path.join(process.cwd(),
|
|
404
|
+
const dirPath = path.join(process.cwd(), CONTAINER_SERVICE_ASSETS);
|
|
422
405
|
if (fs.existsSync(dirPath)) {
|
|
423
|
-
const tokenFilePath = path.join(dirPath,
|
|
406
|
+
const tokenFilePath = path.join(dirPath, K8S_AUTH_TOKEN_FILENAME);
|
|
424
407
|
if (fs.existsSync(tokenFilePath)) {
|
|
425
408
|
fs.unlinkSync(tokenFilePath);
|
|
426
409
|
}
|
package/out/tunnel/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './docker-compose-lifecycle';
|
|
2
|
-
export * from './tunnel-options';
|
|
1
|
+
export * from './docker-compose-lifecycle.js';
|
|
2
|
+
export * from './tunnel-options.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tunnel/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tunnel/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
|
package/out/tunnel/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./docker-compose-lifecycle"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./tunnel-options"), exports);
|
|
1
|
+
export * from './docker-compose-lifecycle.js';
|
|
2
|
+
export * from './tunnel-options.js';
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const shared_1 = require("../shared");
|
|
8
|
-
exports.defaultDebugStartingPort = 9229;
|
|
9
|
-
exports.defaultDebugHost = '127.0.0.1';
|
|
10
|
-
exports.TUNNEL_BUNDLE_DIRECTORY = path_1.default.join(shared_1.FORGE_DIRECTORY, 'tunnel-output');
|
|
11
|
-
exports.defaultNoDebugTunnelOptions = {
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { FORGE_DIRECTORY } from '../shared/index.js';
|
|
3
|
+
export const defaultDebugStartingPort = 9229;
|
|
4
|
+
export const defaultDebugHost = '127.0.0.1';
|
|
5
|
+
export const TUNNEL_BUNDLE_DIRECTORY = path.join(FORGE_DIRECTORY, 'tunnel-output');
|
|
6
|
+
export const defaultNoDebugTunnelOptions = {
|
|
12
7
|
debug: false,
|
|
13
|
-
debugStartingPort:
|
|
14
|
-
debugHost:
|
|
8
|
+
debugStartingPort: defaultDebugStartingPort,
|
|
9
|
+
debugHost: defaultDebugHost
|
|
15
10
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
async function getServicePort(services, serviceKey) {
|
|
11
|
+
export const DEFAULT_PROXY_INGRESS_PORT = 7071;
|
|
12
|
+
export const DEFAULT_PROXY_HEALTHCHECK_PORT = 7073;
|
|
13
|
+
export const DEFAULT_PROXY_HEALTHCHECK_PORT_HOST_MACHINE = 7011;
|
|
14
|
+
export async function getServicePort(services, serviceKey) {
|
|
20
15
|
if (!serviceKey || !services || services.length === 0)
|
|
21
16
|
return undefined;
|
|
22
|
-
const defaultPort = services[0].tunnel?.port ??
|
|
17
|
+
const defaultPort = services[0].tunnel?.port ?? DEFAULT_PROXY_INGRESS_PORT;
|
|
23
18
|
const index = services.findIndex((service) => service.key === serviceKey);
|
|
24
19
|
if (index > -1) {
|
|
25
20
|
return services[index].tunnel?.port ?? defaultPort + index;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ora } from 'ora';
|
|
2
|
-
import { HintCategory, TableCell, TableOptions, UI } from './ui';
|
|
3
|
-
import { StatsigService } from '../service/statsig-service';
|
|
2
|
+
import { HintCategory, TableCell, TableOptions, UI } from './ui.js';
|
|
3
|
+
import { StatsigService } from '../service/statsig-service.js';
|
|
4
4
|
export interface ProgressResult {
|
|
5
5
|
successful: boolean;
|
|
6
6
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-line-ui.d.ts","sourceRoot":"","sources":["../../src/ui/command-line-ui.ts"],"names":[],"mappings":"AAMA,OAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAQ/B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"command-line-ui.d.ts","sourceRoot":"","sources":["../../src/ui/command-line-ui.ts"],"names":[],"mappings":"AAMA,OAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAQ/B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAIpE,OAAO,EAAW,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAcxE,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,KAAK,SAAS,CAAC,GAAG,SAAS,MAAM,IAAI,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;AAQjF,qBAAa,aAAc,YAAW,EAAE;IAiDpC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAIxB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAEtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAtDlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IAKjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAM;IAE9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwB;IAGvD,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,mBAAmB,CAAwC;IAEnE,OAAO,CAAC,MAAM,CAAC,y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