@forge/cli-shared 6.7.1-next.2-experimental-a12307f → 6.8.0-next.10

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 CHANGED
@@ -1,13 +1,62 @@
1
1
  # @forge/cli-shared
2
2
 
3
- ## 6.7.1-next.2-experimental-a12307f
3
+ ## 6.8.0-next.10
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 2cdac63: forge install should list all scopes
8
- - 999a9d0: Update error messages for deployment
9
- - Updated dependencies [94e48b9]
10
- - @forge/manifest@8.9.0-next.0-experimental-a12307f
7
+ - Updated dependencies [de0bf46]
8
+ - @forge/manifest@8.9.0-next.5
9
+
10
+ ## 6.8.0-next.9
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [acf1edf]
15
+ - Updated dependencies [3a703de]
16
+ - @forge/manifest@8.9.0-next.4
17
+
18
+ ## 6.8.0-next.8
19
+
20
+ ### Patch Changes
21
+
22
+ - 0aad197: Change product wording to context
23
+
24
+ ## 6.8.0-next.7
25
+
26
+ ### Patch Changes
27
+
28
+ - 9d231e9: switch the `forge create` cross-context flow to use the new `app.contexts` manifest format
29
+ - b503084: switch the `forge create` cross-context flow to use the new `app.contexts` manifest format
30
+ - Updated dependencies [9d231e9]
31
+ - Updated dependencies [b503084]
32
+ - @forge/manifest@8.9.0-next.3
33
+
34
+ ## 6.8.0-next.6
35
+
36
+ ### Patch Changes
37
+
38
+ - a7db2e6: improve error message
39
+ - Updated dependencies [003b1ed]
40
+ - @forge/manifest@8.9.0-next.2
41
+
42
+ ## 6.8.0-next.5
43
+
44
+ ### Patch Changes
45
+
46
+ - 210360b: Refactor text functions for easier read and maintenance
47
+
48
+ ## 6.8.0-next.4
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [64daaa5]
53
+ - @forge/manifest@8.9.0-next.1
54
+
55
+ ## 6.8.0-next.3
56
+
57
+ ### Minor Changes
58
+
59
+ - d156658: Switch the `forge create` flow to select product context first
11
60
 
12
61
  ## 6.7.1-next.2
13
62
 
@@ -1,9 +1,11 @@
1
1
  import { CreateAppClientInput, RegisterAppCommand, RegisterAppResult } from './register-app';
2
2
  import { Templater } from './template';
3
3
  import { PackageInstaller } from './package-installer';
4
+ import { StatsigService } from '../service';
4
5
  export interface CreateAppCommandInput extends CreateAppClientInput {
5
6
  template: string;
6
7
  directory: string;
8
+ requiredProduct?: string;
7
9
  }
