feat: refactor query proxy and router API, add random utilities, and create index files for queries
- Updated imports in proxy.ts to use browser-specific router. - Refactored router-api-proxy.ts to streamline imports. - Enhanced random.ts with additional utility functions for generating random IDs and letters. - Created bun.config.ts for building query modules dynamically. - Added index files for query modules (query-ai, query-app, query-config, query-login, query-shop, query-upload) to facilitate exports. - Implemented get-query-list.ts to automate the generation of package entries for queries.
This commit is contained in:
19
src/get-query-list.ts
Normal file
19
src/get-query-list.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user