@forge/bundler 7.1.0-next.8 → 7.1.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 +163 -0
- package/out/common.d.ts +0 -1
- package/out/common.d.ts.map +1 -1
- package/out/common.js +3 -3
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -1
- package/out/lint.d.ts.map +1 -1
- package/out/lint.js +5 -1
- package/out/runtime.d.ts +2 -0
- package/out/runtime.d.ts.map +1 -1
- package/out/runtime.js +81 -38
- package/out/text.d.ts +2 -1
- package/out/text.d.ts.map +1 -1
- package/out/text.js +2 -1
- package/out/types.d.ts +4 -2
- package/out/types.d.ts.map +1 -1
- package/out/types.js +4 -0
- package/out/typescript.d.ts +2 -2
- package/out/typescript.d.ts.map +1 -1
- package/out/typescript.js +6 -2
- package/out/webpack.d.ts +4 -3
- package/out/webpack.d.ts.map +1 -1
- package/out/webpack.js +3 -2
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,168 @@
|
|
|
1
1
|
# @forge/bundler
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 342098d: Implement server-side linter logic to prevent accidental major app version deployments
|
|
8
|
+
- a36d70b: Implement manual bundler
|
|
9
|
+
- d1610cc: Manual runtime packaging option
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4b90a07: Lint target directory when using the manual packaging
|
|
14
|
+
- Updated dependencies [4d50a76]
|
|
15
|
+
- Updated dependencies [905d8c5]
|
|
16
|
+
- Updated dependencies [0f6f64f]
|
|
17
|
+
- Updated dependencies [8a9e608]
|
|
18
|
+
- Updated dependencies [f01417b]
|
|
19
|
+
- Updated dependencies [18b920d]
|
|
20
|
+
- Updated dependencies [d706cd8]
|
|
21
|
+
- Updated dependencies [342098d]
|
|
22
|
+
- Updated dependencies [c8105d8]
|
|
23
|
+
- Updated dependencies [4b90a07]
|
|
24
|
+
- Updated dependencies [3e8de63]
|
|
25
|
+
- Updated dependencies [cddef39]
|
|
26
|
+
- Updated dependencies [0949833]
|
|
27
|
+
- Updated dependencies [a36d70b]
|
|
28
|
+
- Updated dependencies [d1610cc]
|
|
29
|
+
- Updated dependencies [52e074e]
|
|
30
|
+
- Updated dependencies [8d20095]
|
|
31
|
+
- Updated dependencies [e7bfe5e]
|
|
32
|
+
- Updated dependencies [bc2d278]
|
|
33
|
+
- Updated dependencies [498fda5]
|
|
34
|
+
- Updated dependencies [ca4fa27]
|
|
35
|
+
- Updated dependencies [4404f62]
|
|
36
|
+
- Updated dependencies [89ccb1e]
|
|
37
|
+
- Updated dependencies [39f1f15]
|
|
38
|
+
- Updated dependencies [c3a0f20]
|
|
39
|
+
- @forge/cli-shared@9.3.0
|
|
40
|
+
- @forge/lint@6.1.0
|
|
41
|
+
- @forge/manifest@13.3.0
|
|
42
|
+
|
|
43
|
+
## 7.1.0-next.22
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [cddef39]
|
|
48
|
+
- @forge/cli-shared@9.3.0-next.20
|
|
49
|
+
- @forge/manifest@13.3.0-next.11
|
|
50
|
+
- @forge/lint@6.1.0-next.22
|
|
51
|
+
|
|
52
|
+
## 7.1.0-next.21
|
|
53
|
+
|
|
54
|
+
### Minor Changes
|
|
55
|
+
|
|
56
|
+
- 342098d: Implement server-side linter logic to prevent accidental major app version deployments
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- Updated dependencies [342098d]
|
|
61
|
+
- @forge/cli-shared@9.3.0-next.19
|
|
62
|
+
- @forge/lint@6.1.0-next.21
|
|
63
|
+
|
|
64
|
+
## 7.1.0-next.20
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- @forge/lint@6.0.3-next.20
|
|
69
|
+
|
|
70
|
+
## 7.1.0-next.19
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [4404f62]
|
|
75
|
+
- @forge/manifest@13.3.0-next.10
|
|
76
|
+
- @forge/cli-shared@9.3.0-next.18
|
|
77
|
+
- @forge/lint@6.0.3-next.19
|
|
78
|
+
|
|
79
|
+
## 7.1.0-next.18
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Updated dependencies [8d20095]
|
|
84
|
+
- @forge/cli-shared@9.3.0-next.17
|
|
85
|
+
- @forge/lint@6.0.3-next.18
|
|
86
|
+
|
|
87
|
+
## 7.1.0-next.17
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [905d8c5]
|
|
92
|
+
- @forge/cli-shared@9.3.0-next.16
|
|
93
|
+
- @forge/lint@6.0.3-next.17
|
|
94
|
+
|
|
95
|
+
## 7.1.0-next.16
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- Updated dependencies [52e074e]
|
|
100
|
+
- @forge/cli-shared@9.3.0-next.15
|
|
101
|
+
- @forge/lint@6.0.3-next.16
|
|
102
|
+
|
|
103
|
+
## 7.1.0-next.15
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [c8105d8]
|
|
108
|
+
- Updated dependencies [3e8de63]
|
|
109
|
+
- @forge/cli-shared@9.3.0-next.14
|
|
110
|
+
- @forge/manifest@13.3.0-next.9
|
|
111
|
+
- @forge/lint@6.0.3-next.15
|
|
112
|
+
|
|
113
|
+
## 7.1.0-next.14
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Updated dependencies [8a9e608]
|
|
118
|
+
- @forge/cli-shared@9.3.0-next.13
|
|
119
|
+
- @forge/lint@6.0.3-next.14
|
|
120
|
+
|
|
121
|
+
## 7.1.0-next.13
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- 4b90a07: Lint target directory when using the manual packaging
|
|
126
|
+
- Updated dependencies [4b90a07]
|
|
127
|
+
- @forge/manifest@13.3.0-next.8
|
|
128
|
+
- @forge/lint@6.0.3-next.13
|
|
129
|
+
- @forge/cli-shared@9.3.0-next.12
|
|
130
|
+
|
|
131
|
+
## 7.1.0-next.12
|
|
132
|
+
|
|
133
|
+
### Patch Changes
|
|
134
|
+
|
|
135
|
+
- Updated dependencies [18b920d]
|
|
136
|
+
- @forge/cli-shared@9.3.0-next.11
|
|
137
|
+
- @forge/lint@6.0.3-next.12
|
|
138
|
+
|
|
139
|
+
## 7.1.0-next.11
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [0f6f64f]
|
|
144
|
+
- @forge/lint@6.0.3-next.11
|
|
145
|
+
|
|
146
|
+
## 7.1.0-next.10
|
|
147
|
+
|
|
148
|
+
### Patch Changes
|
|
149
|
+
|
|
150
|
+
- Updated dependencies [bc2d278]
|
|
151
|
+
- @forge/cli-shared@9.3.0-next.10
|
|
152
|
+
- @forge/lint@6.0.3-next.10
|
|
153
|
+
|
|
154
|
+
## 7.1.0-next.9
|
|
155
|
+
|
|
156
|
+
### Minor Changes
|
|
157
|
+
|
|
158
|
+
- a36d70b: Implement manual bundler
|
|
159
|
+
|
|
160
|
+
### Patch Changes
|
|
161
|
+
|
|
162
|
+
- Updated dependencies [a36d70b]
|
|
163
|
+
- @forge/cli-shared@9.3.0-next.9
|
|
164
|
+
- @forge/lint@6.0.3-next.9
|
|
165
|
+
|
|
3
166
|
## 7.1.0-next.8
|
|
4
167
|
|
|
5
168
|
### Patch Changes
|
package/out/common.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Handler } from '@forge/cli-shared';
|
|
2
2
|
import { BundlerArgs, EntryPoint } from './types';
|
|
3
3
|
export declare function getOutputDir(args: Pick<BundlerArgs, 'watchMode'>): string;
|
|
4
|
-
export declare const SOURCE_DIR = "src";
|
|
5
4
|
export declare const NODE_MODULES_DIR = "node_modules";
|
|
6
5
|
export declare function getEntryPoints(handlers: Handler[]): EntryPoint[];
|
|
7
6
|
export declare function createEntryPointsForResource(resourceKey: string, resourcePath: string, entry?: Record<string, string>): EntryPoint[];
|
package/out/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAmC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAmC,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAElD,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,CAKzE;AAED,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAOhE;AAgBD,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,UAAU,EAAE,CAYd"}
|
package/out/common.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NODE_MODULES_DIR =
|
|
3
|
+
exports.NODE_MODULES_DIR = void 0;
|
|
4
4
|
exports.getOutputDir = getOutputDir;
|
|
5
5
|
exports.getEntryPoints = getEntryPoints;
|
|
6
6
|
exports.createEntryPointsForResource = createEntryPointsForResource;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
10
|
+
const manifest_1 = require("@forge/manifest");
|
|
10
11
|
function getOutputDir(args) {
|
|
11
12
|
const outputDir = args.watchMode === 'debug' ? path_1.default.resolve(cli_shared_1.TUNNEL_BUNDLE_DIRECTORY) : (0, cli_shared_1.tmpDir)('dist');
|
|
12
13
|
return outputDir;
|
|
13
14
|
}
|
|
14
|
-
exports.SOURCE_DIR = 'src';
|
|
15
15
|
exports.NODE_MODULES_DIR = 'node_modules';
|
|
16
16
|
function getEntryPoints(handlers) {
|
|
17
17
|
const modules = new Set(handlers.map(({ module }) => module));
|
|
18
18
|
return Array.from(modules).map((module) => ({
|
|
19
19
|
name: module,
|
|
20
|
-
path: path_1.default.resolve(
|
|
20
|
+
path: path_1.default.resolve(manifest_1.SOURCE_DIRECTORY, module)
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
23
|
function createEntryPointsForResource(resourceKey, resourcePath, entry) {
|
package/out/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { getOutputDir, getEntryPoints, createEntryPointsForResource } from './co
|
|
|
2
2
|
export { runLinter } from './lint';
|
|
3
3
|
export { NativeUIBundler, NativeUIBundleResult } from './nativeui';
|
|
4
4
|
export { getNodeBundler, NODE_RUNTIME_CODE_FILE } from './runtime';
|
|
5
|
-
export { Bundler, BundlerError, BundlerMetadata, emptyMetadata, mergeMetadata, BundlerOutput, BundlerWatch, EntryPoint, WatcherMonitor } from './types';
|
|
5
|
+
export { AdditionalOutputs, Bundler, BundlerError, BundlerMetadata, emptyMetadata, mergeMetadata, mergeOutputs, BundlerOutput, BundlerWatch, EntryPoint, WatcherMonitor } from './types';
|
|
6
6
|
export { getCompiler, handleWebpackCompilationResult } from './webpack';
|
|
7
7
|
export { getNativeUiBuildConfig, getNativeUiWorkerBuildConfig } from './config/nativeui';
|
|
8
8
|
export { getWrapperProvider, LocalWrapperProvider } from './wrapper-provider';
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocalWrapperProvider = exports.getWrapperProvider = exports.getNativeUiWorkerBuildConfig = exports.getNativeUiBuildConfig = exports.handleWebpackCompilationResult = exports.getCompiler = exports.mergeMetadata = exports.emptyMetadata = exports.BundlerError = exports.NODE_RUNTIME_CODE_FILE = exports.getNodeBundler = exports.NativeUIBundler = exports.runLinter = exports.createEntryPointsForResource = exports.getEntryPoints = exports.getOutputDir = void 0;
|
|
3
|
+
exports.LocalWrapperProvider = exports.getWrapperProvider = exports.getNativeUiWorkerBuildConfig = exports.getNativeUiBuildConfig = exports.handleWebpackCompilationResult = exports.getCompiler = exports.mergeOutputs = exports.mergeMetadata = exports.emptyMetadata = exports.BundlerError = exports.NODE_RUNTIME_CODE_FILE = exports.getNodeBundler = exports.NativeUIBundler = exports.runLinter = exports.createEntryPointsForResource = exports.getEntryPoints = exports.getOutputDir = void 0;
|
|
4
4
|
var common_1 = require("./common");
|
|
5
5
|
Object.defineProperty(exports, "getOutputDir", { enumerable: true, get: function () { return common_1.getOutputDir; } });
|
|
6
6
|
Object.defineProperty(exports, "getEntryPoints", { enumerable: true, get: function () { return common_1.getEntryPoints; } });
|
|
@@ -16,6 +16,7 @@ var types_1 = require("./types");
|
|
|
16
16
|
Object.defineProperty(exports, "BundlerError", { enumerable: true, get: function () { return types_1.BundlerError; } });
|
|
17
17
|
Object.defineProperty(exports, "emptyMetadata", { enumerable: true, get: function () { return types_1.emptyMetadata; } });
|
|
18
18
|
Object.defineProperty(exports, "mergeMetadata", { enumerable: true, get: function () { return types_1.mergeMetadata; } });
|
|
19
|
+
Object.defineProperty(exports, "mergeOutputs", { enumerable: true, get: function () { return types_1.mergeOutputs; } });
|
|
19
20
|
var webpack_1 = require("./webpack");
|
|
20
21
|
Object.defineProperty(exports, "getCompiler", { enumerable: true, get: function () { return webpack_1.getCompiler; } });
|
|
21
22
|
Object.defineProperty(exports, "handleWebpackCompilationResult", { enumerable: true, get: function () { return webpack_1.handleWebpackCompilationResult; } });
|
package/out/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EAGhB,gBAAgB,EAEhB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,UAAU,EAAE,MAAM,aAAa,CAAC;AAIlE,wBAAsB,SAAS,CAC7B,cAAc,EAAE,cAAc,EAE9B,MAAM,GAAE,UAAkC,EAC1C,gBAAgB,mBAAyB,EACzC,gBAAgB,mBAAyB,GACxC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EAGhB,gBAAgB,EAEhB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,UAAU,EAAE,MAAM,aAAa,CAAC;AAIlE,wBAAsB,SAAS,CAC7B,cAAc,EAAE,cAAc,EAE9B,MAAM,GAAE,UAAkC,EAC1C,gBAAgB,mBAAyB,EACzC,gBAAgB,mBAAyB,GACxC,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
|
package/out/lint.js
CHANGED
|
@@ -19,7 +19,11 @@ async function runLinter(statsigService, logger = { info: console.log }, fileSys
|
|
|
19
19
|
]);
|
|
20
20
|
const UIKitFilesToLint = UIKitFilesByDirectory.reduce((allFiles, directoryFiles) => allFiles.concat(directoryFiles), []);
|
|
21
21
|
try {
|
|
22
|
-
const lintResults = await (0, lint_1.lint)([...filesToLint, ...UIKitFilesToLint], manifest, 'development', logger, statsigService
|
|
22
|
+
const lintResults = await (0, lint_1.lint)([...filesToLint, ...UIKitFilesToLint], manifest, 'development', logger, statsigService, {
|
|
23
|
+
linter: {
|
|
24
|
+
mode: 'client-side'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
23
27
|
if (lintResults.some((result) => result.size())) {
|
|
24
28
|
logger.info('');
|
|
25
29
|
(0, lint_1.reportLintResults)(logger, lintResults);
|
package/out/runtime.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ConfigReader, Logger, StatsigService } from '@forge/cli-shared';
|
|
2
|
+
import { ManifestSchema } from '@forge/manifest';
|
|
2
3
|
import { Bundler } from './types';
|
|
3
4
|
import { WrapperProvider } from './wrapper-provider';
|
|
5
|
+
export type PackageOptions = NonNullable<ManifestSchema['app']['package']>;
|
|
4
6
|
export declare const NODE_RUNTIME_CODE_FILE = "__forge__.cjs";
|
|
5
7
|
export declare function getNodeBundler(logger: Logger, wrapperProvider: WrapperProvider, configReader: ConfigReader, statsigService: StatsigService): Bundler;
|
|
6
8
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAiC,cAAc,EAAa,MAAM,mBAAmB,CAAC;AAEnH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,OAAO,EAEL,OAAO,EAOR,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAiB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAK3E,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAkOtD,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
|
@@ -4,43 +4,45 @@ exports.NODE_RUNTIME_CODE_FILE = void 0;
|
|
|
4
4
|
exports.getNodeBundler = getNodeBundler;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
var RawSource = webpack_1.default.sources.RawSource;
|
|
7
|
+
const chokidar_1 = tslib_1.__importDefault(require("chokidar"));
|
|
8
|
+
const debounce_1 = tslib_1.__importDefault(require("debounce"));
|
|
10
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
11
10
|
const i18n_1 = require("@forge/i18n");
|
|
12
11
|
const common_1 = require("./config/common");
|
|
13
|
-
const
|
|
14
|
-
const webpack_2 = require("./webpack");
|
|
12
|
+
const metadata_1 = require("./metadata");
|
|
15
13
|
const text_1 = require("./text");
|
|
14
|
+
const types_1 = require("./types");
|
|
15
|
+
const typescript_1 = require("./typescript");
|
|
16
|
+
const webpack_1 = require("./webpack");
|
|
16
17
|
exports.NODE_RUNTIME_CODE_FILE = '__forge__.cjs';
|
|
17
18
|
const NODE_RUNTIME_BACKUP_WRAPPER_FILE = '__forge_wrapper__.cjs';
|
|
18
19
|
const NODE_RUNTIME_USE_LOCAL_WRAPPER_FILE = '__forge_use_local_wrapper.txt';
|
|
19
20
|
const NODE_RUNTIME_VERSION_FILE = 'runtime.json';
|
|
20
|
-
async function
|
|
21
|
+
async function getRuntimeArtifacts(provider, args) {
|
|
22
|
+
const result = new Map();
|
|
21
23
|
const wrapper = await provider.getNodeRuntimeWrapper();
|
|
22
24
|
const loader = await provider.getNodeRuntimeLoader();
|
|
23
25
|
let entrypointScript;
|
|
24
26
|
if (loader) {
|
|
25
27
|
entrypointScript = loader;
|
|
26
|
-
|
|
28
|
+
result.set(NODE_RUNTIME_BACKUP_WRAPPER_FILE, Buffer.from(wrapper.script));
|
|
27
29
|
}
|
|
28
30
|
else {
|
|
29
31
|
entrypointScript = wrapper;
|
|
30
32
|
}
|
|
31
|
-
|
|
33
|
+
result.set(exports.NODE_RUNTIME_CODE_FILE, Buffer.from(entrypointScript.script));
|
|
32
34
|
if (process.env.FORGE_RUNTIME_PATH) {
|
|
33
|
-
|
|
35
|
+
result.set(NODE_RUNTIME_USE_LOCAL_WRAPPER_FILE, Buffer.from('Local wrapper used'));
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
result.set(NODE_RUNTIME_VERSION_FILE, Buffer.from(JSON.stringify({ version: entrypointScript.version }, null, 2)));
|
|
38
|
+
if (args.i18nResourceBundle) {
|
|
39
|
+
for (const [fileName, filePath] of (0, cli_shared_1.listFilesInI18nResourceBundle)(args.i18nResourceBundle)) {
|
|
40
|
+
result.set(path_1.default.join(i18n_1.I18N_BUNDLE_FOLDER_NAME, fileName), filePath);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
42
44
|
}
|
|
43
|
-
class NodeBundler extends
|
|
45
|
+
class NodeBundler extends webpack_1.WebpackBundler {
|
|
44
46
|
wrapperProvider;
|
|
45
47
|
constructor(logger, wrapperProvider) {
|
|
46
48
|
super(logger);
|
|
@@ -57,19 +59,13 @@ class NodeBundler extends webpack_2.WebpackBundler {
|
|
|
57
59
|
fullySpecified: false
|
|
58
60
|
}
|
|
59
61
|
});
|
|
60
|
-
webpackConfig.plugins.push({
|
|
61
|
-
apply: (compiler) => {
|
|
62
|
-
compiler.hooks.make.tapPromise('AfterEmitPlugin', async (compilation) => {
|
|
63
|
-
const emit = async (name, contents) => compilation.emitAsset(name, new RawSource(contents));
|
|
64
|
-
await emitWrapperFiles(this.wrapperProvider, emit);
|
|
65
|
-
if (args.i18nResourceBundle) {
|
|
66
|
-
await emitI18nFiles(args.i18nResourceBundle, emit);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
62
|
return [webpackConfig];
|
|
72
63
|
}
|
|
64
|
+
async getOutput(args, config, stats) {
|
|
65
|
+
const result = await super.getOutput(args, config, stats);
|
|
66
|
+
result.additionalOutputs = (0, types_1.mergeOutputs)(result.additionalOutputs, await getRuntimeArtifacts(this.wrapperProvider, args));
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
73
69
|
}
|
|
74
70
|
class TypeScriptNodeBundler extends typescript_1.TypeScriptBundler {
|
|
75
71
|
wrapperProvider;
|
|
@@ -79,18 +75,62 @@ class TypeScriptNodeBundler extends typescript_1.TypeScriptBundler {
|
|
|
79
75
|
}
|
|
80
76
|
async getResult(args, outputDir, output, additionalOutputs) {
|
|
81
77
|
const result = await super.getResult(args, outputDir, output, additionalOutputs);
|
|
82
|
-
|
|
83
|
-
const outputPath = path_1.default.join(outputDir, name);
|
|
84
|
-
await promises_1.default.mkdir(path_1.default.dirname(outputPath), { recursive: true });
|
|
85
|
-
await promises_1.default.writeFile(outputPath, contents);
|
|
86
|
-
};
|
|
87
|
-
await emitWrapperFiles(this.wrapperProvider, emit);
|
|
88
|
-
if (args.i18nResourceBundle) {
|
|
89
|
-
await emitI18nFiles(args.i18nResourceBundle, emit);
|
|
90
|
-
}
|
|
78
|
+
result.additionalOutputs = (0, types_1.mergeOutputs)(result.additionalOutputs, await getRuntimeArtifacts(this.wrapperProvider, args));
|
|
91
79
|
return result;
|
|
92
80
|
}
|
|
93
81
|
}
|
|
82
|
+
class ManualBundler {
|
|
83
|
+
logger;
|
|
84
|
+
wrapperProvider;
|
|
85
|
+
static WATCH_DEBOUNCE_MS = 200;
|
|
86
|
+
path;
|
|
87
|
+
constructor(config, logger, wrapperProvider) {
|
|
88
|
+
this.logger = logger;
|
|
89
|
+
this.wrapperProvider = wrapperProvider;
|
|
90
|
+
if (!config?.path) {
|
|
91
|
+
throw new cli_shared_1.UserError(text_1.Text.manualBundlerPathRequired);
|
|
92
|
+
}
|
|
93
|
+
this.path = config.path;
|
|
94
|
+
}
|
|
95
|
+
async bundle(args) {
|
|
96
|
+
const outputDir = path_1.default.join(args.appDirectory, this.path);
|
|
97
|
+
const additionalOutputs = await getRuntimeArtifacts(this.wrapperProvider, args);
|
|
98
|
+
const metadata = await (0, metadata_1.getMetadata)(this.logger, args.appDirectory, new Set());
|
|
99
|
+
metadata.bundler = 'manual@2026';
|
|
100
|
+
return { outputDir, additionalOutputs, metadata };
|
|
101
|
+
}
|
|
102
|
+
async watch(args, watch) {
|
|
103
|
+
const result = await this.bundle(args);
|
|
104
|
+
const watcher = chokidar_1.default.watch(result.outputDir, {
|
|
105
|
+
persistent: false,
|
|
106
|
+
ignoreInitial: true,
|
|
107
|
+
ignored: (path) => path.includes('node_modules')
|
|
108
|
+
});
|
|
109
|
+
const onChange = (0, debounce_1.default)(async () => {
|
|
110
|
+
await watch.onBuildWillStart();
|
|
111
|
+
try {
|
|
112
|
+
const nextResult = await this.bundle(args);
|
|
113
|
+
await watch.onBuildFinished(null, nextResult);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
await watch.onBuildFinished(error);
|
|
117
|
+
}
|
|
118
|
+
}, ManualBundler.WATCH_DEBOUNCE_MS);
|
|
119
|
+
watcher.on('all', () => void onChange());
|
|
120
|
+
watcher.on('error', (error) => void watch.onBuildFinished(error));
|
|
121
|
+
await new Promise((resolve, reject) => {
|
|
122
|
+
watcher.once('ready', resolve);
|
|
123
|
+
watcher.once('error', reject);
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
result,
|
|
127
|
+
stop: async () => {
|
|
128
|
+
onChange.clear();
|
|
129
|
+
await watcher.close();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
94
134
|
class ConfigBundler {
|
|
95
135
|
logger;
|
|
96
136
|
wrapperProvider;
|
|
@@ -104,6 +144,9 @@ class ConfigBundler {
|
|
|
104
144
|
}
|
|
105
145
|
async getBundler() {
|
|
106
146
|
const config = (await this.configReader.readConfig()).app.package;
|
|
147
|
+
if (config?.path && config?.bundler !== 'manual@2026') {
|
|
148
|
+
throw new cli_shared_1.UserError(text_1.Text.packagePathOnlySupportedForManualBundler);
|
|
149
|
+
}
|
|
107
150
|
if (config?.bundler === 'typescript') {
|
|
108
151
|
if (!(await this.statsigService.isTypescriptBundlerEnabled())) {
|
|
109
152
|
throw new cli_shared_1.UserError(text_1.Text.typescriptBundlerEAP);
|
|
@@ -111,7 +154,7 @@ class ConfigBundler {
|
|
|
111
154
|
return new TypeScriptNodeBundler(this.logger, this.wrapperProvider);
|
|
112
155
|
}
|
|
113
156
|
if (config?.bundler === 'manual@2026') {
|
|
114
|
-
|
|
157
|
+
return new ManualBundler(config, this.logger, this.wrapperProvider);
|
|
115
158
|
}
|
|
116
159
|
return new NodeBundler(this.logger, this.wrapperProvider);
|
|
117
160
|
}
|
package/out/text.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const Text: {
|
|
|
4
4
|
noExecutableFile: string;
|
|
5
5
|
metadataFailed: (error: Error) => string;
|
|
6
6
|
typescriptBundlerEAP: string;
|
|
7
|
-
|
|
7
|
+
manualBundlerPathRequired: string;
|
|
8
|
+
packagePathOnlySupportedForManualBundler: string;
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=text.d.ts.map
|
package/out/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;mCACgB,MAAM,EAAE;8BACb,MAAM,EAAE;;4BAKV,KAAK
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;mCACgB,MAAM,EAAE;8BACb,MAAM,EAAE;;4BAKV,KAAK;;;;CAI9B,CAAC"}
|
package/out/text.js
CHANGED
|
@@ -8,5 +8,6 @@ exports.Text = {
|
|
|
8
8
|
noExecutableFile: 'Could not find the main executable file',
|
|
9
9
|
metadataFailed: (error) => `Application code metadata processing failed: ${error.message}`,
|
|
10
10
|
typescriptBundlerEAP: `TypeScript bundler is a Forge EAP feature. Please see ${cli_shared_1.Text.go('dac/platform/forge/manifest-reference/#package')} for more details.`,
|
|
11
|
-
|
|
11
|
+
manualBundlerPathRequired: 'For manual packaging, the path to the packaged runtime code is required.',
|
|
12
|
+
packagePathOnlySupportedForManualBundler: 'The package path is only needed when the application is packaged manually.'
|
|
12
13
|
};
|
package/out/types.d.ts
CHANGED
|
@@ -12,11 +12,13 @@ export type BundlerMetadata = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare function emptyMetadata(): BundlerMetadata;
|
|
14
14
|
export declare function mergeMetadata(metadata1: BundlerMetadata, metadata2: BundlerMetadata): BundlerMetadata;
|
|
15
|
+
export type AdditionalOutputs = Map<string, string | Buffer>;
|
|
15
16
|
export interface BundlerOutput {
|
|
16
17
|
outputDir: string;
|
|
17
|
-
additionalOutputs?:
|
|
18
|
+
additionalOutputs?: AdditionalOutputs;
|
|
18
19
|
metadata?: BundlerMetadata;
|
|
19
20
|
}
|
|
21
|
+
export declare function mergeOutputs(outputs1: AdditionalOutputs | undefined, outputs2: AdditionalOutputs | undefined): AdditionalOutputs;
|
|
20
22
|
export type BundlerWatchMode = 'watch' | 'debug';
|
|
21
23
|
export type EntryPoint = {
|
|
22
24
|
name: string;
|
|
@@ -38,7 +40,7 @@ export type BundlerWatch = {
|
|
|
38
40
|
onBuildFinished: ((err: null, result: BundlerOutput) => Promise<void>) & ((err: Error) => Promise<void>);
|
|
39
41
|
};
|
|
40
42
|
export interface WatcherMonitor {
|
|
41
|
-
stop(): void
|
|
43
|
+
stop(): Promise<void>;
|
|
42
44
|
}
|
|
43
45
|
export type BundlerWatchOutput = WatcherMonitor & {
|
|
44
46
|
result: BundlerOutput;
|
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.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,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAQlB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,iBAAiB,GAAG,SAAS,EACvC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,GACtC,iBAAiB,CAEnB;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,gBAAgB,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,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;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/types.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BundlerError = void 0;
|
|
4
4
|
exports.emptyMetadata = emptyMetadata;
|
|
5
5
|
exports.mergeMetadata = mergeMetadata;
|
|
6
|
+
exports.mergeOutputs = mergeOutputs;
|
|
6
7
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
8
|
function emptyMetadata() {
|
|
8
9
|
return {
|
|
@@ -28,6 +29,9 @@ function mergeMetadata(metadata1, metadata2) {
|
|
|
28
29
|
bundler: metadata1.bundler || metadata2.bundler
|
|
29
30
|
};
|
|
30
31
|
}
|
|
32
|
+
function mergeOutputs(outputs1, outputs2) {
|
|
33
|
+
return new Map([...(outputs1 ?? []), ...(outputs2 ?? [])]);
|
|
34
|
+
}
|
|
31
35
|
class BundlerError extends cli_shared_1.UserError {
|
|
32
36
|
}
|
|
33
37
|
exports.BundlerError = BundlerError;
|
package/out/typescript.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ChildProcessByStdio } from 'child_process';
|
|
2
2
|
import { Readable } from 'stream';
|
|
3
3
|
import { Logger } from '@forge/cli-shared';
|
|
4
|
-
import { Bundler, BundlerOutput, BundlerArgs, BundlerWatch, BundlerWatchArgs, BundlerWatchOutput } from './types';
|
|
4
|
+
import { AdditionalOutputs, Bundler, BundlerOutput, BundlerArgs, BundlerWatch, BundlerWatchArgs, BundlerWatchOutput } from './types';
|
|
5
5
|
type OutputProcess = ChildProcessByStdio<null, Readable, null>;
|
|
6
6
|
export declare abstract class TypeScriptBundler implements Bundler {
|
|
7
7
|
protected readonly logger: Logger;
|
|
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, additionalOutputs?:
|
|
11
|
+
protected getResult(args: BundlerArgs, outputDir: string, output?: string, additionalOutputs?: AdditionalOutputs): 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;AAUrE,OAAO,EACL,iBAAiB,EACjB,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,iBAAiB,GACpC,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;CA8DtF"}
|
package/out/typescript.js
CHANGED
|
@@ -7,6 +7,7 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
7
7
|
const readline_1 = require("readline");
|
|
8
8
|
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
|
9
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
10
|
+
const manifest_1 = require("@forge/manifest");
|
|
10
11
|
const common_1 = require("./common");
|
|
11
12
|
const dependencies_1 = require("./dependencies");
|
|
12
13
|
const text_1 = require("./text");
|
|
@@ -20,7 +21,7 @@ class TypeScriptBundler {
|
|
|
20
21
|
runTypeScript(args, outputDir) {
|
|
21
22
|
const processArgs = [];
|
|
22
23
|
processArgs.push('--project', args.appDirectory);
|
|
23
|
-
processArgs.push('--rootDir', path_1.default.join(args.appDirectory,
|
|
24
|
+
processArgs.push('--rootDir', path_1.default.join(args.appDirectory, manifest_1.SOURCE_DIRECTORY));
|
|
24
25
|
if (args.watchMode) {
|
|
25
26
|
processArgs.push('--watch');
|
|
26
27
|
}
|
|
@@ -118,7 +119,10 @@ class TypeScriptBundler {
|
|
|
118
119
|
if (isFirstRun) {
|
|
119
120
|
isFirstRun = false;
|
|
120
121
|
this.logger.info(cli_shared_1.LogColor.trace(args.successMessage));
|
|
121
|
-
resolve({
|
|
122
|
+
resolve({
|
|
123
|
+
result,
|
|
124
|
+
stop: async () => void compiler.kill()
|
|
125
|
+
});
|
|
122
126
|
return;
|
|
123
127
|
}
|
|
124
128
|
await watch.onBuildFinished(null, result);
|
package/out/webpack.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import webpack from 'webpack';
|
|
|
2
2
|
import { Logger } from '@forge/cli-shared';
|
|
3
3
|
import { CommonOutputOptions } from './config/common';
|
|
4
4
|
import { Bundler, BundlerOutput, BundlerArgs, BundlerWatch, BundlerWatchArgs, BundlerWatchOutput } from './types';
|
|
5
|
-
export
|
|
5
|
+
export type Stats = webpack.Stats;
|
|
6
|
+
export declare function handleWebpackCompilationResult(logger: Logger, err: Error | null | undefined, stats: Pick<Stats, 'hasErrors' | 'hasWarnings' | 'toJson'> | undefined): asserts stats is Stats;
|
|
6
7
|
export declare function getCompiler(config: webpack.Configuration): webpack.Compiler;
|
|
7
8
|
export type ConfigWithOutput = webpack.Configuration & {
|
|
8
9
|
output: CommonOutputOptions;
|
|
@@ -11,9 +12,9 @@ export type Configs = [ConfigWithOutput, ...ConfigWithOutput[]];
|
|
|
11
12
|
export declare abstract class WebpackBundler implements Bundler {
|
|
12
13
|
protected readonly logger: Logger;
|
|
13
14
|
constructor(logger: Logger);
|
|
14
|
-
protected getOutput(args: BundlerArgs, config: ConfigWithOutput, stats:
|
|
15
|
+
protected getOutput(args: BundlerArgs, config: ConfigWithOutput, stats: Stats): Promise<BundlerOutput>;
|
|
15
16
|
protected isRegularModule(name: string): boolean;
|
|
16
|
-
protected localModules(stats:
|
|
17
|
+
protected localModules(stats: Stats): Set<string>;
|
|
17
18
|
protected runCompiler(args: BundlerArgs, config: ConfigWithOutput): Promise<BundlerOutput>;
|
|
18
19
|
abstract getConfigs(args: BundlerArgs): Promise<Configs>;
|
|
19
20
|
bundle(args: BundlerArgs): Promise<BundlerOutput>;
|
package/out/webpack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAA4B,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EACL,OAAO,EAEP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAGnB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AAElC,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC,GAAG,SAAS,GACrE,OAAO,CAAC,KAAK,IAAI,KAAK,CAkCxB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,QAAQ,CAE3E;AAqBD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,GAAG;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEvF,MAAM,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAEhE,8BAAsB,cAAe,YAAW,OAAO;IACzC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;cAE7B,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;IAkB5G,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAmBhD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;cAwBjC,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAsBhG,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAElD,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAWjD,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2CtF"}
|
package/out/webpack.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.handleWebpackCompilationResult = handleWebpackCompilationResult;
|
|
|
5
5
|
exports.getCompiler = getCompiler;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const util_1 = require("util");
|
|
8
9
|
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
9
10
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
10
11
|
const metadata_1 = require("./metadata");
|
|
@@ -125,7 +126,7 @@ class WebpackBundler {
|
|
|
125
126
|
const outputs = await Promise.all(configs.map((cfg) => this.runCompiler(args, cfg)));
|
|
126
127
|
const [primary, ...rest] = outputs;
|
|
127
128
|
const metadata = rest.reduce((acc, output) => (output.metadata ? (0, types_1.mergeMetadata)(acc, output.metadata) : acc), primary.metadata ?? (0, types_1.emptyMetadata)());
|
|
128
|
-
return {
|
|
129
|
+
return { ...primary, metadata };
|
|
129
130
|
}
|
|
130
131
|
async watch(args, watch) {
|
|
131
132
|
const configs = await this.getConfigs(args);
|
|
@@ -146,7 +147,7 @@ class WebpackBundler {
|
|
|
146
147
|
const result = await this.getOutput(args, targetConfig, stats);
|
|
147
148
|
if (isFirstRun) {
|
|
148
149
|
isFirstRun = false;
|
|
149
|
-
resolve({ result, stop: ()
|
|
150
|
+
resolve({ result, stop: (0, util_1.promisify)(watching.close.bind(watching)) });
|
|
150
151
|
}
|
|
151
152
|
else {
|
|
152
153
|
await watch.onBuildFinished(null, result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bundler",
|
|
3
|
-
"version": "7.1.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Default bundler for Forge apps",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -21,13 +21,15 @@
|
|
|
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.3.0
|
|
24
|
+
"@forge/cli-shared": "9.3.0",
|
|
25
25
|
"@forge/i18n": "1.0.0",
|
|
26
|
-
"@forge/lint": "6.0
|
|
27
|
-
"@forge/manifest": "13.3.0
|
|
26
|
+
"@forge/lint": "6.1.0",
|
|
27
|
+
"@forge/manifest": "13.3.0",
|
|
28
28
|
"babel-loader": "^8.3.0",
|
|
29
29
|
"cheerio": "^1.2.0",
|
|
30
|
+
"chokidar": "^4.0.3",
|
|
30
31
|
"cross-spawn": "^7.0.6",
|
|
32
|
+
"debounce": "^2.2.0",
|
|
31
33
|
"fs-extra": "^11.2.0",
|
|
32
34
|
"html-webpack-plugin": "^5.6.3",
|
|
33
35
|
"nock": "13.5.6",
|