@modern-js/plugin-docsite 0.0.0-canary-20220413163328 → 0.0.0-canary-20220511090154

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.
File without changes
@@ -0,0 +1 @@
1
+ {"cacheable":true,"platform":"linux","arch":"x64","nodeVersion":"v14.19.1","command":"modern build","clean":true,"files":{"package.json":"0a8fa6ea48460a9d64effddacd80cc4b29671529bf331f126deacd6a701f5e10","src/build-task.ts":"83a3bc9ddc1dca960e9b2e5de84ac1963d49fab0fe7e1e639e152273674b8a6a","src/features/build.ts":"7e314c553a35d220360389ed285bf343802ba6b5e98e87de0ae316df37245d87","src/features/constant.ts":"a045ca15eb2b8afbab33f58a83f86f53c784e077bb98eb8267ce66b4e80f346a","src/features/dev.ts":"28a87b0b1b53decb55e1b10dadfc48478004d379b820ec6960602d9551d7afd9","src/features/index.ts":"06fc0fc245e398c5cc6466f03c35b14647b20773f80af721c6b1a33e173dcc52","src/features/utils/chokidar.ts":"b477d03f665a59fa80b2b3cc1ee9d796a084cb811966ddaf3026f94deeb5ea21","src/features/utils/generate-files.ts":"8df9d977e311f5cfe9932c44e2817971723a6a3f598be5747073562f48adf223","src/features/utils/valid.ts":"d7775e29f332249da78a07c830e5f38aa516ca5c8e790883fb51d7f78e3712a4","src/features/utils/webpack.ts":"13744c27b61f96dfb2c8c45fd6a31c8cf2e5750b521410f86a0c43c534a838c2","src/index.ts":"0780e6c913c4071820eb32ff002b704ee5584542004149a070ce202090ee66c9","src/type.d.ts":"a235d11736458f99c839b62023ac534118297e27f19b815c49538267e2c24896","tsconfig.json":"5731d8911916d6287062c7fe93aab75c2133ba94d23354195bc24ac3a6534503"},"output":["dist/**/*.js"],"dependencies":{}}
@@ -0,0 +1,9 @@
1
+ Compiling in progress...
2
+ Run `tsc` log:
3
+ [TSC Compiler]: Successfully
4
+
5
+
6
+ Run babel compiler code log:
7
+ [Babel Compiler]: Successfully
8
+
9
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,90 @@
1
1
  # @modern-js/plugin-docsite
2
2
 
3
+ ## 0.0.0-canary-20220511090154
4
+
5
+ ### Patch Changes
6
+
7
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
8
+ - Updated dependencies [d2995e7d7]
9
+ - Updated dependencies [47934c4da]
10
+ - Updated dependencies [d32f35134]
11
+ - Updated dependencies [97086dde8]
12
+ - Updated dependencies [6ae4a34ae]
13
+ - Updated dependencies [97086dde8]
14
+ - Updated dependencies [97086dde8]
15
+ - @modern-js/webpack@0.0.0-canary-20220511090154
16
+ - @modern-js/utils@0.0.0-canary-20220511090154
17
+
18
+ ## 1.2.9
19
+
20
+ ### Patch Changes
21
+
22
+ - 69a728375: fix: remove exports.jsnext:source after publish
23
+ - Updated dependencies [b7b8075dc]
24
+ - Updated dependencies [cd7346b0d]
25
+ - Updated dependencies [0e0537005]
26
+ - Updated dependencies [738c55d39]
27
+ - Updated dependencies [69a728375]
28
+ - @modern-js/webpack@1.6.2
29
+ - @modern-js/utils@1.7.2
30
+
31
+ ## 1.2.8
32
+
33
+ ### Patch Changes
34
+
35
+ - 77519490: refactor(webpack): remove `@modern-js/core`
36
+ - Updated dependencies [2d155c4c]
37
+ - Updated dependencies [a0475f1a]
38
+ - Updated dependencies [123e432d]
39
+ - Updated dependencies [e5a9b26d]
40
+ - Updated dependencies [0b26b93b]
41
+ - Updated dependencies [123e432d]
42
+ - Updated dependencies [f9f66ef9]
43
+ - Updated dependencies [71526621]
44
+ - Updated dependencies [77519490]
45
+ - Updated dependencies [592edabc]
46
+ - Updated dependencies [3578716a]
47
+ - Updated dependencies [895fa0ff]
48
+ - Updated dependencies [3d1fac2a]
49
+ - Updated dependencies [3578913e]
50
+ - Updated dependencies [1c3beab3]
51
+ - @modern-js/utils@1.6.0
52
+ - @modern-js/webpack@1.5.7
53
+
54
+ ## 1.2.7
55
+
56
+ ### Patch Changes
57
+
58
+ - 6cffe99d: chore:
59
+ remove react eslint rules for `modern-js` rule set.
60
+ add .eslintrc for each package to speed up linting
61
+ - 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
62
+ - 60f7d8bf: feat: add tests dir to npmignore
63
+ - 5dbbeb57: fix: export extended Command type
64
+ - Updated dependencies [b8599d09]
65
+ - Updated dependencies [6cffe99d]
66
+ - Updated dependencies [04ae5262]
67
+ - Updated dependencies [60f7d8bf]
68
+ - Updated dependencies [e4cec1ce]
69
+ - Updated dependencies [3bf4f8b0]
70
+ - @modern-js/utils@1.5.0
71
+ - @modern-js/webpack@1.5.5
72
+
73
+ ## 1.2.6
74
+
75
+ ### Patch Changes
76
+
77
+ - 17d0cc46: feat: prebundle lodash to @modern-js/utils/lodash
78
+ - Updated dependencies [ec1b7367]
79
+ - Updated dependencies [77ff9754]
80
+ - Updated dependencies [d2d1d6b2]
81
+ - Updated dependencies [07a4887e]
82
+ - Updated dependencies [ea2ae711]
83
+ - Updated dependencies [17d0cc46]
84
+ - Updated dependencies [d2d1d6b2]
85
+ - @modern-js/webpack@1.5.4
86
+ - @modern-js/utils@1.4.0
87
+
3
88
  ## 1.2.5
