dumi 2.0.2 → 2.0.3

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/bin/dumi.js CHANGED
File without changes
@@ -1 +1 @@
1
- (function(){var e={226:function(e){var n=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,o,i,c)=>{if(o&&typeof o==="object"||typeof o==="function"){for(let s of r(o))if(!a.call(e,s)&&s!==i)n(e,s,{get:()=>o[s],enumerable:!(c=t(o,s))||c.enumerable})}return e};var __toCommonJS=e=>__copyProps(n({},"__esModule",{value:true}),e);var o={};__export(o,{default:()=>analytics_default});e.exports=__toCommonJS(o);var analytics_default=e=>{const n=process.env.GA_KEY;const t=process.env.GA_V2_KEY;const enableBy=e=>e.config.analytics||n;e.describe({key:"analytics",config:{schema(e){return e.alternatives().try(e.object({baidu:e.string(),ga:e.string(),ga_v2:e.string()}),e.boolean().invalid(true))},onChange:e.ConfigChangeType.reload},enableBy:enableBy});const baiduTpl=e=>`\n (function() {\n var hm = document.createElement('script');\n hm.src = '//hm.baidu.com/hm.js?${e}';\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(hm, s);\n })();\n `;const gaTpl=e=>`\n (function(){\n if (!location.port) {\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments)\n }, i[r].l = 1 * new Date();\n a = s.createElement(o),\n m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m)\n })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');\n ga('create', '${e}', 'auto');\n ga('send', 'pageview');\n }\n })();\n `;const gaV2Tpl=e=>`\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${e}');\n `.trim();e.addHTMLHeadScripts((()=>{const r=e.config.analytics||{};const{baidu:a,ga:o=n,ga_v2:i=t}=r;const c=[];if(a){c.push({content:"var _hmt = _hmt || [];"})}if(e.env!=="development"){if(a){c.push({content:baiduTpl(a)})}if(o){c.push({content:gaTpl(o)})}if(i){c.push({async:true,src:`//www.googletagmanager.com/gtag/js?id=${i}`},{content:gaV2Tpl(i)})}}return c.filter(Boolean)}))};0&&0}};var n={};function __nccwpck_require__(t){var r=n[t];if(r!==undefined){return r.exports}var a=n[t]={exports:{}};var o=true;try{e[t](a,a.exports,__nccwpck_require__);o=false}finally{if(o)delete n[t]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(226);module.exports=t})();
1
+ (function(){var e={814:function(e){var n=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,o,i,c)=>{if(o&&typeof o==="object"||typeof o==="function"){for(let s of r(o))if(!a.call(e,s)&&s!==i)n(e,s,{get:()=>o[s],enumerable:!(c=t(o,s))||c.enumerable})}return e};var __toCommonJS=e=>__copyProps(n({},"__esModule",{value:true}),e);var o={};__export(o,{default:()=>analytics_default});e.exports=__toCommonJS(o);var analytics_default=e=>{const n=process.env.GA_KEY;const t=process.env.GA_V2_KEY;const enableBy=e=>e.config.analytics||n;e.describe({key:"analytics",config:{schema(e){return e.alternatives().try(e.object({baidu:e.string(),ga:e.string(),ga_v2:e.string()}),e.boolean().invalid(true))},onChange:e.ConfigChangeType.reload},enableBy:enableBy});const baiduTpl=e=>`\n (function() {\n var hm = document.createElement('script');\n hm.src = '//hm.baidu.com/hm.js?${e}';\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(hm, s);\n })();\n `;const gaTpl=e=>`\n (function(){\n if (!location.port) {\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments)\n }, i[r].l = 1 * new Date();\n a = s.createElement(o),\n m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m)\n })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');\n ga('create', '${e}', 'auto');\n ga('send', 'pageview');\n }\n })();\n `;const gaV2Tpl=e=>`\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${e}');\n `.trim();e.addHTMLHeadScripts((()=>{const r=e.config.analytics||{};const{baidu:a,ga:o=n,ga_v2:i=t}=r;const c=[];if(a){c.push({content:"var _hmt = _hmt || [];"})}if(e.env!=="development"){if(a){c.push({content:baiduTpl(a)})}if(o){c.push({content:gaTpl(o)})}if(i){c.push({async:true,src:`//www.googletagmanager.com/gtag/js?id=${i}`},{content:gaV2Tpl(i)})}}return c.filter(Boolean)}))};0&&0}};var n={};function __nccwpck_require__(t){var r=n[t];if(r!==undefined){return r.exports}var a=n[t]={exports:{}};var o=true;try{e[t](a,a.exports,__nccwpck_require__);o=false}finally{if(o)delete n[t]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(814);module.exports=t})();
@@ -1 +1 @@
1
- {"name":"@umijs/plugins","version":"4.0.30","authors":["chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"],"license":"MIT","_lastModified":"2022-11-13T07:05:33.094Z"}
1
+ {"name":"@umijs/plugins","version":"4.0.32","authors":["chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"],"license":"MIT","_lastModified":"2022-11-20T09:58:00.334Z"}
@@ -80,7 +80,7 @@ var derivative_default = (api) => {
80
80
  safeExcludeInMFSU(api, [new RegExp("dumi/dist/client")]);
81
81
  api.modifyDefaultConfig((memo) => {
82
82
  if (api.userConfig.mfsu !== false) {
83
- if (import_fs.default.existsSync(import_path.default.join(api.cwd, "node_modules", ".pnpm"))) {
83
+ if (import_fs.default.existsSync(import_path.default.join(api.cwd, "node_modules", ".pnpm")) || process.platform === "win32") {
84
84
  memo.mfsu = false;
85
85
  } else {
86
86
  memo.mfsu.strategy = "normal";
@@ -43,7 +43,7 @@ var meta_default = (api) => {
43
43
  if (!route.isLayout && !/\*|:/.test(route.path) && route.file && !(0, import_tabs.isTabRouteFile)(route.file)) {
44
44
  metaFiles.push({
45
45
  index: metaFiles.length,
46
- file: route.file,
46
+ file: (0, import_plugin_utils.winPath)(route.file),
47
47
  id: route.id
48
48
  });
49
49
  }
@@ -35,12 +35,16 @@ var EMBED_CLOSE_TAG = "</embed>";
35
35
  var unified;
36
36
  var remarkParse;
37
37
  var remarkFrontmatter;
38
+ var remarkDirective;
39
+ var remarkGfm;
38
40
  var visit;
39
41
  (async () => {
40
42
  ({ visitParents: visit } = await import("unist-util-visit-parents"));
41
43
  ({ unified } = await import("unified"));
42
44
  ({ default: remarkParse } = await import("remark-parse"));
43
45
  ({ default: remarkFrontmatter } = await import("remark-frontmatter"));
46
+ ({ default: remarkDirective } = await import("remark-directive"));
47
+ ({ default: remarkGfm } = await import("remark-gfm"));
44
48
  })();
45
49
  function remarkRawAST() {
46
50
  this.Compiler = function Compiler(ast) {
@@ -79,7 +83,7 @@ function remarkEmbed(opts) {
79
83
  const {
80
84
  result: mdast,
81
85
  data: { embeds }
82
- } = unified().use(remarkParse).use(remarkEmbed, { ...opts, fileAbsPath: absPath }).use(remarkFrontmatter).use(remarkRawAST).processSync(content);
86
+ } = unified().use(remarkParse).use(remarkEmbed, { ...opts, fileAbsPath: absPath }).use(remarkFrontmatter).use(remarkDirective).use(remarkGfm).use(remarkRawAST).processSync(content);
83
87
  if (!node.value.endsWith(EMBED_CLOSE_TAG)) {
84
88
  for (let j = i; j < parent.children.length; j++) {
85
89
  const sibling = parent.children[j];
package/package.json CHANGED
@@ -1,8 +1,26 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.0.2",
4
- "description": "Framework for developing UI components",
5
- "keywords": [],
3
+ "version": "2.0.3",
4
+ "description": "📖 Documentation Generator of React Component",
5
+ "keywords": [
6
+ "generator",
7
+ "umi",
8
+ "webpack",
9
+ "react",
10
+ "static site generator",
11
+ "jamstack",
12
+ "markdown",
13
+ "components",
14
+ "documentation"
15
+ ],
16
+ "homepage": "https://d.umijs.org",
17
+ "bugs": {
18
+ "url": "https://github.com/umijs/dumi/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/umijs/dumi"
23
+ },
6
24
  "license": "MIT",
7
25
  "main": "dist/index.js",
8
26
  "types": "index.d.ts",
@@ -12,7 +30,9 @@
12
30
  "dist",
13
31
  "compiled",
14
32
  "theme-default",
15
- "index.d.ts"
33
+ "index.d.ts",
34
+ "plugin-utils.js",
35
+ "plugin-utils.d.ts"
16
36
  ],
17
37
  "scripts": {
18
38
  "build": "father build",
@@ -22,6 +42,7 @@
22
42
  "docs:build": "node ./bin/dumi.js build",
23
43
  "docs:dev": "node ./bin/dumi.js dev",
24
44
  "docs:sync": "node ./scripts/sync-from-umi.js",
45
+ "format": "prettier --cache --write .",
25
46
  "lint": "npm run lint:es && npm run lint:css",
26
47
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
27
48
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
@@ -36,19 +57,19 @@
36
57
  },
37
58
  "lint-staged": {
38
59
  "*.{md,json}": [
39
- "prettier --write --no-error-on-unmatched-pattern"
60
+ "prettier --cache --write --no-error-on-unmatched-pattern"
40
61
  ],
41
62
  "*.{css,less}": [
42
63
  "stylelint --fix",
43
- "prettier --write"
64
+ "prettier --cache --write"
44
65
  ],
45
66
  "*.{js,jsx}": [
46
67
  "eslint --fix",
47
- "prettier --write"
68
+ "prettier --cache --write"
48
69
  ],
49
70
  "*.{ts,tsx}": [
50
71
  "eslint --fix",
51
- "prettier --parser=typescript --write"
72
+ "prettier --cache --parser=typescript --write"
52
73
  ]
53
74
  },
54
75
  "dependencies": {
@@ -118,7 +139,7 @@
118
139
  "@types/react": "^18.0.16",
119
140
  "@types/react-copy-to-clipboard": "^5.0.4",
120
141
  "@umijs/lint": "^4.0.32",
121
- "@umijs/plugins": "^4.0.32",
142
+ "@umijs/plugins": "4.0.32",
122
143
  "eslint": "^8.20.0",
123
144
  "father": "^4.1.0",
124
145
  "husky": "^8.0.1",
@@ -0,0 +1 @@
1
+ export * from 'umi/plugin-utils';
@@ -0,0 +1 @@
1
+ module.exports = require('umi/plugin-utils');