@forge/cli-shared 3.7.1-next.0 → 3.8.0-next.2
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 +15 -0
- package/out/apps/create-an-app.d.ts.map +1 -1
- package/out/apps/create-an-app.js +5 -2
- 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 +4 -1
- package/out/apps/register-app.d.ts +9 -2
- package/out/apps/register-app.d.ts.map +1 -1
- package/out/apps/register-app.js +8 -5
- package/out/graphql/app-environment-graphql-client.d.ts +11 -3
- package/out/graphql/app-environment-graphql-client.d.ts.map +1 -1
- package/out/graphql/app-environment-graphql-client.js +36 -6
- package/out/graphql/graphql-types.d.ts +266 -243
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +12 -19
- package/out/shared/environment.d.ts +1 -0
- package/out/shared/environment.d.ts.map +1 -1
- package/out/shared/environment.js +2 -1
- package/out/ui/text.d.ts +21 -13
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +32 -15
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 3.8.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 081aaa9e: Bumping dependencies via Renovate:
|
|
8
|
+
|
|
9
|
+
- cli-table3
|
|
10
|
+
|
|
11
|
+
## 3.8.0-next.1
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- db2615bd: Allow custom environment names
|
|
16
|
+
- dc0e1983: Added 'forge environment list' command
|
|
17
|
+
|
|
3
18
|
## 3.7.1-next.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-an-app.d.ts","sourceRoot":"","sources":["../../src/apps/create-an-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAI1C;AAED,oBAAY,sBAAsB,GAAG,iBAAiB,GAAG;IACvD,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAFhB,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB;IAGxC,OAAO,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,EACV,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-an-app.d.ts","sourceRoot":"","sources":["../../src/apps/create-an-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAI1C;AAED,oBAAY,sBAAsB,GAAG,iBAAiB,GAAG;IACvD,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAFhB,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB;IAGxC,OAAO,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,EACV,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAU7C,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAQxD"}
|
|
@@ -16,9 +16,12 @@ class CreateAppCommand {
|
|
|
16
16
|
}
|
|
17
17
|
async execute({ name, description, template, directory }) {
|
|
18
18
|
await this.templater.downloadAndExtract(template, directory);
|
|
19
|
-
const
|
|
19
|
+
const result = await this.registerAppCommand.registerApp({ name, description }, directory, true);
|
|
20
20
|
await this.packageInstaller.install(directory);
|
|
21
|
-
return {
|
|
21
|
+
return {
|
|
22
|
+
analytics: { template, appId: result.id, appName: name },
|
|
23
|
+
environments: result.environments.map((env) => env.key)
|
|
24
|
+
};
|
|
22
25
|
}
|
|
23
26
|
async getAvailableTemplates() {
|
|
24
27
|
const availableTemplates = await this.templater.getAvailableTemplates();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GraphQLClient } from '../graphql';
|
|
2
|
-
import { CreateAppClient, CreateAppClientInput } from './register-app';
|
|
2
|
+
import { CreateAppClient, CreateAppClientInput, CreateAppResult } from './register-app';
|
|
3
3
|
export declare class CannotCreateAppError extends Error {
|
|
4
4
|
}
|
|
5
5
|
export declare class CreateAppGraphQLClient implements CreateAppClient {
|
|
6
6
|
private readonly graphqlClient;
|
|
7
7
|
constructor(graphqlClient: GraphQLClient);
|
|
8
|
-
createApp(input: CreateAppClientInput): Promise<
|
|
8
|
+
createApp(input: CreateAppClientInput): Promise<CreateAppResult>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=create-app-graphql-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app-graphql-client.d.ts","sourceRoot":"","sources":["../../src/apps/create-app-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAA+C,MAAM,YAAY,CAAC;AAGlG,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-app-graphql-client.d.ts","sourceRoot":"","sources":["../../src/apps/create-app-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAA+C,MAAM,YAAY,CAAC;AAGlG,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExF,qBAAa,oBAAqB,SAAQ,KAAK;CAAG;AAElD,qBAAa,sBAAuB,YAAW,eAAe;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;CA6C9E"}
|
|
@@ -23,6 +23,9 @@ class CreateAppGraphQLClient {
|
|
|
23
23
|
}
|
|
24
24
|
app {
|
|
25
25
|
id
|
|
26
|
+
environments {
|
|
27
|
+
key
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
}
|
|
@@ -41,7 +44,7 @@ class CreateAppGraphQLClient {
|
|
|
41
44
|
if (!app) {
|
|
42
45
|
throw new CannotCreateAppError(ui_1.Text.create.error.app.creation);
|
|
43
46
|
}
|
|
44
|
-
return app
|
|
47
|
+
return app;
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
exports.CreateAppGraphQLClient = CreateAppGraphQLClient;
|
|
@@ -5,10 +5,17 @@ export interface CreateAppClientInput {
|
|
|
5
5
|
name: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
}
|
|
8
|
+
export interface CreateAppResult {
|
|
9
|
+
id: string;
|
|
10
|
+
environments: {
|
|
11
|
+
key: string;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
8
14
|
export interface CreateAppClient {
|
|
9
|
-
createApp(input: CreateAppClientInput): Promise<
|
|
15
|
+
createApp(input: CreateAppClientInput): Promise<CreateAppResult>;
|
|
10
16
|
}
|
|
11
17
|
export declare type RegisterAppResult = {
|
|
18
|
+
environments: string[];
|
|
12
19
|
analytics: {
|
|
13
20
|
appId: string;
|
|
14
21
|
appName: string;
|
|
@@ -20,6 +27,6 @@ export declare class RegisterAppCommand {
|
|
|
20
27
|
private readonly logger;
|
|
21
28
|
constructor(appClient: CreateAppClient, appConfigWriter: ConfigSectionWriter<AppDetails>, logger: Logger);
|
|
22
29
|
execute(input: CreateAppClientInput, shouldPrependAppName?: boolean): Promise<RegisterAppResult>;
|
|
23
|
-
registerApp(input: CreateAppClientInput, directory: string, shouldPrependAppName: boolean): Promise<
|
|
30
|
+
registerApp(input: CreateAppClientInput, directory: string, shouldPrependAppName: boolean): Promise<CreateAppResult>;
|
|
24
31
|
}
|
|
25
32
|
//# sourceMappingURL=register-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-app.d.ts","sourceRoot":"","sources":["../../src/apps/register-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,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O,GAC5B,OAAO,CAAC,eAAe,CAAC;CAkB5B"}
|
package/out/apps/register-app.js
CHANGED
|
@@ -10,16 +10,19 @@ class RegisterAppCommand {
|
|
|
10
10
|
this.logger = logger;
|
|
11
11
|
}
|
|
12
12
|
async execute(input, shouldPrependAppName = false) {
|
|
13
|
-
const
|
|
14
|
-
return {
|
|
13
|
+
const result = await this.registerApp(input, '.', shouldPrependAppName);
|
|
14
|
+
return {
|
|
15
|
+
analytics: { appId: result.id, appName: input.name },
|
|
16
|
+
environments: result.environments.map((env) => env.key)
|
|
17
|
+
};
|
|
15
18
|
}
|
|
16
19
|
async registerApp(input, directory, shouldPrependAppName) {
|
|
17
20
|
this.logger.info(ui_1.Text.create.taskRegister);
|
|
18
|
-
const
|
|
21
|
+
const result = await this.appClient.createApp(input);
|
|
19
22
|
const cwd = process.cwd();
|
|
20
23
|
process.chdir((0, path_1.resolve)(cwd, directory));
|
|
21
24
|
try {
|
|
22
|
-
await this.appConfigWriter.writeConfigSection({ id });
|
|
25
|
+
await this.appConfigWriter.writeConfigSection({ id: result.id });
|
|
23
26
|
if (shouldPrependAppName) {
|
|
24
27
|
await this.appConfigWriter.prependAppNameToModules(input.name);
|
|
25
28
|
}
|
|
@@ -28,7 +31,7 @@ class RegisterAppCommand {
|
|
|
28
31
|
process.chdir(cwd);
|
|
29
32
|
}
|
|
30
33
|
this.logger.info(ui_1.Text.create.taskCreateEnvironments);
|
|
31
|
-
return
|
|
34
|
+
return result;
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
exports.RegisterAppCommand = RegisterAppCommand;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { GraphQLClient } from './index';
|
|
2
|
-
import { UserError } from '../shared';
|
|
1
|
+
import { AppEnvironmentType, GraphQLClient } from './index';
|
|
2
|
+
import { UserError } from '../shared/error-handling';
|
|
3
3
|
export declare class MissingAppError extends UserError {
|
|
4
4
|
constructor();
|
|
5
5
|
}
|
|
6
6
|
export declare class MissingAppEnvironmentError extends UserError {
|
|
7
|
-
constructor();
|
|
7
|
+
constructor(envKey: string);
|
|
8
|
+
}
|
|
9
|
+
export interface AppEnvironmentDetails {
|
|
10
|
+
appAri: string;
|
|
11
|
+
name: string;
|
|
12
|
+
environmentType: AppEnvironmentType;
|
|
13
|
+
environmentKey: string;
|
|
8
14
|
}
|
|
9
15
|
export interface AppEnvironmentClient {
|
|
10
16
|
getAppEnvironmentId: (appId: string, environmentKey: string) => Promise<string>;
|
|
17
|
+
getAppEnvironmentDetails: (appId: string, environmentKey: string) => Promise<AppEnvironmentDetails>;
|
|
11
18
|
}
|
|
12
19
|
export declare class AppEnvironmentsGraphqlClient implements AppEnvironmentClient {
|
|
13
20
|
private readonly graphqlClient;
|
|
14
21
|
constructor(graphqlClient: GraphQLClient);
|
|
15
22
|
getAppEnvironmentId(appId: string, environmentKey: string): Promise<string>;
|
|
23
|
+
getAppEnvironmentDetails(appAri: string, environmentKey: string): Promise<AppEnvironmentDetails>;
|
|
16
24
|
}
|
|
17
25
|
//# sourceMappingURL=app-environment-graphql-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-environment-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-environment-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"app-environment-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-environment-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,qBAAa,eAAgB,SAAQ,SAAS;;CAI7C;AAED,qBAAa,0BAA2B,SAAQ,SAAS;gBAC3C,MAAM,EAAE,MAAM;CAG3B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrG;AAED,qBAAa,4BAA6B,YAAW,oBAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B3E,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiC9G"}
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppEnvironmentsGraphqlClient = exports.MissingAppEnvironmentError = exports.MissingAppError = void 0;
|
|
4
4
|
const ui_1 = require("../ui");
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const error_handling_1 = require("../shared/error-handling");
|
|
6
|
+
const environment_1 = require("../shared/environment");
|
|
7
|
+
class MissingAppError extends error_handling_1.UserError {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(ui_1.Text.env.error.appNotExist);
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
exports.MissingAppError = MissingAppError;
|
|
12
|
-
class MissingAppEnvironmentError extends
|
|
13
|
-
constructor() {
|
|
14
|
-
super(ui_1.Text.env.error.envNotExist);
|
|
13
|
+
class MissingAppEnvironmentError extends error_handling_1.UserError {
|
|
14
|
+
constructor(envKey) {
|
|
15
|
+
super(ui_1.Text.env.error.envNotExist(envKey, environment_1.environmentToOption));
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.MissingAppEnvironmentError = MissingAppEnvironmentError;
|
|
@@ -37,9 +38,38 @@ class AppEnvironmentsGraphqlClient {
|
|
|
37
38
|
throw new MissingAppError();
|
|
38
39
|
}
|
|
39
40
|
if (!result.app.environmentByKey) {
|
|
40
|
-
throw new MissingAppEnvironmentError();
|
|
41
|
+
throw new MissingAppEnvironmentError(environmentKey);
|
|
41
42
|
}
|
|
42
43
|
return result.app.environmentByKey.id;
|
|
43
44
|
}
|
|
45
|
+
async getAppEnvironmentDetails(appAri, environmentKey) {
|
|
46
|
+
const query = `
|
|
47
|
+
query forge_cli_getApplicationEnvironmentId($id: ID!, $key: String!) {
|
|
48
|
+
app(id: $id) {
|
|
49
|
+
name
|
|
50
|
+
environmentByKey(key: $key) {
|
|
51
|
+
id
|
|
52
|
+
type
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const result = await this.graphqlClient.query(query, {
|
|
58
|
+
id: appAri,
|
|
59
|
+
key: environmentKey
|
|
60
|
+
});
|
|
61
|
+
if (!result.app) {
|
|
62
|
+
throw new MissingAppError();
|
|
63
|
+
}
|
|
64
|
+
if (!result.app.environmentByKey) {
|
|
65
|
+
throw new MissingAppEnvironmentError(environmentKey);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
name: result.app.name,
|
|
69
|
+
appAri,
|
|
70
|
+
environmentKey,
|
|
71
|
+
environmentType: result.app.environmentByKey.type
|
|
72
|
+
};
|
|
73
|
+
}
|
|
44
74
|
}
|
|
45
75
|
exports.AppEnvironmentsGraphqlClient = AppEnvironmentsGraphqlClient;
|