4
89
 
5
90
  ### Patch Changes
@@ -1,9 +1,3 @@
1
- import _difference from "lodash/difference";
2
- import _template from "lodash/template";
3
- import _union from "lodash/union";
4
- import _camelCase from "lodash/camelCase";
5
- import _startCase from "lodash/startCase";
6
-
7
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; }
8
2
 
9
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; }
@@ -13,6 +7,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
13
7
  import path from 'path';
14
8
  import { logger, fs } from '@modern-js/utils';
15
9
  import matter from 'gray-matter';
10
+ import { startCase, camelCase, union, template, difference } from '@modern-js/utils/lodash';
16
11
  import GithubSlugger from 'github-slugger';
17
12
  import sortPaths from 'sort-paths';
18
13
  import visit from 'unist-util-visit';
@@ -31,7 +26,7 @@ const loadTemplate = async (file, customPath = false) => {
31
26
  result = await fs.readFile(path.join(UTILS_STATIC, file), 'utf-8');
32
27
  }
33
28
 
34
- return _template(result, {
29
+ return template(result, {
35
30
  interpolate: /<%=([\s\S]+?)%>/g
36
31
  });
37
32
  };
@@ -42,7 +37,7 @@ async function handleFile(appDirectory, tmpDir, file, images) {
42
37
  const parsed = matter(content);
43
38
 
44
39
  if (!parsed.data.title) {
45
- parsed.data.title = _startCase(_camelCase(path.basename(moduleName)));
40
+ parsed.data.title = startCase(camelCase(path.basename(moduleName)));
46
41
  }
47
42
 
48
43
  const slugger = new GithubSlugger();
@@ -84,12 +79,10 @@ async function handleFile(appDirectory, tmpDir, file, images) {
84
79
  }
85
80
  });
86
81
  });
87
-
88
- const extraImported = _difference(imported.map(n => n.id), exported.map(n => n.id)); // we have to put the export statement with the import,
82
+ const extraImported = difference(imported.map(n => n.id), exported.map(n => n.id)); // we have to put the export statement with the import,
89
83
  // otherwise the mdx's babel transformer cannot found
90
84
  // the corresponding imports
91
85
 
