@forge/cli-shared 8.22.1-next.0 → 8.23.0-experimental-4a332af
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 +159 -0
- package/out/apps/create-an-app.d.ts +3 -1
- package/out/apps/create-an-app.d.ts.map +1 -1
- package/out/apps/create-an-app.js +3 -2
- package/out/apps/register-app.d.ts +3 -1
- package/out/apps/register-app.d.ts.map +1 -1
- package/out/apps/register-app.js +2 -1
- package/out/apps/template-module.d.ts +12 -9
- package/out/apps/template-module.d.ts.map +1 -1
- package/out/apps/template-module.js +61 -25
- package/out/ari/ari.d.ts +4 -0
- package/out/ari/ari.d.ts.map +1 -1
- package/out/ari/ari.js +13 -1
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +16 -3
- package/out/graphql/graphql-types.d.ts +5142 -335
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +610 -70
- package/out/graphql/minimal-graphql-runner.d.ts +3 -3
- package/out/graphql/minimal-graphql-runner.d.ts.map +1 -1
- package/out/graphql/minimal-graphql-runner.js +7 -8
- package/out/shared/forge-cli-attribution.d.ts +16 -0
- package/out/shared/forge-cli-attribution.d.ts.map +1 -0
- package/out/shared/forge-cli-attribution.js +129 -0
- package/out/shared/index.d.ts +1 -0
- package/out/shared/index.d.ts.map +1 -1
- package/out/shared/index.js +1 -0
- package/out/ui/text.d.ts +78 -4
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +106 -11
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,164 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 8.23.0-experimental-4a332af
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 09ef550: Dry run
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- aa757af: Module add
|
|
12
|
+
- Updated dependencies [aa757af]
|
|
13
|
+
- @forge/manifest@12.8.0-experimental-4a332af
|
|
14
|
+
|
|
15
|
+
## 8.23.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 30060eb: Emit `isAgent`/`isCI` on GASv3 analytics events via a new shared `ForgeCliAttribution` class, used by both the `atl-attribution` GraphQL header and analytics client.
|
|
20
|
+
- 369bc9b: `ForgeCliAttribution.agentHint()` now delegates agent detection to [`@vercel/detect-agent`](https://www.npmjs.com/package/@vercel/detect-agent), expanding coverage and replacing the previous brittle PATH-based heuristic. The set of recognised agents is defined by the upstream library. Rovo Dev and Windsurf are still detected directly within `ForgeCliAttribution` and take precedence over the library's result. `agentHint()` and `build()` are now `async` and must be `await`ed by callers.
|
|
21
|
+
- 3bbb9da: Extend `ForgeCliAttribution` to emit additional fields on the `atl-attribution` GraphQL header and GASv3 analytics events: `skillName`, `agentHint` (auto-detects rovo-dev, claude-code, cursor, codex, antigravity, opencode, windsurf, gemini, github-copilot), and `isStudio`. All three are sourced from reserved `ATL_FORGE_ATTRIBUTION_*` env vars with input validation. Adds a generic `ATL_FORGE_ATTRIBUTION_<KEY>` wildcard pass-through so additional attribution fields can be supplied via environment variables (with key/value validation and reserved-field protection)
|
|
22
|
+
- 808adbd: Grouped commands in CLI help and commander.js version bump
|
|
23
|
+
- e2113b4: introduce `--skipRollout` for `forge deploy`
|
|
24
|
+
- a885062: Support a limit parameter in the version bulk-upgrade start command
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 84d9930: adding option to include installation-id for uninstall flow
|
|
29
|
+
- 2c85db9: Add option to create global app
|
|
30
|
+
- ef0434d: Added support for multi-entry resources in UI Kit applications, enabling developers to define multiple entry points within a single resource.
|
|
31
|
+
- Updated dependencies [1eded6e]
|
|
32
|
+
- Updated dependencies [0e45239]
|
|
33
|
+
- Updated dependencies [e6a3ab2]
|
|
34
|
+
- Updated dependencies [cf7000f]
|
|
35
|
+
- Updated dependencies [d660fb0]
|
|
36
|
+
- Updated dependencies [e7b0684]
|
|
37
|
+
- Updated dependencies [f7c39e1]
|
|
38
|
+
- Updated dependencies [8d90f4f]
|
|
39
|
+
- Updated dependencies [bf76c3c]
|
|
40
|
+
- Updated dependencies [ef0434d]
|
|
41
|
+
- Updated dependencies [55991a3]
|
|
42
|
+
- Updated dependencies [e5b5031]
|
|
43
|
+
- Updated dependencies [2e44a71]
|
|
44
|
+
- Updated dependencies [489c6d0]
|
|
45
|
+
- Updated dependencies [c775d3d]
|
|
46
|
+
- Updated dependencies [c99451e]
|
|
47
|
+
- Updated dependencies [f80e7b3]
|
|
48
|
+
- @forge/manifest@12.8.0
|
|
49
|
+
|
|
50
|
+
## 8.23.0-next.13
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [489c6d0]
|
|
55
|
+
- @forge/manifest@12.8.0-next.10
|
|
56
|
+
|
|
57
|
+
## 8.23.0-next.12
|
|
58
|
+
|
|
59
|
+
### Minor Changes
|
|
60
|
+
|
|
61
|
+
- e2113b4: introduce `--skipRollout` for `forge deploy`
|
|
62
|
+
|
|
63
|
+
## 8.23.0-next.11
|
|
64
|
+
|
|
65
|
+
### Minor Changes
|
|
66
|
+
|
|
67
|
+
- 369bc9b: `ForgeCliAttribution.agentHint()` now delegates agent detection to [`@vercel/detect-agent`](https://www.npmjs.com/package/@vercel/detect-agent), expanding coverage and replacing the previous brittle PATH-based heuristic. The set of recognised agents is defined by the upstream library. Rovo Dev and Windsurf are still detected directly within `ForgeCliAttribution` and take precedence over the library's result. `agentHint()` and `build()` are now `async` and must be `await`ed by callers.
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [e5b5031]
|
|
72
|
+
- @forge/manifest@12.8.0-next.9
|
|
73
|
+
|
|
74
|
+
## 8.23.0-next.10
|
|
75
|
+
|
|
76
|
+
### Minor Changes
|
|
77
|
+
|
|
78
|
+
- 3bbb9da: Extend `ForgeCliAttribution` to emit additional fields on the `atl-attribution` GraphQL header and GASv3 analytics events: `skillName`, `agentHint` (auto-detects rovo-dev, claude-code, cursor, codex, antigravity, opencode, windsurf, gemini, github-copilot), and `isStudio`. All three are sourced from reserved `ATL_FORGE_ATTRIBUTION_*` env vars with input validation. Adds a generic `ATL_FORGE_ATTRIBUTION_<KEY>` wildcard pass-through so additional attribution fields can be supplied via environment variables (with key/value validation and reserved-field protection)
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [bf76c3c]
|
|
83
|
+
- @forge/manifest@12.8.0-next.8
|
|
84
|
+
|
|
85
|
+
## 8.23.0-next.9
|
|
86
|
+
|
|
87
|
+
### Minor Changes
|
|
88
|
+
|
|
89
|
+
- 30060eb: Emit `isAgent`/`isCI` on GASv3 analytics events via a new shared `ForgeCliAttribution` class, used by both the `atl-attribution` GraphQL header and analytics client.
|
|
90
|
+
|
|
91
|
+
## 8.23.0-next.8
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies [f7c39e1]
|
|
96
|
+
- @forge/manifest@12.8.0-next.7
|
|
97
|
+
|
|
98
|
+
## 8.23.0-next.7
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- Updated dependencies [e7b0684]
|
|
103
|
+
- @forge/manifest@12.8.0-next.6
|
|
104
|
+
|
|
105
|
+
## 8.23.0-next.6
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- ef0434d: Added support for multi-entry resources in UI Kit applications, enabling developers to define multiple entry points within a single resource.
|
|
110
|
+
- Updated dependencies [ef0434d]
|
|
111
|
+
- @forge/manifest@12.8.0-next.5
|
|
112
|
+
|
|
113
|
+
## 8.23.0-next.5
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Updated dependencies [1eded6e]
|
|
118
|
+
- Updated dependencies [cf7000f]
|
|
119
|
+
- Updated dependencies [d660fb0]
|
|
120
|
+
- @forge/manifest@12.8.0-next.4
|
|
121
|
+
|
|
122
|
+
## 8.23.0-next.4
|
|
123
|
+
|
|
124
|
+
### Minor Changes
|
|
125
|
+
|
|
126
|
+
- a885062: Support a limit parameter in the version bulk-upgrade start command
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- 84d9930: adding option to include installation-id for uninstall flow
|
|
131
|
+
|
|
132
|
+
## 8.23.0-next.3
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- Updated dependencies [8d90f4f]
|
|
137
|
+
- @forge/manifest@12.8.0-next.3
|
|
138
|
+
|
|
139
|
+
## 8.23.0-next.2
|
|
140
|
+
|
|
141
|
+
### Minor Changes
|
|
142
|
+
|
|
143
|
+
- 808adbd: Grouped commands in CLI help and commander.js version bump
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [55991a3]
|
|
148
|
+
- @forge/manifest@12.8.0-next.2
|
|
149
|
+
|
|
150
|
+
## 8.22.1-next.1
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- 2c85db9: Add option to create global app
|
|
155
|
+
- Updated dependencies [0e45239]
|
|
156
|
+
- Updated dependencies [2e44a71]
|
|
157
|
+
- Updated dependencies [c775d3d]
|
|
158
|
+
- Updated dependencies [c99451e]
|
|
159
|
+
- Updated dependencies [f80e7b3]
|
|
160
|
+
- @forge/manifest@12.8.0-next.1
|
|
161
|
+
|
|
3
162
|
## 8.22.1-next.0
|
|
4
163
|
|
|
5
164
|
### Patch Changes
|
|
@@ -2,10 +2,12 @@ import { CreateAppClientInput, RegisterAppCommand, RegisterAppResult } from './r
|
|
|
2
2
|
import { Templater } from './template';
|
|
3
3
|
import { PackageInstaller } from './package-installer';
|
|
4
4
|
import { StatsigService } from '../service';
|
|
5
|
+
import { InstallationTarget } from '../graphql';
|
|
5
6
|
export interface CreateAppCommandInput extends CreateAppClientInput {
|
|
6
7
|
template: string;
|
|
7
8
|
directory: string;
|
|
8
9
|
requiredProduct?: string;
|
|
10
|
+
installationTarget?: InstallationTarget;
|
|
9
11
|
}
|
|
10
12
|
export declare class NoTemplatesError extends Error {
|
|
11
13
|
constructor();
|
|
@@ -21,7 +23,7 @@ export declare class CreateAppCommand {
|
|
|
21
23
|
private readonly packageInstaller;
|
|
22
24
|
private readonly statsig;
|
|
23
25
|
constructor(templater: Templater, registerAppCommand: RegisterAppCommand, packageInstaller: PackageInstaller, statsig: StatsigService);
|
|
24
|
-
execute({ name, description, template, directory, requiredProduct, developerSpaceId, billingConsent }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
|
|
26
|
+
execute({ name, description, template, directory, requiredProduct, installationTarget, developerSpaceId, billingConsent }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
|
|
25
27
|
getAvailableTemplates(): Promise<string[]>;
|
|
26
28
|
filterAvailableProducts<T extends string>(products: T[], teamworkGraph: T, crossContext: T): Promise<T[]>;
|
|
27
29
|
}
|
|
@@ -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;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,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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@ -19,11 +19,12 @@ class CreateAppCommand {
|
|
|
19
19
|
this.packageInstaller = packageInstaller;
|
|
20
20
|
this.statsig = statsig;
|
|
21
21
|
}
|
|
22
|
-
async execute({ name, description, template, directory, requiredProduct, developerSpaceId, billingConsent }) {
|
|
22
|
+
async execute({ name, description, template, directory, requiredProduct, installationTarget, developerSpaceId, billingConsent }) {
|
|
23
23
|
await this.templater.downloadAndExtract(template, directory);
|
|
24
24
|
const result = await this.registerAppCommand.registerApp({ name, description, developerSpaceId, billingConsent }, directory, {
|
|
25
25
|
shouldPrependAppName: true,
|
|
26
|
-
requiredProduct
|
|
26
|
+
requiredProduct,
|
|
27
|
+
installationTarget
|
|
27
28
|
});
|
|
28
29
|
await this.packageInstaller.install(directory);
|
|
29
30
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigFile, ConfigSectionReader, ConfigSectionWriter, NO_VALIDATION_TYPE } from '../config';
|
|
2
|
+
import { InstallationTarget } from '../graphql';
|
|
2
3
|
import { Logger } from '../ui';
|
|
3
4
|
import { AppDetails } from './app-config';
|
|
4
5
|
export interface CreateAppClientInput {
|
|
@@ -33,9 +34,10 @@ export declare class RegisterAppCommand {
|
|
|
33
34
|
execute(input: CreateAppClientInput, { shouldPrependAppName }?: {
|
|
34
35
|
shouldPrependAppName?: boolean | undefined;
|
|
35
36
|
}): Promise<RegisterAppResult>;
|
|
36
|
-
registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, requiredProduct }: {
|
|
37
|
+
registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, requiredProduct, installationTarget }: {
|
|
37
38
|
shouldPrependAppName: boolean;
|
|
38
39
|
requiredProduct?: string;
|
|
40
|
+
installationTarget?: InstallationTarget;
|
|
39
41
|
}): Promise<CreateAppResult>;
|
|
40
42
|
}
|
|
41
43
|
//# sourceMappingURL=register-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-app.d.ts","sourceRoot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E,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,EACE,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EACnB,EAAE;QACD,oBAAoB,EAAE,OAAO,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;KACzC,GACA,OAAO,CAAC,eAAe,CAAC;CAwC5B"}
|
package/out/apps/register-app.js
CHANGED
|
@@ -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, requiredProduct }) {
|
|
27
|
+
async registerApp(input, directory, { shouldPrependAppName, requiredProduct, installationTarget }) {
|
|
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 () => {
|
|
@@ -38,6 +38,7 @@ class RegisterAppCommand {
|
|
|
38
38
|
const section = await this.appConfigReader.readConfigSection();
|
|
39
39
|
let newAppDetails = {
|
|
40
40
|
id: result.id,
|
|
41
|
+
...(installationTarget && { installationTarget }),
|
|
41
42
|
...(requiredProduct && {
|
|
42
43
|
compatibility: {
|
|
43
44
|
[requiredProduct]: {
|
|
@@ -15,11 +15,12 @@ export interface ModuleTemplateMeta {
|
|
|
15
15
|
category?: string;
|
|
16
16
|
uiFramework?: UIFramework;
|
|
17
17
|
moduleKey: string;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
manifestPath?: string;
|
|
19
|
+
dependencies?: Record<string, string>;
|
|
20
|
+
devDependencies?: Record<string, string>;
|
|
20
21
|
frontend?: {
|
|
21
|
-
dependencies?: string
|
|
22
|
-
devDependencies?: string
|
|
22
|
+
dependencies?: Record<string, string>;
|
|
23
|
+
devDependencies?: Record<string, string>;
|
|
23
24
|
};
|
|
24
25
|
customUiDependencies?: string[];
|
|
25
26
|
customUiDevDependencies?: string[];
|
|
@@ -33,11 +34,11 @@ export interface ModuleTemplateMeta {
|
|
|
33
34
|
}>;
|
|
34
35
|
variants?: Record<UIFramework, {
|
|
35
36
|
manifestPath?: string;
|
|
36
|
-
dependencies?: Record<string, string
|
|
37
|
-
devDependencies?: Record<string, string
|
|
37
|
+
dependencies?: Record<string, string>;
|
|
38
|
+
devDependencies?: Record<string, string>;
|
|
38
39
|
frontend?: {
|
|
39
|
-
dependencies?: string
|
|
40
|
-
devDependencies?: string
|
|
40
|
+
dependencies?: Record<string, string>;
|
|
41
|
+
devDependencies?: Record<string, string>;
|
|
41
42
|
};
|
|
42
43
|
variables?: TemplateVariableDef[];
|
|
43
44
|
fileOperations?: Array<{
|
|
@@ -56,7 +57,9 @@ export declare class TemplateModuleServices {
|
|
|
56
57
|
getAvailableModules(product: string): Promise<ModuleTemplateMeta[]>;
|
|
57
58
|
private fetchModuleTemplates;
|
|
58
59
|
fetchManifestFragment(manifestPath: string): Promise<string>;
|
|
59
|
-
|
|
60
|
+
applyVariant(template: ModuleTemplateMeta, uiFramework?: UIFramework): ModuleTemplateMeta;
|
|
61
|
+
prepareModuleMetadata(template: ModuleTemplateMeta, uiFramework?: UIFramework): Promise<ModuleTemplateMeta>;
|
|
62
|
+
downloadModuleBundle(template: ModuleTemplateMeta, uiFramework?: UIFramework): Promise<void>;
|
|
60
63
|
cleanupCache(cacheDir: string): void;
|
|
61
64
|
}
|
|
62
65
|
//# sourceMappingURL=template-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-module.d.ts","sourceRoot":"","sources":["../../src/apps/template-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template-module.d.ts","sourceRoot":"","sources":["../../src/apps/template-module.ts"],"names":[],"mappings":"AAWA,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAED,oBAAY,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAElB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE;QACT,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC1C,CAAC;IAEF,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAClC,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,IAAI,EAAE,QAA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,EAAE,WAAW,GAAG,kBAAkB;IAqBnF,qBAAqB,CAChC,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,kBAAkB,CAAC;IAajB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA2ClG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAO5C"}
|
|
@@ -7,6 +7,7 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
7
7
|
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
8
8
|
const os_1 = tslib_1.__importDefault(require("os"));
|
|
9
9
|
const url_1 = require("url");
|
|
10
|
+
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
10
11
|
const text_1 = require("../ui/text");
|
|
11
12
|
const BIFROST_BASE_URL = 'https://forge-templates-bifrost.ddev.frontend.public.atl-paas.net/assets/';
|
|
12
13
|
const MODULE_INDEX_FILE = 'template-modules.json';
|
|
@@ -52,41 +53,76 @@ class TemplateModuleServices {
|
|
|
52
53
|
}
|
|
53
54
|
return await res.text();
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
throw new Error(text_1.Text.module.add.errorInvalidUIFramework(uiFramework, template.moduleKey));
|
|
62
|
-
}
|
|
63
|
-
if (variantData?.manifestPath) {
|
|
64
|
-
manifestFragment = await this.fetchManifestFragment(variantData.manifestPath);
|
|
65
|
-
}
|
|
66
|
-
const cacheDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'forge-module-'));
|
|
67
|
-
if (manifestFragment) {
|
|
68
|
-
fs_1.default.writeFileSync(path_1.default.join(cacheDir, 'manifest-fragment.yml'), manifestFragment);
|
|
56
|
+
applyVariant(template, uiFramework) {
|
|
57
|
+
if (!uiFramework)
|
|
58
|
+
return { ...template };
|
|
59
|
+
const variantData = template.variants?.[uiFramework];
|
|
60
|
+
if (!variantData) {
|
|
61
|
+
throw new Error(text_1.Text.module.add.errorInvalidUIFramework(uiFramework, template.moduleKey));
|
|
69
62
|
}
|
|
70
63
|
return {
|
|
71
64
|
...template,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
fileOperations: variantData.fileOperations ?? template.fileOperations
|
|
80
|
-
}
|
|
81
|
-
: {}),
|
|
82
|
-
cacheDir
|
|
65
|
+
uiFramework,
|
|
66
|
+
manifestPath: variantData.manifestPath ?? template.manifestPath,
|
|
67
|
+
dependencies: variantData.dependencies ?? template.dependencies,
|
|
68
|
+
devDependencies: variantData.devDependencies ?? template.devDependencies,
|
|
69
|
+
frontend: variantData.frontend ?? template.frontend,
|
|
70
|
+
variables: variantData.variables ?? template.variables,
|
|
71
|
+
fileOperations: variantData.fileOperations ?? template.fileOperations
|
|
83
72
|
};
|
|
84
73
|
}
|
|
74
|
+
async prepareModuleMetadata(template, uiFramework) {
|
|
75
|
+
const resolved = this.applyVariant(template, uiFramework);
|
|
76
|
+
const cacheDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'forge-module-'));
|
|
77
|
+
if (resolved.manifestPath) {
|
|
78
|
+
const manifestFragment = await this.fetchManifestFragment(resolved.manifestPath);
|
|
79
|
+
fs_1.default.writeFileSync(path_1.default.join(cacheDir, 'manifest-fragment.yml'), manifestFragment);
|
|
80
|
+
}
|
|
81
|
+
return { ...resolved, cacheDir };
|
|
82
|
+
}
|
|
83
|
+
async downloadModuleBundle(template, uiFramework) {
|
|
84
|
+
if (!template.fileOperations?.length) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!template.cacheDir) {
|
|
88
|
+
throw new Error(text_1.Text.module.add.errorCacheDirMissing(template.moduleKey));
|
|
89
|
+
}
|
|
90
|
+
const rel = uiFramework ? `${template.moduleKey}/${uiFramework}/bundle.zip` : `${template.moduleKey}/bundle.zip`;
|
|
91
|
+
const url = `${this.baseUrl}${rel}`;
|
|
92
|
+
let res;
|
|
93
|
+
try {
|
|
94
|
+
res = await (0, node_fetch_1.default)(url);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
98
|
+
throw new Error(text_1.Text.module.add.errorFailedToDownloadBundle(template.moduleKey, message), { cause: err });
|
|
99
|
+
}
|
|
100
|
+
if (!res.ok) {
|
|
101
|
+
throw new BifrostFetchError(`${text_1.Text.module.errors.bifrostZipFetchFailed(template.moduleKey, res.status, res.statusText)} (last URL: ${url})`);
|
|
102
|
+
}
|
|
103
|
+
const arrayBuffer = await res.arrayBuffer();
|
|
104
|
+
const zipPath = path_1.default.join(template.cacheDir, 'bundle.zip');
|
|
105
|
+
fs_1.default.writeFileSync(zipPath, Buffer.from(arrayBuffer));
|
|
106
|
+
try {
|
|
107
|
+
new adm_zip_1.default(zipPath).extractAllTo(template.cacheDir, true);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
throw new BifrostFetchError(text_1.Text.module.add.errorZipExtractionFailed(template.moduleKey, err.message));
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
try {
|
|
114
|
+
fs_1.default.rmSync(zipPath, { force: true });
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
85
120
|
cleanupCache(cacheDir) {
|
|
86
121
|
try {
|
|
87
122
|
fs_1.default.rmSync(cacheDir, { recursive: true, force: true });
|
|
88
123
|
}
|
|
89
124
|
catch {
|
|
125
|
+
throw new Error(text_1.Text.module.add.errorCacheCleanupFailed(cacheDir));
|
|
90
126
|
}
|
|
91
127
|
}
|
|
92
128
|
}
|
package/out/ari/ari.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Ari, AnyAri, JiraWorkspaceAri, ConfluenceWorkspaceAri, CompassWorkspaceAri, GraphWorkspaceAri } from '@forge/util/packages/ari';
|
|
2
2
|
export declare const SITE_RESOURCE_TYPE = "site";
|
|
3
3
|
export declare const WORKSPACE_RESOURCE_TYPE = "workspace";
|
|
4
|
+
export declare const INSTALLATION_RESOURCE_TYPE = "installation";
|
|
4
5
|
export declare const TRELLO_RESOURCE_OWNER = "trello";
|
|
5
6
|
export declare const BITBUCKET_RESOURCE_OWNER = "bitbucket";
|
|
6
7
|
export declare function appIdToAriString(appId: string): string;
|
|
@@ -13,6 +14,9 @@ export declare class UnknownSiteWithoutResourceIdError extends Error {
|
|
|
13
14
|
export declare class UnknownWorkspaceWithoutResourceIdError extends Error {
|
|
14
15
|
constructor();
|
|
15
16
|
}
|
|
17
|
+
export declare class UnknownInstallationWithoutResourceIdError extends Error {
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
16
20
|
export declare function parseInstallationContext(installationContext: string): AnyAri;
|
|
17
21
|
export declare const createWorkspaceAriByProduct: {
|
|
18
22
|
jira: (siteId: string, activationId: string) => JiraWorkspaceAri;
|
package/out/ari/ari.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ari.d.ts","sourceRoot":"","sources":["../../src/ari/ari.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,MAAM,EACN,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAIlC,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,uBAAuB,cAAc,CAAC;AACnD,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,wBAAwB,cAAc,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAID,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OA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C,SAAQ,KAAK;;CAInE;AASD,wBAAgB,wBAAwB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CA0B5E;AAGD,eAAO,MAAM,2BAA2B;mBACvB,MAAM,gBAAgB,MAAM;yBACtB,MAAM,gBAAgB,MAAM;sBAC/B,MAAM,eAAe,MAAM;qBAC5B,MAAM,gBAAgB,MAAM;CAC9C,CAAC"}
|
package/out/ari/ari.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createWorkspaceAriByProduct = exports.parseInstallationContext = exports.UnknownWorkspaceWithoutResourceIdError = exports.UnknownSiteWithoutResourceIdError = exports.encodeContext = exports.buildExtensionAri = exports.buildContextAri = exports.appIdToAriString = exports.BITBUCKET_RESOURCE_OWNER = exports.TRELLO_RESOURCE_OWNER = exports.WORKSPACE_RESOURCE_TYPE = exports.SITE_RESOURCE_TYPE = void 0;
|
|
3
|
+
exports.createWorkspaceAriByProduct = exports.parseInstallationContext = exports.UnknownInstallationWithoutResourceIdError = exports.UnknownWorkspaceWithoutResourceIdError = exports.UnknownSiteWithoutResourceIdError = exports.encodeContext = exports.buildExtensionAri = exports.buildContextAri = exports.appIdToAriString = exports.BITBUCKET_RESOURCE_OWNER = exports.TRELLO_RESOURCE_OWNER = exports.INSTALLATION_RESOURCE_TYPE = exports.WORKSPACE_RESOURCE_TYPE = exports.SITE_RESOURCE_TYPE = void 0;
|
|
4
4
|
const ari_1 = require("@forge/util/packages/ari");
|
|
5
5
|
const shared_1 = require("../shared");
|
|
6
6
|
const ui_1 = require("../ui");
|
|
7
7
|
exports.SITE_RESOURCE_TYPE = 'site';
|
|
8
8
|
exports.WORKSPACE_RESOURCE_TYPE = 'workspace';
|
|
9
|
+
exports.INSTALLATION_RESOURCE_TYPE = 'installation';
|
|
9
10
|
exports.TRELLO_RESOURCE_OWNER = 'trello';
|
|
10
11
|
exports.BITBUCKET_RESOURCE_OWNER = 'bitbucket';
|
|
11
12
|
function appIdToAriString(appId) {
|
|
@@ -45,6 +46,12 @@ class UnknownWorkspaceWithoutResourceIdError extends Error {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
exports.UnknownWorkspaceWithoutResourceIdError = UnknownWorkspaceWithoutResourceIdError;
|
|
49
|
+
class UnknownInstallationWithoutResourceIdError extends Error {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(ui_1.Text.installList.noResourceIdInInstallation);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.UnknownInstallationWithoutResourceIdError = UnknownInstallationWithoutResourceIdError;
|
|
48
55
|
function parseInstallationContext(installationContext) {
|
|
49
56
|
const context = ari_1.AnyAri.parse(installationContext);
|
|
50
57
|
switch (context.resourceType) {
|
|
@@ -58,6 +65,11 @@ function parseInstallationContext(installationContext) {
|
|
|
58
65
|
throw new UnknownWorkspaceWithoutResourceIdError();
|
|
59
66
|
}
|
|
60
67
|
break;
|
|
68
|
+
case exports.INSTALLATION_RESOURCE_TYPE:
|
|
69
|
+
if (!context.resourceId) {
|
|
70
|
+
throw new UnknownInstallationWithoutResourceIdError();
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
61
73
|
default:
|
|
62
74
|
throw new Error('Unknown resource type');
|
|
63
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,
|
|
1
|
+
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM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IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAajE,OAAO,CAAC,aAAa;IAIR,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAe1G,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,wBAAwB;IAkBhC,OAAO,CAAC,6BAA6B;IAkBrC,OAAO,CAAC,gBAAgB;IAIX,oBAAoB,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC;IAqClF,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAe1E,YAAY,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAsB1E,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKzD,OAAO,CAAC,eAAe;CAkCxB"}
|
|
@@ -182,7 +182,10 @@ class ConfigFile {
|
|
|
182
182
|
return [module.resource, ...config_1.ModuleEntryPoints.map((entryPoint) => module[entryPoint]?.resource || '')];
|
|
183
183
|
})
|
|
184
184
|
.filter(Boolean);
|
|
185
|
-
const missingModuleResourcesKeys = modulesResourcesKeys.filter((
|
|
185
|
+
const missingModuleResourcesKeys = modulesResourcesKeys.filter((resourceReference) => {
|
|
186
|
+
const { resourceKey } = (0, manifest_1.parseResourceReference)(resourceReference);
|
|
187
|
+
return !resources.some((resource) => resource.key === resourceKey);
|
|
188
|
+
});
|
|
186
189
|
if (missingModuleResourcesKeys.length > 0) {
|
|
187
190
|
throw new ResourceDefinitionMissingError(missingModuleResourcesKeys);
|
|
188
191
|
}
|
|
@@ -267,7 +270,12 @@ class ConfigFile {
|
|
|
267
270
|
return app.connect?.key;
|
|
268
271
|
}
|
|
269
272
|
getResourceType({ key: resourceKey }, allModules) {
|
|
270
|
-
const linkedModule = allModules.find((m) =>
|
|
273
|
+
const linkedModule = allModules.find((m) => {
|
|
274
|
+
if (!m.resource)
|
|
275
|
+
return false;
|
|
276
|
+
const { resourceKey: moduleResourceKey } = (0, manifest_1.parseResourceReference)(m.resource);
|
|
277
|
+
return moduleResourceKey === resourceKey;
|
|
278
|
+
}) ??
|
|
271
279
|
allModules
|
|
272
280
|
.reduce((acc, m) => {
|
|
273
281
|
config_1.ModuleEntryPoints.forEach((entryPoint) => {
|
|
@@ -278,7 +286,12 @@ class ConfigFile {
|
|
|
278
286
|
});
|
|
279
287
|
return acc;
|
|
280
288
|
}, [])
|
|
281
|
-
.find(({ resource }) =>
|
|
289
|
+
.find(({ resource }) => {
|
|
290
|
+
if (!resource)
|
|
291
|
+
return false;
|
|
292
|
+
const { resourceKey: moduleResourceKey } = (0, manifest_1.parseResourceReference)(resource);
|
|
293
|
+
return moduleResourceKey === resourceKey;
|
|
294
|
+
});
|
|
282
295
|
if (!linkedModule) {
|
|
283
296
|
return 'default';
|
|
284
297
|
}
|