@umijs/preset-umi 4.3.31 → 4.3.32

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.
@@ -104,6 +104,6 @@ ${import_utils.chalk.red(
104
104
  }
105
105
  });
106
106
  function isAbsolutePath(path) {
107
- return path.startsWith("/") || path.startsWith("@fs/");
107
+ return path.startsWith("/") || path.startsWith("@fs/") || /^[A-Za-z]:\//.test(path);
108
108
  }
109
109
  };
@@ -69,19 +69,24 @@ var clickToComponent_default = (api) => {
69
69
  content: `
70
70
  import { ClickToComponent } from 'click-to-react-component';
71
71
  import React from 'react';
72
+
73
+ const pathModifier = (path) => {
74
+ return path.startsWith('${api.paths.cwd}') ? path : '${api.paths.cwd}/' + path;
75
+ }
76
+
72
77
  export function rootContainer(container, opts) {
73
- return React.createElement(
74
- (props) => {
75
- return (
76
- <>
77
- <ClickToComponent editor="${api.config.clickToComponent.editor || "vscode"}"/>
78
- {props.children}
79
- </>
80
- );
81
- },
82
- opts,
83
- container,
84
- );
78
+ return React.createElement(
79
+ (props) => {
80
+ return (
81
+ <>
82
+ <ClickToComponent editor="${api.config.clickToComponent.editor || "vscode"}" pathModifier={pathModifier} />
83
+ {props.children}
84
+ </>
85
+ );
86
+ },
87
+ opts,
88
+ container,
89
+ );
85
90
  }
86
91
  `
87
92
  });
@@ -53,9 +53,9 @@ function babelPlugin_default() {
53
53
  if (cache.has(filename) && !filename.includes("bundler-webpack/client") && !filename.startsWith((0, import_utils.winPath)((0, import_path.join)(opts.cwd, "node_modules")))) {
54
54
  opts.onCheckCode({
55
55
  args: {
56
- ...cache.get(state.opts.filename),
57
- file: state.opts.filename,
58
- isFromTmp: state.opts.filename.startsWith(opts.absTmpPath)
56
+ ...cache.get(filename),
57
+ file: filename,
58
+ isFromTmp: filename.startsWith(opts.absTmpPath)
59
59
  }
60
60
  });
61
61
  }
@@ -64,7 +64,7 @@ function babelPlugin_default() {
64
64
  Program: {
65
65
  enter(path, state) {
66
66
  opts = state.opts;
67
- const file = path == null ? void 0 : path.hub.file.opts.filename;
67
+ const file = (0, import_utils.winPath)(path == null ? void 0 : path.hub.file.opts.filename);
68
68
  const cache = this.cache;
69
69
  cache.set(file, {
70
70
  code: path.hub.getCode(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.3.31",
3
+ "version": "4.3.32",
4
4
  "description": "@umijs/preset-umi",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/preset-umi#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@iconify/utils": "2.1.1",
23
23
  "@svgr/core": "6.5.1",
24
- "@umijs/bundler-mako": "0.9.5",
24
+ "@umijs/bundler-mako": "0.9.6",
25
25
  "@umijs/es-module-parser": "0.0.7",
26
26
  "@umijs/history": "5.3.1",
27
27
  "babel-plugin-dynamic-import-node": "2.3.3",
@@ -41,21 +41,21 @@
41
41
  "react-router": "6.3.0",
42
42
  "react-router-dom": "6.3.0",
43
43
  "regenerator-runtime": "0.13.11",
44
- "@umijs/bundler-esbuild": "4.3.31",
45
- "@umijs/bundler-vite": "4.3.31",
46
- "@umijs/ast": "4.3.31",
47
- "@umijs/babel-preset-umi": "4.3.31",
48
- "@umijs/core": "4.3.31",
49
- "@umijs/bundler-webpack": "4.3.31",
50
- "@umijs/bundler-utils": "4.3.31",
51
- "@umijs/plugin-run": "4.3.31",
52
- "@umijs/mfsu": "4.3.31",
53
- "@umijs/renderer-react": "4.3.31",
54
- "@umijs/server": "4.3.31",
55
- "@umijs/did-you-know": "1.0.3",
44
+ "@umijs/ast": "4.3.32",
45
+ "@umijs/babel-preset-umi": "4.3.32",
46
+ "@umijs/bundler-utils": "4.3.32",
47
+ "@umijs/bundler-vite": "4.3.32",
48
+ "@umijs/bundler-webpack": "4.3.32",
49
+ "@umijs/core": "4.3.32",
50
+ "@umijs/mfsu": "4.3.32",
51
+ "@umijs/renderer-react": "4.3.32",
52
+ "@umijs/plugin-run": "4.3.32",
53
+ "@umijs/server": "4.3.32",
56
54
  "@umijs/ui": "3.0.1",
57
- "@umijs/utils": "4.3.31",
58
- "@umijs/zod2ts": "4.3.31"
55
+ "@umijs/utils": "4.3.32",
56
+ "@umijs/did-you-know": "1.0.3",
57
+ "@umijs/zod2ts": "4.3.32",
58
+ "@umijs/bundler-esbuild": "4.3.32"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@manypkg/get-packages": "1.1.3",