@modern-js/plugin-ssg 1.2.9 → 1.2.12

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,43 @@
1
1
  # @modern-js/plugin-ssg
2
2
 
3
+ ## 1.2.12
4
+
5
+ ### Patch Changes
6
+
7
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
8
+ - Updated dependencies [d32f35134]
9
+ - Updated dependencies [6ae4a34ae]
10
+ - Updated dependencies [b80229c79]
11
+ - Updated dependencies [948cc4436]
12
+ - @modern-js/utils@1.7.3
13
+
14
+ ## 1.2.11
15
+
16
+ ### Patch Changes
17
+
18
+ - 69a728375: fix: remove exports.jsnext:source after publish
19
+ - Updated dependencies [cd7346b0d]
20
+ - Updated dependencies [69a728375]
21
+ - @modern-js/utils@1.7.2
22
+
23
+ ## 1.2.10
24
+
25
+ ### Patch Changes
26
+
27
+ - 895fa0ff: chore: using "workspace:\*" in devDependencies
28
+ - b54a15ed: fix ssg with server plugin
29
+ - Updated dependencies [2d155c4c]
30
+ - Updated dependencies [123e432d]
31
+ - Updated dependencies [e5a9b26d]
32
+ - Updated dependencies [0b26b93b]
33
+ - Updated dependencies [123e432d]
34
+ - Updated dependencies [f9f66ef9]
35
+ - Updated dependencies [592edabc]
36
+ - Updated dependencies [895fa0ff]
37
+ - Updated dependencies [3578913e]
38
+ - Updated dependencies [1c3beab3]
39
+ - @modern-js/utils@1.6.0
40
+
3
41
  ## 1.2.9
4
42
 
5
43
  ### Patch Changes
@@ -41,7 +41,7 @@ export function getUrlPrefix(route, baseUrl) {
41
41
  const filters = baseUrl.filter(url => route.urlPath.includes(url));
42
42
 
43
43
  if (filters.length > 1) {
44
- const matched = filters.sort((a, b) => a.length - b.length)[0]; // this should never happend
44
+ const matched = filters.sort((a, b) => a.length - b.length)[0]; // this should never happened
45
45
 
46
46
  if (!matched) {
47
47
  throw new Error('');
@@ -58,7 +58,7 @@ export function getUrlPrefix(route, baseUrl) {
58
58
  const prefix = `${base}/${entryName}`;
59
59
  return prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;
60
60
  } // if no output, return default path for aggred-route(relative),
61
- // or thorw error for control-route
61
+ // or throw error for control-route
62
62
 
63
63
  export function getOutput(route, base, agreed) {
64
64
  const {
@@ -13,8 +13,7 @@ export const createServer = (api, ssgRoutes, pageRoutes, apiRoutes, options, app
13
13
  silent: true
14
14
  });
15
15
  const appContext = api.useAppContext();
16
- const serverPlugins = appContext.plugins.filter(p => p.server).map(p => p.server);
17
- const plugins = serverPlugins.map(p => p.name);
16
+ const plugins = appContext.plugins.filter(p => p.server).map(p => p.server);
18
17
  cp.send(JSON.stringify({
19
18
  options,
20
19
  renderRoutes: ssgRoutes,
@@ -60,7 +60,7 @@ function getUrlPrefix(route, baseUrl) {
60
60
  const filters = baseUrl.filter(url => route.urlPath.includes(url));
61
61
 
62
62
  if (filters.length > 1) {
63
- const matched = filters.sort((a, b) => a.length - b.length)[0]; // this should never happend
63
+ const matched = filters.sort((a, b) => a.length - b.length)[0]; // this should never happened
64
64
 
65
65
  if (!matched) {
66
66
  throw new Error('');
@@ -77,7 +77,7 @@ function getUrlPrefix(route, baseUrl) {
77
77
  const prefix = `${base}/${entryName}`;
78
78
  return prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;
79
79
  } // if no output, return default path for aggred-route(relative),
80
- // or thorw error for control-route
80
+ // or throw error for control-route
81
81
 
82
82
 
83
83
  function getOutput(route, base, agreed) {
@@ -29,8 +29,7 @@ const createServer = (api, ssgRoutes, pageRoutes, apiRoutes, options, appDirecto
29
29
  });
30
30
 
31
31
  const appContext = api.useAppContext();
32
- const serverPlugins = appContext.plugins.filter(p => p.server).map(p => p.server);
33
- const plugins = serverPlugins.map(p => p.name);
32
+ const plugins = appContext.plugins.filter(p => p.server).map(p => p.server);
34
33
  cp.send(JSON.stringify({
35
34
  options,
36
35
  renderRoutes: ssgRoutes,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.9",
14
+ "version": "1.2.12",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -55,23 +55,23 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@babel/runtime": "^7",
58
- "@modern-js/utils": "^1.5.0",
58
+ "@modern-js/utils": "^1.7.3",
59
59
  "node-mocks-http": "^1.10.1",
60
60
  "normalize-path": "^3.0.0",
61
61
  "portfinder": "^1.0.28",
62
62
  "react-router-dom": "^5.2.1"
63
63
  },
64
64
  "devDependencies": {
65
- "@modern-js/types": "^1.5.0",
66
- "@modern-js/prod-server": "^1.1.1",
67
- "@types/jest": "^26",
65
+ "@modern-js/types": "1.5.3",
66
+ "@modern-js/prod-server": "1.1.5",
67
+ "@types/jest": "^27",
68
68
  "@types/node": "^14",
69
69
  "@types/react": "^17",
70
70
  "@types/react-dom": "^17",
71
71
  "@types/react-router": "^5.1.16",
72
72
  "@types/react-router-dom": "^5.1.8",
73
73
  "typescript": "^4",
74
- "@modern-js/core": "1.8.0",
74
+ "@modern-js/core": "1.10.2",
75
75
  "@scripts/build": "0.0.0",
76
76
  "jest": "^27",
77
77
  "@scripts/jest-config": "0.0.0"
@@ -86,11 +86,33 @@
86
86
  "registry": "https://registry.npmjs.org/",
87
87
  "access": "public"
88
88
  },
89
+ "wireit": {
90
+ "build": {
91
+ "command": "modern build",
92
+ "files": [
93
+ "src/**/*",
94
+ "tsconfig.json",
95
+ "package.json"
96
+ ],
97
+ "output": [
98
+ "dist/**/*"
99
+ ]
100
+ },
101
+ "test": {
102
+ "command": "jest --passWithNoTests",
103
+ "files": [
104
+ "src/**/*",
105
+ "tsconfig.json",
106
+ "package.json"
107
+ ],
108
+ "output": []
109
+ }
110
+ },
89
111
  "scripts": {
90
112
  "new": "modern new",
91
- "build": "modern build",
113
+ "build": "wireit",
92
114
  "dev": "modern build --watch",
93
- "test": "jest --passWithNoTests"
115
+ "test": "wireit"
94
116
  },
95
117
  "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"
96
118
  }
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,11 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "paths": {},
8
- "esModuleInterop": true
9
- },
10
- "include": ["src"]
11
- }