fix(data-source,dep,utils): 迭代器数据源配置编译

This commit is contained in:
roymondchen 2024-03-29 12:20:30 +08:00
parent 47b19ae7fa
commit 0e0f50187e
11 changed files with 394 additions and 163 deletions

View File

@ -33,6 +33,7 @@
"data-source"
],
"dependencies": {
"@tmagic/dep": "1.4.2",
"@tmagic/utils": "1.4.2",
"@tmagic/schema": "1.4.2",
"events": "^3.3.0",

View File

@ -18,19 +18,14 @@
import EventEmitter from 'events';
import { cloneDeep, template } from 'lodash-es';
import { cloneDeep } from 'lodash-es';
import type { AppCore, DataSourceSchema, Id, MNode } from '@tmagic/schema';
import {
compiledNode,
DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX,
DSL_NODE_KEY_COPY_PREFIX,
getValueByKeyPath,
} from '@tmagic/utils';
import { compiledNode } from '@tmagic/utils';
import { DataSource, HttpDataSource } from './data-sources';
import type { ChangeEvent, DataSourceManagerData, DataSourceManagerOptions } from './types';
import { compliedConditions, createIteratorContentData } from './utils';
import { compiledNodeField, compliedConditions, compliedIteratorItems } from './utils';
class DataSourceManager extends EventEmitter {
private static dataSourceClassMap = new Map<string, typeof DataSource>();
@ -186,40 +181,7 @@ class DataSourceManager extends EventEmitter {
if (node.visible === false) return newNode;
return compiledNode(
(value: any) => {
// 使用data-source-input等表单控件配置的字符串模板`xxx${id.field}xxx`
if (typeof value === 'string') {
return template(value)(this.data);
}
// 使用data-source-select等表单控件配置的数据源{ isBindDataSource: true, dataSourceId: 'xxx'}
if (value?.isBindDataSource && value.dataSourceId) {
return this.data[value.dataSourceId];
}
// 指定数据源的字符串模板,如:{ isBindDataSourceField: true, dataSourceId: 'id', template: `xxx${field}xxx`}
if (value?.isBindDataSourceField && value.dataSourceId && typeof value.template === 'string') {
return template(value.template)(this.data[value.dataSourceId]);
}
// 使用data-source-field-select等表单控件的数据源字段[`${DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX}${id}`, 'field']
if (Array.isArray(value) && typeof value[0] === 'string') {
const [prefixId, ...fields] = value;
const prefixIndex = prefixId.indexOf(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
if (prefixIndex > -1) {
const dsId = prefixId.substring(prefixIndex + DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX.length);
const data = this.data[dsId];
if (!data) return value;
return getValueByKeyPath(fields.join('.'), data);
}
}
return value;
},
(value: any) => compiledNodeField(value, this.data),
newNode,
this.app.dsl?.dataSourceDeps || {},
sourceId,
@ -231,35 +193,10 @@ class DataSourceManager extends EventEmitter {
}
public compliedIteratorItems(itemData: any, items: MNode[], dataSourceField: string[] = []) {
return items.map((item) => {
const keys: string[] = [];
const [dsId, ...fields] = dataSourceField;
Object.entries(item).forEach(([key, value]) => {
if (
typeof value === 'string' &&
!key.startsWith(DSL_NODE_KEY_COPY_PREFIX) &&
value.includes(`${dsId}`) &&
/\$\{([\s\S]+?)\}/.test(value)
) {
keys.push(key);
}
});
return compiledNode(
(value: string) => template(value)(createIteratorContentData(itemData, dsId, fields)),
item,
{
[dsId]: {
[item.id]: {
name: '',
keys,
},
},
},
dsId,
);
});
const [dsId, ...keys] = dataSourceField;
const ds = this.get(dsId);
if (!ds) return items;
return compliedIteratorItems(itemData, items, dsId, keys);
}
public destroy() {

View File

@ -1,5 +1,17 @@
import { cloneDeep, template } from 'lodash-es';
import { isDataSourceTemplate, isUseDataSourceField, Target, Watcher } from '@tmagic/dep';
import type { MApp, MNode, MPage, MPageFragment } from '@tmagic/schema';
import { compiledCond, getValueByKeyPath, isPage, isPageFragment, replaceChildNode } from '@tmagic/utils';
import {
compiledCond,
compiledNode,
DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX,
DSL_NODE_KEY_COPY_PREFIX,
getValueByKeyPath,
isPage,
isPageFragment,
replaceChildNode,
} from '@tmagic/utils';
import type { DataSourceManagerData } from './types';
@ -57,3 +69,85 @@ export const createIteratorContentData = (itemData: any, dsId: string, fields: s
return data;
};
export const compliedDataSourceField = (value: any, data: DataSourceManagerData) => {
const [prefixId, ...fields] = value;
const prefixIndex = prefixId.indexOf(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
if (prefixIndex > -1) {
const dsId = prefixId.substring(prefixIndex + DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX.length);
const dsData = data[dsId];
if (!dsData) return value;
return getValueByKeyPath(fields.join('.'), dsData);
}
return value;
};
export const compiledNodeField = (value: any, data: DataSourceManagerData) => {
// 使用data-source-input等表单控件配置的字符串模板`xxx${id.field}xxx`
if (typeof value === 'string') {
return template(value)(data);
}
// 使用data-source-select等表单控件配置的数据源{ isBindDataSource: true, dataSourceId: 'xxx'}
if (value?.isBindDataSource && value.dataSourceId) {
return data[value.dataSourceId];
}
// 指定数据源的字符串模板,如:{ isBindDataSourceField: true, dataSourceId: 'id', template: `xxx${field}xxx`}
if (value?.isBindDataSourceField && value.dataSourceId && typeof value.template === 'string') {
return template(value.template)(data[value.dataSourceId]);
}
// 使用data-source-field-select等表单控件的数据源字段[`${DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX}${id}`, 'field']
if (Array.isArray(value) && typeof value[0] === 'string') {
return compliedDataSourceField(value, data);
}
return value;
};
export const compliedIteratorItems = (itemData: any, items: MNode[], dsId: string, keys: string[] = []) => {
const watcher = new Watcher();
watcher.addTarget(
new Target({
id: dsId,
isTarget: (key: string | number, value: any) => {
if (`${key}`.startsWith(DSL_NODE_KEY_COPY_PREFIX)) {
return false;
}
return isDataSourceTemplate(value, dsId) || isUseDataSourceField(value, dsId);
},
}),
);
watcher.collect(items, true);
const { deps } = watcher.getTarget(dsId);
if (!Object.keys(deps).length) {
return items;
}
return items.map((item) => {
if (!deps[item.id]?.keys.length) {
return item;
}
return compiledNode(
(value: any) => {
const ctxData = createIteratorContentData(itemData, dsId, keys);
return compiledNodeField(value, ctxData);
},
cloneDeep(item),
{
[dsId]: deps,
},
dsId,
);
});
};

View File

@ -29,6 +29,7 @@ export default defineConfig(({ mode }) => ({
? [{ find: /^@data-source/, replacement: path.join(__dirname, './src') }]
: [
{ find: /^@data-source/, replacement: path.join(__dirname, './src') },
{ find: /^@tmagic\/dep/, replacement: path.join(__dirname, '../dep/src/index.ts') },
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../schema/src/index.ts') },
],
},

View File

@ -39,6 +39,111 @@ export const createRelatedCompTarget = (options: CustomTargetOptions) =>
...options,
});
/**
* ['array'] ['array', '0'] ['array', '0', 'a'] false
* ['array', 'a'] true
* @param keys
* @param fields
* @returns boolean
*/
export const isIncludeArrayField = (keys: string[], fields: DataSchema[]) => {
let includeArray = false;
keys.reduce((accumulator: DataSchema[], currentValue: string, currentIndex: number) => {
const field = accumulator.find(({ name }) => name === currentValue);
if (
field &&
field.type === 'array' &&
// 不是整数
/^(?!\d+$).*$/.test(`${keys[currentIndex + 1]}`) &&
currentIndex < keys.length - 1
) {
includeArray = true;
}
return field?.fields || [];
}, fields);
return includeArray;
};
/**
* (value)使Id(dsId)`xxx${dsId.field}xxx${dsId.field}`
* @param value any
* @param dsId string | number
* @returns boolean
*/
export const isDataSourceTemplate = (value: any, dsId: string | number) =>
typeof value === 'string' && value.includes(`${dsId}`) && /\$\{([\s\S]+?)\}/.test(value);
/**
* ,{ isBindDataSourceField: true, dataSourceId: 'id', template: `xxx${field}xxx`}
* @param value any
* @param dsId string | number
* @returns boolean
*/
export const isSpecificDataSourceTemplate = (value: any, dsId: string | number) =>
value?.isBindDataSourceField &&
value.dataSourceId &&
value.dataSourceId === dsId &&
typeof value.template === 'string';
/**
* [+ID, ]
* 使data-source-field-select value: 'value'
* @param value any
* @param id string | number
* @returns boolean
*/
export const isUseDataSourceField = (value: any, id: string | number) => {
if (!Array.isArray(value) || typeof value[0] !== 'string') {
return false;
}
const [prefixId] = value;
const prefixIndex = prefixId.indexOf(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
if (prefixIndex === -1) {
return false;
}
const dsId = prefixId.substring(prefixIndex + DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX.length);
return dsId === id;
};
/**
* ${dsId.array.a}
* @param value any
* @param ds DataSourceSchema
* @returns boolean
*/
export const isDataSourceTemplateNotIncludeArrayField = (value: string, ds: DataSourceSchema): boolean => {
// 模板中可能会存在多个表达式,将表达式从模板中提取出来
const templates = value.match(/\$\{([\s\S]+?)\}/g) || [];
for (const tpl of templates) {
const keys = tpl
// 将${dsId.xxxx} 转成 dsId.xxxx
.substring(2, tpl.length - 1)
// 将 array[0] 转成 array.0
.replaceAll(/\[(\d+)\]/g, '.$1')
.split('.');
const dsId = keys.shift();
if (!dsId || dsId !== ds.id) {
continue;
}
// ${dsId.array} ${dsId.array[0]} ${dsId.array[0].a} 这种是依赖
// ${dsId.array.a} 这种不是依赖,这种需要再迭代器容器中的组件才能使用,依赖由迭代器处理
if (isIncludeArrayField(keys, ds.fields)) {
return false;
}
}
return true;
};
export const createDataSourceTarget = (ds: DataSourceSchema, initialDeps: DepData = {}) =>
new Target({
type: DepTargetType.DATA_SOURCE,
@ -52,76 +157,21 @@ export const createDataSourceTarget = (ds: DataSourceSchema, initialDeps: DepDat
return true;
}
// 或者在模板在使用数据源,如:`xxx${dsId.field}xxx${dsId.field}`
if (typeof value === 'string' && value.includes(`${ds.id}`) && /\$\{([\s\S]+?)\}/.test(value)) {
// 模板中可能会存在多个表达式,将表达式从模板中提取出来
const templates = value.match(/\$\{([\s\S]+?)\}/g) || [];
for (const tpl of templates) {
const keys = tpl
// 将${dsId.xxxx} 转成 dsId.xxxx
.substring(2, tpl.length - 1)
// 将 array[0] 转成 array.0
.replaceAll(/\[(\d+)\]/g, '.$1')
.split('.');
const dsId = keys.shift();
if (!dsId || dsId !== ds.id) {
continue;
}
// ${dsId.array} ${dsId.array[0]} ${dsId.array[0].a} 这种是依赖
// ${dsId.array.a} 这种不是依赖,这种需要再迭代器容器中的组件才能使用,依赖由迭代器处理
let includeArray = false;
keys.reduce((accumulator: DataSchema[], currentValue: string, currentIndex: number) => {
const field = accumulator.find(({ name }) => name === currentValue);
if (
field &&
field.type === 'array' &&
typeof keys[currentIndex + 1] !== 'number' &&
currentIndex < keys.length - 1
) {
includeArray = true;
}
return field?.fields || [];
}, ds.fields);
if (includeArray) {
continue;
}
return true;
}
return false;
// 或者在模板在使用数据源
if (isDataSourceTemplate(value, ds.id)) {
return isDataSourceTemplateNotIncludeArrayField(value, ds);
}
// 指定数据源的字符串模板,如:{ isBindDataSourceField: true, dataSourceId: 'id', template: `xxx${field}xxx`}
if (
value?.isBindDataSourceField &&
value.dataSourceId &&
value.dataSourceId === ds.id &&
typeof value.template === 'string'
) {
if (isSpecificDataSourceTemplate(value, ds.id)) {
return true;
}
// 关联数据源字段,格式为 [前缀+数据源ID, 字段名]
// 使用data-source-field-select value: 'value' 可以配置出来
if (!Array.isArray(value) || typeof value[0] !== 'string') {
return false;
if (isUseDataSourceField(value, ds.id)) {
const [, ...keys] = value;
return !isIncludeArrayField(keys, ds.fields);
}
const [prefixId] = value;
const prefixIndex = prefixId.indexOf(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
if (prefixIndex === -1) {
return false;
}
const dsId = prefixId.substring(prefixIndex + DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX.length);
return dsId === ds.id;
return false;
},
});

View File

@ -1,5 +1,8 @@
import { describe, expect, test } from 'vitest';
import { DataSchema } from '@tmagic/schema';
import { DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX } from '@tmagic/utils';
import * as utils from '../src/utils';
describe('utils', () => {
@ -51,4 +54,137 @@ describe('utils', () => {
expect(isTarget1).toBeFalsy();
});
test('isIncludeArrayField', () => {
const arrayFields: DataSchema[] = [{ fields: [{ name: 'a', type: 'string' }], type: 'array', name: 'array' }];
const objectFields: DataSchema[] = [{ fields: [{ name: 'a', type: 'string' }], type: 'object', name: 'object' }];
expect(utils.isIncludeArrayField(['array', 'a'], arrayFields)).toBeTruthy();
expect(utils.isIncludeArrayField(['array', '0', 'a'], arrayFields)).toBeFalsy();
expect(utils.isIncludeArrayField(['array', '0'], arrayFields)).toBeFalsy();
expect(utils.isIncludeArrayField(['array'], arrayFields)).toBeFalsy();
expect(utils.isIncludeArrayField(['object'], objectFields)).toBeFalsy();
expect(utils.isIncludeArrayField(['object', 'a'], objectFields)).toBeFalsy();
});
test('isDataSourceTemplate', () => {
expect(utils.isDataSourceTemplate('xxx${dsId.field}xxx${dsId.field}', 'dsId')).toBeTruthy();
expect(utils.isDataSourceTemplate('${dsId.field}', 'dsId')).toBeTruthy();
expect(utils.isDataSourceTemplate('${dsId}', 'dsId')).toBeTruthy();
expect(utils.isDataSourceTemplate('${dsId.field}', 'dsId1')).toBeFalsy();
expect(utils.isDataSourceTemplate('${dsId.field', 'dsId')).toBeFalsy();
});
test('isSpecificDataSourceTemplate', () => {
expect(
utils.isSpecificDataSourceTemplate(
{
isBindDataSourceField: true,
dataSourceId: 'id',
template: 'xxx${field}xxx',
},
'id',
),
).toBeTruthy();
expect(
utils.isSpecificDataSourceTemplate(
{
isBindDataSourceField: true,
template: 'xxx${field}xxx',
},
'id',
),
).toBeFalsy();
expect(
utils.isSpecificDataSourceTemplate(
{
isBindDataSourceField: true,
dataSourceId: 'id',
template: 123,
},
'id',
),
).toBeFalsy();
expect(
utils.isSpecificDataSourceTemplate(
{
isBindDataSourceField: true,
dataSourceId: 'id',
template: 'xxx${field}xxx',
},
'id1',
),
).toBeFalsy();
});
test('isUseDataSourceField', () => {
expect(utils.isUseDataSourceField([`${DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX}dsID`, 'field'], 'dsID')).toBeTruthy();
expect(utils.isUseDataSourceField([`${DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX}dsID`, 'field'], 'dsID1')).toBeFalsy();
expect(utils.isUseDataSourceField([`abcdsID`, 'field'], 'dsID')).toBeFalsy();
expect(utils.isUseDataSourceField([123, 'field'], 123)).toBeFalsy();
});
test('isDataSourceTemplateNotIncludeArrayField', () => {
const arrayFields: DataSchema[] = [{ fields: [{ name: 'a', type: 'string' }], type: 'array', name: 'array' }];
const objectFields: DataSchema[] = [{ fields: [{ name: 'a', type: 'string' }], type: 'object', name: 'object' }];
expect(
utils.isDataSourceTemplateNotIncludeArrayField('${dsId.array}', {
type: 'base',
id: 'dsId',
methods: [],
fields: arrayFields,
}),
).toBeTruthy();
expect(
utils.isDataSourceTemplateNotIncludeArrayField('${dsId.array}${dsId.object.a}', {
type: 'base',
id: 'dsId',
methods: [],
fields: [...arrayFields, ...objectFields],
}),
).toBeTruthy();
expect(
utils.isDataSourceTemplateNotIncludeArrayField('${dsId.array.a}${dsId.object.a}', {
type: 'base',
id: 'dsId',
methods: [],
fields: [...arrayFields, ...objectFields],
}),
).toBeFalsy();
expect(
utils.isDataSourceTemplateNotIncludeArrayField('${dsId.array}${dsId.array.a}', {
type: 'base',
id: 'dsId',
methods: [],
fields: arrayFields,
}),
).toBeFalsy();
expect(
utils.isDataSourceTemplateNotIncludeArrayField('${dsId.array.a}', {
type: 'base',
id: 'dsId',
methods: [],
fields: arrayFields,
}),
).toBeFalsy();
expect(
utils.isDataSourceTemplateNotIncludeArrayField('${dsId.array[1].a}', {
type: 'base',
id: 'dsId',
methods: [],
fields: arrayFields,
}),
).toBeTruthy();
});
});

View File

@ -165,18 +165,17 @@ export const guid = (digit = 8): string =>
return v.toString(16);
});
export const getValueByKeyPath: any = (keys = '', data: Record<string | number, any> = {}) =>
export const getValueByKeyPath: any = (keys: string | string[] = '', data: Record<string | number, any> = {}) => {
// 将 array[0] 转成 array.0
keys
.replaceAll(/\[(\d+)\]/g, '.$1')
.split('.')
.reduce((accumulator, currentValue: any) => {
if (isObject(accumulator) || Array.isArray(accumulator)) {
return accumulator[currentValue];
}
const keyArray = Array.isArray(keys) ? keys : keys.replaceAll(/\[(\d+)\]/g, '.$1').split('.');
return keyArray.reduce((accumulator, currentValue: any) => {
if (isObject(accumulator) || Array.isArray(accumulator)) {
return accumulator[currentValue];
}
return void 0;
}, data);
return void 0;
}, data);
};
export const setValueByKeyPath: any = (keys: string, value: any, data: Record<string | number, any> = {}) =>
objectSet(data, keys, value);
@ -266,13 +265,20 @@ export const compiledNode = (
}
keys.forEach((key) => {
const cacheKey = `${DSL_NODE_KEY_COPY_PREFIX}${key}`;
const keys = `${key}`.replaceAll(/\[(\d+)\]/g, '.$1').split('.');
const cacheKey = keys.map((key, index) => {
if (index < keys.length - 1) {
return key;
}
return `${DSL_NODE_KEY_COPY_PREFIX}${key}`;
});
const value = getValueByKeyPath(key, node);
let templateValue = getValueByKeyPath(cacheKey, node);
if (typeof templateValue === 'undefined') {
setValueByKeyPath(cacheKey, value, node);
setValueByKeyPath(cacheKey.join('.'), value, node);
templateValue = value;
}

35
pnpm-lock.yaml generated
View File

@ -199,6 +199,9 @@ importers:
packages/data-source:
dependencies:
'@tmagic/dep':
specifier: 1.4.2
version: link:../dep
'@tmagic/schema':
specifier: 1.4.2
version: link:../schema
@ -4715,33 +4718,33 @@ packages:
- '@vue/server-renderer'
dev: true
/@tmagic/core@1.3.16(dayjs@1.11.10):
resolution: {integrity: sha512-Q5s9kCExr+oKdXRHIINs4tTC0tBN6pzbQGZmIbOn89LRzjScjV9OMr47pNBrkygRkSrKbhWlJv+6JWV0CDNiew==}
/@tmagic/core@1.4.2(dayjs@1.11.10):
resolution: {integrity: sha512-ti8RmSCu+m96OmpqTTfVN14lAw2YkPZLg47cWbsWpIvvpo9D/eFSJr6njU/OpmsAYU4ypyEPzdnPDklOvhHiJA==}
engines: {node: '>=18'}
dependencies:
'@tmagic/data-source': 1.3.16(dayjs@1.11.10)
'@tmagic/schema': 1.3.16
'@tmagic/utils': 1.3.16(dayjs@1.11.10)
'@tmagic/data-source': 1.4.2(dayjs@1.11.10)
'@tmagic/schema': 1.4.2
'@tmagic/utils': 1.4.2(dayjs@1.11.10)
events: 3.3.0
lodash-es: 4.17.21
transitivePeerDependencies:
- dayjs
dev: false
/@tmagic/data-source@1.3.16(dayjs@1.11.10):
resolution: {integrity: sha512-QSAegN2jkal6KdD76RDIVeMk2d3iTKTQSzyNtffruPNDU23aK3t4KVlCo3CpgtKtMaixKpuspmbdNUF3g0y9NA==}
/@tmagic/data-source@1.4.2(dayjs@1.11.10):
resolution: {integrity: sha512-HCWdUCn56JBH4A5Ea9JNzIgjwTll8h9FAopeLRYRvtkDLFxoyAIONweT99D2ih4S9PmcyxxE0Dy2C4Ef4JVX0Q==}
engines: {node: '>=18'}
dependencies:
'@tmagic/schema': 1.3.16
'@tmagic/utils': 1.3.16(dayjs@1.11.10)
'@tmagic/schema': 1.4.2
'@tmagic/utils': 1.4.2(dayjs@1.11.10)
events: 3.3.0
lodash-es: 4.17.21
transitivePeerDependencies:
- dayjs
dev: false
/@tmagic/schema@1.3.16:
resolution: {integrity: sha512-2OXS8PaHWSom7EiQOGNqmmzsbJwQZ2q8NX1KBODHPT+hSvH4T6Uc2dnVYgqZH6G99ex/uZIdeR1BX0od7fNxOQ==}
/@tmagic/schema@1.4.2:
resolution: {integrity: sha512-XDmvKLclLoYyCgD/XnDk5ONf/hyTiiSovhWnv1XjyFV9hTr3JahVrFz89Wzk7UX0y2AoaVtW/kpm3QNjDvDbvQ==}
engines: {node: '>=18'}
dev: false
@ -4755,24 +4758,24 @@ packages:
element-plus: ^2.4.3
vue: ^3.3.8
dependencies:
'@tmagic/core': 1.3.16(dayjs@1.11.10)
'@tmagic/core': 1.4.2(dayjs@1.11.10)
'@tmagic/editor': link:packages/editor
'@tmagic/form': link:packages/form
'@tmagic/schema': link:packages/schema
'@tmagic/utils': 1.3.16(dayjs@1.11.10)
'@tmagic/utils': 1.4.2(dayjs@1.11.10)
element-plus: 2.6.1(vue@3.4.21)
vue: 3.4.21(typescript@5.4.2)
transitivePeerDependencies:
- dayjs
dev: false
/@tmagic/utils@1.3.16(dayjs@1.11.10):
resolution: {integrity: sha512-PI26Fllv03NAyUze6P59r9U5pIgkkjHUGmj9VM9y+7KI+N/9HhnstbZSpOIsmUANOzAhD1VLq0Bt7tUcMSaFxg==}
/@tmagic/utils@1.4.2(dayjs@1.11.10):
resolution: {integrity: sha512-OQ0qo+3JZD94lXsxlSjxqR4tuv55MwnKpxN2C/wLmY0h4z9Aelchd0qRVN3ukC4WL6SleRbk50lWmWiOLVCdYQ==}
engines: {node: '>=18'}
peerDependencies:
dayjs: ^1.11.4
dependencies:
'@tmagic/schema': 1.3.16
'@tmagic/schema': 1.4.2
dayjs: 1.11.10
lodash-es: 4.17.21
dev: false

View File

@ -37,6 +37,7 @@ export default defineConfig({
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') },
{ find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') },
{ find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') },
{ find: /^@tmagic\/dep/, replacement: path.join(__dirname, '../../packages/dep/src/index.ts') },
],
},

View File

@ -35,6 +35,7 @@ export default defineConfig({
{ find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') },
{ find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') },
{ find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') },
{ find: /^@tmagic\/dep/, replacement: path.join(__dirname, '../../packages/dep/src/index.ts') },
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') },
],
},

View File

@ -35,6 +35,7 @@ export default defineConfig({
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') },
{ find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') },
{ find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') },
{ find: /^@tmagic\/dep/, replacement: path.join(__dirname, '../../packages/dep/src/index.ts') },
{ find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') },
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') },
],