@forge/bundler 7.2.3 → 7.3.0-next.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,18 @@
1
1
  # @forge/bundler
2
2
 
3
+ ## 7.3.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a68050a: Removed the TypeScript bundler EAP. Use manual packaging instead, running `tsc` or another compiler yourself.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [a68050a]
12
+ - @forge/cli-shared@9.8.0-next.0
13
+ - @forge/manifest@13.7.0-next.0
14
+ - @forge/lint@6.3.1-next.0
15
+
3
16
  ## 7.2.3
4
17
 
5
18
  ### Patch Changes
package/out/runtime.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ConfigReader, Logger, StatsigService } from '@forge/cli-shared';
1
+ import { ConfigReader, Logger } from '@forge/cli-shared';
2
2
  import { ManifestSchema } from '@forge/manifest';
3
3
  import { Bundler } from './types';
4
4
  import { WrapperProvider } from './wrapper-provider';
5
5
  export type PackageOptions = NonNullable<ManifestSchema['app']['package']>;
6
6
  export declare const NODE_RUNTIME_CODE_FILE = "__forge__.cjs";
7
- export declare function getNodeBundler(logger: Logger, wrapperProvider: WrapperProvider, configReader: ConfigReader, statsigService: StatsigService): Bundler;
7
+ export declare function getNodeBundler(logger: Logger, wrapperProvider: WrapperProvider, configReader: ConfigReader): Bundler;
8
8
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
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,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAK3E,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AA4NtD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC7B,OAAO,CAET"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,EAA4C,MAAM,mBAAmB,CAAC;AAEnG,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,OAAO,EAEL,OAAO,EAOR,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAK3E,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AA2LtD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAEpH"}
package/out/runtime.js CHANGED
@@ -12,7 +12,6 @@ const common_1 = require("./config/common");
12
12
  const metadata_1 = require("./metadata");
13
13
  const text_1 = require("./text");
14
14
  const types_1 = require("./types");
15
- const typescript_1 = require("./typescript");
16
15
  const webpack_1 = require("./webpack");
17
16
  exports.NODE_RUNTIME_CODE_FILE = '__forge__.cjs';
18
17
  const NODE_RUNTIME_BACKUP_WRAPPER_FILE = '__forge_wrapper__.cjs';
@@ -60,18 +59,6 @@ class NodeBundler extends webpack_1.WebpackBundler {
60
59
  return result;
61
60
  }
62
61
  }
