@nocobase/app 2.1.0-alpha.10 → 2.1.0-alpha.11

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.
Files changed (131) hide show
  1. package/client/.umirc.ts +2 -2
  2. package/client/index.html +14 -0
  3. package/client/rsbuild.config.ts +261 -0
  4. package/{client-v2/src/routes/AppInfoDemoRoute.tsx → client/src/main.tsx} +2 -4
  5. package/client-v2/index.html +3 -17
  6. package/client-v2/public/browser-checker.js +186 -0
  7. package/client-v2/public/favicon/favicon.ico +0 -0
  8. package/client-v2/public/file-placeholder/ai-200-200.png +0 -0
  9. package/client-v2/public/file-placeholder/audio-200-200.png +0 -0
  10. package/client-v2/public/file-placeholder/docx-200-200.png +0 -0
  11. package/client-v2/public/file-placeholder/eps-200-200.png +0 -0
  12. package/client-v2/public/file-placeholder/gif-200-200.png +0 -0
  13. package/client-v2/public/file-placeholder/jpeg-200-200.png +0 -0
  14. package/client-v2/public/file-placeholder/pdf-200-200.png +0 -0
  15. package/client-v2/public/file-placeholder/png-200-200.png +0 -0
  16. package/client-v2/public/file-placeholder/pptx-200-200.png +0 -0
  17. package/client-v2/public/file-placeholder/psd-200-200.png +0 -0
  18. package/client-v2/public/file-placeholder/svg-200-200.png +0 -0
  19. package/client-v2/public/file-placeholder/unknown-200-200.png +0 -0
  20. package/client-v2/public/file-placeholder/video-200-200.png +0 -0
  21. package/client-v2/public/file-placeholder/xlsx-200-200.png +0 -0
  22. package/client-v2/public/file-placeholder/zip-200-200.png +0 -0
  23. package/client-v2/public/global.css +63 -0
  24. package/client-v2/public/nocobase.png +0 -0
  25. package/client-v2/public/robots.txt +2 -0
  26. package/client-v2/rsbuild.config.ts +85 -23
  27. package/client-v2/src/.plugins/index.ts +4 -0
  28. package/client-v2/src/main.tsx +3 -3
  29. package/dist/client/{1708.645e826c.async.js → 600.1751a15d.async.js} +23 -23
  30. package/dist/client/index.html +1 -1
  31. package/dist/client/index.html.tpl +1 -1
  32. package/dist/client/p__index.482f66b1.async.js +2752 -0
  33. package/dist/client/umi.96c93a47.js +63 -0
  34. package/dist/client/v2/assets/{1310-fbaee3cb.js → 1310-21e5c8a8.js} +1 -1
  35. package/dist/client/v2/assets/1331-9092cf22.js +1 -0
  36. package/dist/client/v2/assets/{1425-0d0cc788.js → 1425-a2b446a6.js} +1 -1
  37. package/dist/client/v2/assets/{1507-3a78eb3b.js → 1507-a673a0c0.js} +1 -1
  38. package/dist/client/v2/assets/{158-9800497f.js → 158-6a033567.js} +1 -1
  39. package/dist/client/v2/assets/{1725-6bb35fdf.js → 1725-6f5b8d53.js} +1 -1
  40. package/dist/client/v2/assets/{1786-8fd8cc53.js → 1786-8969223a.js} +2 -2
  41. package/dist/client/v2/assets/{1951-3af0a41f.js → 1951-f63bc4b3.js} +1 -1
  42. package/dist/client/v2/assets/{2017-7bc3cc87.js → 2017-b35f125d.js} +1 -1
  43. package/dist/client/v2/assets/{212-30d011b4.js → 212-59d29e60.js} +1 -1
  44. package/dist/client/v2/assets/{2335-40fc71a2.js → 2335-1d33c3cf.js} +1 -1
  45. package/dist/client/v2/assets/{2555-0744d7fe.js → 2555-dee484a1.js} +1 -1
  46. package/dist/client/v2/assets/{2702-2f40d8de.js → 2702-8d5ab2a8.js} +1 -1
  47. package/dist/client/v2/assets/2710-93d67bf0.js +36 -0
  48. package/dist/client/v2/assets/{2726-927c9cfb.js → 2726-f6cc5db9.js} +1 -1
  49. package/dist/client/v2/assets/{2861-da0bb151.js → 2861-48106fd8.js} +1 -1
  50. package/dist/client/v2/assets/{2898-cf256b0e.js → 2898-2a7d5793.js} +2 -2
  51. package/dist/client/v2/assets/{2958-e4b6ff73.js → 2958-5a85effa.js} +3 -3
  52. package/dist/client/v2/assets/{3117-54ef67b5.js → 3117-3d38bb4d.js} +1 -1
  53. package/dist/client/v2/assets/{338-3d2099ef.js → 338-2f192edd.js} +1 -1
  54. package/dist/client/v2/assets/3475-c42974e1.js +1 -0
  55. package/dist/client/v2/assets/{3660-c7fcb199.js → 3660-27f9c6c5.js} +1 -1
  56. package/dist/client/v2/assets/{3662-b25a5e70.js → 3662-135bbea1.js} +1 -1
  57. package/dist/client/v2/assets/{3690-3dd94e4c.js → 3690-4a8bdf43.js} +1 -1
  58. package/dist/client/v2/assets/{3727-da97de5f.js → 3727-b74fc29b.js} +1 -1
  59. package/dist/client/v2/assets/{3916-250bcfe2.js → 3916-ba5b43b5.js} +1 -1
  60. package/dist/client/v2/assets/{3989-f2860cc7.js → 3989-e72345bb.js} +1 -1
  61. package/dist/client/v2/assets/{4313-afee0e7e.js → 4313-9687f912.js} +1 -1
  62. package/dist/client/v2/assets/{5064-2ca0d32b.js → 5064-93d8e29e.js} +1 -1
  63. package/dist/client/v2/assets/{5501-a146926a.js → 5501-a3b5b97f.js} +1 -1
  64. package/dist/client/v2/assets/{5721-b76fecc5.js → 5721-f00ddbf2.js} +1 -1
  65. package/dist/client/v2/assets/{5759-11ca4d36.js → 5759-d5b1d946.js} +2 -2
  66. package/dist/client/v2/assets/{5761-5b4fcc0f.js → 5761-8ab1974d.js} +1 -1
  67. package/dist/client/v2/assets/6064-1517304e.js +2 -0
  68. package/dist/client/v2/assets/{9261-5b0e2178.js.LICENSE.txt → 6064-1517304e.js.LICENSE.txt} +7 -0
  69. package/dist/client/v2/assets/6269-35e90156.js +1 -0
  70. package/dist/client/v2/assets/{6437-18d1e044.js → 6437-2f91d29a.js} +1 -1
  71. package/dist/client/v2/assets/{6581-4874c6dc.js → 6581-51c928bf.js} +1 -1
  72. package/dist/client/v2/assets/{6738-06ce7af7.js → 6738-eb09fa59.js} +1 -1
  73. package/dist/client/v2/assets/{700-8f6e9747.js → 700-5f166286.js} +2 -2
  74. package/dist/client/v2/assets/{7021-32b49ced.js → 7021-01608dc5.js} +2 -2
  75. package/dist/client/v2/assets/{7201-2049816a.js → 7201-8e6e91a3.js} +1 -1
  76. package/dist/client/v2/assets/{7959-f9145d32.js → 7959-ab57fce2.js} +1 -1
  77. package/dist/client/v2/assets/{8138-f2234325.js → 8138-704104a5.js} +1 -1
  78. package/dist/client/v2/assets/{8262-09946e21.js → 8262-7a324b59.js} +1 -1
  79. package/dist/client/v2/assets/{8434-7296f545.js → 8434-79232eec.js} +1 -1
  80. package/dist/client/v2/assets/{8438-55cc74f0.js → 8438-9d210970.js} +2 -2
  81. package/dist/client/v2/assets/{8562-022da9fa.js → 8562-215edc37.js} +1 -1
  82. package/dist/client/v2/assets/9836-288424d8.js +22 -0
  83. package/dist/client/v2/assets/index-a2c43823.js +269 -0
  84. package/dist/client/v2/assets/runtime-d6e0ee3d.js +1 -0
  85. package/dist/client/v2/assets/vendor-antd-ecosystem-1ffc870c.js +2 -0
  86. package/dist/client/v2/assets/vendor-antd-icons-db04cf76.js +2 -0
  87. package/dist/client/v2/browser-checker.js +186 -0
  88. package/dist/client/v2/favicon/favicon.ico +0 -0
  89. package/dist/client/v2/file-placeholder/ai-200-200.png +0 -0
  90. package/dist/client/v2/file-placeholder/audio-200-200.png +0 -0
  91. package/dist/client/v2/file-placeholder/docx-200-200.png +0 -0
  92. package/dist/client/v2/file-placeholder/eps-200-200.png +0 -0
  93. package/dist/client/v2/file-placeholder/gif-200-200.png +0 -0
  94. package/dist/client/v2/file-placeholder/jpeg-200-200.png +0 -0
  95. package/dist/client/v2/file-placeholder/pdf-200-200.png +0 -0
  96. package/dist/client/v2/file-placeholder/png-200-200.png +0 -0
  97. package/dist/client/v2/file-placeholder/pptx-200-200.png +0 -0
  98. package/dist/client/v2/file-placeholder/psd-200-200.png +0 -0
  99. package/dist/client/v2/file-placeholder/svg-200-200.png +0 -0
  100. package/dist/client/v2/file-placeholder/unknown-200-200.png +0 -0
  101. package/dist/client/v2/file-placeholder/video-200-200.png +0 -0
  102. package/dist/client/v2/file-placeholder/xlsx-200-200.png +0 -0
  103. package/dist/client/v2/file-placeholder/zip-200-200.png +0 -0
  104. package/dist/client/v2/global.css +63 -0
  105. package/dist/client/v2/index.html +12 -18
  106. package/dist/client/v2/nocobase.png +0 -0
  107. package/dist/client/v2/robots.txt +2 -0
  108. package/package.json +6 -6
  109. package/client-v2/src/plugins/AppInfoDemoPlugin.ts +0 -40
  110. package/client-v2/src/routes/DemoHomepageRoute.tsx +0 -28
  111. package/client-v2/src/routes/FlowSettingsComponentLoaderDemoRoute.tsx +0 -40
  112. package/client-v2/src/settings/DemoFlowSettingsLazyField.tsx +0 -14
  113. package/dist/client/p__index.ce72fd4e.async.js +0 -2738
  114. package/dist/client/umi.daa4a9d2.js +0 -63
  115. package/dist/client/v2/assets/2710-ddca03eb.js +0 -36
  116. package/dist/client/v2/assets/3475-d92f065a.js +0 -1
  117. package/dist/client/v2/assets/465-1cb2158a.js +0 -1
  118. package/dist/client/v2/assets/5366-53bf100a.js +0 -1
  119. package/dist/client/v2/assets/6269-1fd42a11.js +0 -1
  120. package/dist/client/v2/assets/6830-d23120a0.js +0 -1
  121. package/dist/client/v2/assets/7482-c3d402ea.js +0 -1
  122. package/dist/client/v2/assets/7928-c2116323.js +0 -1
  123. package/dist/client/v2/assets/9261-5b0e2178.js +0 -2
  124. package/dist/client/v2/assets/9836-65eadc90.js +0 -22
  125. package/dist/client/v2/assets/index-df3f23f2.js +0 -236
  126. package/dist/client/v2/assets/runtime-9ee03ea7.js +0 -1
  127. package/dist/client/v2/assets/vendor-antd-ecosystem-3072b8fa.js +0 -2
  128. package/dist/client/v2/assets/vendor-antd-icons-b7d99c50.js +0 -2
  129. /package/dist/client/v2/assets/{index-df3f23f2.js.LICENSE.txt → index-a2c43823.js.LICENSE.txt} +0 -0
  130. /package/dist/client/v2/assets/{vendor-antd-ecosystem-3072b8fa.js.LICENSE.txt → vendor-antd-ecosystem-1ffc870c.js.LICENSE.txt} +0 -0
  131. /package/dist/client/v2/assets/{vendor-antd-icons-b7d99c50.js.LICENSE.txt → vendor-antd-icons-db04cf76.js.LICENSE.txt} +0 -0
