@forge/cli-shared 9.3.0-next.8 → 9.3.0

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,5 +1,120 @@
1
1
  # @forge/cli-shared
2
2
 
3
+ ## 9.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8a9e608: Pull the Forge tunnel proxy-sidecar image from the Portable Registry, falling back to ECR if the initial pull fails
8
+ - 18b920d: Update feature gate name
9
+ - 342098d: Implement server-side linter logic to prevent accidental major app version deployments
10
+ - a36d70b: Implement manual bundler
11
+ - 52e074e: Global App integration + Trigger / Action modules
12
+ - bc2d278: Display deeplinks to installed modules after a successful `forge install`
13
+ - ca4fa27: Add utility function to check if a UI Kit resource needs to be bundled
14
+
15
+ ### Patch Changes
16
+
17
+ - 4d50a76: Changes to forge deploy with a feature-gated combined artifact upload flow.
18
+ - 905d8c5: Design changes, hint to module add and a spinner when loading
19
+ - c8105d8: Remind the user to authenticate to the container registry after creating a new container
20
+ - 3e8de63: add `manifest render` command
21
+ - cddef39: Rename 'package' resource property to 'bundler' to align with property for backend bundling
22
+ - 0949833: Update `tmp` to 0.2.7 to remediate vulnerability
23
+ - 8d20095: bump adm-zip to v0.6.0
24
+ - e7bfe5e: Removing installationTarget
25
+ - Updated dependencies [f01417b]
26
+ - Updated dependencies [d706cd8]
27
+ - Updated dependencies [4b90a07]
28
+ - Updated dependencies [3e8de63]
29
+ - Updated dependencies [cddef39]
30
+ - Updated dependencies [d1610cc]
31
+ - Updated dependencies [e7bfe5e]
32
+ - Updated dependencies [498fda5]
33
+ - Updated dependencies [4404f62]
34
+ - Updated dependencies [89ccb1e]
35
+ - Updated dependencies [39f1f15]
36
+ - Updated dependencies [c3a0f20]
37
+ - @forge/manifest@13.3.0
38
+
39
+ ## 9.3.0-next.20
40
+
41
+ ### Patch Changes
42
+
43
+ - cddef39: Rename 'package' resource property to 'bundler' to align with property for backend bundling
44
+ - Updated dependencies [cddef39]
45
+ - @forge/manifest@13.3.0-next.11
46
+
47
+ ## 9.3.0-next.19
48
+
49
+ ### Minor Changes
50
+
51
+ - 342098d: Implement server-side linter logic to prevent accidental major app version deployments
52
+
53
+ ## 9.3.0-next.18
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [4404f62]
58
+ - @forge/manifest@13.3.0-next.10
59
+
60
+ ## 9.3.0-next.17
61
+
62
+ ### Patch Changes
63
+
64
+ - 8d20095: bump adm-zip to v0.6.0
65
+
66
+ ## 9.3.0-next.16
67
+
68
+ ### Patch Changes
69
+
70
+ - 905d8c5: Design changes, hint to module add and a spinner when loading
71
+
72
+ ## 9.3.0-next.15
73
+
74
+ ### Minor Changes
75
+
76
+ - 52e074e: Global App integration + Trigger / Action modules
77
+
78
+ ## 9.3.0-next.14
79
+
80
+ ### Patch Changes
81
+
82
+ - c8105d8: Remind the user to authenticate to the container registry after creating a new container
83
+ - 3e8de63: add `manifest render` command
84
+ - Updated dependencies [3e8de63]
85
+ - @forge/manifest@13.3.0-next.9
86
+
87
+ ## 9.3.0-next.13
88
+
89
+ ### Minor Changes
90
+
91
+ - 8a9e608: Pull the Forge tunnel proxy-sidecar image from the Portable Registry, falling back to ECR if the initial pull fails
92
+
93
+ ## 9.3.0-next.12
94
+
95
+ ### Patch Changes
96
+
97
+ - Updated dependencies [4b90a07]
98
+ - @forge/manifest@13.3.0-next.8
99
+
100
+ ## 9.3.0-next.11
101
+
102
+ ### Minor Changes
103
+
104
+ - 18b920d: Update feature gate name
105
+
106
+ ## 9.3.0-next.10
107
+
108
+ ### Minor Changes
109
+
110
+ - bc2d278: Display deeplinks to installed modules after a successful `forge install`
111
+
112
+ ## 9.3.0-next.9
113
+
114
+ ### Minor Changes
115
+
116
+ - a36d70b: Implement manual bundler
117
+
3
118
  ## 9.3.0-next.8
