@modern-js/server-utils 2.0.0-beta.1 → 2.0.0-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @modern-js/server-utils
2
2
 
3
+ ## 2.0.0-beta.2
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9c3e: chore: v2
8
+
9
+ ### Patch Changes
10
+
11
+ - 9b915e0c10: fix: tsconfig-paths plugin's new node use old node flag
12
+ fix: tsconfig-paths 插件转换的新节点使用旧节点的 flag
13
+ - a8642da58f: fix(server-utils): incorrect babel-compiler version
14
+
15
+ fix(server-utils): 修复引用错误的 babel-compiler 版本的问题
16
+
17
+ - c2bb0f1: chore(server-utils): using pre-bundled tsconfig-paths
18
+
19
+ chore(server-utils): 使用预打包的 tsconfig-paths 依赖
20
+
21
+ - 14b712da84: fix: use consistent alias type and default value across packages
22
+
23
+ fix: 在各个包中使用一致的 alias 类型定义和默认值
24
+
25
+ - Updated dependencies [92f0ead]
26
+ - Updated dependencies [edd1cfb1af]
27
+ - Updated dependencies [cc971eabfc]
28
+ - Updated dependencies [5b9049f2e9]
29
+ - Updated dependencies [92004d1]
30
+ - Updated dependencies [b8bbe036c7]
31
+ - Updated dependencies [d5a31df781]
32
+ - Updated dependencies [dda38c9c3e]
33
+ - Updated dependencies [3bbea92b2a]
34
+ - Updated dependencies [f179749]
35
+ - Updated dependencies [abf3421a75]
36
+ - Updated dependencies [543be9558e]
37
+ - Updated dependencies [14b712da84]
38
+ - @modern-js/utils@2.0.0-beta.2
39
+ - @modern-js/plugin@2.0.0-beta.2
40
+ - @modern-js/babel-preset-lib@2.0.0-beta.2
41
+ - @modern-js/babel-compiler@2.0.0-beta.2
42
+
3
43
  ## 2.0.0-beta.1
4
44
 
5
45
  ### Major Changes
