@modern-js/server-utils 2.35.0 → 2.35.1

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.
@@ -35,11 +35,11 @@ const validateAbsolutePaths = (filenames, messageFunc) => {
35
35
  filenames.forEach((filename) => validateAbsolutePath(filename, messageFunc(filename)));
36
36
  };
37
37
  const compile = async (appDirectory, modernConfig, compileOptions) => {
38
- var _modernConfig_server, _modernConfig;
38
+ var _modernConfig_server;
39
39
  const { sourceDirs, distDir, tsconfigPath } = compileOptions;
40
40
  validateAbsolutePaths(sourceDirs, (dir) => `source dir ${dir} is not an absolute path.`);
41
41
  validateAbsolutePath(distDir, `dist dir ${distDir} is not an absolute path.`);
42
- const compiler = (_modernConfig = modernConfig) === null || _modernConfig === void 0 ? void 0 : (_modernConfig_server = _modernConfig.server) === null || _modernConfig_server === void 0 ? void 0 : _modernConfig_server.compiler;
42
+ const compiler = modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_server = modernConfig.server) === null || _modernConfig_server === void 0 ? void 0 : _modernConfig_server.compiler;
43
43
  const isTsProject = tsconfigPath && await _utils.fs.pathExists(tsconfigPath);
44
44
  if (!isTsProject || compiler === "babel") {
45
45
  const { compileByBabel } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("../compilers/babel")));
@@ -102,8 +102,8 @@ function tsconfigPathsBeforeHookFactory(tsBinary, baseUrl, paths) {
102
102
  }
