@nocobase/devtools 2.1.0-beta.33 → 2.1.0-beta.35

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/common.js CHANGED
@@ -131,6 +131,10 @@ export default function devDynamicImport(packageName: string): Promise<any> {
131
131
  absolute: true,
132
132
  });
133
133
 
134
+ if (process.env.NOCOBASE_DEV_LOCAL_PLUGINS_ONLY === 'true') {
135
+ return this.getPluginContent(pluginFolders);
136
+ }
137
+
134
138
  const storagePluginFolders = glob.sync(['*/package.json', '*/*/package.json'], {
135
139
  cwd: resolvePluginStoragePath(),
136
140
  onlyFiles: true,
@@ -141,7 +145,13 @@ export default function devDynamicImport(packageName: string): Promise<any> {
141
145
  .sync(['plugin-*/package.json'], { cwd: this.nocobaseDir, onlyFiles: true, absolute: true })
142
146
  .map((item) => realpathSync(item));
143
147
 
144
- return Array.from(new Set([...pluginFolders, ...storagePluginFolders, ...nocobasePluginFolders]))
148
+ return this.getPluginContent(
149
+ Array.from(new Set([...pluginFolders, ...storagePluginFolders, ...nocobasePluginFolders])),
150
+ );
151
+ }
152
+
153
+ getPluginContent(pluginPackageJsonPaths) {
154
+ return pluginPackageJsonPaths
145
155
  .filter((item) => {
146
156
  const pluginDir = dirname(item);
147
157
  const clientJs = join(pluginDir, this.options.clientRootFile);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@nocobase/devtools",
3
- "version": "2.1.0-beta.33",
3
+ "version": "2.1.0-beta.35",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./src/index.js",
7
7
  "dependencies": {
8
- "@nocobase/build": "2.1.0-beta.33",
9
- "@nocobase/client": "2.1.0-beta.33",
10
- "@nocobase/test": "2.1.0-beta.33",
11
- "@nocobase/utils": "2.1.0-beta.33",
8
+ "@nocobase/build": "2.1.0-beta.35",
9
+ "@nocobase/client": "2.1.0-beta.35",
10
+ "@nocobase/test": "2.1.0-beta.35",
11
+ "@nocobase/utils": "2.1.0-beta.35",
12
12
  "@rsbuild/core": "1.7.3",
13
13
  "@rsbuild/plugin-less": "^1.6.2",
14
14
  "@rsbuild/plugin-node-polyfill": "1.4.4",
@@ -22,6 +22,7 @@
22
22
  "@types/react-dom": "^18.0.0",
23
23
  "@typescript-eslint/eslint-plugin": "^6.2.0",
24
24
  "@typescript-eslint/parser": "^6.2.0",
25
+ "@umijs/utils": "3.5.20",
25
26
  "concurrently": "^7.0.0",
26
27
  "cross-env": "^7.0.3",
27
28
  "eslint": "^8.45.0",
@@ -47,7 +48,7 @@
47
48
  "ts-node": "9.1.1",
48
49
  "ts-node-dev": "1.1.8",
49
50
  "tsconfig-paths": "^4.2.0",
50
- "tsx": "^4.6.2",
51
+ "tsx": "^4.19.0",
51
52
  "typescript": "5.1.3",
52
53
  "umi": "^4.0.69"
53
54
  },
@@ -56,5 +57,5 @@
56
57
  "url": "git+https://github.com/nocobase/nocobase.git",
57
58
  "directory": "packages/core/devtools"
58
59
  },
59
- "gitHead": "4815c394e80a264fa8ed619246280923c47aeb72"
60
+ "gitHead": "74310d8b9e9581fcde14b5a93d12b41ddb5bb325"
60
61
  }
@@ -1,3 +1,4 @@
1
1
  export declare function getRsbuildAlias(): Record<string, string>;
2
+ export declare function getRsbuildBrowserAlias(): Record<string, string>;
2
3
  export declare function generatePlugins(): void;
3
4
  export declare function generateV2Plugins(): void;
package/rsbuildConfig.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import common from './common.js';
2
+ import path from 'node:path';
2
3
 
3
4
  const { getPackagePaths, generateV2Plugins, generatePlugins } = common;
4
5
 
@@ -9,4 +10,19 @@ export function getRsbuildAlias() {
9
10
  }, {});
10
11
  }
11
12
 
13
+ function addPackageModuleAlias(alias, packageName, subpath, targetFile) {
14
+ if (alias[subpath]) {
15
+ return;
16
+ }
17
+ alias[`${subpath}$`] = path.resolve(process.cwd(), 'node_modules', packageName, targetFile);
18
+ }
19
+
20
+ export function getRsbuildBrowserAlias() {
21
+ const alias = getRsbuildAlias();
22
+ addPackageModuleAlias(alias, '@nocobase/client', '@nocobase/client', 'es/index.mjs');
23
+ addPackageModuleAlias(alias, '@nocobase/client-v2', '@nocobase/client-v2', 'es/index.mjs');
24
+ addPackageModuleAlias(alias, '@nocobase/client-v2', '@nocobase/client-v2/flow-compat', 'es/flow-compat/index.mjs');
25
+ return alias;
26
+ }
27
+
12
28
  export { generateV2Plugins, generatePlugins };