@modern-js/server-core 1.3.3 → 1.3.6-beta.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,27 @@
1
1
  # @modern-js/server-plugin
2
2
 
3
+ ## 1.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
8
+ - Updated dependencies [d5913bd96]
9
+ - Updated dependencies [d32f35134]
10
+ - Updated dependencies [6ae4a34ae]
11
+ - Updated dependencies [b80229c79]
12
+ - Updated dependencies [948cc4436]
13
+ - @modern-js/plugin@1.3.4
14
+ - @modern-js/utils@1.7.3
15
+
16
+ ## 1.3.4
17
+
18
+ ### Patch Changes
19
+
20
+ - 69a728375: fix: remove exports.jsnext:source after publish
21
+ - Updated dependencies [cd7346b0d]
22
+ - Updated dependencies [69a728375]
23
+ - @modern-js/utils@1.7.2
24
+
3
25
  ## 1.3.3
4
26
 
5
27
  ### Patch Changes
@@ -35,6 +35,7 @@ const beforeSend = createAsyncPipeline();
35
35
  const afterSend = createParallelWorkflow();
36
36
  const reset = createParallelWorkflow();
37
37
  export const AppContext = createContext({});
38
+ export const setAppContext = value => AppContext.set(value);
38
39
  export const ConfigContext = createContext({});
39
40
  /**
40
41
  * Get original content of user config.
@@ -48,7 +49,8 @@ export const useConfigContext = () => ConfigContext.use().value;
48
49
  export const useAppContext = () => AppContext.use().value;
49
50
  const pluginAPI = {
50
51
  useAppContext,
51
- useConfigContext
52
+ useConfigContext,
53
+ setAppContext
52
54
  };
53
55
  const serverHooks = {
54
56
  // server hook
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useConfigContext = exports.useAppContext = exports.serverManager = exports.createServerManager = exports.createPlugin = exports.ConfigContext = exports.AppContext = void 0;
6
+ exports.useConfigContext = exports.useAppContext = exports.setAppContext = exports.serverManager = exports.createServerManager = exports.createPlugin = exports.ConfigContext = exports.AppContext = void 0;
7
7
 
8
8
  var _plugin = require("@modern-js/plugin");
9
9
 
@@ -45,6 +45,10 @@ const afterSend = (0, _plugin.createParallelWorkflow)();
45
45
  const reset = (0, _plugin.createParallelWorkflow)();
46
46
  const AppContext = (0, _plugin.createContext)({});
47
47
  exports.AppContext = AppContext;
48
+
49
+ const setAppContext = value => AppContext.set(value);
50
+
51
+ exports.setAppContext = setAppContext;
48
52
  const ConfigContext = (0, _plugin.createContext)({});
49
53
  /**
50
54
  * Get original content of user config.
@@ -65,7 +69,8 @@ const useAppContext = () => AppContext.use().value;
65
69
  exports.useAppContext = useAppContext;
66
70
  const pluginAPI = {
67
71
  useAppContext,
68
- useConfigContext
72
+ useConfigContext,
73
+ setAppContext
69
74
  };
70
75
  const serverHooks = {
71
76
  // server hook
@@ -34,6 +34,7 @@ export declare type RequestResult = {
34
34
  export declare type SSRServerContext = Record<string, unknown>;
35
35
  export declare type RenderContext = Record<string, unknown>;
36
36
  export declare const AppContext: import("@modern-js/plugin").Context<ISAppContext>;
37
+ export declare const setAppContext: (value: ISAppContext) => void;
37
38
  export declare const ConfigContext: import("@modern-js/plugin").Context<UserConfig>;
38
39
  /**
39
40
  * Get original content of user config.
@@ -48,6 +49,7 @@ export declare const useAppContext: () => ISAppContext;
48
49
  declare const pluginAPI: {
49
50
  useAppContext: () => ISAppContext;
50
51
  useConfigContext: () => UserConfig;
52
+ setAppContext: (value: ISAppContext) => void;
51
53
  };
52
54
  declare const serverHooks: {
53
55
  gather: import("@modern-js/plugin").ParallelWorkflow<{
@@ -170,6 +172,7 @@ export declare const createServerManager: () => import("@modern-js/plugin").Asyn
170
172
  }, {
171
173
  useAppContext: () => ISAppContext;
172
174
  useConfigContext: () => UserConfig;
175
+ setAppContext: (value: ISAppContext) => void;
173
176
  }>;
174
177
  export declare const serverManager: import("@modern-js/plugin").AsyncManager<{
175
178
  gather: import("@modern-js/plugin").ParallelWorkflow<{
@@ -228,6 +231,7 @@ export declare const serverManager: import("@modern-js/plugin").AsyncManager<{
228
231
  }, {
229
232
  useAppContext: () => ISAppContext;
230
233
  useConfigContext: () => UserConfig;
234
+ setAppContext: (value: ISAppContext) => void;
231
235
  }>;
232
236
  /** Plugin options of a server plugin. */
