mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
* start setting up types * Add types for sandbox flag * Add initial secure API extensions implementation * Remove erroneous file * Delete old exec implementation * Read sandbox from extension manifest * Rename \0virtual to @directus/virtual-ent4y * Test register exec * Add exec function using ivm callback * Throw error on invalid type * Make extensions individually unregisterable * Remove support for secure bundle extensions * Rework context passing to fix async * Remove unused promise.resolve * Start implementing secure extension register and context functions * Rename secure to sandbox * Only dispose isolate on catastrophic error * Use callback copy option instead of explicit ExternalCopy * Add registerOperation handler * Add registerRoute handler * Rename some return values * Rename sandbox registration file * Expose utils through sdk import * Remove unused files * Rename timeout to sleep for consistency with flows * Make registerRoute method uppercase * Add request util * Abort process on catastrophic error * Update api extension sdk import name * Add variables for reference parameters for consistency * Add permissions to request util * Fix non-determinism when registering sandboxed extensions * Improve stack trace readability * Initialize isolated-vm for Vitest * Format files * Fix request options undefined check * Always copy host function result into isolate * Split up host function reference generation * Add workaround for async error from host not thrown in isolate * Use undefined instead of null as first argument to apply * Abort process if sandbox has reached memory limit * Reorganize files * Use type error for assertion * Use typeerrors in sdk generators, restructure some more * Document * Add changeset --------- Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
9 lines
439 B
JavaScript
9 lines
439 B
JavaScript
// From https://sharp.pixelplumbing.com/install#worker-threads:
|
|
// On some platforms, including glibc-based Linux, the main thread must call require('sharp') before worker threads are created.
|
|
// This is to ensure shared libraries remain loaded in memory until after all threads are complete.
|
|
// Without this, the following error may occur: Module did not self-register
|
|
import 'sharp';
|
|
import 'isolated-vm';
|
|
|
|
export default function () {}
|