@forge/bundler 7.0.2-next.1 → 7.0.2-next.11
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 +85 -0
- package/out/dependencies.d.ts +4 -0
- package/out/dependencies.d.ts.map +1 -1
- package/out/dependencies.js +39 -17
- package/out/runtime.d.ts +0 -1
- package/out/runtime.d.ts.map +1 -1
- package/out/runtime.js +2 -7
- package/out/types.d.ts +1 -0
- package/out/types.d.ts.map +1 -1
- package/out/typescript.d.ts +1 -1
- package/out/typescript.d.ts.map +1 -1
- package/out/typescript.js +5 -8
- package/out/wrapper-provider.d.ts.map +1 -1
- package/out/wrapper-provider.js +4 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,90 @@
|
|
|
1
1
|
# @forge/bundler
|
|
2
2
|
|
|
3
|
+
## 7.0.2-next.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f408181: Reject dependencies outside application directory
|
|
8
|
+
- Updated dependencies [f408181]
|
|
9
|
+
- @forge/cli-shared@9.2.0-next.10
|
|
10
|
+
- @forge/lint@6.0.2-next.11
|
|
11
|
+
|
|
12
|
+
## 7.0.2-next.10
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [2b30ef8]
|
|
17
|
+
- @forge/manifest@13.2.0-next.5
|
|
18
|
+
- @forge/cli-shared@9.2.0-next.9
|
|
19
|
+
- @forge/lint@6.0.2-next.10
|
|
20
|
+
|
|
21
|
+
## 7.0.2-next.9
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [5abe69e]
|
|
26
|
+
- @forge/cli-shared@9.2.0-next.8
|
|
27
|
+
- @forge/manifest@13.2.0-next.4
|
|
28
|
+
- @forge/lint@6.0.2-next.9
|
|
29
|
+
|
|
30
|
+
## 7.0.2-next.8
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [8826ca3]
|
|
35
|
+
- Updated dependencies [c67b720]
|
|
36
|
+
- @forge/cli-shared@9.2.0-next.7
|
|
37
|
+
- @forge/manifest@13.2.0-next.3
|
|
38
|
+
- @forge/lint@6.0.2-next.8
|
|
39
|
+
|
|
40
|
+
## 7.0.2-next.7
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- @forge/lint@6.0.2-next.7
|
|
45
|
+
|
|
46
|
+
## 7.0.2-next.6
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- 6e5b5a4: Better interface for packaging the runtime code
|
|
51
|
+
- Updated dependencies [6e5b5a4]
|
|
52
|
+
- @forge/cli-shared@9.2.0-next.6
|
|
53
|
+
- @forge/lint@6.0.2-next.6
|
|
54
|
+
|
|
55
|
+
## 7.0.2-next.5
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [d415c89]
|
|
60
|
+
- @forge/cli-shared@9.2.0-next.5
|
|
61
|
+
- @forge/lint@6.0.2-next.5
|
|
62
|
+
|
|
63
|
+
## 7.0.2-next.4
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [903d6c1]
|
|
68
|
+
- @forge/cli-shared@9.2.0-next.4
|
|
69
|
+
- @forge/lint@6.0.2-next.4
|
|
70
|
+
|
|
71
|
+
## 7.0.2-next.3
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [757223b]
|
|
76
|
+
- @forge/cli-shared@9.2.0-next.3
|
|
77
|
+
- @forge/lint@6.0.2-next.3
|
|
78
|
+
|
|
79
|
+
## 7.0.2-next.2
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Updated dependencies [7195f29]
|
|
84
|
+
- @forge/manifest@13.1.1-next.2
|
|
85
|
+
- @forge/cli-shared@9.1.1-next.2
|
|
86
|
+
- @forge/lint@6.0.2-next.2
|
|
87
|
+
|
|
3
88
|
## 7.0.2-next.1
|
|
4
89
|
|
|
5
90
|
### Patch Changes
|
package/out/dependencies.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
type CopyDepsOptions = {
|
|
2
2
|
exclude?: string[];
|
|
3
3
|
};
|
|
4
|
+
export declare const DEFAULT_COPY_DEPENDENCIES_OPTIONS: {
|
|
5
|
+
exclude: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function getProductionDependencies(moduleDir: string, options?: CopyDepsOptions): Promise<Map<string, string>>;
|
|
4
8
|
export declare function copyProductionDependencies(moduleDir: string, target: string, options?: CopyDepsOptions): Promise<void>;
|
|
5
9
|
export {};
|
|
6
10
|
//# sourceMappingURL=dependencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAoDA,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyBF,eAAO,MAAM,iCAAiC;;CAE7C,CAAC;AAYF,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAI9B;AAsDD,wBAAsB,0BAA0B,CAC9C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
package/out/dependencies.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_COPY_DEPENDENCIES_OPTIONS = void 0;
|
|
4
|
+
exports.getProductionDependencies = getProductionDependencies;
|
|
3
5
|
exports.copyProductionDependencies = copyProductionDependencies;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const fs_1 = require("fs");
|
|
@@ -7,6 +9,10 @@ const promises_1 = require("fs/promises");
|
|
|
7
9
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
10
|
const fs_extra_1 = require("fs-extra");
|
|
9
11
|
const common_1 = require("./common");
|
|
12
|
+
function isWithinRoot(root, source) {
|
|
13
|
+
const relativeToRoot = path_1.default.relative(path_1.default.resolve(root), path_1.default.resolve(source));
|
|
14
|
+
return relativeToRoot === '' || (!relativeToRoot.startsWith('..') && !path_1.default.isAbsolute(relativeToRoot));
|
|
15
|
+
}
|
|
10
16
|
async function readPackageJSON(directory) {
|
|
11
17
|
try {
|
|
12
18
|
const packageJson = await (0, promises_1.readFile)(path_1.default.join(directory, 'package.json'), 'utf8');
|
|
@@ -16,8 +22,8 @@ async function readPackageJSON(directory) {
|
|
|
16
22
|
return null;
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
|
-
async function dependencyDir(moduleDir, dependency) {
|
|
20
|
-
for (let source = moduleDir; source !== path_1.default.dirname(source); source = path_1.default.dirname(source)) {
|
|
25
|
+
async function dependencyDir(moduleDir, dependency, root) {
|
|
26
|
+
for (let source = path_1.default.resolve(moduleDir); source !== path_1.default.dirname(source) && isWithinRoot(root, source); source = path_1.default.dirname(source)) {
|
|
21
27
|
const candidate = path_1.default.join(source, common_1.NODE_MODULES_DIR, dependency);
|
|
22
28
|
if ((0, fs_1.existsSync)(candidate)) {
|
|
23
29
|
return candidate;
|
|
@@ -25,30 +31,46 @@ async function dependencyDir(moduleDir, dependency) {
|
|
|
25
31
|
}
|
|
26
32
|
return null;
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
exports.DEFAULT_COPY_DEPENDENCIES_OPTIONS = {
|
|
35
|
+
exclude: ['@forge/react', '@forge/bridge']
|
|
36
|
+
};
|
|
37
|
+
async function getProductionDependencies(moduleDir, options) {
|
|
38
|
+
const result = new Map();
|
|
39
|
+
await enumerateProductionDependencies(moduleDir, options ?? {}, moduleDir, result, new Set());
|
|
40
|
+
return result;
|
|
31
41
|
}
|
|
32
|
-
async function
|
|
42
|
+
async function enumerateProductionDependencies(moduleDir, options, root, result, visited) {
|
|
33
43
|
const packageDef = await readPackageJSON(moduleDir);
|
|
34
|
-
if (!packageDef) {
|
|
44
|
+
if (!packageDef?.dependencies) {
|
|
35
45
|
return;
|
|
36
46
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
if (exclude.includes(dependency)) {
|
|
47
|
+
for (const dependency of Object.keys(packageDef.dependencies)) {
|
|
48
|
+
if (options.exclude?.includes(dependency)) {
|
|
40
49
|
continue;
|
|
41
50
|
}
|
|
42
|
-
const source = await dependencyDir(moduleDir, dependency);
|
|
51
|
+
const source = await dependencyDir(moduleDir, dependency, root);
|
|
43
52
|
if (source) {
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
if (!isWithinRoot(root, source)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const destination = path_1.default.relative(root, source);
|
|
57
|
+
if (visited.has(destination)) {
|
|
46
58
|
continue;
|
|
47
59
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
visited.add(destination);
|
|
61
|
+
for (const entry of await (0, promises_1.readdir)(source)) {
|
|
62
|
+
if (entry === common_1.NODE_MODULES_DIR) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
result.set(path_1.default.join(destination, entry), path_1.default.join(source, entry));
|
|
66
|
+
}
|
|
67
|
+
await enumerateProductionDependencies(source, options, root, result, visited);
|
|
52
68
|
}
|
|
53
69
|
}
|
|
54
70
|
}
|
|
71
|
+
async function copyProductionDependencies(moduleDir, target, options) {
|
|
72
|
+
const dependencies = await getProductionDependencies(moduleDir, options);
|
|
73
|
+
for (const [destination, source] of dependencies.entries()) {
|
|
74
|
+
await (0, fs_extra_1.copy)(source, path_1.default.join(target, destination));
|
|
75
|
+
}
|
|
76
|
+
}
|
package/out/runtime.d.ts
CHANGED
|
@@ -2,6 +2,5 @@ import { ConfigReader, Logger, StatsigService } from '@forge/cli-shared';
|
|
|
2
2
|
import { Bundler } from './types';
|
|
3
3
|
import { WrapperProvider } from './wrapper-provider';
|
|
4
4
|
export declare const NODE_RUNTIME_CODE_FILE = "__forge__.cjs";
|
|
5
|
-
export declare function userCodePath(entryKey: string): string;
|
|
6
5
|
export declare function getNodeBundler(logger: Logger, wrapperProvider: WrapperProvider, configReader: ConfigReader, statsigService: StatsigService): Bundler;
|
|
7
6
|
//# sourceMappingURL=runtime.d.ts.map
|
package/out/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAEZ,MAAM,EAEN,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,OAAO,EAAkF,MAAM,SAAS,CAAC;AAGlH,OAAO,EAAiB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMpE,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAEZ,MAAM,EAEN,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,OAAO,EAAkF,MAAM,SAAS,CAAC;AAGlH,OAAO,EAAiB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMpE,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAkLtD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC7B,OAAO,CAET"}
|
package/out/runtime.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NODE_RUNTIME_CODE_FILE = void 0;
|
|
4
|
-
exports.userCodePath = userCodePath;
|
|
5
4
|
exports.getNodeBundler = getNodeBundler;
|
|
6
5
|
const tslib_1 = require("tslib");
|
|
7
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
@@ -18,10 +17,6 @@ exports.NODE_RUNTIME_CODE_FILE = '__forge__.cjs';
|
|
|
18
17
|
const NODE_RUNTIME_BACKUP_WRAPPER_FILE = '__forge_wrapper__.cjs';
|
|
19
18
|
const NODE_RUNTIME_USE_LOCAL_WRAPPER_FILE = '__forge_use_local_wrapper.txt';
|
|
20
19
|
const NODE_RUNTIME_VERSION_FILE = 'runtime.json';
|
|
21
|
-
const NODE_WEBPACK_USER_CODE_DIR = 'bundled';
|
|
22
|
-
function userCodePath(entryKey) {
|
|
23
|
-
return path_1.default.join(path_1.default.dirname(entryKey), NODE_WEBPACK_USER_CODE_DIR, path_1.default.basename(entryKey));
|
|
24
|
-
}
|
|
25
20
|
async function emitWrapperFiles(provider, emit) {
|
|
26
21
|
const wrapper = await provider.getNodeRuntimeWrapper();
|
|
27
22
|
const loader = await provider.getNodeRuntimeLoader();
|
|
@@ -82,8 +77,8 @@ class TypeScriptNodeBundler extends typescript_1.TypeScriptBundler {
|
|
|
82
77
|
super(logger);
|
|
83
78
|
this.wrapperProvider = wrapperProvider;
|
|
84
79
|
}
|
|
85
|
-
async getResult(args, outputDir, output) {
|
|
86
|
-
const result = await super.getResult(args, outputDir, output);
|
|
80
|
+
async getResult(args, outputDir, output, additionalOutputs) {
|
|
81
|
+
const result = await super.getResult(args, outputDir, output, additionalOutputs);
|
|
87
82
|
const emit = async (name, contents) => {
|
|
88
83
|
const outputPath = path_1.default.join(outputDir, name);
|
|
89
84
|
await promises_1.default.mkdir(path_1.default.dirname(outputPath), { recursive: true });
|
package/out/types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare function emptyMetadata(): BundlerMetadata;
|
|
|
14
14
|
export declare function mergeMetadata(metadata1: BundlerMetadata, metadata2: BundlerMetadata): BundlerMetadata;
|
|
15
15
|
export interface BundlerOutput {
|
|
16
16
|
outputDir: string;
|
|
17
|
+
additionalOutputs?: Map<string, string>;
|
|
17
18
|
metadata?: BundlerMetadata;
|
|
18
19
|
}
|
|
19
20
|
export type BundlerWatchMode = 'watch' | 'debug';
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,aAAa,IAAI,eAAe,CAS/C;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,eAAe,CAarG;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.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gB,GAAG,WAAW,GACxC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,GAAG;IACzC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG;IACzB,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CAC1G,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,IAAI,IAAI,IAAI,CAAC;CACd;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG;IAChD,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjF,CAAC;AAEF,qBAAa,YAAa,SAAQ,SAAS;CAAG"}
|
package/out/typescript.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare abstract class TypeScriptBundler implements Bundler {
|
|
|
8
8
|
constructor(logger: Logger);
|
|
9
9
|
protected runTypeScript(args: BundlerArgs, outputDir: string): OutputProcess;
|
|
10
10
|
protected isListedFile(line: string): string | null;
|
|
11
|
-
protected getResult(args: BundlerArgs, outputDir: string, output?: string): Promise<BundlerOutput>;
|
|
11
|
+
protected getResult(args: BundlerArgs, outputDir: string, output?: string, additionalOutputs?: Map<string, string>): Promise<BundlerOutput>;
|
|
12
12
|
bundle(args: BundlerArgs): Promise<BundlerOutput>;
|
|
13
13
|
watch(args: BundlerWatchArgs, watch: BundlerWatch): Promise<BundlerWatchOutput>;
|
|
14
14
|
}
|
package/out/typescript.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIlC,OAAO,EAA4B,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIlC,OAAO,EAA4B,MAAM,EAAE,MAAM,mBAAmB,CAAC;AASrE,OAAO,EACL,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAGjB,KAAK,aAAa,GAAG,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAE/D,8BAAsB,iBAAkB,YAAW,OAAO;IAC5C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;IAE7C,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa;IAwB5E,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;cAWnC,SAAS,CACvB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,aAAa,CAAC;IAkBnB,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IA4BjD,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2DtF"}
|
package/out/typescript.js
CHANGED
|
@@ -12,9 +12,6 @@ const dependencies_1 = require("./dependencies");
|
|
|
12
12
|
const text_1 = require("./text");
|
|
13
13
|
const types_1 = require("./types");
|
|
14
14
|
const metadata_1 = require("./metadata");
|
|
15
|
-
const COPY_DEPENDENCIES_OPTIONS = {
|
|
16
|
-
exclude: ['@forge/react', '@forge/bridge']
|
|
17
|
-
};
|
|
18
15
|
class TypeScriptBundler {
|
|
19
16
|
logger;
|
|
20
17
|
constructor(logger) {
|
|
@@ -48,7 +45,7 @@ class TypeScriptBundler {
|
|
|
48
45
|
}
|
|
49
46
|
return line;
|
|
50
47
|
}
|
|
51
|
-
async getResult(args, outputDir, output) {
|
|
48
|
+
async getResult(args, outputDir, output, additionalOutputs) {
|
|
52
49
|
let metadata;
|
|
53
50
|
if (output) {
|
|
54
51
|
const files = new Set();
|
|
@@ -64,11 +61,11 @@ class TypeScriptBundler {
|
|
|
64
61
|
metadata = (0, types_1.emptyMetadata)();
|
|
65
62
|
}
|
|
66
63
|
metadata.bundler = 'typescript';
|
|
67
|
-
return { outputDir, metadata };
|
|
64
|
+
return { outputDir, metadata, additionalOutputs };
|
|
68
65
|
}
|
|
69
66
|
async bundle(args) {
|
|
70
67
|
const outputDir = (0, common_1.getOutputDir)(args);
|
|
71
|
-
await (0, dependencies_1.
|
|
68
|
+
const additionalOutputs = await (0, dependencies_1.getProductionDependencies)(args.appDirectory, dependencies_1.DEFAULT_COPY_DEPENDENCIES_OPTIONS);
|
|
72
69
|
const compiler = this.runTypeScript(args, outputDir);
|
|
73
70
|
let output = '';
|
|
74
71
|
compiler.stdout.on('data', (data) => (output += data.toString()));
|
|
@@ -78,7 +75,7 @@ class TypeScriptBundler {
|
|
|
78
75
|
const errors = output.split('\n').filter((line) => !this.isListedFile(line));
|
|
79
76
|
throw new cli_shared_1.BundlerTSError(text_1.Text.typescriptError(errors));
|
|
80
77
|
}
|
|
81
|
-
const result = await this.getResult(args, outputDir, output);
|
|
78
|
+
const result = await this.getResult(args, outputDir, output, additionalOutputs);
|
|
82
79
|
resolve(result);
|
|
83
80
|
}
|
|
84
81
|
catch (e) {
|
|
@@ -88,7 +85,7 @@ class TypeScriptBundler {
|
|
|
88
85
|
}
|
|
89
86
|
async watch(args, watch) {
|
|
90
87
|
const outputDir = (0, common_1.getOutputDir)(args);
|
|
91
|
-
await (0, dependencies_1.copyProductionDependencies)(args.appDirectory, outputDir,
|
|
88
|
+
await (0, dependencies_1.copyProductionDependencies)(args.appDirectory, outputDir, dependencies_1.DEFAULT_COPY_DEPENDENCIES_OPTIONS);
|
|
92
89
|
const compiler = this.runTypeScript(args, outputDir);
|
|
93
90
|
let isFirstRun = true;
|
|
94
91
|
const output = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper-provider.d.ts","sourceRoot":"","sources":["../src/wrapper-provider.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,SAAS,EAGT,cAAc,EACf,MAAM,mBAAmB,CAAC;AAW3B,qBAAa,yBAA0B,SAAQ,SAAS;;CAIvD;AAED,qBAAa,mBAAoB,SAAQ,SAAS;gBACpC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAGhD;AAED,qBAAa,yBAA0B,SAAQ,SAAS;gBAC1C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS;CAG3D;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,qBAAqB,IAAI,OAAO,CAAC,aAAa,CAAC,CAA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C,CAAC;IAChD,oBAAoB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;CAC5D;AAOD,qBAAa,oBAAqB,YAAW,eAAe;IAExD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,MAAM;YAExB,cAAc;IAatB,qBAAqB,IAAI,OAAO,CAAC,aAAa,CAAC;IAI/C,oBAAoB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAGjE;AAED,qBAAa,sBAAuB,YAAW,eAAe;IAKhD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc;IAJ7D,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,MAAM,CAA4B;IAC1C,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEM,cAAc,EAAE,cAAc;YAI/C,sBAAsB;IAgBpC,OAAO,CAAC,cAAc,CAuCpB;IAEI,qBAAqB,IAAI,OAAO,CAAC,aAAa,CAAC;IAO/C,oBAAoB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAQjE;AAED,eAAO,MAAM,kBAAkB,GAAI,sCAGhC;IACD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,EAAE,cAAc,CAAC;CAChC,kDAQA,CAAC"}
|
package/out/wrapper-provider.js
CHANGED
|
@@ -22,7 +22,7 @@ class LocalWrapperNotFoundError extends cli_shared_1.UserError {
|
|
|
22
22
|
exports.LocalWrapperNotFoundError = LocalWrapperNotFoundError;
|
|
23
23
|
class WrapperNetworkError extends cli_shared_1.BaseError {
|
|
24
24
|
constructor(message, requestId) {
|
|
25
|
-
super(
|
|
25
|
+
super(requestId, message);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.WrapperNetworkError = WrapperNetworkError;
|
|
@@ -105,6 +105,9 @@ class NetworkWrapperProvider {
|
|
|
105
105
|
if (e instanceof ParseWrapperCDNIndexError) {
|
|
106
106
|
throw e;
|
|
107
107
|
}
|
|
108
|
+
if (e instanceof WrapperNetworkError) {
|
|
109
|
+
throw e;
|
|
110
|
+
}
|
|
108
111
|
throw new WrapperNetworkError(e instanceof Error ? e.message : 'Networking error when retrieving runtime component, retry the command.');
|
|
109
112
|
}
|
|
110
113
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bundler",
|
|
3
|
-
"version": "7.0.2-next.
|
|
3
|
+
"version": "7.0.2-next.11",
|
|
4
4
|
"description": "Default bundler for Forge apps",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"@babel/plugin-transform-react-jsx": "^7.23.4",
|
|
22
22
|
"@babel/traverse": "^7.24.0",
|
|
23
23
|
"@babel/types": "^7.24.0",
|
|
24
|
-
"@forge/cli-shared": "9.
|
|
24
|
+
"@forge/cli-shared": "9.2.0-next.10",
|
|
25
25
|
"@forge/i18n": "1.0.0",
|
|
26
|
-
"@forge/lint": "6.0.2-next.
|
|
27
|
-
"@forge/manifest": "13.
|
|
26
|
+
"@forge/lint": "6.0.2-next.11",
|
|
27
|
+
"@forge/manifest": "13.2.0-next.5",
|
|
28
28
|
"babel-loader": "^8.3.0",
|
|
29
29
|
"cheerio": "^1.2.0",
|
|
30
30
|
"cross-spawn": "^7.0.6",
|