@nocobase/cli 2.1.0-alpha.1 → 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.
@@ -0,0 +1,338 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta
6
+ name="viewport"
7
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
8
+ />
9
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
10
+ <title>NocoBase Loading...</title>
11
+ <style data-basic>
12
+ body {
13
+ margin: 0;
14
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
15
+ min-height: 100vh;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ flex-direction: column;
20
+ color: #333;
21
+ background-color: #f5f5f5;
22
+ }
23
+
24
+ #loading {
25
+ position: relative;
26
+ padding: 20px 28px 24px 88px;
27
+ }
28
+
29
+ #loading::before {
30
+ position: absolute;
31
+ left: 0;
32
+ top: 50%;
33
+ content: '';
34
+ display: inline-block;
35
+ width: 40px;
36
+ height: 40px;
37
+ border-radius: 50%;
38
+ border: 3px solid #e0e0e0;
39
+ border-top-color: #999;
40
+ animation: loading-spin 0.9s linear infinite;
41
+ transform: translateY(-50%);
42
+ }
43
+
44
+ #loading h3 {
45
+ margin: 0 0 2px;
46
+ color: #666;
47
+ font-size: 20px;
48
+ font-weight: normal;
49
+ }
50
+
51
+ #loading small {
52
+ color: #888;
53
+ font-size: 12px;
54
+ }
55
+
56
+ #loading small::after {
57
+ content: 'from source';
58
+ }
59
+
60
+ #loading p {
61
+ box-sizing: border-box;
62
+ font-family: Georgia, 'Times New Roman', Times, serif;
63
+ color: #333;
64
+ }
65
+
66
+ #loading p:empty {
67
+ display: none;
68
+ }
69
+
70
+ #loading p span {
71
+ font-family: sans-serif;
72
+ padding: 0 6px 0 2px;
73
+ color: #666;
74
+ font-size: 14px;
75
+ vertical-align: bottom;
76
+ }
77
+
78
+ #loading p.summary {
79
+ margin: 8px 0;
80
+ height: 28px;
81
+ font-size: 24px;
82
+ }
83
+
84
+ #loading p.detail {
85
+ margin: 2px 0;
86
+ height: 40px;
87
+ font-size: 16px;
88
+ }
89
+
90
+ code.progress-details {
91
+ margin-top: 20px;
92
+ font-size: 13px;
93
+ color: #999;
94
+ max-width: calc(100vw - 500px);
95
+ text-align: center;
96
+ white-space: pre-wrap;
97
+ }
98
+
99
+ @keyframes fade-in-out {
100
+ 0% {
101
+ opacity: 0.4;
102
+ }
103
+
104
+ 100% {
105
+ opacity: 1;
106
+ }
107
+ }
108
+
109
+ @keyframes loading-spin {
110
+ 0% {
111
+ transform: translateY(-50%) rotate(0deg);
112
+ }
113
+
114
+ 100% {
115
+ transform: translateY(-50%) rotate(360deg);
116
+ }
117
+ }
118
+ </style>
119
+ <style data-mfsu>
120
+ #loading[data-mfsu]::after {
121
+ position: absolute;
122
+ top: 0;
123
+ left: 64px;
124
+ content: '';
125
+ width: 20px;
126
+ height: 22px;
127
+ background: center / 20px 22px;
128
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAuCAMAAABteatCAAABKVBMVEUAAAADAgAAAAAAAAAAAAAAAAAAAAAIBwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMCgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASDwIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+2SgAAAD81ycWEwPxzSXOsCBBOAoqIwbjwiOWgBd2ZBJdTw741Ca1mhyhihlHPAswKQcbFwT00CbgvyLWtyG5nh2GchV7aRNYSw1VSA3zzybpxyTmxCTLrR+QehaMdxZvXxFmVxBjVQ85MQglIAXqxyTSsyG/ox6zmRyrkhqpkBqmjhqdhhiBbhRQRAxMQQyKBhJVAAAAM3RSTlMA/vrcEO3F/nA4BvfUqYx4aFAjBP7x6uOugCEdCrSllohUSj0yLRQC/se/k2FWJ7qamFjVvxppAAAB4klEQVQ4y42U10IaQRhG2QVBAaVIMxQNCthT9iwdkSoEEkss6e39HyIaQ4Zhdjee63PxH/h2XCqF4EbU9QQ8bsAb9vxXzNI7iYGeivgdvQ12h8ag09VgaXPF3sujjYwHzq96gNvu3OgSY2PGx1bf7txMkJ+mITBHNufmuKsYMm//nit5y8TODJXzKWTnvW2dL4YFpz5y63NeOkHLyvum8ao05/m91EwLr6mxJR24Sf+DhTeGkOQd4ruw8FpoYcnbCfBd1cwb9CPJKya5Vr32lEBe8kovuG0r3qBLfNslsUW5oXiVWxI7shdB+6R473okj2XvOM6l4g3vYK24OJmJGlK93gU9e5QRYor6wLCg/fWXBvGXs54QmjQZ6c5LMfOCDuX3VcOOsz8z3wvfjyYUBOrjhp1qXgHux//vIAFarVOx8honGkvLsz2u51cD4JucLg6t8sZHYM0jvRCH+yyeazbLsPrMtUg6lISm8D7XwWv5CBTitMRPXgN3xGVFOsnEVBpUPEFqbdGgiwYZ/z71itqgkqM/fPyO1QZ5vLHqv4bnLlvCaCO1QSWi0bl/kUSDDSsBfqgNKtEEN2qDStFN90JpUMnsUZ4+NPidvVIKUBtUDkA0OBBCNDjxWjQ4o4sGR34DhGGszb2iUaMAAAAASUVORK5CYII=');
129
+ animation: fade-in-out alternate infinite 1s;
130
+ }
131
+
132
+ #loading[data-mfsu] small::after {
133
+ content: 'Umi with MFSU';
134
+ }
135
+
136
+ #loading[data-mfsu]:hover p.summary,
137
+ #loading[data-mfsu]:not(:hover) p.detail {
138
+ display: none;
139
+ }
140
+ </style>
141
+ <style data-progress>
142
+ #loading[data-percent^='2']:not([data-percent='2'])::before,
143
+ #loading[data-percent^='3']:not([data-percent='3'])::before {
144
+ background-position-x: -68px;
145
+ }
146
+
147
+ #loading[data-percent^='4']:not([data-percent='4'])::before,
148
+ #loading[data-percent^='5']:not([data-percent='5'])::before {
149
+ background-position-x: -136px;
150
+ }
151
+
152
+ #loading[data-percent^='6']:not([data-percent='6'])::before,
153
+ #loading[data-percent^='7']:not([data-percent='7'])::before {
154
+ background-position-x: -204px;
155
+ }
156
+
157
+ #loading[data-percent^='8']:not([data-percent='8'])::before,
158
+ #loading[data-percent^='9']:not([data-percent='9'])::before {
159
+ background-position-x: -272px;
160
+ }
161
+
162
+ #loading[data-percent='99']::before,
163
+ #loading[data-percent='100']::before {
164
+ background-position-x: -340px !important;
165
+ }
166
+ </style>
167
+ <style data-mako>
168
+ #loading[data-mako]::after {
169
+ position: absolute;
170
+ top: 0;
171
+ left: 64px;
172
+ content: '';
173
+ width: 20px;
174
+ height: 22px;
175
+ background: center / 20px 22px;
176
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAuCAMAAABteatCAAABKVBMVEUAAAADAgAAAAAAAAAAAAAAAAAAAAAIBwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMCgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASDwIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+2SgAAAD81ycWEwPxzSXOsCBBOAoqIwbjwiOWgBd2ZBJdTw741Ca1mhyhihlHPAswKQcbFwT00CbgvyLWtyG5nh2GchV7aRNYSw1VSA3zzybpxyTmxCTLrR+QehaMdxZvXxFmVxBjVQ85MQglIAXqxyTSsyG/ox6zmRyrkhqpkBqmjhqdhhiBbhRQRAxMQQyKBhJVAAAAM3RSTlMA/vrcEO3F/nA4BvfUqYx4aFAjBP7x6uOugCEdCrSllohUSj0yLRQC/se/k2FWJ7qamFjVvxppAAAB4klEQVQ4y42U10IaQRhG2QVBAaVIMxQNCthT9iwdkSoEEkss6e39HyIaQ4Zhdjee63PxH/h2XCqF4EbU9QQ8bsAb9vxXzNI7iYGeivgdvQ12h8ag09VgaXPF3sujjYwHzq96gNvu3OgSY2PGx1bf7txMkJ+mITBHNufmuKsYMm//nit5y8TODJXzKWTnvW2dL4YFpz5y63NeOkHLyvum8ao05/m91EwLr6mxJR24Sf+DhTeGkOQd4ruw8FpoYcnbCfBd1cwb9CPJKya5Vr32lEBe8kovuG0r3qBLfNslsUW5oXiVWxI7shdB+6R473okj2XvOM6l4g3vYK24OJmJGlK93gU9e5QRYor6wLCg/fWXBvGXs54QmjQZ6c5LMfOCDuX3VcOOsz8z3wvfjyYUBOrjhp1qXgHux//vIAFarVOx8honGkvLsz2u51cD4JucLg6t8sZHYM0jvRCH+yyeazbLsPrMtUg6lISm8D7XwWv5CBTitMRPXgN3xGVFOsnEVBpUPEFqbdGgiwYZ/z71itqgkqM/fPyO1QZ5vLHqv4bnLlvCaCO1QSWi0bl/kUSDDSsBfqgNKtEEN2qDStFN90JpUMnsUZ4+NPidvVIKUBtUDkA0OBBCNDjxWjQ4o4sGR34DhGGszb2iUaMAAAAASUVORK5CYII=');
177
+ animation: fade-in-out alternate infinite 1s;
178
+ }
179
+
180
+ #loading[data-mako] small::after {
181
+ content: 'Umi with Mako';
182
+ }
183
+
184
+ #loading[data-mako] .loader {
185
+ position: fixed;
186
+ left: 0;
187
+ top: 0;
188
+ height: 5px;
189
+ width: 100vw;
190
+ --c:no-repeat linear-gradient(#1d90fe 0 0);
191
+ background: var(--c),var(--c),#cddeee;
192
+ background-size: 60% 100%;
193
+ animation: l16 3s infinite;
194
+ }
195
+
196
+ @keyframes l16 {
197
+ 0% {background-position:-150% 0,-150% 0}
198
+ 66% {background-position: 250% 0,-150% 0}
199
+ 100% {background-position: 250% 0, 250% 0}
200
+ }
201
+ </style>
202
+ <style data-utoopack>
203
+ #loading[data-utoopack]::after {
204
+ position: absolute;
205
+ top: 0;
206
+ left: 64px;
207
+ content: '';
208
+ width: 20px;
209
+ height: 22px;
210
+ background: center / 20px 22px;
211
+ background-image: url('data:image/png;base64,iVBORw0K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5vLHqv4bnLlvCaCO1QSWi0bl/kUSDDSsBfqgNKtEEN2qDStFN90JpUMnsUZ4+NPidvVIKUBtUDkA0OBBCNDjxWjQ4o4sGR34DhGGszb2iUaMAAAAASUVORK5CYII=');
212
+ animation: fade-in-out alternate infinite 1s;
213
+ }
214
+
215
+ #loading[data-utoopack] small::after {
216
+ content: 'Umi with Utoopack';
217
+ }
218
+
219
+ #loading[data-utoopack] .loader {
220
+ position: fixed;
221
+ left: 0;
222
+ top: 0;
223
+ height: 5px;
224
+ width: 100vw;
225
+ --c:no-repeat linear-gradient(#1d90fe 0 0);
226
+ background: var(--c),var(--c),#cddeee;
227
+ background-size: 60% 100%;
228
+ animation: l16 3s infinite;
229
+ }
230
+
231
+ @keyframes l16 {
232
+ 0% {background-position:-150% 0,-150% 0}
233
+ 66% {background-position: 250% 0,-150% 0}
234
+ 100% {background-position: 250% 0, 250% 0}
235
+ }
236
+ </style>
237
+ </head>
238
+
239
+ <body>
240
+ <div id="loading">
241
+ <div class="loader"></div>
242
+ <h3>Bundling...</h3>
243
+ <small></small>
244
+ <p class="summary"></p>
245
+ <p class="detail"></p>
246
+ </div>
247
+ <code class="progress-details"></code>
248
+
249
+ <script>
250
+ const loading = document.getElementById('loading');
251
+ const progressDetails = document.querySelector('.progress-details');
252
+ const summary = loading.querySelector('.summary');
253
+ const detail = loading.querySelector('.detail');
254
+
255
+ function check(data) {
256
+ renderStatus(data);
257
+ if (
258
+ data.bundleStatus.done &&
259
+ (!data.mfsuBundleStatus || data.mfsuBundleStatus.done)
260
+ ) {
261
+ location.reload();
262
+ } else {
263
+ setTimeout(loadData, 300);
264
+ }
265
+ }
266
+
267
+ function renderStatus(data) {
268
+ if (data.bundler === 'mako') {
269
+ loading.setAttribute('data-mako', '');
270
+ window.__MAKO_PERCENT = window.__MAKO_PERCENT || 0.1;
271
+ const makoPercent = Math.floor(window.__MAKO_PERCENT * 100);
272
+ loading.setAttribute('data-percent', makoPercent);
273
+ window.__MAKO_PERCENT = window.__MAKO_PERCENT >= 1 ? 0.2 : window.__MAKO_PERCENT + 0.1;
274
+ return;
275
+ }
276
+ if (data.bundler === 'utoopack') {
277
+ loading.setAttribute('data-utoopack', '');
278
+ window.__UTOO_PERCENT = window.__UTOO_PERCENT || 0.1;
279
+ const utooPercent = Math.floor(window.__UTOO_PERCENT * 100);
280
+ loading.setAttribute('data-percent', utooPercent);
281
+ window.__UTOO_PERCENT = window.__UTOO_PERCENT >= 1 ? 0.2 : window.__UTOO_PERCENT + 0.1;
282
+
283
+ return;
284
+ }
285
+ const hasMFSU = Boolean(data.mfsuBundleStatus);
286
+ const hasProgressDetails = Boolean(
287
+ data.bundleStatus.progresses[0].details,
288
+ );
289
+
290
+ if (hasProgressDetails) {
291
+ const details = data.bundleStatus.progresses[0].details;
292
+ if (details.length) {
293
+ progressDetails.innerHTML = details.join('<br />');
294
+ }
295
+ }
296
+
297
+ const srcPercent = Math.floor(
298
+ (data.bundleStatus.done
299
+ ? 1
300
+ : data.bundleStatus.progresses[0].percent || 0) * 100,
301
+ );
302
+ const mfsuPrecent =
303
+ hasMFSU &&
304
+ Math.floor(
305
+ (data.mfsuBundleStatus.done
306
+ ? 1
307
+ : data.mfsuBundleStatus.percent || 0) * 100,
308
+ );
309
+ const totalPercent = hasMFSU
310
+ ? Math.floor((srcPercent + mfsuPrecent) / 2)
311
+ : srcPercent;
312
+ const summaryText = totalPercent + '<span>%</span>';
313
+ let detailText = summaryText;
314
+
315
+ if (hasMFSU) {
316
+ loading.setAttribute('data-mfsu', '');
317
+ detailText = [
318
+ srcPercent + '<span>% for src</span>',
319
+ '<br />',
320
+ mfsuPrecent + '<span>% for deps</span>',
321
+ ].join('\n');
322
+ detail.innerHTML = detailText;
323
+ }
324
+
325
+ loading.setAttribute('data-percent', totalPercent);
326
+ summary.innerHTML = summaryText;
327
+ }
328
+
329
+ function loadData() {
330
+ fetch('/__umi/api/bundle-status')
331
+ .then((res) => res.json())
332
+ .then(check);
333
+ }
334
+
335
+ loadData();
336
+ </script>
337
+ </body>
338
+ </html>
@@ -24,8 +24,8 @@
24
24
  "@types/react-dom": "^18.0.0",