63
- class TypeScriptNodeBundler extends typescript_1.TypeScriptBundler {
64
- wrapperProvider;
65
- constructor(logger, wrapperProvider) {
66
- super(logger);
67
- this.wrapperProvider = wrapperProvider;
68
- }
69
- async getResult(args, outputDir, output, additionalOutputs) {
70
- const result = await super.getResult(args, outputDir, output, additionalOutputs);
71
- result.additionalOutputs = (0, types_1.mergeOutputs)(result.additionalOutputs, await getRuntimeArtifacts(this.wrapperProvider, args));
72
- return result;
73
- }
74
- }
75
62
  class ManualBundler {
76
63
  logger;
77
64
  wrapperProvider;
@@ -128,24 +115,16 @@ class ConfigBundler {
128
115
  logger;
129
116
  wrapperProvider;
130
117
  configReader;
131
- statsigService;
132
- constructor(logger, wrapperProvider, configReader, statsigService) {
118
+ constructor(logger, wrapperProvider, configReader) {
133
119
  this.logger = logger;
134
120
  this.wrapperProvider = wrapperProvider;
135
121
  this.configReader = configReader;
136
- this.statsigService = statsigService;
137
122
  }
138
123
  async getBundler() {
139
124
  const config = (await this.configReader.readConfig()).app.package;
140
125
  if (config?.path && config?.bundler !== 'manual@2026') {
141
126
  throw new cli_shared_1.UserError(text_1.Text.packagePathOnlySupportedForManualBundler);
142
127
  }
143
- if (config?.bundler === 'typescript') {
144
- if (!(await this.statsigService.isTypescriptBundlerEnabled())) {
145
- throw new cli_shared_1.UserError(text_1.Text.typescriptBundlerEAP);
146
- }
147
- return new TypeScriptNodeBundler(this.logger, this.wrapperProvider);
148
- }
149
128
  if (config?.bundler === 'manual@2026') {
150
129
  return new ManualBundler(config, this.logger, this.wrapperProvider);
151
130
  }
@@ -158,6 +137,6 @@ class ConfigBundler {
158
137
  return (await this.getBundler()).watch(args, watch);
159
138
  }
160
139
  }
161
- function getNodeBundler(logger, wrapperProvider, configReader, statsigService) {
162
- return new ConfigBundler(logger, wrapperProvider, configReader, statsigService);
140
+ function getNodeBundler(logger, wrapperProvider, configReader) {
141
+ return new ConfigBundler(logger, wrapperProvider, configReader);
163
142
  }
package/out/text.d.ts CHANGED
@@ -3,7 +3,6 @@ export declare const Text: {
3
3
  typescriptError: (errors: string[]) => string;
4
4
  noExecutableFile: string;
5
5
  metadataFailed: (error: Error) => string;
6
- typescriptBundlerEAP: string;
7
6
  manualBundlerPathRequired: string;
8
7
  packagePathOnlySupportedForManualBundler: string;
9
8
  };
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;;;;CAI9B,CAAC"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;mCACgB,MAAM,EAAE;8BACb,MAAM,EAAE;;4BAKV,KAAK;;;CAG9B,CAAC"}
package/out/text.js CHANGED
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Text = void 0;
4
- const cli_shared_1 = require("@forge/cli-shared");
5
4
  exports.Text = {
6
5
  genericBundlingError: (errors) => `Bundling failed: ${errors.join(', ')}`,
7
6
  typescriptError: (errors) => `TypeScript errors in the app caused the bundling to fail. Fix the errors listed below before rerunning the command. ${errors.join('\n')}`,
8
7
  noExecutableFile: 'Could not find the main executable file',
9
8
  metadataFailed: (error) => `Application code metadata processing failed: ${error.message}`,
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
9
  manualBundlerPathRequired: 'For manual packaging, the path to the packaged runtime code is required.',
12
10
  packagePathOnlySupportedForManualBundler: 'The package path is only needed when the application is packaged manually.'
13
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bundler",
3
- "version": "7.2.3",
3
+ "version": "7.3.0-next.0",
4
4
  "description": "Default bundler for Forge apps",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Atlassian",
@@ -21,16 +21,14 @@
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.7.0",
24
+ "@forge/cli-shared": "9.8.0-next.0",
25
25
  "@forge/i18n": "1.0.0",
26
- "@forge/lint": "6.3.0",
27
- "@forge/manifest": "13.6.0",
26
+ "@forge/lint": "6.3.1-next.0",
27
+ "@forge/manifest": "13.7.0-next.0",
28
28
  "babel-loader": "^8.3.0",
29
29
  "cheerio": "^1.2.0",
30
30
  "chokidar": "^4.0.3",
31
- "cross-spawn": "^7.0.6",
32
31
  "debounce": "^2.2.0",
33
- "fs-extra": "^11.2.0",
34
32
  "html-webpack-plugin": "^5.6.3",
35
33
  "nock": "13.5.6",
36
34
  "tmp": "^0.2.3",
@@ -43,8 +41,6 @@
43
41
  "devDependencies": {
44
42
  "@atlassian/xen-test-util": "^4.2.0",
45
43
  "@forge/runtime": "7.0.0",
46
- "@types/cross-spawn": "^6.0.6",
47
- "@types/fs-extra": "^11.0.4",
48
44
  "@types/jest": "^29.5.14",
49
45
  "@types/node": "20.19.1",
50
46
  "@types/react": "^18.2.64",
@@ -54,7 +50,6 @@
54
50
  "eslint": "^8.56.0",
55
51
  "eslint-config-prettier": "^9.1.0",
56
52
  "eslint-plugin-prettier": "^5.1.3",
57
- "glob": "^13.0.0",
58
53
  "jest-matcher-specific-error": "^1.0.0",
59
54
  "prettier": "3.2.5",
60
55
  "typescript": "5.9.2"
@@ -1,10 +0,0 @@
1
- type CopyDepsOptions = {
2
- exclude?: string[];
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>>;
8
- export declare function copyProductionDependencies(moduleDir: string, target: string, options?: CopyDepsOptions): Promise<void>;
9
- export {};
10
- //# sourceMappingURL=dependencies.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_COPY_DEPENDENCIES_OPTIONS = void 0;
4
- exports.getProductionDependencies = getProductionDependencies;
5
- exports.copyProductionDependencies = copyProductionDependencies;
6
- const tslib_1 = require("tslib");
7
- const fs_1 = require("fs");
8
- const promises_1 = require("fs/promises");
9
- const path_1 = tslib_1.__importDefault(require("path"));
10
- const fs_extra_1 = require("fs-extra");
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
- }
16
- async function readPackageJSON(directory) {
17
- try {
18
- const packageJson = await (0, promises_1.readFile)(path_1.default.join(directory, 'package.json'), 'utf8');
19
- return JSON.parse(packageJson);
20
- }
21
- catch (e) {
22
- return null;
23
- }
24
- }
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)) {
27
- const candidate = path_1.default.join(source, common_1.NODE_MODULES_DIR, dependency);
28
- if ((0, fs_1.existsSync)(candidate)) {
29
- return candidate;
30
- }
31
- }
32
- return null;
33
- }
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;
41
- }
42
- async function enumerateProductionDependencies(moduleDir, options, root, result, visited) {
43
- const packageDef = await readPackageJSON(moduleDir);
44
- if (!packageDef?.dependencies) {
45
- return;
46
- }
47
- for (const dependency of Object.keys(packageDef.dependencies)) {
48
- if (options.exclude?.includes(dependency)) {
49
- continue;
50
- }
51
- const source = await dependencyDir(moduleDir, dependency, root);
52
- if (source) {
53
- if (!isWithinRoot(root, source)) {
54
- continue;
55
- }
56
- const destination = path_1.default.relative(root, source);
57
- if (visited.has(destination)) {
58
- continue;
59
- }
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);
68
- }
69
- }
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
- }
@@ -1,16 +0,0 @@
1
- import { ChildProcessByStdio } from 'child_process';
2
- import { Readable } from 'stream';
3
- import { Logger } from '@forge/cli-shared';
4
- import { AdditionalOutputs, Bundler, BundlerOutput, BundlerArgs, BundlerWatch, BundlerWatchArgs, BundlerWatchOutput } from './types';
5
- type OutputProcess = ChildProcessByStdio<null, Readable, null>;
6
- export declare abstract class TypeScriptBundler implements Bundler {
7
- protected readonly logger: Logger;
8
- constructor(logger: Logger);
9
- protected runTypeScript(args: BundlerArgs, outputDir: string): OutputProcess;
10
- protected isListedFile(line: string): string | null;
11
- protected getResult(args: BundlerArgs, outputDir: string, output?: string, additionalOutputs?: AdditionalOutputs): Promise<BundlerOutput>;
12
- bundle(args: BundlerArgs): Promise<BundlerOutput>;
13
- watch(args: BundlerWatchArgs, watch: BundlerWatch): Promise<BundlerWatchOutput>;
14
- }
15
- export {};
16
- //# sourceMappingURL=typescript.d.ts.map
@@ -1 +0,0 @@
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 DELETED
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TypeScriptBundler = 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 readline_1 = require("readline");
8
- const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
9
- const cli_shared_1 = require("@forge/cli-shared");
10
- const manifest_1 = require("@forge/manifest");
11
- const common_1 = require("./common");
12
- const dependencies_1 = require("./dependencies");
13
- const text_1 = require("./text");
14
- const types_1 = require("./types");
15
- const metadata_1 = require("./metadata");
16
- class TypeScriptBundler {
17
- logger;
18
- constructor(logger) {
19
- this.logger = logger;
20
- }
21
- runTypeScript(args, outputDir) {
22
- const processArgs = [];
23
- processArgs.push('--project', args.appDirectory);
24
- processArgs.push('--rootDir', path_1.default.join(args.appDirectory, manifest_1.SOURCE_DIRECTORY));
25
- if (args.watchMode) {
26
- processArgs.push('--watch');
27
- }
28
- else {
29
- processArgs.push('--listFiles');
30
- }
31
- processArgs.push('--outDir', outputDir);
32
- let tsc = 'tsc';
33
- const appTsc = path_1.default.join(args.appDirectory, common_1.NODE_MODULES_DIR, '.bin', 'tsc');
34
- if ((0, fs_1.existsSync)(appTsc)) {
35
- tsc = appTsc;
36
- }
37
- return (0, cross_spawn_1.default)(tsc, processArgs, { stdio: ['ignore', 'pipe', 'inherit'] });
38
- }
39
- isListedFile(line) {
40
- line = line.trim();
41
- if (line.length === 0) {
42
- return null;
43
- }
44
- if (!line.match(/^\/.+\.[cm]?[jt]sx?$/)) {
45
- return null;
46
- }
47
- return line;
48
- }
49
- async getResult(args, outputDir, output, additionalOutputs) {
50
- let metadata;
51
- if (output) {
52
- const files = new Set();
53
- for (const line of output.split('\n')) {
54
- const filePath = this.isListedFile(line);
55
- if (filePath) {
56
- files.add(filePath);
57
- }
58
- }
59
- metadata = await (0, metadata_1.getMetadata)(this.logger, args.appDirectory, files);
60
- }
61
- else {
62
- metadata = (0, types_1.emptyMetadata)();
63
- }
64
- metadata.bundler = 'typescript';
65
- return { outputDir, metadata, additionalOutputs };
66
- }
67
- async bundle(args) {
68
- const outputDir = (0, common_1.getOutputDir)(args);
69
- const additionalOutputs = await (0, dependencies_1.getProductionDependencies)(args.appDirectory, dependencies_1.DEFAULT_COPY_DEPENDENCIES_OPTIONS);
70
- const compiler = this.runTypeScript(args, outputDir);
71
- let output = '';
72
- compiler.stdout.on('data', (data) => (output += data.toString()));
73
- return new Promise((resolve, reject) => compiler.on('exit', async (code) => {
74
- try {
75
- if (code !== 0) {
76
- const errors = output.split('\n').filter((line) => !this.isListedFile(line));
77
- throw new cli_shared_1.BundlerTSError(text_1.Text.typescriptError(errors));
78
- }
79
- const result = await this.getResult(args, outputDir, output, additionalOutputs);
80
- resolve(result);
81
- }
82
- catch (e) {
83
- reject(e);
84
- }
85
- }));
86
- }
87
- async watch(args, watch) {
88
- const outputDir = (0, common_1.getOutputDir)(args);
89
- await (0, dependencies_1.copyProductionDependencies)(args.appDirectory, outputDir, dependencies_1.DEFAULT_COPY_DEPENDENCIES_OPTIONS);
90
- const compiler = this.runTypeScript(args, outputDir);
91
- let isFirstRun = true;
92
- const output = [];
93
- return new Promise((resolve, reject) => {
94
- compiler.on('exit', async () => {
95
- reject(new cli_shared_1.BundlerTSError(text_1.Text.typescriptError(output)));
96
- });
97
- const outputLines = (0, readline_1.createInterface)(compiler.stdout);
98
- outputLines.on('line', async (line) => {
99
- if (/Starting (incremental )?compilation/.exec(line)) {
100
- if (!isFirstRun) {
101
- await watch.onBuildWillStart();
102
- }
103
- output.length = 0;
104
- return;
105
- }
106
- if (!line.includes('Watching for file changes.')) {
107
- line = line.trim();
108
- if (line) {
109
- output.push(line);
110
- }
111
- return;
112
- }
113
- try {
114
- const errors = Number(/Found (\d+) error/.exec(line)?.[1] ?? '0');
115
- if (errors) {
116
- throw new cli_shared_1.BundlerTSError(text_1.Text.typescriptError(output));
117
- }
118
- const result = await this.getResult(args, outputDir);
119
- if (isFirstRun) {
120
- isFirstRun = false;
121
- this.logger.info(cli_shared_1.LogColor.trace(args.successMessage));
122
- resolve({
123
- result,
124
- stop: async () => void compiler.kill()
125
- });
126
- return;
127
- }
128
- await watch.onBuildFinished(null, result);
129
- }
130
- catch (e) {
131
- if (isFirstRun) {
132
- isFirstRun = false;
133
- reject(e);
134
- return;
135
- }
136
- await watch.onBuildFinished(e);
137
- }
138
- });
139
- });
140
- }
141
- }
142
- exports.TypeScriptBundler = TypeScriptBundler;