@@ -29,7 +29,7 @@ export const resolveBabelConfig = (appDirectory, config, option
29
29
  // FIXME: babel type can't pass type checking
30
30
  ) => {
31
31
  const {
32
- envVars,
32
+ define,
33
33
  globalVars,
34
34
  alias,
35
35
  babelConfig
@@ -46,8 +46,9 @@ export const resolveBabelConfig = (appDirectory, config, option
46
46
  enableReactPreset: true,
47
47
  enableTypescriptPreset: true,
48
48
  alias: aliasConfig,
49
- envVars,
50
- globalVars
49
+ // FIXME: handle the define envVars
50
+ envVars: define,
51
+ globalVars: globalVars
51
52
  }, {
52
53
  type: option.type,
53
54
  syntax: option.syntax
@@ -1,7 +1,7 @@
1
1
  import * as os from 'os';
2
2
  import path, { dirname, posix } from 'path';
3
3
  import * as ts from 'typescript';
4
- import { createMatchPath } from 'tsconfig-paths';
4
+ import { createMatchPath } from '@modern-js/utils/tsconfig-paths';
5
5
  const isRegExpKey = str => {
6
6
  return str.startsWith('^') || str.endsWith('$');
7
7
  };
@@ -58,7 +58,7 @@ const resolveBabelConfig = (appDirectory, config, option
58
58
  // FIXME: babel type can't pass type checking
59
59
  ) => {
60
60
  const {
61
- envVars,
61
+ define,
62
62
  globalVars,
63
63
  alias,
64
64
  babelConfig
@@ -75,8 +75,9 @@ const resolveBabelConfig = (appDirectory, config, option
75
75
  enableReactPreset: true,
76
76
  enableTypescriptPreset: true,
77
77
  alias: aliasConfig,
78
- envVars,
79
- globalVars
78
+ // FIXME: handle the define envVars
79
+ envVars: define,
80
+ globalVars: globalVars
80
81
  }, {
81
82
  type: option.type,
82
83
  syntax: option.syntax
@@ -7,7 +7,7 @@ exports.tsconfigPathsBeforeHookFactory = tsconfigPathsBeforeHookFactory;
7
7
  var os = _interopRequireWildcard(require("os"));
8
8
  var _path = _interopRequireWildcard(require("path"));
9
9
  var ts = _interopRequireWildcard(require("typescript"));
10
- var _tsconfigPaths = require("tsconfig-paths");
10
+ var _tsconfigPaths = require("@modern-js/utils/tsconfig-paths");
11
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
13
  const isRegExpKey = str => {
@@ -29,7 +29,7 @@ export var getBabelConfig = function getBabelConfig(libPresetOption, syntaxOptio
29
29
  export var resolveBabelConfig = function resolveBabelConfig(appDirectory, config, option
30
30
  // FIXME: babel type can't pass type checking
31
31
  ) {
32
- var envVars = config.envVars,
32
+ var define = config.define,
33
33
  globalVars = config.globalVars,
34
34
  alias = config.alias,
35
35
  babelConfig = config.babelConfig;
@@ -45,7 +45,8 @@ export var resolveBabelConfig = function resolveBabelConfig(appDirectory, config
45
45
  enableReactPreset: true,
46
46
  enableTypescriptPreset: true,
47
47
  alias: aliasConfig,
48
- envVars: envVars,
48
+ // FIXME: handle the define envVars
49
+ envVars: define,
49
50
  globalVars: globalVars
50
51
  }, {
51
52
  type: option.type,
@@ -4,7 +4,7 @@ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIt
4
4
  import * as os from 'os';
5
5
  import path, { dirname, posix } from 'path';
6
6
  import * as ts from 'typescript';
7
- import { createMatchPath } from 'tsconfig-paths';
7
+ import { createMatchPath } from '@modern-js/utils/tsconfig-paths';
8
8
  var isRegExpKey = function isRegExpKey(str) {
9
9
  return str.startsWith('^') || str.endsWith('$');
10
10
  };
@@ -1,14 +1,14 @@
1
- import type { NormalizedConfig } from '@modern-js/core';
1
+ import type { SourceNormalizedConfig, ToolsNormalizedConfig } from '@modern-js/server-core';
2
2
  export interface Pattern {
3
3
  from: string;
4
4
  to: string;
5
5
  tsconfigPath?: string;
6
6
  }
7
7
  export interface IConfig {
8
- alias?: NormalizedConfig['source']['alias'];
9
- envVars?: NormalizedConfig['source']['envVars'];
10
- globalVars?: NormalizedConfig['source']['globalVars'];
11
- babelConfig?: NormalizedConfig['tools']['babel'];
8
+ alias?: SourceNormalizedConfig['alias'];
9
+ define?: SourceNormalizedConfig['define'];
10
+ globalVars?: SourceNormalizedConfig['globalVars'];
11
+ babelConfig?: ToolsNormalizedConfig['babel'];
12
12
  server: {
13
13
  compiler?: 'babel' | 'typescript';
14
14
  };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.1",
14
+ "version": "2.0.0-beta.2",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -37,11 +37,10 @@
37
37
  "@babel/runtime": "^7.18.0",
38
38
  "babel-plugin-module-resolver": "^4.1.0",
39
39
  "babel-plugin-transform-typescript-metadata": "^0.3.2",
40
- "tsconfig-paths": "3.14.1",
41
- "@modern-js/babel-compiler": "2.0.0-beta.1",
42
- "@modern-js/babel-preset-lib": "2.0.0-beta.1",
43
- "@modern-js/plugin": "2.0.0-beta.1",
44
- "@modern-js/utils": "2.0.0-beta.1"
40
+ "@modern-js/babel-compiler": "2.0.0-beta.2",
41
+ "@modern-js/babel-preset-lib": "2.0.0-beta.2",
42
+ "@modern-js/plugin": "2.0.0-beta.2",
43
+ "@modern-js/utils": "2.0.0-beta.2"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@types/babel__core": "^7.1.15",
@@ -50,9 +49,9 @@
50
49
  "jest": "^27",
51
50
  "ts-jest": "^27.0.4",
52
51
  "typescript": "^4",
53
- "@modern-js/core": "2.0.0-beta.1",
54
- "@scripts/build": "2.0.0-beta.1",
55
- "@scripts/jest-config": "2.0.0-beta.1"
52
+ "@modern-js/server-core": "2.0.0-beta.2",
53
+ "@scripts/build": "2.0.0-beta.2",
54
+ "@scripts/jest-config": "2.0.0-beta.2"
56
55
  },
57
56
  "sideEffects": false,
58
57
  "publishConfig": {
@@ -60,9 +59,9 @@
60
59
  "access": "public"
61
60
  },
62
61
  "scripts": {
63
- "new": "modern new",
64
- "dev": "modern build --watch",
65
- "build": "modern build",
62
+ "new": "modern-lib new",
63
+ "dev": "modern-lib build --watch",
64
+ "build": "modern-lib build",
66
65
  "test": "jest --passWithNoTests"
67
66
  }
68
67
  }