25
25
  "react-router-dom": "^6.30.1",
26
26
  "react-router": "^6.30.1",
27
+ "antd": "5.24.2",
27
28
  "async": "^3.2.6",
28
- "antd": "5.12.8",
29
29
  "rollup": "4.24.0",
30
30
  "semver": "^7.7.1"
31
31
  },
@@ -0,0 +1,2 @@
1
+ export * from './dist/client-v2';
2
+ export { default } from './dist/client-v2';
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client-v2/index.js');
@@ -5,6 +5,7 @@
5
5
  "dependencies": {},
6
6
  "peerDependencies": {
7
7
  "@nocobase/client": "2.x",
8
+ "@nocobase/client-v2": "2.x",
8
9
  "@nocobase/server": "2.x",
9
10
  "@nocobase/test": "2.x"
10
11
  }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ // CSS modules
11
+ type CSSModuleClasses = { readonly [key: string]: string };
12
+
13
+ declare module '*.module.css' {
14
+ const classes: CSSModuleClasses;
15
+ export default classes;
16
+ }
17
+ declare module '*.module.scss' {
18
+ const classes: CSSModuleClasses;
19
+ export default classes;
20
+ }
21
+ declare module '*.module.sass' {
22
+ const classes: CSSModuleClasses;
23
+ export default classes;
24
+ }
25
+ declare module '*.module.less' {
26
+ const classes: CSSModuleClasses;
27
+ export default classes;
28
+ }
29
+ declare module '*.module.styl' {
30
+ const classes: CSSModuleClasses;
31
+ export default classes;
32
+ }
33
+ declare module '*.module.stylus' {
34
+ const classes: CSSModuleClasses;
35
+ export default classes;
36
+ }
37
+ declare module '*.module.pcss' {
38
+ const classes: CSSModuleClasses;
39
+ export default classes;
40
+ }
41
+ declare module '*.module.sss' {
42
+ const classes: CSSModuleClasses;
43
+ export default classes;
44
+ }
45
+
46
+ // CSS
47
+ declare module '*.css' {}
48
+ declare module '*.scss' {}
49
+ declare module '*.sass' {}
50
+ declare module '*.less' {}
51
+ declare module '*.styl' {}
52
+ declare module '*.stylus' {}
53
+ declare module '*.pcss' {}
54
+ declare module '*.sss' {}
55
+
56
+ declare module '*.apng' {
57
+ const src: string;
58
+ export default src;
59
+ }
60
+ declare module '*.png' {
61
+ const src: string;
62
+ export default src;
63
+ }
64
+ declare module '*.jpg' {
65
+ const src: string;
66
+ export default src;
67
+ }
68
+ declare module '*.jpeg' {
69
+ const src: string;
70
+ export default src;
71
+ }
72
+ declare module '*.jfif' {
73
+ const src: string;
74
+ export default src;
75
+ }
76
+ declare module '*.pjpeg' {
77
+ const src: string;
78
+ export default src;
79
+ }
80
+ declare module '*.pjp' {
81
+ const src: string;
82
+ export default src;
83
+ }
84
+ declare module '*.gif' {
85
+ const src: string;
86
+ export default src;
87
+ }
88
+ declare module '*.svg' {
89
+ const src: string;
90
+ export default src;
91
+ }
92
+ declare module '*.ico' {
93
+ const src: string;
94
+ export default src;
95
+ }
96
+ declare module '*.webp' {
97
+ const src: string;
98
+ export default src;
99
+ }
100
+ declare module '*.avif' {
101
+ const src: string;
102
+ export default src;
103
+ }
@@ -0,0 +1 @@
1
+ export { default } from './plugin';
@@ -0,0 +1,7 @@
1
+ import { Plugin } from '@nocobase/client-v2';
2
+
3
+ export class {{{pascalCaseName}}}ClientV2 extends Plugin {
4
+ async load() {}
5
+ }
6
+
7
+ export default {{{pascalCaseName}}}ClientV2;