@modern-js/plugin-express 1.1.0 → 1.1.4-rc.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,85 +1,72 @@
1
1
  # @modern-js/plugin-express
2
2
 
3
- ## 1.1.0
4
-
5
- ### Minor Changes
6
-
7
- - 96119db2: Relese v1.1.0
8
-
9
- 1. 全面支持 Windows 平台
10
-
11
- ISSUE:
12
-
13
- - [182](https://github.com/modern-js-dev/modern.js/issues/182)
14
- - [236](https://github.com/modern-js-dev/modern.js/issues/236)
15
-
16
- PR
17
-
18
- - [219](https://github.com/modern-js-dev/modern.js/pull/219)
19
- - [247](https://github.com/modern-js-dev/modern.js/pull/247)
20
- - [249](https://github.com/modern-js-dev/modern.js/pull/249)
21
- - [253](https://github.com/modern-js-dev/modern.js/pull/253)
22
- - [268](https://github.com/modern-js-dev/modern.js/pull/268)
23
- - [270](https://github.com/modern-js-dev/modern.js/pull/270)
24
- - [273](https://github.com/modern-js-dev/modern.js/pull/273)
25
- - [276](https://github.com/modern-js-dev/modern.js/pull/276)
26
-
27
- 2. 修复 Unbundled 模式启用问题
28
-
29
- ISSUE
30
-
31
- - [186](https://github.com/modern-js-dev/modern.js/issues/186)
32
- - [224](https://github.com/modern-js-dev/modern.js/issues/224)
33
- - [225](https://github.com/modern-js-dev/modern.js/issues/225)
34
- - [238](https://github.com/modern-js-dev/modern.js/issues/238)
35
-
36
- PR
37
-
38
- - [226](https://github.com/modern-js-dev/modern.js/pull/226)
39
- - [264](https://github.com/modern-js-dev/modern.js/pull/264)
40
- - [codesmith-12](https://github.com/modern-js-dev/codesmith/pull/12)
3
+ ## 1.1.4-rc.0
41
4
 
42
- 3. 修复模块工程方案 .npmignore 文件初始化未生成
43
-
44
- ISSUE
45
-
46
- - [198](https://github.com/modern-js-dev/modern.js/issues/198)
47
-
48
- PR
49
-
50
- - [209](https://github.com/modern-js-dev/modern.js/pull/209)
51
-
52
- 4. 修复 Storybook 使用时浏览器打开页面报错
53
-
54
- ISSUE
55
-
56
- - [228](https://github.com/modern-js-dev/modern.js/issues/228)
57
-
58
- PR
5
+ ### Patch Changes
59
6
 
60
- - [254](https://github.com/modern-js-dev/modern.js/pull/254)
7
+ - 529d7fae: fix: runtime path is broken in development environment
8
+ - Updated dependencies [d927bc83]
9
+ - Updated dependencies [d73ff455]
10
+ - Updated dependencies [9c1ab865]
11
+ - Updated dependencies [d73ff455]
12
+ - Updated dependencies [d73ff455]
13
+ - Updated dependencies [d73ff455]
14
+ - Updated dependencies [d73ff455]
15
+ - @modern-js/utils@1.1.4-rc.0
16
+ - @modern-js/core@1.1.4-rc.0
17
+ - @modern-js/bff-utils@1.1.2-rc.0
18
+ - @modern-js/server-plugin@1.1.2
19
+ - @modern-js/adapter-helpers@1.1.1
20
+ - @modern-js/bff-runtime@1.1.2-rc.0
21
+
22
+ ## 1.1.3
61
23
 
62
- 5. 修复 BFF 一体化开发不支持 unbundle 模式
24
+ ### Patch Changes
63
25
 
64
- ISSUE
26
+ - 39e8137d: fix: support prefix array & webpack loader should read requestCreator & adjust runtime path to relative
27
+ - Updated dependencies [085a6a58]
28
+ - Updated dependencies [085a6a58]
29
+ - Updated dependencies [085a6a58]
30
+ - Updated dependencies [d280ea33]
31
+ - Updated dependencies [d4fcc73a]
32
+ - Updated dependencies [085a6a58]
33
+ - Updated dependencies [ed1f6b12]
34
+ - Updated dependencies [a5ebbb00]
35
+ - Updated dependencies [085a6a58]
36
+ - @modern-js/core@1.1.3
37
+ - @modern-js/server-plugin@1.1.2
38
+ - @modern-js/utils@1.1.3
39
+
40
+ ## 1.1.2
65
41
 
66
- - [235](https://github.com/modern-js-dev/modern.js/issues/235)
67
- - [257](https://github.com/modern-js-dev/modern.js/issues/257)
42
+ ### Patch Changes
68
43
 
69
- PR
44
+ - 0fa83663: support more .env files
45
+ - Updated dependencies [6f7fe574]
46
+ - Updated dependencies [0fa83663]
47
+ - Updated dependencies [f594fbc8]
48
+ - @modern-js/core@1.1.2
49
+ - @modern-js/adapter-helpers@1.1.1
50
+ - @modern-js/bff-runtime@1.1.1
51
+ - @modern-js/bff-utils@1.1.1
52
+ - @modern-js/server-plugin@1.1.1
53
+ - @modern-js/utils@1.1.2
70
54
 
71
- - [269](https://github.com/modern-js-dev/modern.js/pull/269)
72
- - [271](https://github.com/modern-js-dev/modern.js/pull/271)
55
+ ## 1.1.1
73
56
 
74
- 6. 修复 Node17 dev 命令报错问题
57
+ ### Patch Changes
75
58
 
76
- ISSUE
59
+ - 6ffd1a50: Refactor to base on farrow-pipeline
60
+ - Updated dependencies [687c92c7]
61
+ - Updated dependencies [c0fc0700]
62
+ - @modern-js/core@1.1.1
63
+ - @modern-js/utils@1.1.1
77
64
 
78
- - [180](https://github.com/modern-js-dev/modern.js/issues/180)
65
+ ## 1.1.0
79
66
 
80
- PR
67
+ ### Minor Changes
81
68
 
82
- - [214](https://github.com/modern-js-dev/modern.js/pull/214)
69
+ - 96119db2: Relese v1.1.0
83
70
 
84
71
  ### Patch Changes
85
72
 
@@ -8,17 +8,28 @@ export default createPlugin(() => {
8
8
  config() {
9
9
  // eslint-disable-next-line react-hooks/rules-of-hooks
10
10
  const appContext = useAppContext();
11
+ const {
12
+ appDirectory
13
+ } = appContext;
11
14
  bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
15
+ const serverRuntimePath = bffExportsUtils.getPath(); // Look up one level, because the artifacts after build have dist directories
16
+
17
+ let relativeRuntimePath = path.join('../', path.relative(appDirectory, serverRuntimePath));
18
+
19
+ if (process.env.NODE_ENV === 'development') {
20
+ relativeRuntimePath = `./${path.relative(appDirectory, serverRuntimePath)}`;
21
+ }
22
+
12
23
  return {
13
24
  source: {
14
25
  alias: {
15
- '@modern-js/runtime/server': bffExportsUtils.getPath()
26
+ '@modern-js/runtime/server': relativeRuntimePath
16
27
  }
17
28
  }
18
29
  };
19
30
  },
20
31
 
21
- modifyEntryImports() {
32
+ modifyEntryImports(input) {
22
33
  // eslint-disable-next-line react-hooks/rules-of-hooks
23
34
  const {
24
35
  appDirectory
@@ -42,6 +53,7 @@ export default createPlugin(() => {
42
53
  ...pluginRuntime
43
54
  }
44
55
  `);
56
+ return input;
45
57
  }
46
58
 
47
59
  };
@@ -1,6 +1,6 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
2
 
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
@@ -22,17 +22,28 @@ var _default = (0, _core.createPlugin)(() => {
22
22
  config() {
23
23
  // eslint-disable-next-line react-hooks/rules-of-hooks
24
24
  const appContext = (0, _core.useAppContext)();
25
+ const {
26
+ appDirectory
27
+ } = appContext;
25
28
  bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
29
+ const serverRuntimePath = bffExportsUtils.getPath(); // Look up one level, because the artifacts after build have dist directories
30
+
31
+ let relativeRuntimePath = path.join('../', path.relative(appDirectory, serverRuntimePath));
32
+
33
+ if (process.env.NODE_ENV === 'development') {
34
+ relativeRuntimePath = `./${path.relative(appDirectory, serverRuntimePath)}`;
35
+ }
36
+
26
37
  return {
27
38
  source: {
28
39
  alias: {
29
- '@modern-js/runtime/server': bffExportsUtils.getPath()
40
+ '@modern-js/runtime/server': relativeRuntimePath
30
41
  }
31
42
  }
32
43
  };
33
44
  },
34
45
 
35
- modifyEntryImports() {
46
+ modifyEntryImports(input) {
36
47
  // eslint-disable-next-line react-hooks/rules-of-hooks
37
48
  const {
38
49
  appDirectory
@@ -56,6 +67,7 @@ var _default = (0, _core.createPlugin)(() => {
56
67
  ...pluginRuntime
57
68
  }
58
69
  `);
70
+ return input;
59
71
  }
60
72
 
61
73
  };
@@ -19,9 +19,9 @@ var _utils = require("@modern-js/utils");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
23
 
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
25
 
26
26
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
27
 
@@ -1,5 +1,8 @@
1
1
  declare const _default: import("@modern-js/core").AsyncPlugin<Partial<import("@modern-js/core").Progresses2Threads<{
2
2
  config: import("@modern-js/core").ParallelWorkflow<void, unknown>;
3
+ resolvedConfig: import("@modern-js/core").AsyncWaterfall<{
4
+ resolved: import("@modern-js/core").NormalizedConfig;
5
+ }>;
3
6
  validateSchema: import("@modern-js/core").ParallelWorkflow<void, unknown>;
4
7
  prepare: import("@modern-js/core").AsyncWorkflow<void, void>;
5
8
  commands: import("@modern-js/core").AsyncWorkflow<{
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.0",
14
+ "version": "1.1.4-rc.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.15.3",
32
- "@modern-js/adapter-helpers": "^1.1.0",
33
- "@modern-js/utils": "^1.1.0",
32
+ "@modern-js/adapter-helpers": "^1.1.1",
33
+ "@modern-js/utils": "^1.1.4-rc.0",
34
34
  "cookie-parser": "^1.4.5",
35
35
  "finalhandler": "^1.1.2",
36
36
  "formidable": "^1.2.2",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "express": "^4.17.1",
41
- "@modern-js/server-utils": "^1.1.0",
42
- "@modern-js/bff-runtime": "^1.1.0",
41
+ "@modern-js/server-utils": "^1.1.3-rc.0",
42
+ "@modern-js/bff-runtime": "^1.1.2-rc.0",
43
43
  "@types/cookie-parser": "^1.4.2",
44
44
  "@types/express": "^4.17.13",
45
45
  "@types/finalhandler": "^1.1.1",
@@ -50,11 +50,11 @@
50
50
  "@types/type-is": "^1.6.3",
51
51
  "supertest": "^6.1.6",
52
52
  "typescript": "^4",
53
- "@modern-js/bff-utils": "^1.1.0",
54
- "@modern-js/core": "^1.1.0",
55
- "@modern-js/server-plugin": "^1.1.0",
56
- "@modern-js/plugin-testing": "^1.0.2",
57
- "@modern-js/module-tools": "^1.0.2"
53
+ "@modern-js/bff-utils": "^1.1.2-rc.0",
54
+ "@modern-js/core": "^1.1.4-rc.0",
55
+ "@modern-js/server-plugin": "^1.1.2",
56
+ "@modern-js/plugin-testing": "^1.1.1",
57
+ "@modern-js/module-tools": "^1.1.1"
58
58
  },
59
59
  "modernConfig": {
60
60
  "output": {
@@ -62,10 +62,10 @@
62
62
  }
63
63
  },
64
64
  "peerDependencies": {
65
- "@modern-js/bff-utils": "^1.1.0",
66
- "@modern-js/core": "^1.1.0",
67
- "@modern-js/server-plugin": "^1.1.0",
68
- "@modern-js/bff-runtime": "^1.1.0",
65
+ "@modern-js/bff-utils": "^1.1.2-rc.0",
66
+ "@modern-js/core": "^1.1.4-rc.0",
67
+ "@modern-js/server-plugin": "^1.1.2",
68
+ "@modern-js/bff-runtime": "^1.1.2-rc.0",
69
69
  "express": "^4.17.1"
70
70
  },
71
71
  "publishConfig": {
@@ -76,5 +76,6 @@
76
76
  "new": "modern new",
77
77
  "build": "modern build",
78
78
  "test": "modern test"
79
- }
79
+ },
80
+ "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
80
81
  }
package/src/cli/index.ts CHANGED
@@ -11,18 +11,36 @@ export default createPlugin(
11
11
  config() {
12
12
  // eslint-disable-next-line react-hooks/rules-of-hooks
13
13
  const appContext = useAppContext();
14
+ const { appDirectory } = appContext;
14
15
  bffExportsUtils = createRuntimeExportsUtils(
15
16
  appContext.internalDirectory,
16
17
  'server',
17
18
  );
18
19
 
20
+ const serverRuntimePath = bffExportsUtils.getPath();
21
+
22
+ // Look up one level, because the artifacts after build have dist directories
23
+ let relativeRuntimePath = path.join(
24
+ '../',
25
+ path.relative(appDirectory, serverRuntimePath),
26
+ );
27
+
28
+ if (process.env.NODE_ENV === 'development') {
29
+ relativeRuntimePath = `./${path.relative(
30
+ appDirectory,
31
+ serverRuntimePath,
32
+ )}`;
33
+ }
34
+
19
35
  return {
20
36
  source: {
21
- alias: { '@modern-js/runtime/server': bffExportsUtils.getPath() },
37
+ alias: {
38
+ '@modern-js/runtime/server': relativeRuntimePath,
39
+ },
22
40
  },
23
41
  };
24
42
  },
25
- modifyEntryImports() {
43
+ modifyEntryImports(input) {
26
44
  // eslint-disable-next-line react-hooks/rules-of-hooks
27
45
  const { appDirectory } = useAppContext();
28
46
  const runtimePath = require.resolve(`@modern-js/runtime`, {
@@ -56,6 +74,7 @@ export default createPlugin(
56
74
  ...pluginRuntime
57
75
  }
58
76
  `);
77
+ return input;
59
78
  },
60
79
  };
61
80
  },