@modern-js/runtime 1.1.3 → 1.2.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,5 +1,34 @@
1
1
  # @modern-js/runtime
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cfe11628: Make Modern.js self bootstraping
8
+
9
+ ### Patch Changes
10
+
11
+ - 146dcd85: modify server framework plugin hook types and hook context
12
+ - 146dcd85: modify server framework plugin hook types
13
+ - 146dcd85: fix test case in babel compiler
14
+ - Updated dependencies [2da09c69]
15
+ - Updated dependencies [5597289b]
16
+ - Updated dependencies [fc71e36f]
17
+ - Updated dependencies [146dcd85]
18
+ - Updated dependencies [a2cb9abc]
19
+ - Updated dependencies [c3d46ee4]
20
+ - Updated dependencies [cfe11628]
21
+ - Updated dependencies [146dcd85]
22
+ - Updated dependencies [146dcd85]
23
+ - @modern-js/utils@1.2.0
24
+ - @modern-js/plugin-ssr@1.2.0
25
+ - @modern-js/create-request@1.2.0
26
+ - @modern-js/core@1.3.0
27
+ - @modern-js/bff-runtime@1.2.0
28
+ - @modern-js/runtime-core@1.2.0
29
+ - @modern-js/plugin-router@1.2.0
30
+ - @modern-js/plugin-state@1.2.0
31
+
3
32
  ## 1.1.3
4
33
 
5
34
  ### Patch Changes
@@ -1 +1,2 @@
1
- export * from '@modern-js/bff-runtime';
1
+ export * from '@modern-js/bff-runtime';
2
+ export const hook = attacher => attacher;
@@ -3,11 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ hook: true
8
+ };
9
+ exports.hook = void 0;
6
10
 
7
11
  var _bffRuntime = require("@modern-js/bff-runtime");
8
12
 
9
13
  Object.keys(_bffRuntime).forEach(function (key) {
10
14
  if (key === "default" || key === "__esModule") return;
15
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
11
16
  if (key in exports && exports[key] === _bffRuntime[key]) return;
12
17
  Object.defineProperty(exports, key, {
13
18
  enumerable: true,
@@ -15,4 +20,8 @@ Object.keys(_bffRuntime).forEach(function (key) {
15
20
  return _bffRuntime[key];
16
21
  }
17
22
  });
18
- });
23
+ });
24
+
25
+ const hook = attacher => attacher;
26
+
27
+ exports.hook = hook;
@@ -1 +1,4 @@
1
- export * from '@modern-js/bff-runtime';
1
+ export * from '@modern-js/bff-runtime';
2
+ export var hook = function hook(attacher) {
3
+ return attacher;
4
+ };
@@ -1 +1,2 @@
1
- export * from '@modern-js/bff-runtime';
1
+ export * from '@modern-js/bff-runtime';
2
+ export declare const hook: (attacher: any) => any;
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ const sharedConfig = require('@scripts/jest-config');
2
+
3
+ /** @type {import('@jest/types').Config.InitialOptions} */
4
+ module.exports = {
5
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
6
+ ...sharedConfig,
7
+ rootDir: __dirname,
8
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.3",
14
+ "version": "1.2.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./type.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -103,43 +103,45 @@
103
103
  },
104
104
  "dependencies": {
105
105
  "@babel/runtime": "^7",
106
+ "@modern-js/plugin-router": "^1.2.0",
107
+ "@modern-js/plugin-ssr": "^1.2.0",
108
+ "@modern-js/plugin-state": "^1.2.0",
109
+ "@modern-js/runtime-core": "^1.2.0",
110
+ "@modern-js/utils": "^1.2.0",
111
+ "@modern-js/bff-runtime": "^1.2.0",
112
+ "@modern-js/create-request": "^1.2.0",
106
113
  "@loadable/component": "^5.15.0",
107
- "@modern-js/bff-runtime": "^1.1.1",
108
- "@modern-js/create-request": "^1.1.2",
109
- "@modern-js/plugin-router": "^1.1.3",
110
- "@modern-js/plugin-ssr": "^1.1.3",
111
- "@modern-js/plugin-state": "^1.1.4",
112
- "@modern-js/runtime-core": "^1.1.4",
113
- "@modern-js/utils": "^1.1.6",
114
- "@types/loadable__component": "^5.13.4",
115
- "@types/react-helmet": "^6.1.2",
116
- "@types/styled-components": "^5.1.13",
117
114
  "react-helmet": "^6.1.0",
118
115
  "styled-components": "^5.3.1"
119
116
  },
120
117
  "devDependencies": {
121
- "@modern-js/core": "^1.1.2",
122
- "@modern-js/module-tools": "^1.1.5",
123
- "@modern-js/plugin-testing": "^1.2.2",
118
+ "@modern-js/core": "^1.3.0",
119
+ "@scripts/build": "0.0.0",
120
+ "@types/loadable__component": "^5.13.4",
121
+ "@types/react-helmet": "^6.1.2",
122
+ "@types/styled-components": "^5.1.13",
124
123
  "@types/jest": "^26",
125
124
  "@types/node": "^14",
126
125
  "@types/react": "^17",
127
126
  "@types/react-dom": "^17",
128
- "typescript": "^4"
127
+ "typescript": "^4",
128
+ "jest": "^27",
129
+ "@scripts/jest-config": "0.0.0"
129
130
  },
130
131
  "peerDependencies": {
131
- "@modern-js/core": "^1.1.2"
132
+ "@modern-js/core": "^1.3.0"
132
133
  },
133
134
  "sideEffects": false,
134
135
  "modernConfig": {},
135
136
  "publishConfig": {
136
137
  "registry": "https://registry.npmjs.org/",
137
- "access": "public"
138
+ "access": "public",
139
+ "types": "./type.d.ts"
138
140
  },
139
141
  "scripts": {
140
142
  "new": "modern new",
141
143
  "build": "modern build",
142
- "test": "modern test --passWithNoTests"
144
+ "test": "jest --passWithNoTests"
143
145
  },
144
146
  "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"
145
147
  }
@@ -1 +1,2 @@
1
1
  export * from '@modern-js/bff-runtime';
2
+ export const hook = (attacher: any) => attacher;
@@ -0,0 +1,11 @@
1
+ import { createApp, createPlugin, useRuntimeContext } from '../src';
2
+ import plugin from '../src/cli';
3
+
4
+ describe('plugin-runtime', () => {
5
+ it('default', () => {
6
+ expect(plugin).toBeDefined();
7
+ expect(createApp).toBeDefined();
8
+ expect(createPlugin).toBeDefined();
9
+ expect(useRuntimeContext).toBeDefined();
10
+ });
11
+ });
@@ -0,0 +1,10 @@
1
+ import { hook } from '../src/exports/server';
2
+
3
+ describe('runtime export', () => {
4
+ it('should return self after hook', () => {
5
+ const fn = () => {
6
+ // empty
7
+ };
8
+ expect(hook(fn)).toBe(fn);
9
+ });
10
+ });
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@modern-js/tsconfig/base",
3
+ "compilerOptions": {
4
+ "declaration": false,
5
+ "jsx": "preserve",
6
+ "baseUrl": "./",
7
+ "noEmit": true,
8
+ "isolatedModules": true,
9
+ "sourceMap": true,
10
+ "types": ["node", "jest"]
11
+ },
12
+ "paths": {}
13
+ }