4
119
 
5
120
  ### Patch Changes
@@ -15,6 +15,6 @@ const isHostedResourceModule = (module) => {
15
15
  };
16
16
  exports.isHostedResourceModule = isHostedResourceModule;
17
17
  const shouldBundleResource = (resource) => {
18
- return resource.resourceType === 'nativeUI' && !resource.package;
18
+ return resource.resourceType === 'nativeUI' && !resource.bundler;
19
19
  };
20
20
  exports.shouldBundleResource = shouldBundleResource;
@@ -0,0 +1,40 @@
1
+ import { UserError } from '../shared';
2
+ import { Logger } from '../ui';
3
+ export declare abstract class Archiver {
4
+ abstract addContent(fileName: string, contents: Buffer): void;
5
+ abstract addFrom(fileName: string, filePath: string): void;
6
+ abstract finalise(): Promise<string>;
7
+ addMany(entries: Map<string, string | Buffer>): void;
8
+ }
9
+ export declare class ArchiverError extends UserError {
10
+ }
11
+ export declare class ZipArchiver extends Archiver {
12
+ private readonly archive;
13
+ private readonly logger;
14
+ private tempFile;
15
+ private resolves;
16
+ private rejects;
17
+ private constructor();
18
+ static create(logger: Logger): Promise<ZipArchiver>;
19
+ addContent(fileName: string, contents: Buffer): void;
20
+ addFrom(fileName: string, filePath: string): void;
21
+ finalise(): Promise<string>;
22
+ onWarning(cb: (err: Error) => void): void;
23
+ private onArchiveError;
24
+ private onClose;
25
+ }
26
+ export declare class DirectoryArchiver extends Archiver {
27
+ private readonly target;
28
+ constructor(target: string);
29
+ addContent(fileName: string, contents: Buffer): void;
30
+ addFrom(fileName: string, filePath: string): void;
31
+ finalise(): Promise<string>;
32
+ }
33
+ export declare class MultiArchiver extends Archiver {
34
+ private readonly archivers;
35
+ constructor(archivers: Archiver[]);
36
+ addContent(fileName: string, contents: Buffer): void;
37
+ addFrom(fileName: string, filePath: string): void;
38
+ finalise(): Promise<string>;
39
+ }
40
+ //# sourceMappingURL=archiver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/file-system/archiver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,8BAAsB,QAAQ;aACZ,UAA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AGzC;AAED,qBAAa,aAAc,SAAQ,QAAQ;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,QAAQ,EAAE;IAI3C,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMpD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAM3C,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;CAIzC"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultiArchiver = exports.DirectoryArchiver = exports.ZipArchiver = exports.ArchiverError = exports.Archiver = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs_1 = require("fs");
6
+ const path_1 = tslib_1.__importDefault(require("path"));
7
+ const tmp_1 = tslib_1.__importDefault(require("tmp"));
8
+ const shared_1 = require("../shared");
9
+ class Archiver {
10
+ addMany(entries) {
11
+ for (const [name, output] of entries) {
12
+ if (Buffer.isBuffer(output)) {
13
+ this.addContent(name, output);
14
+ }
15
+ else {
16
+ this.addFrom(name, output);
17
+ }
18
+ }
19
+ }
20
+ }
21
+ exports.Archiver = Archiver;
22
+ class ArchiverError extends shared_1.UserError {
23
+ }
24
+ exports.ArchiverError = ArchiverError;
25
+ const invalidArchivePathMessage = (fileName) => `Invalid archive path "${fileName}"`;
26
+ const archiveContentAddedMessage = (fileName) => `Added archive content "${fileName}"`;
27
+ const archiveFileAddedMessage = (fileName, filePath) => `Added archive file "${fileName}" from "${filePath}"`;
28
+ function validateArchivePath(fileName) {
29
+ if (!fileName) {
30
+ return;
31
+ }
32
+ const normalizedPath = path_1.default.posix.normalize(fileName.replace(/\\/g, '/'));
33
+ if (path_1.default.posix.isAbsolute(normalizedPath) || normalizedPath === '..' || normalizedPath.startsWith('../')) {
34
+ throw new ArchiverError(invalidArchivePathMessage(fileName));
35
+ }
36
+ }
37
+ class ZipArchiver extends Archiver {
38
+ archive;
39
+ logger;
40
+ tempFile = tmp_1.default.fileSync({ postfix: '.zip' });
41
+ resolves = [];
42
+ rejects = [];
43
+ constructor(archive, logger) {
44
+ super();
45
+ this.archive = archive;
46
+ this.logger = logger;
47
+ const output = (0, fs_1.createWriteStream)(this.tempFile.name);
48
+ this.archive.pipe(output);
49
+ output.on('close', this.onClose);
50
+ this.archive.on('warning', this.onArchiveError);
51
+ this.archive.on('error', this.onArchiveError);
52
+ }
53
+ static async create(logger) {
54
+ const { ZipArchive } = await Promise.resolve().then(() => tslib_1.__importStar(require('archiver')));
55
+ return new ZipArchiver(new ZipArchive(), logger);
56
+ }
57
+ addContent(fileName, contents) {
58
+ validateArchivePath(fileName);
59
+ this.archive.append(contents, { name: fileName });
60
+ this.logger.debug(archiveContentAddedMessage(fileName));
61
+ }
62
+ addFrom(fileName, filePath) {
63
+ validateArchivePath(fileName);
64
+ if ((0, fs_1.statSync)(filePath).isDirectory()) {
65
+ this.archive.directory(filePath, fileName || false);
66
+ }
67
+ else {
68
+ this.archive.file(filePath, { name: fileName });
69
+ }
70
+ this.logger.debug(archiveFileAddedMessage(fileName, filePath));
71
+ }
72
+ finalise() {
73
+ return new Promise((resolve, reject) => {
74
+ this.resolves.push(resolve);
75
+ this.rejects.push(reject);
76
+ this.archive.finalize();
77
+ });
78
+ }
79
+ onWarning(cb) {
80
+ this.archive.on('warning', cb);
81
+ }
82
+ onArchiveError = (err) => {
83
+ const error = new ArchiverError(err.message);
84
+ for (const reject of this.rejects) {
85
+ reject(error);
86
+ }
87
+ };
88
+ onClose = () => {
89
+ for (const resolve of this.resolves) {
90
+ resolve(this.tempFile.name);
91
+ }
92
+ };
93
+ }
94
+ exports.ZipArchiver = ZipArchiver;
95
+ class DirectoryArchiver extends Archiver {
96
+ target;
97
+ constructor(target) {
98
+ super();
99
+ this.target = target;
100
+ }
101
+ addContent(fileName, contents) {
102
+ validateArchivePath(fileName);
103
+ try {
104
+ const targetName = path_1.default.join(this.target, fileName);
105
+ (0, fs_1.mkdirSync)(path_1.default.dirname(targetName), { recursive: true });
106
+ (0, fs_1.writeFileSync)(targetName, contents);
107
+ }
108
+ catch (e) {
109
+ throw new ArchiverError(e.message);
110
+ }
111
+ }
112
+ addFrom(fileName, filePath) {
113
+ validateArchivePath(fileName);
114
+ try {
115
+ const targetName = path_1.default.join(this.target, fileName);
116
+ (0, fs_1.cpSync)(filePath, targetName, { recursive: true });
117
+ }
118
+ catch (e) {
119
+ throw new ArchiverError(e.message);
120
+ }
121
+ }
122
+ async finalise() {
123
+ return this.target;
124
+ }
125
+ }
126
+ exports.DirectoryArchiver = DirectoryArchiver;
127
+ class MultiArchiver extends Archiver {
128
+ archivers;
129
+ constructor(archivers) {
130
+ super();
131
+ this.archivers = archivers;
132
+ }
133
+ addContent(fileName, contents) {
134
+ for (const archiver of this.archivers) {
135
+ archiver.addContent(fileName, contents);
136
+ }
137
+ }
138
+ addFrom(fileName, filePath) {
139
+ for (const archiver of this.archivers) {
140
+ archiver.addFrom(fileName, filePath);
141
+ }
142
+ }
143
+ async finalise() {
144
+ const paths = await Promise.all(this.archivers.map((archiver) => archiver.finalise()));
145
+ return paths[0];
146
+ }
147
+ }
148
+ exports.MultiArchiver = MultiArchiver;
@@ -1,5 +1,6 @@
1
1
  export * from './file-system-reader';
2
2
  export * from './file-system-writer';
3
+ export * from './archiver';
3
4
  export * from './util';
4
5
  export * from './zip-accessor';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file-system/index.ts"],"names":[],"mappings":"AAEA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file-system/index.ts"],"names":[],"mappings":"AAEA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./file-system-reader"), exports);
5
5
  tslib_1.__exportStar(require("./file-system-writer"), exports);
6
+ tslib_1.__exportStar(require("./archiver"), exports);
6
7
  tslib_1.__exportStar(require("./util"), exports);
7
8
  tslib_1.__exportStar(require("./zip-accessor"), exports);