@nocobase/cli 1.9.0-beta.9 → 2.0.0-alpha.2

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/cli",
3
- "version": "1.9.0-beta.9",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./src/index.js",
@@ -8,7 +8,7 @@
8
8
  "nocobase": "./bin/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@nocobase/app": "1.9.0-beta.9",
11
+ "@nocobase/app": "2.0.0-alpha.2",
12
12
  "@nocobase/license-kit": "^0.2.17",
13
13
  "@types/fs-extra": "^11.0.1",
14
14
  "@umijs/utils": "3.5.20",
@@ -27,12 +27,12 @@
27
27
  "tsx": "^4.19.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@nocobase/devtools": "1.9.0-beta.9"
30
+ "@nocobase/devtools": "2.0.0-alpha.2"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
34
34
  "url": "git+https://github.com/nocobase/nocobase.git",
35
35
  "directory": "packages/core/cli"
36
36
  },
37
- "gitHead": "b44464f1d1bbc96022d0f622e0a2f1d7e8d7142f"
37
+ "gitHead": "1322f486b248bef53ed8c8f42f0a39dfd02125fd"
38
38
  }
@@ -54,7 +54,7 @@ function addTestCommand(name, cli) {
54
54
  const first = paths?.[0];
55
55
  if (!process.env.TEST_ENV && first) {
56
56
  const key = first.split(path.sep).join('/');
57
- if (key.includes('/client/')) {
57
+ if (key.includes('/client/') || key.includes('/flow-engine/')) {
58
58
  process.env.TEST_ENV = 'client-side';
59
59
  } else {
60
60
  process.env.TEST_ENV = 'server-side';
@@ -22,8 +22,8 @@
22
22
  "cytoscape": "3.28.0",
23
23
  "@types/react": "18.3.18",
24
24
  "@types/react-dom": "^18.0.0",
25
- "react-router-dom": "6.28.1",
26
- "react-router": "6.28.1",
25
+ "react-router-dom": "^6.30.1",
26
+ "react-router": "^6.30.1",
27
27
  "async": "^3.2.6",
28
28
  "antd": "5.12.8",
29
29
  "rollup": "4.24.0",
@@ -1,21 +1 @@
1
- import { Plugin } from '@nocobase/client';
2
-
3
- export class {{{pascalCaseName}}}Client extends Plugin {
4
- async afterAdd() {
5
- // await this.app.pm.add()
6
- }
7
-
8
- async beforeLoad() {}
9
-
10
- // You can get and modify the app instance here
11
- async load() {
12
- console.log(this.app);
13
- // this.app.addComponents({})
14
- // this.app.addScopes({})
15
- // this.app.addProvider()
16
- // this.app.addProviders()
17
- // this.app.router.add()
18
- }
19
- }
20
-
21
- export default {{{pascalCaseName}}}Client;
1
+ export { default } from './plugin';
@@ -1,12 +1,21 @@
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
+ import { tExpr as _tExpr, useFlowEngine } from '@nocobase/flow-engine';
1
11
  // @ts-ignore
2
12
  import pkg from './../../package.json';
3
- import { useApp } from '@nocobase/client';
4
13
 
5
14
  export function useT() {
6
- const app = useApp();
7
- return (str: string) => app.i18n.t(str, { ns: [pkg.name, 'client'] });
15
+ const engine = useFlowEngine();
16
+ return (str: string) => engine.context.t(str, { ns: [pkg.name, 'client'] });
8
17
  }
9
18
 
10
- export function tStr(key: string) {
11
- return `{{t(${JSON.stringify(key)}, { ns: ['${pkg.name}', 'client'], nsMode: 'fallback' })}}`;
19
+ export function tExpr(key: string) {
20
+ return _tExpr(key, { ns: [pkg.name, 'client'] });
12
21
  }
@@ -0,0 +1,12 @@
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
+ import { ModelConstructor } from '@nocobase/flow-engine';
11
+
12
+ export default {} as Record<string, ModelConstructor>;
@@ -0,0 +1,10 @@
1
+ import { Plugin } from '@nocobase/client';
2
+ import models from './models';
3
+
4
+ export class {{{pascalCaseName}}}Client extends Plugin {
5
+ async load() {
6
+ this.flowEngine.registerModels(models);
7
+ }
8
+ }
9
+
10
+ export default {{{pascalCaseName}}}Client;
@@ -1 +0,0 @@
1
- {}