@modern-js/server-utils 3.1.0 → 3.1.2

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.
@@ -1,4 +1,4 @@
1
- import { isAbsolute } from "path";
1
+ import * as __rspack_external_path from "path";
2
2
  const FILE_EXTENSIONS = [
3
3
  '.js',
4
4
  '.ts',
@@ -6,7 +6,7 @@ const FILE_EXTENSIONS = [
6
6
  '.ejs'
7
7
  ];
8
8
  const validateAbsolutePath = (filename, message)=>{
9
- if (!isAbsolute(filename)) throw new Error(message);
9
+ if (!__rspack_external_path.isAbsolute(filename)) throw new Error(message);
10
10
  };
11
11
  const validateAbsolutePaths = (filenames, messageFunc)=>{
12
12
  filenames.forEach((filename)=>validateAbsolutePath(filename, messageFunc(filename)));
@@ -1,7 +1,7 @@
1
- import { platform } from "os";
2
1
  import path, { dirname, posix } from "path";
3
2
  import { createMatchPath } from "@modern-js/utils/tsconfig-paths";
4
- import { SyntaxKind } from "typescript";
3
+ import * as __rspack_external_os from "os";
4
+ import * as __rspack_external_typescript from "typescript";
5
5
  const isRegExpKey = (str)=>str.startsWith('^') || str.endsWith('$');
6
6
  const resolveAliasPath = (baseUrl, filePath)=>{
7
7
  if (filePath.startsWith('.') || filePath.startsWith('..')) return path.resolve(baseUrl, filePath);
@@ -42,7 +42,7 @@ const createAliasMatcher = (baseUrl, alias)=>{
42
42
  }
43
43
  };
44
44
  };
45
- const isDynamicImport = (tsBinary, node)=>tsBinary.isCallExpression(node) && node.expression.kind === SyntaxKind.ImportKeyword;
45
+ const isDynamicImport = (tsBinary, node)=>tsBinary.isCallExpression(node) && node.expression.kind === __rspack_external_typescript.SyntaxKind.ImportKeyword;
46
46
  function tsconfigPathsBeforeHookFactory(tsBinary, baseUrl, paths) {
47
47
  const tsPaths = {};
48
48
  const alias = {};
@@ -99,7 +99,7 @@ function getNotAliasedPath(sf, matcher, text) {
99
99
  '.jsx'
100
100
  ]);
101
101
  if (!result) return;
102
- if ('win32' === platform()) result = result.replace(/\\/g, '/');
102
+ if ('win32' === __rspack_external_os.platform()) result = result.replace(/\\/g, '/');
103
103
  if (!path.isAbsolute(result)) {
104
104
  if (!result.startsWith('.') && !result.startsWith('..')) try {
105
105
  const packagePath = require.resolve(result, {
@@ -1,2 +1 @@
1
- import { compile } from "./common/index.mjs";
2
- export { compile };
1
+ export { compile } from "./common/index.mjs";
@@ -1,5 +1,5 @@
1
1
  import "node:module";
2
- import { isAbsolute } from "path";
2
+ import * as __rspack_external_path from "path";
3
3
  const FILE_EXTENSIONS = [
4
4
  '.js',
5
5
  '.ts',
@@ -7,7 +7,7 @@ const FILE_EXTENSIONS = [
7
7
  '.ejs'
8
8
  ];
9
9
  const validateAbsolutePath = (filename, message)=>{
10
- if (!isAbsolute(filename)) throw new Error(message);
10
+ if (!__rspack_external_path.isAbsolute(filename)) throw new Error(message);
11
11
  };
12
12
  const validateAbsolutePaths = (filenames, messageFunc)=>{
13
13
  filenames.forEach((filename)=>validateAbsolutePath(filename, messageFunc(filename)));
@@ -1,9 +1,9 @@
1
1
  import __rslib_shim_module__ from "node:module";
2
2
  const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
3
- import { platform } from "os";
4
3
  import path, { dirname, posix } from "path";
5
4
  import { createMatchPath } from "@modern-js/utils/tsconfig-paths";
6
- import { SyntaxKind } from "typescript";
5
+ import * as __rspack_external_os from "os";
6
+ import * as __rspack_external_typescript from "typescript";
7
7
  const isRegExpKey = (str)=>str.startsWith('^') || str.endsWith('$');
8
8
  const resolveAliasPath = (baseUrl, filePath)=>{
9
9
  if (filePath.startsWith('.') || filePath.startsWith('..')) return path.resolve(baseUrl, filePath);
@@ -44,7 +44,7 @@ const createAliasMatcher = (baseUrl, alias)=>{
44
44
  }
45
45
  };
46
46
  };
47
- const isDynamicImport = (tsBinary, node)=>tsBinary.isCallExpression(node) && node.expression.kind === SyntaxKind.ImportKeyword;
47
+ const isDynamicImport = (tsBinary, node)=>tsBinary.isCallExpression(node) && node.expression.kind === __rspack_external_typescript.SyntaxKind.ImportKeyword;
48
48
  function tsconfigPathsBeforeHookFactory(tsBinary, baseUrl, paths) {
49
49
  const tsPaths = {};
50
50
  const alias = {};
@@ -101,7 +101,7 @@ function getNotAliasedPath(sf, matcher, text) {
101
101
  '.jsx'
102
102
  ]);
103
103
  if (!result) return;
104
- if ('win32' === platform()) result = result.replace(/\\/g, '/');
104
+ if ('win32' === __rspack_external_os.platform()) result = result.replace(/\\/g, '/');
105
105
  if (!path.isAbsolute(result)) {
106
106
  if (!result.startsWith('.') && !result.startsWith('..')) try {
107
107
  const packagePath = require.resolve(result, {
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- import { compile } from "./common/index.mjs";
3
- export { compile };
2
+ export { compile } from "./common/index.mjs";
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.0",
18
+ "version": "3.1.2",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/cjs/index.js",
21
21
  "exports": {
@@ -38,15 +38,15 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@swc/helpers": "^0.5.17",
41
- "@modern-js/utils": "3.1.0"
41
+ "@modern-js/utils": "3.1.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@rslib/core": "0.19.6",
44
+ "@rslib/core": "0.20.3",
45
45
  "@types/node": "^20",
46
46
  "typescript": "^5",
47
47
  "@modern-js/rslib": "2.68.10",
48
- "@modern-js/server-core": "3.1.0",
49
- "@scripts/rstest-config": "2.66.0"
48
+ "@scripts/rstest-config": "2.66.0",
49
+ "@modern-js/server-core": "3.1.2"
50
50
  },
51
51
  "sideEffects": false,
52
52
  "publishConfig": {
File without changes