233
237
 
@@ -295,6 +299,7 @@ export declare const createPlugin: (setup?: AsyncSetup<{
295
299
  }, {
296
300
  useAppContext: () => ISAppContext;
297
301
  useConfigContext: () => UserConfig;
302
+ setAppContext: (value: ISAppContext) => void;
298
303
  }> | undefined, options?: PluginOptions<{
299
304
  gather: import("@modern-js/plugin").ParallelWorkflow<{
300
305
  addWebMiddleware: (_input: any) => void;
@@ -406,6 +411,7 @@ export declare const createPlugin: (setup?: AsyncSetup<{
406
411
  }, {
407
412
  useAppContext: () => ISAppContext;
408
413
  useConfigContext: () => UserConfig;
414
+ setAppContext: (value: ISAppContext) => void;
409
415
  }>> | undefined) => import("@modern-js/plugin").AsyncPlugin<{
410
416
  gather: import("@modern-js/plugin").ParallelWorkflow<{
411
417
  addWebMiddleware: (_input: any) => void;
@@ -463,5 +469,6 @@ export declare const createPlugin: (setup?: AsyncSetup<{
463
469
  }, {
464
470
  useAppContext: () => ISAppContext;
465
471
  useConfigContext: () => UserConfig;
472
+ setAppContext: (value: ISAppContext) => void;
466
473
  }>;
467
474
  export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.3.3",
14
+ "version": "1.3.6-beta.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -28,15 +28,15 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@modern-js/plugin": "^1.3.3",
32
- "@modern-js/utils": "^1.7.0"
31
+ "@modern-js/plugin": "^1.3.6",
32
+ "@modern-js/utils": "^1.7.6"
33
33
  },
34
34
  "devDependencies": {
35
- "@modern-js/core": "1.10.0",
36
- "@modern-js/types": "1.5.2",
35
+ "@modern-js/core": "1.11.2",
36
+ "@modern-js/types": "1.5.4",
37
37
  "@scripts/build": "0.0.0",
38
38
  "@scripts/jest-config": "0.0.0",
39
- "@types/jest": "^26",
39
+ "@types/jest": "^27",
40
40
  "@types/node": "^14",
41
41
  "@types/react": "^17",
42
42
  "@types/react-dom": "^17",
@@ -53,12 +53,36 @@
53
53
  },
54
54
  "publishConfig": {
55
55
  "registry": "https://registry.npmjs.org/",
56
- "access": "public"
56
+ "access": "public",
57
+ "types": "./dist/types/index.d.ts"
58
+ },
59
+ "wireit": {
60
+ "build": {
61
+ "command": "modern build",
62
+ "files": [
63
+ "src/**/*",
64
+ "tsconfig.json",
65
+ "package.json"
66
+ ],
67
+ "output": [
68
+ "dist/**/*"
69
+ ]
70
+ },
71
+ "test": {
72
+ "command": "jest --passWithNoTests",
73
+ "files": [
74
+ "src/**/*",
75
+ "tsconfig.json",
76
+ "package.json",
77
+ "tests/**/*"
78
+ ],
79
+ "output": []
80
+ }
57
81
  },
58
82
  "scripts": {
59
83
  "new": "modern new",
60
- "build": "modern build",
61
- "test": "jest --passWithNoTests"
84
+ "build": "wireit",
85
+ "test": "wireit"
62
86
  },
63
87
  "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"
64
88
  }
package/.eslintrc.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- extends: ['@modern-js'],
3
- parserOptions: {
4
- project: require.resolve('./tsconfig.json'),
5
- },
6
- };
package/jest.config.js DELETED
@@ -1,7 +0,0 @@
1
- const sharedConfig = require('@scripts/jest-config');
2
-
3
- /** @type {import('@jest/types').Config.InitialOptions} */
4
- module.exports = {
5
- ...sharedConfig,
6
- rootDir: __dirname,
7
- };
package/modern.config.js DELETED
@@ -1,2 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {};
package/tsconfig.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "isolatedModules": true,
8
- "paths": {},
9
- "types": ["node", "jest"]
10
- },
11
- "include": ["src"]
12
- }