This commit is contained in:
2026-02-17 23:13:28 +08:00
parent c0bd0b7964
commit 90a73bc1f6
2 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
import glob from 'fast-glob';
const lists = glob.sync('query/*/index.ts', {
absolute: true,
});
export const queryList = lists.map((filePath) => {
const segments = filePath.split('/');
const queryName = segments[segments.length - 2];
return {
name: queryName,
pkgs: `"./${queryName}": "./dist/${queryName}.js",`
};
});
// console.log('Query List:', queryList);
const pkgs = queryList.map(q => q.pkgs).join('\n');
console.log('Package Entries:\n\r', pkgs);
const storeLists = glob.sync('store/*/index.ts', {
absolute: true,
});
export const storeList = storeLists.map((filePath) => {
const segments = filePath.split('/');
const storeName = segments[segments.length - 2];
return {
name: storeName,
pkgs: `"./${storeName}": "./dist/${storeName}.js",`
};
});
// console.log('Store List:', storeList);
const storePkgs = storeList.map(s => s.pkgs).join('\n');
console.log('Store Entries:\n\r', storePkgs);