mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix extensions (#6377)
* Add support for npm extensions * Allow extensions to import vue from the main app * Bundle app extensions on server startup * Fix return type of useLayoutState * Add shared package * Add extension-sdk package * Add type declaration files to allow deep import of shared package * Add extension loading to shared * Refactor extension loading to use shared package * Remove app bundle newline replacement * Fix extension loading in development * Rename extension entrypoints * Update extension build instructions * Remove vite auto-replacement workaround * Update package-lock.json * Remove newline from generated extension entrypoint * Update package-lock.json * Build shared package as cjs and esm * Move useLayoutState composable to shared * Reverse vite base env check * Share useLayoutState composable through extension-sdk * Update layout docs * Update package versions * Small cleanup * Fix layout docs * Fix imports * Add nickrum to codeowners * Fix typo * Add 'em to vite config too * Fix email Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
committed by
GitHub
parent
1644c6397c
commit
051df415df
@@ -1,22 +0,0 @@
|
||||
export async function asyncPool<IN, OUT>(
|
||||
poolLimit: number,
|
||||
array: ReadonlyArray<IN>,
|
||||
iteratorFn: (generator: IN, array: ReadonlyArray<IN>) => Promise<OUT>
|
||||
): Promise<OUT[]> {
|
||||
const ret = [];
|
||||
const executing: any[] = [];
|
||||
|
||||
for (const item of array) {
|
||||
const p = Promise.resolve().then(() => iteratorFn(item, array));
|
||||
ret.push(p);
|
||||
|
||||
if (poolLimit <= array.length) {
|
||||
const e = p.then(() => executing.splice(executing.indexOf(e), 1));
|
||||
executing.push(e);
|
||||
if (executing.length >= poolLimit) {
|
||||
await Promise.race(executing);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Promise.all(ret);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Filter } from '@/types/';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { clone } from 'lodash';
|
||||
|
||||
export default function filtersToQuery(filters: readonly Filter[]): { filter: Record<string, any> } {
|
||||
|
||||
Reference in New Issue
Block a user