temp
This commit is contained in:
37
src/scripts/get-query-list.ts
Normal file
37
src/scripts/get-query-list.ts
Normal 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);
|
||||
Reference in New Issue
Block a user