103
103
  if (tsBinary.isImportDeclaration(node) || tsBinary.isExportDeclaration(node) && node.moduleSpecifier) {
104
104
  try {
105
- var _node_moduleSpecifier, _node;
106
- const importPathWithQuotes = (_node = node) === null || _node === void 0 ? void 0 : (_node_moduleSpecifier = _node.moduleSpecifier) === null || _node_moduleSpecifier === void 0 ? void 0 : _node_moduleSpecifier.getText();
105
+ var _node_moduleSpecifier;
106
+ const importPathWithQuotes = node === null || node === void 0 ? void 0 : (_node_moduleSpecifier = node.moduleSpecifier) === null || _node_moduleSpecifier === void 0 ? void 0 : _node_moduleSpecifier.getText();
107
107
  if (!importPathWithQuotes) {
108
108
  return node;
109
109
  }
@@ -20,7 +20,7 @@ var validateAbsolutePaths = function(filenames, messageFunc) {
20
20
  };
21
21
  export var compile = function() {
22
22
  var _ref = _async_to_generator(function(appDirectory, modernConfig, compileOptions) {
23
- var _modernConfig_server, _modernConfig, sourceDirs, distDir, tsconfigPath, compiler, isTsProject, _tmp, compileByBabel, compileByTs;
23
+ var _modernConfig_server, sourceDirs, distDir, tsconfigPath, compiler, isTsProject, _tmp, compileByBabel, compileByTs;
24
24
  return _ts_generator(this, function(_state) {
25
25
  switch (_state.label) {
26
26
  case 0:
@@ -29,7 +29,7 @@ export var compile = function() {
29
29
  return "source dir ".concat(dir, " is not an absolute path.");
30
30
  });
31
31
  validateAbsolutePath(distDir, "dist dir ".concat(distDir, " is not an absolute path."));
32
- compiler = (_modernConfig = modernConfig) === null || _modernConfig === void 0 ? void 0 : (_modernConfig_server = _modernConfig.server) === null || _modernConfig_server === void 0 ? void 0 : _modernConfig_server.compiler;
32
+ compiler = modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_server = modernConfig.server) === null || _modernConfig_server === void 0 ? void 0 : _modernConfig_server.compiler;
33
33
  _tmp = tsconfigPath;
34
34
  if (!_tmp)
35
35
  return [
@@ -111,8 +111,8 @@ export function tsconfigPathsBeforeHookFactory(tsBinary, baseUrl, paths) {
111
111
  }
112
112
  if (tsBinary.isImportDeclaration(node) || tsBinary.isExportDeclaration(node) && node.moduleSpecifier) {
113
113
  try {
114
- var _node_moduleSpecifier, _node;
115
- var importPathWithQuotes1 = (_node = node) === null || _node === void 0 ? void 0 : (_node_moduleSpecifier = _node.moduleSpecifier) === null || _node_moduleSpecifier === void 0 ? void 0 : _node_moduleSpecifier.getText();
114
+ var _node_moduleSpecifier;
115
+ var importPathWithQuotes1 = node === null || node === void 0 ? void 0 : (_node_moduleSpecifier = node.moduleSpecifier) === null || _node_moduleSpecifier === void 0 ? void 0 : _node_moduleSpecifier.getText();
116
116
  if (!importPathWithQuotes1) {
117
117
  return node;
118
118
  }
@@ -15,11 +15,11 @@ const validateAbsolutePaths = (filenames, messageFunc) => {
15
15
  filenames.forEach((filename) => validateAbsolutePath(filename, messageFunc(filename)));
16
16
  };
17
17
  export const compile = async (appDirectory, modernConfig, compileOptions) => {
18
- var _modernConfig_server, _modernConfig;
18
+ var _modernConfig_server;
19
19
  const { sourceDirs, distDir, tsconfigPath } = compileOptions;
20
20
  validateAbsolutePaths(sourceDirs, (dir) => `source dir ${dir} is not an absolute path.`);
21
21
  validateAbsolutePath(distDir, `dist dir ${distDir} is not an absolute path.`);
22
- const compiler = (_modernConfig = modernConfig) === null || _modernConfig === void 0 ? void 0 : (_modernConfig_server = _modernConfig.server) === null || _modernConfig_server === void 0 ? void 0 : _modernConfig_server.compiler;
22
+ const compiler = modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_server = modernConfig.server) === null || _modernConfig_server === void 0 ? void 0 : _modernConfig_server.compiler;
23
23
  const isTsProject = tsconfigPath && await fs.pathExists(tsconfigPath);
24
24
  if (!isTsProject || compiler === "babel") {
25
25
  const { compileByBabel } = await import("../compilers/babel");
@@ -91,8 +91,8 @@ export function tsconfigPathsBeforeHookFactory(tsBinary, baseUrl, paths) {
91
91
  }
92
92
  if (tsBinary.isImportDeclaration(node) || tsBinary.isExportDeclaration(node) && node.moduleSpecifier) {
93
93
  try {
94
- var _node_moduleSpecifier, _node;
95
- const importPathWithQuotes = (_node = node) === null || _node === void 0 ? void 0 : (_node_moduleSpecifier = _node.moduleSpecifier) === null || _node_moduleSpecifier === void 0 ? void 0 : _node_moduleSpecifier.getText();
94
+ var _node_moduleSpecifier;
95
+ const importPathWithQuotes = node === null || node === void 0 ? void 0 : (_node_moduleSpecifier = node.moduleSpecifier) === null || _node_moduleSpecifier === void 0 ? void 0 : _node_moduleSpecifier.getText();
96
96
  if (!importPathWithQuotes) {
97
97
  return node;
98
98
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.35.0",
18
+ "version": "2.35.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -37,10 +37,10 @@
37
37
  "@babel/preset-typescript": "^7.22.15",
38
38
  "babel-plugin-transform-typescript-metadata": "^0.3.2",
39
39
  "@swc/helpers": "0.5.1",
40
- "@modern-js/babel-compiler": "2.35.0",
41
- "@modern-js/babel-preset-base": "2.35.0",
42
- "@modern-js/utils": "2.35.0",
43
- "@modern-js/babel-plugin-module-resolver": "2.35.0"
40
+ "@modern-js/babel-compiler": "2.35.1",
41
+ "@modern-js/babel-preset-base": "2.35.1",
42
+ "@modern-js/utils": "2.35.1",
43
+ "@modern-js/babel-plugin-module-resolver": "2.35.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/babel__core": "^7.20.0",
@@ -49,9 +49,9 @@
49
49
  "jest": "^29",
50
50
  "ts-jest": "^29.1.0",
51
51
  "typescript": "^5",
52
- "@modern-js/server-core": "2.35.0",
53
- "@scripts/build": "2.35.0",
54
- "@scripts/jest-config": "2.35.0"
52
+ "@scripts/build": "2.35.1",
53
+ "@scripts/jest-config": "2.35.1",
54
+ "@modern-js/server-core": "2.35.1"
55
55
  },
56
56
  "sideEffects": false,
57
57
  "publishConfig": {