@modern-js/server-utils 2.68.11 → 2.68.13

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.
@@ -102,7 +102,11 @@ const compileByTs = async (appDirectory, config, compileOptions) => {
102
102
  ...new Set(allDiagnostics)
103
103
  ], formatHost));
104
104
  if (typeof noEmitOnError === "undefined" || noEmitOnError === true) {
105
- process.exit(1);
105
+ if (compileOptions.throwErrorInsteadOfExit) {
106
+ import_utils.logger.error("TypeScript compilation failed");
107
+ } else {
108
+ process.exit(1);
109
+ }
106
110
  }
107
111
  }
108
112
  for (const source of sourceDirs) {
@@ -110,7 +110,11 @@ var compileByTs = function() {
110
110
  if (allDiagnostics.length > 0) {
111
111
  logger.error(ts.formatDiagnosticsWithColorAndContext(_to_consumable_array(new Set(allDiagnostics)), formatHost));
112
112
  if (typeof noEmitOnError === "undefined" || noEmitOnError === true) {
113
- process.exit(1);
113
+ if (compileOptions.throwErrorInsteadOfExit) {
114
+ logger.error("TypeScript compilation failed");
115
+ } else {
116
+ process.exit(1);
117
+ }
114
118
  }
115
119
  }
116
120
  _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
@@ -69,7 +69,11 @@ const compileByTs = async (appDirectory, config, compileOptions) => {
69
69
  ...new Set(allDiagnostics)
70
70
  ], formatHost));
71
71
  if (typeof noEmitOnError === "undefined" || noEmitOnError === true) {
72
- process.exit(1);
72
+ if (compileOptions.throwErrorInsteadOfExit) {
73
+ logger.error("TypeScript compilation failed");
74
+ } else {
75
+ process.exit(1);
76
+ }
73
77
  }
74
78
  }
75
79
  for (const source of sourceDirs) {
@@ -16,6 +16,7 @@ export interface CompileOptions {
16
16
  distDir: string;
17
17
  tsconfigPath?: string;
18
18
  moduleType?: 'module' | 'commonjs';
19
+ throwErrorInsteadOfExit?: boolean;
19
20
  }
20
21
  export type CompileFunc = (appDirectory: string, modernConfig: IConfig, compileOptions: CompileOptions) => Promise<void>;
21
22
  export declare const FILE_EXTENSIONS: string[];
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.68.11",
18
+ "version": "2.68.13",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -38,10 +38,10 @@
38
38
  "@babel/preset-typescript": "^7.26.0",
39
39
  "@swc/helpers": "^0.5.17",
40
40
  "babel-plugin-transform-typescript-metadata": "^0.3.2",
41
- "@modern-js/babel-compiler": "2.68.11",
42
- "@modern-js/babel-plugin-module-resolver": "2.68.11",
43
- "@modern-js/babel-preset": "2.68.11",
44
- "@modern-js/utils": "2.68.11"
41
+ "@modern-js/babel-plugin-module-resolver": "2.68.13",
42
+ "@modern-js/babel-compiler": "2.68.13",
43
+ "@modern-js/babel-preset": "2.68.13",
44
+ "@modern-js/utils": "2.68.13"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/babel__core": "^7.20.5",
@@ -50,8 +50,8 @@
50
50
  "jest": "^29",
51
51
  "ts-jest": "^29.1.0",
52
52
  "typescript": "^5",
53
+ "@modern-js/server-core": "2.68.13",
53
54
  "@scripts/build": "2.66.0",
54
- "@modern-js/server-core": "2.68.11",
55
55
  "@scripts/jest-config": "2.66.0"
56
56
  },
57
57
  "sideEffects": false,