@@ -13,11 +13,14 @@ import { defineConfig } from '@rsbuild/core';
13
13
  import { pluginLess } from '@rsbuild/plugin-less';
14
14
  import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
15
15
  import { pluginReact } from '@rsbuild/plugin-react';
16
- import { getRsbuildAlias } from '../../devtools/rsbuildConfig';
16
+ import { pluginSvgr } from '@rsbuild/plugin-svgr';
17
+ import { generateV2Plugins, getRsbuildAlias } from '@nocobase/devtools/rsbuildConfig';
17
18
 
18
19
  const __filename = fileURLToPath(import.meta.url);
19
20
  const __dirname = path.dirname(__filename);
20
21
 
22
+ generateV2Plugins();
23
+
21
24
  function ensurePublicPath(value: string) {
22
25
  let normalized = value || '/v2/';
23
26
  if (!normalized.startsWith('/')) {
@@ -34,6 +37,46 @@ function toNumber(value: string | undefined, fallback: number) {
34
37
  return Number.isFinite(parsed) ? parsed : fallback;
35
38
  }
36
39
 
40
+ function createRuntimeHeadScript(v2PublicPath: string, isBuild: boolean) {
41
+ if (!isBuild) {
42
+ return [
43
+ `window['__nocobase_public_path__'] = window['__nocobase_public_path__'] || ${JSON.stringify(v2PublicPath)};`,
44
+ `window['__esm_cdn_base_url__'] = window['__esm_cdn_base_url__'] || ${JSON.stringify(
45
+ process.env.ESM_CDN_BASE_URL || 'https://esm.sh',
46
+ )};`,
47
+ `window['__esm_cdn_suffix__'] = window['__esm_cdn_suffix__'] || ${JSON.stringify(
48
+ process.env.ESM_CDN_SUFFIX || '',
49
+ )};`,
50
+ ].join('\n');
51
+ }
52
+
53
+ return [
54
+ `window['__nocobase_public_path__'] = window['__nocobase_public_path__'] || ${JSON.stringify(v2PublicPath)};`,
55
+ `window['__nocobase_api_base_url__'] = window['__nocobase_api_base_url__'] || ${JSON.stringify(
56
+ process.env.API_BASE_URL || process.env.API_BASE_PATH || '',
57
+ )};`,
58
+ `window['__nocobase_api_client_storage_prefix__'] = window['__nocobase_api_client_storage_prefix__'] || ${JSON.stringify(
59
+ process.env.API_CLIENT_STORAGE_PREFIX || '',
60
+ )};`,
61
+ `window['__nocobase_api_client_storage_type__'] = window['__nocobase_api_client_storage_type__'] || ${JSON.stringify(
62
+ process.env.API_CLIENT_STORAGE_TYPE || '',
63
+ )};`,
64
+ `window['__nocobase_api_client_share_token__'] = window['__nocobase_api_client_share_token__'] || ${JSON.stringify(
65
+ process.env.API_CLIENT_SHARE_TOKEN || 'false',
66
+ )};`,
67
+ `window['__nocobase_ws_url__'] = window['__nocobase_ws_url__'] || ${JSON.stringify(
68
+ process.env.WEBSOCKET_URL || '',
69
+ )};`,
70
+ `window['__nocobase_ws_path__'] = window['__nocobase_ws_path__'] || ${JSON.stringify(process.env.WS_PATH || '')};`,
71
+ `window['__esm_cdn_base_url__'] = window['__esm_cdn_base_url__'] || ${JSON.stringify(
72
+ process.env.ESM_CDN_BASE_URL || 'https://esm.sh',
73
+ )};`,
74
+ `window['__esm_cdn_suffix__'] = window['__esm_cdn_suffix__'] || ${JSON.stringify(
75
+ process.env.ESM_CDN_SUFFIX || '',
76
+ )};`,
77
+ ].join('\n');
78
+ }
79
+
37
80
  function createDefineValues(v2PublicPath: string) {
38
81
  return {
39
82
  'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
@@ -49,20 +92,6 @@ function createDefineValues(v2PublicPath: string) {
49
92
  };
50
93
  }
51
94
 
52
- function createTemplateParameters(v2PublicPath: string) {
53
- return {
54
- BASE_URL: v2PublicPath,
55
- API_BASE_URL: process.env.API_BASE_URL || process.env.API_BASE_PATH || '',
56
- API_CLIENT_STORAGE_PREFIX: process.env.API_CLIENT_STORAGE_PREFIX || '',
57
- API_CLIENT_STORAGE_TYPE: process.env.API_CLIENT_STORAGE_TYPE || '',
58
- API_CLIENT_SHARE_TOKEN: process.env.API_CLIENT_SHARE_TOKEN || 'false',
59
- WS_URL: process.env.WEBSOCKET_URL || '',
60
- WS_PATH: process.env.WS_PATH || '',
61
- ESM_CDN_BASE_URL: process.env.ESM_CDN_BASE_URL || 'https://esm.sh',
62
- ESM_CDN_SUFFIX: process.env.ESM_CDN_SUFFIX || '',
63
- };
64
- }
65
-
66
95
  export default defineConfig(({ command }) => {
67
96
  const isBuild = command === 'build';
68
97
  const appPublicPath = ensurePublicPath(process.env.APP_PUBLIC_PATH || '/');
@@ -76,7 +105,7 @@ export default defineConfig(({ command }) => {
76
105
  const workspaceAliases = getRsbuildAlias();
77
106
 
78
107
  return {
79
- plugins: [pluginReact(), pluginLess(), pluginNodePolyfill()],
108
+ plugins: [pluginReact(), pluginLess(), pluginNodePolyfill(), pluginSvgr()],
80
109
  resolve: {
81
110
  alias: workspaceAliases,
82
111
  },
@@ -90,7 +119,43 @@ export default defineConfig(({ command }) => {
90
119
  html: {
91
120
  template: path.resolve(__dirname, 'index.html'),
92
121
  scriptLoading: isBuild ? 'module' : 'defer',
93
- templateParameters: createTemplateParameters(v2PublicPath),
122
+ tags: [
123
+ {
124
+ tag: 'link',
125
+ attrs: {
126
+ rel: 'icon',
127
+ href: `${v2PublicPath}favicon_no_exist.ico`,
128
+ },
129
+ publicPath: false,
130
+ head: true,
131
+ append: false,
132
+ },
133
+ {
134
+ tag: 'link',
135
+ attrs: {
136
+ rel: 'stylesheet',
137
+ href: `${v2PublicPath}global.css`,
138
+ },
139
+ publicPath: false,
140
+ head: true,
141
+ append: false,
142
+ },
143
+ {
144
+ tag: 'script',
145
+ children: createRuntimeHeadScript(v2PublicPath, isBuild),
146
+ head: true,
147
+ append: false,
148
+ },
149
+ {
150
+ tag: 'script',
151
+ attrs: {
152
+ src: `${v2PublicPath}browser-checker.js?v=1`,
153
+ },
154
+ publicPath: false,
155
+ head: true,
156
+ append: false,
157
+ },
158
+ ],
94
159
  },
95
160
  output: {
96
161
  target: 'web',
@@ -125,7 +190,9 @@ export default defineConfig(({ command }) => {
125
190
  host: '0.0.0.0',
126
191
  port: v2Port,
127
192
  compress: true,
128
- publicDir: false,
193
+ publicDir: {
194
+ name: path.resolve(__dirname, 'public'),
195
+ },
129
196
  proxy: {
130
197
  [apiBasePath]: {
131
198
  target: proxyTargetUrl,
@@ -172,11 +239,6 @@ export default defineConfig(({ command }) => {
172
239
  ...config.experiments,
173
240
  outputModule: isBuild,
174
241
  };
175
- config.module.rules.push({
176
- test: /\.svg$/i,
177
- issuer: /\.[jt]sx?$/,
178
- use: ['@svgr/webpack'],
179
- });
180
242
  config.optimization = {
181
243
  ...config.optimization,
182
244
  runtimeChunk: 'single',
@@ -0,0 +1,4 @@
1
+
2
+ export default function devDynamicImport(packageName: string): Promise<any> {
3
+ return Promise.resolve(null);
4
+ }
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { Application } from '@nocobase/client-v2';
11
- import { AppInfoDemoPlugin } from './plugins/AppInfoDemoPlugin';
11
+ import devDynamicImport from './.plugins';
12
12
 
13
13
  declare global {
14
14
  interface Window {
@@ -97,8 +97,8 @@ const app = new Application({
97
97
  url: window.__nocobase_ws_url__ || import.meta.env.WS_URL || '',
98
98
  basename: window.__nocobase_ws_path__ || import.meta.env.WS_PATH || `${rootPublicPath}ws`,
99
99
  },
100
- plugins: [AppInfoDemoPlugin],
101
- loadRemotePlugins: false,
100
+ loadRemotePlugins: true,
101
+ devDynamicImport,
102
102
  });
103
103
 
104
104
  window.__nocobase_v2_app__ = app;