Reorganize repo structure and standards references

This commit is contained in:
david committed 2026-06-29 05:03:42 +02:00
1 parent 3cb93a81be
commit be2054274d
5885 files changed
+2588 -195

No files matched your search

@@ -0,0 +1,25 @@
export type PluginRuntimeEnv = {
[key: string]: string | undefined;
NODE_ENV?: string;
PLUGIN_RUNTIME_PRODUCTION_ENABLED?: string;
};
export const PLUGIN_RUNTIME_PRODUCTION_GATE_ENV = "PLUGIN_RUNTIME_PRODUCTION_ENABLED";
export function isPluginRuntimeProductionEnabled(env: PluginRuntimeEnv = process.env): boolean {
return env.NODE_ENV !== "production" || env.PLUGIN_RUNTIME_PRODUCTION_ENABLED === "true";
}
export function describePluginRuntimeProductionGate(env: PluginRuntimeEnv = process.env): string | null {
if (isPluginRuntimeProductionEnabled(env)) {
return null;
}
return `${PLUGIN_RUNTIME_PRODUCTION_GATE_ENV}=true is required before tenant plugin runtime operations are allowed in production.`;
}
export function assertPluginRuntimeProductionEnabled(env: PluginRuntimeEnv = process.env): void {
const reason = describePluginRuntimeProductionGate(env);
if (reason) {
throw new Error(reason);
}
}