8
10
  export declare class NoTemplatesError extends Error {
9
11
  constructor();
@@ -17,8 +19,10 @@ export declare class CreateAppCommand {
17
19
  private readonly templater;
18
20
  private readonly registerAppCommand;
19
21
  private readonly packageInstaller;
20
- constructor(templater: Templater, registerAppCommand: RegisterAppCommand, packageInstaller: PackageInstaller);
21
- execute({ name, description, template, directory }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
22
+ private readonly statsig;
23
+ constructor(templater: Templater, registerAppCommand: RegisterAppCommand, packageInstaller: PackageInstaller, statsig: StatsigService);
24
+ execute({ name, description, template, directory, requiredProduct }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
22
25
  getAvailableTemplates(): Promise<string[]>;
26
+ filterAvailableProducts<T extends string>(products: T[], teamworkGraph: T, crossContext: T): Promise<T[]>;
23
27
  }
24
28
  //# sourceMappingURL=create-an-app.d.ts.map
@@ -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,K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C,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHP,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,cAAc;IAG7B,OAAO,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EAChB,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAa7C,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAS1C,uBAAuB,CAAC,CAAC,SAAS,MAAM,EACnD,QAAQ,EAAE,CAAC,EAAE,EACb,aAAa,EAAE,CAAC,EAChB,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,EAAE,CAAC;CAehB"}
@@ -12,15 +12,18 @@ class CreateAppCommand {
12
12
  templater;
13
13
  registerAppCommand;
14
14
  packageInstaller;
15
- constructor(templater, registerAppCommand, packageInstaller) {
15
+ statsig;
16
+ constructor(templater, registerAppCommand, packageInstaller, statsig) {
16
17
  this.templater = templater;
17
18
  this.registerAppCommand = registerAppCommand;
18
19
  this.packageInstaller = packageInstaller;
20
+ this.statsig = statsig;
19
21
  }
20
- async execute({ name, description, template, directory }) {
22
+ async execute({ name, description, template, directory, requiredProduct }) {
21
23
  await this.templater.downloadAndExtract(template, directory);
22
24
  const result = await this.registerAppCommand.registerApp({ name, description }, directory, {
23
- shouldPrependAppName: true
25
+ shouldPrependAppName: true,
26
+ requiredProduct
24
27
  });
25
28
  await this.packageInstaller.install(directory);
26
29
  return {
@@ -35,5 +38,19 @@ class CreateAppCommand {
35
38
  }
36
39
  return availableTemplates;
37
40
  }
41
+ async filterAvailableProducts(products, teamworkGraph, crossContext) {
42
+ const useTeamworkGraph = await this.statsig.isTeamworkGraphProductSupported();
43
+ const useCrossProduct = await this.statsig.enableCrossProductAppInstallation();
44
+ return products.filter((product) => {
45
+ switch (product) {
46
+ case teamworkGraph:
47
+ return useTeamworkGraph;
48
+ case crossContext:
49
+ return useCrossProduct;
50
+ default:
51
+ return true;
52
+ }
53
+ });
54
+ }
38
55
  }
39
56
  exports.CreateAppCommand = CreateAppCommand;
@@ -31,8 +31,9 @@ export declare class RegisterAppCommand {
31
31
  execute(input: CreateAppClientInput, { shouldPrependAppName }?: {
32
32
  shouldPrependAppName?: boolean | undefined;
33
33
  }): Promise<RegisterAppResult>;
34
- registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName }: {
34
+ registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, requiredProduct }: {
35
35
  shouldPrependAppName: boolean;
36
+ requiredProduct?: string;
36
37
  }): Promise<CreateAppResult>;
37
38
  }
38
39
  //# 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":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAqB,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAExH,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,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;CACL;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAClE;AAED,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,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K,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAClE;AAED,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAJV,SAAS,EAAE,eAAe,EAC1B,eAAe,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,EACxD,eAAe,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAChD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU;IAG5B,OAAO,CAAC,KAAK,EAAE,oBAAoB,EAAE,EAAE,oBAA4B,EAAE;;KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQvG,WAAW,CACtB,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM,EACjB,EAAE,oBAAoB,EAAE,eAAe,EAAE,EAAE;QAAE,oBAAoB,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GACrG,OAAO,CAAC,eAAe,CAAC;CAuC5B"}
@@ -24,7 +24,7 @@ class RegisterAppCommand {
24
24
  environments: result.environments.map((env) => env.key)
25
25
  };
26
26
  }
27
- async registerApp(input, directory, { shouldPrependAppName }) {
27
+ async registerApp(input, directory, { shouldPrependAppName, requiredProduct }) {
28
28
  this.logger.info(ui_1.Text.create.taskRegister);
29
29
  const result = await this.appClient.createApp(input);
30
30
  await (0, file_system_1.inDirectory)(directory, async () => {
@@ -37,7 +37,14 @@ class RegisterAppCommand {
37
37
  }
38
38
  const section = await this.appConfigReader.readConfigSection();
39
39
  let newAppDetails = {
40
- id: result.id
40
+ id: result.id,
41
+ ...(requiredProduct && {
42
+ contexts: {
43
+ [requiredProduct]: {
44
+ required: true
45
+ }
46
+ }
47
+ })
41
48
  };
42
49
  if (section !== 'invalid' && section !== 'missing') {
43
50
  newAppDetails = {