92
-
93
86
  extraImported.forEach(id => {
94
87
  const {
95
88
  node
@@ -140,9 +133,7 @@ async function handleFile(appDirectory, tmpDir, file, images) {
140
133
  const transpiled = await mdx(parsed.content, {
141
134
  remarkPlugins: [modifier]
142
135
  });
143
-
144
- const totalExported = _union(imported.map(n => n.id), exported.map(n => n.id));
145
-
136
+ const totalExported = union(imported.map(n => n.id), exported.map(n => n.id));
146
137
  const outputFile = path.resolve(tmpDir, `${moduleName}/mdx.jsx`);
147
138
  await fs.outputFile(outputFile, MDX_DEFAULT_RENDERER + transpiled, {
148
139
  encoding: 'utf8'
@@ -5,7 +5,8 @@ import webpack from 'webpack';
5
5
  import { getWebpackConfig, WebpackConfigTarget } from '@modern-js/webpack';
6
6
  import { UTILS_STATIC } from "../constant";
7
7
  export function generatorWebpackConfig(appDirectory, tmpDir, isDev) {
8
- const originConfig = getWebpackConfig(WebpackConfigTarget.CLIENT);
8
+ // FIXME: 这个包现在没有使用,待使用时再重构 webpack 配置的获取
9
+ const originConfig = getWebpackConfig(WebpackConfigTarget.CLIENT, {}, {});
9
10
  const plugins = (originConfig.plugins || []).filter(p => p.constructor !== webpack.HotModuleReplacementPlugin);
10
11
  const config = {
11
12
  mode: isDev ? 'development' : 'production',
@@ -5,22 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.generateFiles = generateFiles;
7
7
 
8
- var _difference2 = _interopRequireDefault(require("lodash/difference"));
9
-
10
- var _template2 = _interopRequireDefault(require("lodash/template"));
11
-
12
- var _union2 = _interopRequireDefault(require("lodash/union"));
13
-
14
- var _camelCase2 = _interopRequireDefault(require("lodash/camelCase"));
15
-
16
- var _startCase2 = _interopRequireDefault(require("lodash/startCase"));
17
-
18
8
  var _path = _interopRequireDefault(require("path"));
19
9
 
20
10
  var _utils = require("@modern-js/utils");
21
11
 
22
12
  var _grayMatter = _interopRequireDefault(require("gray-matter"));
23
13
 
14
+ var _lodash = require("@modern-js/utils/lodash");
15
+
24
16
  var _githubSlugger = _interopRequireDefault(require("github-slugger"));
25
17
 
26
18
  var _sortPaths = _interopRequireDefault(require("sort-paths"));
@@ -54,7 +46,7 @@ const loadTemplate = async (file, customPath = false) => {
54
46
  result = await _utils.fs.readFile(_path.default.join(_constant.UTILS_STATIC, file), 'utf-8');
55
47
  }
56
48
 
57
- return (0, _template2.default)(result, {
49
+ return (0, _lodash.template)(result, {
58
50
  interpolate: /<%=([\s\S]+?)%>/g
59
51
  });
60
52
  };
@@ -65,7 +57,7 @@ async function handleFile(appDirectory, tmpDir, file, images) {
65
57
  const parsed = (0, _grayMatter.default)(content);
66
58
 
67
59
  if (!parsed.data.title) {
68
- parsed.data.title = (0, _startCase2.default)((0, _camelCase2.default)(_path.default.basename(moduleName)));
60
+ parsed.data.title = (0, _lodash.startCase)((0, _lodash.camelCase)(_path.default.basename(moduleName)));
69
61
  }
70
62
 
71
63
  const slugger = new _githubSlugger.default();
@@ -109,7 +101,7 @@ async function handleFile(appDirectory, tmpDir, file, images) {
109
101
  }
110
102
  });
111
103
  });
112
- const extraImported = (0, _difference2.default)(imported.map(n => n.id), exported.map(n => n.id)); // we have to put the export statement with the import,
104
+ const extraImported = (0, _lodash.difference)(imported.map(n => n.id), exported.map(n => n.id)); // we have to put the export statement with the import,
113
105
  // otherwise the mdx's babel transformer cannot found
114
106
  // the corresponding imports
115
107
 
@@ -164,7 +156,7 @@ async function handleFile(appDirectory, tmpDir, file, images) {
164
156
  const transpiled = await (0, _mdx.default)(parsed.content, {
165
157
  remarkPlugins: [modifier]
166
158
  });
167
- const totalExported = (0, _union2.default)(imported.map(n => n.id), exported.map(n => n.id));
159
+ const totalExported = (0, _lodash.union)(imported.map(n => n.id), exported.map(n => n.id));
168
160
 
169
161
  const outputFile = _path.default.resolve(tmpDir, `${moduleName}/mdx.jsx`);
170
162
 
@@ -21,7 +21,8 @@ var _constant = require("../constant");
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
22
 
23
23
  function generatorWebpackConfig(appDirectory, tmpDir, isDev) {
24
- const originConfig = (0, _webpack2.getWebpackConfig)(_webpack2.WebpackConfigTarget.CLIENT);
24
+ // FIXME: 这个包现在没有使用,待使用时再重构 webpack 配置的获取
25
+ const originConfig = (0, _webpack2.getWebpackConfig)(_webpack2.WebpackConfigTarget.CLIENT, {}, {});
25
26
  const plugins = (originConfig.plugins || []).filter(p => p.constructor !== _webpack.default.HotModuleReplacementPlugin);
26
27
  const config = {
27
28
  mode: isDev ? 'development' : 'production',
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-canary-20220413163328",
14
+ "version": "0.0.0-canary-20220511090154",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -37,14 +37,13 @@
37
37
  "@babel/runtime": "^7",
38
38
  "@mdx-js/mdx": "^1.6.22",
39
39
  "@mdx-js/react": "^1.6.22",
40
- "@modern-js/utils": "^0.0.0-canary-20220413163328",
41
- "@modern-js/webpack": "^0.0.0-canary-20220413163328",
40
+ "@modern-js/utils": "^0.0.0-canary-20220511090154",
41
+ "@modern-js/webpack": "^0.0.0-canary-20220511090154",
42
42
  "antd": "^4.16.13",
43
43
  "core-js": "^3.17.2",
44
44
  "github-slugger": "^1.4.0",
45
45
  "gray-matter": "^4.0.3",
46
46
  "html-webpack-plugin": "^5.3.2",
47
- "lodash": "^4.17.21",
48
47
  "mdast-util-to-string": "^2.0.0",
49
48
  "path-browserify": "^1.0.1",
50
49
  "prism-react-renderer": "^1.2.1",
@@ -59,14 +58,13 @@
59
58
  "webpack-dev-server": "^4.1.1"
60
59
  },
61
60
  "devDependencies": {
62
- "@modern-js/core": "0.0.0-canary-20220413163328",
61
+ "@modern-js/core": "0.0.0-canary-20220511090154",
63
62
  "@scripts/build": "0.0.0",
64
63
  "@scripts/jest-config": "0.0.0",
65
64
  "@types/core-js": "^2.5.5",
66
65
  "@types/github-slugger": "^1.3.0",
67
66
  "@types/glob": "^7.1.4",
68
67
  "@types/jest": "^26",
69
- "@types/lodash": "^4.14.168",
70
68
  "@types/node": "^14",
71
69
  "@types/react": "^17",
72
70
  "@types/react-dom": "^17",
@@ -90,10 +88,32 @@
90
88
  "registry": "https://registry.npmjs.org/",
91
89
  "access": "public"
92
90
  },
91
+ "wireit": {
92
+ "build": {
93
+ "command": "modern build",
94
+ "files": [
95
+ "src/**/*.ts",
96
+ "tsconfig.json",
97
+ "package.json"
98
+ ],
99
+ "output": [
100
+ "dist/**/*.js"
101
+ ]
102
+ },
103
+ "test": {
104
+ "command": "jest --passWithNoTests",
105
+ "files": [
106
+ "src/**/*.ts",
107
+ "tsconfig.json",
108
+ "package.json"
109
+ ],
110
+ "output": []
111
+ }
112
+ },
93
113
  "scripts": {
94
114
  "new": "modern new",
95
- "build": "modern build",
96
- "test": "jest --passWithNoTests"
115
+ "build": "wireit",
116
+ "test": "wireit"
97
117
  },
98
118
  "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"
99
119
  }
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "module": "esnext",
5
- "baseUrl": "./",
6
- "paths": {
7
- "@*": ["./*"]
8
- },
9
- "lib": ["dom", "dom.iterable", "esnext"],
10
- "allowJs": true,
11
- "skipLibCheck": true,
12
- "esModuleInterop": true,
13
- "allowSyntheticDefaultImports": true,
14
- "strict": true,
15
- "noImplicitReturns": true,
16
- "noUnusedLocals": true,
17
- "noUnusedParameters": true,
18
- "forceConsistentCasingInFileNames": true,
19
- "moduleResolution": "node",
20
- "resolveJsonModule": true,
21
- "noEmit": true,
22
- "jsx": "react"
23
- },
24
- "include": ["src"]
25
- }
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 = {};
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "module": "esnext",
5
- "baseUrl": "./",
6
- "paths": {
7
- "@*": ["./*"]
8
- },
9
- "lib": ["dom", "dom.iterable", "esnext"],
10
- "allowJs": true,
11
- "skipLibCheck": true,
12
- "esModuleInterop": true,
13
- "allowSyntheticDefaultImports": true,
14
- "strict": true,
15
- "noImplicitReturns": true,
16
- "noUnusedLocals": true,
17
- "noUnusedParameters": true,
18
- "forceConsistentCasingInFileNames": true,
19
- "moduleResolution": "node",
20
- "resolveJsonModule": true,
21
- "noEmit": true,
22
- "jsx": "react"
23
- },
24
- "include": ["src"]
25
- }
@@ -1,7 +0,0 @@
1
- import plugin from '../src';
2
-
3
- describe('plugin-docset', () => {
4
- it('default', () => {
5
- expect(plugin).toBeDefined();
6
- });
7
- });
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "outDir": "./out",
8
- "emitDeclarationOnly": true,
9
- "isolatedModules": true,
10
- "paths": {},
11
- "types": ["node", "jest"]
12
- }
13
- }
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
- "isolatedModules": true,
8
- "paths": {}
9
- },
10
- "include": ["src"]
11
- }