@nocobase/devtools 0.7.0-alpha.81 → 0.7.1-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/devtools",
3
- "version": "0.7.0-alpha.81",
3
+ "version": "0.7.1-alpha.4",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "licenses": [
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "main": "./src/index.js",
13
13
  "dependencies": {
14
- "@nocobase/build": "0.7.0-alpha.81",
14
+ "@nocobase/build": "0.7.1-alpha.4",
15
15
  "@testing-library/react": "^12.1.2",
16
16
  "@types/jest": "^26.0.0",
17
17
  "@types/koa": "^2.13.4",
@@ -62,5 +62,5 @@
62
62
  "url": "git+https://github.com/nocobase/nocobase.git",
63
63
  "directory": "packages/core/devtools"
64
64
  },
65
- "gitHead": "c84bcc9188a9f8d086a6e29b6b00921da030a296"
65
+ "gitHead": "570d039f1904a041729c1967c0637b1109c278a8"
66
66
  }
package/umiConfig.d.ts CHANGED
@@ -1,18 +1,20 @@
1
1
  export declare function getUmiConfig(): {
2
2
  define: {
3
- 'process.env.API_BASE_URL': string;
3
+ 'process.env.API_BASE_URL': string;
4
4
  };
5
5
  proxy: {
6
- [x: string]: {
6
+ [x: string]:
7
+ | {
7
8
  target: string;
8
9
  changeOrigin: boolean;
9
- } | {
10
+ }
11
+ | {
10
12
  target: string;
11
13
  changeOrigin: boolean;
12
14
  pathRewrite: {
13
- [x: string]: string;
15
+ [x: string]: string;
14
16
  };
15
- };
17
+ };
16
18
  };
17
19
  };
18
20
 
package/umiConfig.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const { existsSync } = require('fs');
2
2
  const { resolve } = require('path');
3
3
  const packageJson = require('./package.json');
4
+ const fs = require('fs');
4
5
 
5
6
  console.log('VERSION: ', packageJson.version);
6
7
 
@@ -44,13 +45,25 @@ function getUmiConfig() {
44
45
  }
45
46
 
46
47
  function resolveNocobasePackagesAlias(config) {
47
- const clientSrc = resolve(process.cwd(), './packages/core/client/src');
48
- const utilsSrc = resolve(process.cwd(), './packages/core/utils/src');
49
- if (existsSync(clientSrc)) {
50
- config.module.rules.get('ts-in-node_modules').include.add(clientSrc);
51
- config.resolve.alias.set('@nocobase/client', clientSrc);
52
- config.module.rules.get('ts-in-node_modules').include.add(utilsSrc);
53
- config.resolve.alias.set('@nocobase/utils', utilsSrc);
48
+ const coreDir = resolve(process.cwd(), './packages/core');
49
+ if (!existsSync(coreDir)) {
50
+ return;
51
+ }
52
+ const cores = fs.readdirSync(coreDir);
53
+ for (const package of cores) {
54
+ const packageSrc = resolve(process.cwd(), './packages/core/', package, 'src');
55
+ if (existsSync(packageSrc)) {
56
+ config.module.rules.get('ts-in-node_modules').include.add(packageSrc);
57
+ config.resolve.alias.set(`@nocobase/${package}`, packageSrc);
58
+ }
59
+ }
60
+ const plugins = fs.readdirSync(resolve(process.cwd(), './packages/plugins'));
61
+ for (const package of plugins) {
62
+ const packageSrc = resolve(process.cwd(), './packages/plugins/', package, 'src');
63
+ if (existsSync(packageSrc)) {
64
+ config.module.rules.get('ts-in-node_modules').include.add(packageSrc);
65
+ config.resolve.alias.set(`@nocobase/plugin-${package}`, packageSrc);
66
+ }
54
67
  }
55
68
  }
56
69