@macrowing/inbiz-codegen 1.0.1 → 1.0.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
package/src/config.mjs
CHANGED
|
@@ -18,8 +18,13 @@ export const CODEGEN_ROOT = path.resolve(__dirname, '../..');
|
|
|
18
18
|
*/
|
|
19
19
|
export const TEMPLATES_ROOT = (() => {
|
|
20
20
|
// __dirname = <repo>/codegen/framework/cli/src
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
// 开发态优先仓库里的模板:<repo>/codegen/templates。
|
|
22
|
+
// 发布包里没有仓库结构(该路径解析到 node_modules/templates,通常不存在),
|
|
23
|
+
// 这时才用 prepack 复制到包内的副本 <cli>/templates。
|
|
24
|
+
// 反过来「包内优先」会让开发时的修改被上一次打包的旧副本遮住。
|
|
25
|
+
const repo = path.resolve(__dirname, '../../../templates');
|
|
26
|
+
const bundled = path.resolve(__dirname, '../templates');
|
|
27
|
+
return fs.existsSync(repo) ? repo : bundled;
|
|
23
28
|
})();
|
|
24
29
|
|
|
25
30
|
/** 前端出码工程目录 */
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// 应用级文案目录。
|
|
2
2
|
//
|
|
3
3
|
// `inbiz-codegen generate` 会把平台上的应用词条(组件包 locale 之外的)追加到这里。
|
|
4
|
-
//
|
|
4
|
+
// 形状必须是「[命名空间, 目录] 元组组成的数组」——运行时用 `for...of` 遍历它,
|
|
5
|
+
// 写成对象会直接抛 TypeError: xxx is not iterable。
|
|
6
|
+
//
|
|
7
|
+
// 初始工程没有任何业务词条,保持空数组;组件库自己的词条由 app.tsx 里的
|
|
5
8
|
// `@inbiz/entry/locales/index` 统一注册。
|
|
6
9
|
import type { PreviewCatalog } from '@macrowing/inbiz-runtime';
|
|
7
10
|
|
|
8
|
-
export const customLocales:
|
|
11
|
+
export const customLocales: readonly PreviewCatalog[] = [];
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// 应用级文案目录。
|
|
2
2
|
//
|
|
3
3
|
// `inbiz-codegen generate` 会把平台上的应用词条(组件包 locale 之外的)追加到这里。
|
|
4
|
-
//
|
|
4
|
+
// 形状必须是「[命名空间, 目录] 元组组成的数组」——运行时用 `for...of` 遍历它,
|
|
5
|
+
// 写成对象会直接抛 TypeError: xxx is not iterable。
|
|
6
|
+
//
|
|
7
|
+
// 初始工程没有任何业务词条,保持空数组;组件库自己的词条由 app.tsx 里的
|
|
5
8
|
// `@inbiz/entry/locales/index` 统一注册。
|
|
6
9
|
import type { PreviewCatalog } from '@macrowing/inbiz-runtime';
|
|
7
10
|
|
|
8
|
-
export const customLocales:
|
|
11
|
+
export const customLocales: readonly PreviewCatalog[] = [];
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// 应用级文案目录。
|
|
2
2
|
//
|
|
3
3
|
// `inbiz-codegen generate` 会把平台上的应用词条(组件包 locale 之外的)追加到这里。
|
|
4
|
-
//
|
|
4
|
+
// 形状必须是「[命名空间, 目录] 元组组成的数组」——运行时用 `for...of` 遍历它,
|
|
5
|
+
// 写成对象会直接抛 TypeError: xxx is not iterable。
|
|
6
|
+
//
|
|
7
|
+
// 初始工程没有任何业务词条,保持空数组;组件库自己的词条由 app.tsx 里的
|
|
5
8
|
// `@inbiz/entry/locales/index` 统一注册。
|
|
6
9
|
import type { PreviewCatalog } from '@macrowing/inbiz-runtime';
|
|
7
10
|
|
|
8
|
-
export const customLocales:
|
|
11
|
+
export const customLocales: readonly PreviewCatalog[] = [];
|