@lunora/config 1.0.0-alpha.466 → 1.0.0-alpha.468
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cloudflare/index.d.mts +7 -1
- package/dist/cloudflare/index.d.ts +7 -1
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.d.mts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{POLICY_SCAFFOLD_ENDPOINT-uPZXZrU7.mjs → POLICY_SCAFFOLD_ENDPOINT-DSMpLzsw.mjs} +1 -1
- package/dist/packem_shared/{REQUIRED_COMPATIBILITY_DATE-GjaJU_-D.mjs → REQUIRED_COMPATIBILITY_DATE-BqFeetpX.mjs} +1 -1
- package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-Dbdgz4G6.mjs → SCHEMA_EDIT_ENDPOINT-FM9ZC-gV.mjs} +1 -1
- package/dist/packem_shared/{STUDIO_PATH-DXNMnzuM.mjs → STUDIO_PATH-CWaCBuYC.mjs} +1 -1
- package/dist/packem_shared/{UNEXPORTED_CLASS_MARKER-Cfi7PRg1.mjs → UNEXPORTED_CLASS_MARKER-BZEXldUo.mjs} +1 -1
- package/dist/packem_shared/{assertWranglerSatisfiesSchema-UYsmhXNk.mjs → assertWranglerSatisfiesSchema-_70vhvqk.mjs} +1 -1
- package/dist/packem_shared/checkDevEnv-BwZSVBbB.mjs +3 -0
- package/dist/packem_shared/mergeWranglerEnvironment-CxT2PV1N.mjs +1 -0
- package/dist/packem_shared/resolveLocalWorkerEnv-C1s-quRt.mjs +1 -0
- package/dist/packem_shared/wranglerCodegenInputs--ngEbVLe.mjs +1 -0
- package/dist/packem_shared/{write-atomic-BD9yan7c.mjs → write-atomic-BzViTZCw.mjs} +1 -1
- package/dist/studio-host/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/checkDevEnv-egiW2lSF.mjs +0 -3
- package/dist/packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs +0 -1
- package/dist/packem_shared/wranglerCodegenInputs-Bfe3cN0G.mjs +0 -1
|
@@ -1388,13 +1388,19 @@ interface WranglerCodegenInputs {
|
|
|
1388
1388
|
binding: string;
|
|
1389
1389
|
directory: string;
|
|
1390
1390
|
};
|
|
1391
|
+
/**
|
|
1392
|
+
* The worker entry file the deploy bundles, absolute: the composed `src/worker.ts` when it exists (the deploy
|
|
1393
|
+
* passes it in place of `main`), else wrangler's `main`, else the first `WORKER_ENTRY_FALLBACKS` file. Absent when
|
|
1394
|
+
* none exists, as for the composed `virtual:lunora/worker`. Codegen's `cloudflare:*` import gate starts from it.
|
|
1395
|
+
*/
|
|
1396
|
+
workerEntry?: string;
|
|
1391
1397
|
/** Every well-formed `queues.producers[]` entry of the top level and each `env.<name>` block. */
|
|
1392
1398
|
wranglerQueueProducers: WranglerQueueProducerIR[];
|
|
1393
1399
|
/** Top-level `vars` entries that look like plaintext secrets. */
|
|
1394
1400
|
wranglerVariables: WranglerVariableIR[];
|
|
1395
1401
|
}
|
|
1396
1402
|
/**
|
|
1397
|
-
*
|
|
1403
|
+
* The wrangler inputs are empty when there is no wrangler config or it does not parse; `workerEntry` is still probed. Pass the `target` codegen runs with, so
|
|
1398
1404
|
* an explicit `--target` decides the Studio documents' placement the same way `reconcileStudioAssets` does.
|
|
1399
1405
|
*/
|
|
1400
1406
|
declare const wranglerCodegenInputs: (projectRoot: string, target?: string) => WranglerCodegenInputs;
|
|
@@ -1388,13 +1388,19 @@ interface WranglerCodegenInputs {
|
|
|
1388
1388
|
binding: string;
|
|
1389
1389
|
directory: string;
|
|
1390
1390
|
};
|
|
1391
|
+
/**
|
|
1392
|
+
* The worker entry file the deploy bundles, absolute: the composed `src/worker.ts` when it exists (the deploy
|
|
1393
|
+
* passes it in place of `main`), else wrangler's `main`, else the first `WORKER_ENTRY_FALLBACKS` file. Absent when
|
|
1394
|
+
* none exists, as for the composed `virtual:lunora/worker`. Codegen's `cloudflare:*` import gate starts from it.
|
|
1395
|
+
*/
|
|
1396
|
+
workerEntry?: string;
|
|
1391
1397
|
/** Every well-formed `queues.producers[]` entry of the top level and each `env.<name>` block. */
|
|
1392
1398
|
wranglerQueueProducers: WranglerQueueProducerIR[];
|
|
1393
1399
|
/** Top-level `vars` entries that look like plaintext secrets. */
|
|
1394
1400
|
wranglerVariables: WranglerVariableIR[];
|
|
1395
1401
|
}
|
|
1396
1402
|
/**
|
|
1397
|
-
*
|
|
1403
|
+
* The wrangler inputs are empty when there is no wrangler config or it does not parse; `workerEntry` is still probed. Pass the `target` codegen runs with, so
|
|
1398
1404
|
* an explicit `--target` decides the Studio documents' placement the same way `reconcileStudioAssets` does.
|
|
1399
1405
|
*/
|
|
1400
1406
|
declare const wranglerCodegenInputs: (projectRoot: string, target?: string) => WranglerCodegenInputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{reconcileWranglerBindings as a}from"../packem_shared/reconcileWranglerBindings-DAdI2Z-R.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-
|
|
1
|
+
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{reconcileWranglerBindings as a}from"../packem_shared/reconcileWranglerBindings-DAdI2Z-R.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-_70vhvqk.mjs";import{w as s}from"../packem_shared/asset-headers-CPuEX21i.mjs";import{BINDING_MANIFEST_VERSION as m,buildBindingManifest as p}from"../packem_shared/BINDING_MANIFEST_VERSION-CR06-eW7.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as E,detectCloudflareCliConfig as g,warnCloudflareCliConfigOnce as x}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-75Y5zVF8.mjs";import{default as c}from"../packem_shared/CLOUDFLARE_DRIVER-DbmpoIcg.mjs";import{default as _}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as L}from"../packem_shared/hasCloudflareCredentials-ByCrwaLT.mjs";import{describeWithheld as S,withheldBindings as D}from"../packem_shared/describeWithheld-CbyzZjZF.mjs";import{bindingsNeedingDatabase as W,startLocalHyperdrive as T}from"../packem_shared/bindingsNeedingDatabase-3KyGflIq.mjs";import{readManifest as v,recordManifestKey as B}from"../packem_shared/readManifest-Cighz3WC.mjs";import{HYPERDRIVE_PLACEHOLDER_ID as b}from"../packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{emitProjectAssetHeaders as h}from"../packem_shared/emitProjectAssetHeaders-6iinmRWE.mjs";import{collectExportGaps as M}from"../packem_shared/collectExportGaps-DHUtghqe.mjs";import{reconcileWranglerCompatibilityDate as w}from"../packem_shared/reconcileWranglerCompatibilityDate-Cj94osA-.mjs";import{describePreservedCrons as H,reconcileWranglerCrons as U}from"../packem_shared/describePreservedCrons-i5XT6rtl.mjs";import{pendingBindingChanges as Y,reconcileBindingsSafely as K,reconcileStudioAssets as j,reconcileWranglerExtras as z}from"../packem_shared/pendingBindingChanges-DqP40pSQ.mjs";import{REMOTE_ELIGIBLE_KEYS as J,injectRemoteFlags as X,isRemoteEnvEnabled as k,materializeDevWranglerConfig as q,planRemoteBindings as Z,resolveRemoteEnabled as $,toRemotePlan as ee}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D66_hwjD.mjs";import{materializeServiceDevConfigs as oe}from"../packem_shared/materializeServiceDevConfigs-CI1HXv7f.mjs";import{i as ae}from"../packem_shared/studio-assets-BKWx838V.mjs";import{default as ne}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DWyZ_2QM.mjs";import{withTailConsumer as se}from"../packem_shared/withTailConsumer-BXOIqXxv.mjs";import{WORKERS_CACHE_MIN_DATE as me,isCacheEnabled as pe}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as Ee}from"../packem_shared/wranglerCodegenInputs--ngEbVLe.mjs";import{DEFAULT_OBSERVABILITY as xe,resolveObservabilitySampling as Ce}from"../packem_shared/DEFAULT_OBSERVABILITY-CPLADr5u.mjs";import{mergeWranglerEnvironment as Re}from"../packem_shared/mergeWranglerEnvironment-CxT2PV1N.mjs";import{WRANGLER_FILES as Ie,findWranglerFile as Le,readWranglerJsonc as Ae}from"../packem_shared/WRANGLER_FILES-BF8PUjuo.mjs";import{UNEXPORTED_CLASS_MARKER as De,validateWranglerProject as Oe}from"../packem_shared/UNEXPORTED_CLASS_MARKER-BZEXldUo.mjs";import{scanWranglerVariablesForSecrets as Te}from"../packem_shared/scanWranglerVariablesForSecrets-BQIPpHpH.mjs";import{wranglerToAlchemy as ve}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Fe,REQUIRED_FLAG as be,validateWrangler as ue,validateWranglerConfig as he}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-BqFeetpX.mjs";export{m as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,c as CLOUDFLARE_DRIVER,ne as CLOUDFLARE_TOOLCHAIN_VERSIONS,xe as DEFAULT_OBSERVABILITY,_ as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,b as HYPERDRIVE_PLACEHOLDER_ID,J as REMOTE_ELIGIBLE_KEYS,Fe as REQUIRED_COMPATIBILITY_DATE,be as REQUIRED_FLAG,De as UNEXPORTED_CLASS_MARKER,me as WORKERS_CACHE_MIN_DATE,Ie as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,W as bindingsNeedingDatabase,p as buildBindingManifest,M as collectExportGaps,H as describePreservedCrons,S as describeWithheld,g as detectCloudflareCliConfig,h as emitProjectAssetHeaders,Le as findWranglerFile,L as hasCloudflareCredentials,X as injectRemoteFlags,pe as isCacheEnabled,ae as isOwnedStudioAssets,k as isRemoteEnvEnabled,q as materializeDevWranglerConfig,oe as materializeServiceDevConfigs,Re as mergeWranglerEnvironment,Y as pendingBindingChanges,Z as planRemoteBindings,v as readManifest,Ae as readWranglerJsonc,K as reconcileBindingsSafely,j as reconcileStudioAssets,a as reconcileWranglerBindings,w as reconcileWranglerCompatibilityDate,U as reconcileWranglerCrons,z as reconcileWranglerExtras,B as recordManifestKey,Ce as resolveObservabilitySampling,$ as resolveRemoteEnabled,Te as scanWranglerVariablesForSecrets,T as startLocalHyperdrive,ee as toRemotePlan,ue as validateWrangler,he as validateWranglerConfig,Oe as validateWranglerProject,x as warnCloudflareCliConfigOnce,se as withTailConsumer,D as withheldBindings,Ee as wranglerCodegenInputs,ve as wranglerToAlchemy,s as writeAssetHeaders};
|
package/dist/index.d.mts
CHANGED
|
@@ -799,6 +799,36 @@ declare const detectLintTools: (projectRoot: string) => LintTool[];
|
|
|
799
799
|
* @returns one outcome per tool, in the order given.
|
|
800
800
|
*/
|
|
801
801
|
declare const applyLintIgnores: (projectRoot: string, tools: ReadonlyArray<LintTool>) => LintIgnoreOutcome[];
|
|
802
|
+
/** The slice of one wrangler environment (or the top level) the env is assembled from. */
|
|
803
|
+
interface WorkerEnvScope {
|
|
804
|
+
secrets?: {
|
|
805
|
+
required?: unknown;
|
|
806
|
+
} | null;
|
|
807
|
+
vars?: Record<string, unknown> | null;
|
|
808
|
+
}
|
|
809
|
+
interface LocalWorkerEnvOptions {
|
|
810
|
+
/** The parsed wrangler config, or `undefined` when the project has none. */
|
|
811
|
+
config: (WorkerEnvScope & {
|
|
812
|
+
env?: Record<string, WorkerEnvScope | null | undefined> | null;
|
|
813
|
+
}) | undefined;
|
|
814
|
+
/** Where the wrangler config lives; wrangler reads `.dev.vars` and `.env` beside it. */
|
|
815
|
+
configPath: string | undefined;
|
|
816
|
+
/** The wrangler environment (`--env` / `CLOUDFLARE_ENV`), when one is active. */
|
|
817
|
+
environment?: string;
|
|
818
|
+
/** Defaults to `process.env`. */
|
|
819
|
+
processEnv?: Record<string, string | undefined>;
|
|
820
|
+
/** Where to look when there is no wrangler config. */
|
|
821
|
+
projectRoot: string;
|
|
822
|
+
/** `--var` values the worker is started with: applied last, over `.dev.vars` / `.env`, as wrangler applies its input bindings. */
|
|
823
|
+
vars?: Readonly<Record<string, string>>;
|
|
824
|
+
}
|
|
825
|
+
interface LocalWorkerEnv {
|
|
826
|
+
env: Record<string, unknown>;
|
|
827
|
+
/** What contributed, in order (`wrangler vars`, `.dev.vars`, `.env`, `process.env`, …), for a log line. */
|
|
828
|
+
sources: string[];
|
|
829
|
+
}
|
|
830
|
+
/** Assemble the local dev worker's env; see the module comment. Throws where wrangler would refuse to start. */
|
|
831
|
+
declare const resolveLocalWorkerEnv: (options: LocalWorkerEnvOptions) => LocalWorkerEnv;
|
|
802
832
|
/** The three channels a bundler plugin reports through; `console` satisfies it, as does Rspack's `Logger`. */
|
|
803
833
|
interface FindingLogger {
|
|
804
834
|
error: (message: string) => void;
|
|
@@ -1420,4 +1450,4 @@ type ParseSchemaResult = {
|
|
|
1420
1450
|
* message per failure mode without throwing.
|
|
1421
1451
|
*/
|
|
1422
1452
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1423
|
-
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BUILD_ROOT_ENV, BUILD_TARGET_ENV, BUNDLE_META_PATH_ENV, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type CelldToolchainProbe, type CelldToolchainProbeOptions, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_BUNDLE_META_PATH, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DestructiveEdit, type DetectedFramework, type DevEnvCheck, type DevEnvCheckOptions, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DevTriggerHint, type DevTriggerHintOptions, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type EnvKeyFailure, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type MarkedApiSpec, MissingBuildOutputError, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, STRICT_ADVISORIES_ENV, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, assertBuildTargetMatches, blockingFindingsMessage, buildPackageSecretsBlock, canonicalPath, checkDevEnv, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, describeDevEnvCheck, detectAiAgent, detectFramework, detectLintTools, devTriggerHints, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatDevBannerRow, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readDevVariablesRecord, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, wranglerDotenvFiles, writeApiSpecMarker, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
|
1453
|
+
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BUILD_ROOT_ENV, BUILD_TARGET_ENV, BUNDLE_META_PATH_ENV, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type CelldToolchainProbe, type CelldToolchainProbeOptions, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_BUNDLE_META_PATH, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DestructiveEdit, type DetectedFramework, type DevEnvCheck, type DevEnvCheckOptions, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DevTriggerHint, type DevTriggerHintOptions, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type EnvKeyFailure, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LocalWorkerEnv, type LocalWorkerEnvOptions, type LunoraFormattedLine, type LunoraLineLevel, type MarkedApiSpec, MissingBuildOutputError, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, STRICT_ADVISORIES_ENV, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, assertBuildTargetMatches, blockingFindingsMessage, buildPackageSecretsBlock, canonicalPath, checkDevEnv, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, describeDevEnvCheck, detectAiAgent, detectFramework, detectLintTools, devTriggerHints, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatDevBannerRow, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readDevVariablesRecord, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveLocalWorkerEnv, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, wranglerDotenvFiles, writeApiSpecMarker, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
package/dist/index.d.ts
CHANGED
|
@@ -799,6 +799,36 @@ declare const detectLintTools: (projectRoot: string) => LintTool[];
|
|
|
799
799
|
* @returns one outcome per tool, in the order given.
|
|
800
800
|
*/
|
|
801
801
|
declare const applyLintIgnores: (projectRoot: string, tools: ReadonlyArray<LintTool>) => LintIgnoreOutcome[];
|
|
802
|
+
/** The slice of one wrangler environment (or the top level) the env is assembled from. */
|
|
803
|
+
interface WorkerEnvScope {
|
|
804
|
+
secrets?: {
|
|
805
|
+
required?: unknown;
|
|
806
|
+
} | null;
|
|
807
|
+
vars?: Record<string, unknown> | null;
|
|
808
|
+
}
|
|
809
|
+
interface LocalWorkerEnvOptions {
|
|
810
|
+
/** The parsed wrangler config, or `undefined` when the project has none. */
|
|
811
|
+
config: (WorkerEnvScope & {
|
|
812
|
+
env?: Record<string, WorkerEnvScope | null | undefined> | null;
|
|
813
|
+
}) | undefined;
|
|
814
|
+
/** Where the wrangler config lives; wrangler reads `.dev.vars` and `.env` beside it. */
|
|
815
|
+
configPath: string | undefined;
|
|
816
|
+
/** The wrangler environment (`--env` / `CLOUDFLARE_ENV`), when one is active. */
|
|
817
|
+
environment?: string;
|
|
818
|
+
/** Defaults to `process.env`. */
|
|
819
|
+
processEnv?: Record<string, string | undefined>;
|
|
820
|
+
/** Where to look when there is no wrangler config. */
|
|
821
|
+
projectRoot: string;
|
|
822
|
+
/** `--var` values the worker is started with: applied last, over `.dev.vars` / `.env`, as wrangler applies its input bindings. */
|
|
823
|
+
vars?: Readonly<Record<string, string>>;
|
|
824
|
+
}
|
|
825
|
+
interface LocalWorkerEnv {
|
|
826
|
+
env: Record<string, unknown>;
|
|
827
|
+
/** What contributed, in order (`wrangler vars`, `.dev.vars`, `.env`, `process.env`, …), for a log line. */
|
|
828
|
+
sources: string[];
|
|
829
|
+
}
|
|
830
|
+
/** Assemble the local dev worker's env; see the module comment. Throws where wrangler would refuse to start. */
|
|
831
|
+
declare const resolveLocalWorkerEnv: (options: LocalWorkerEnvOptions) => LocalWorkerEnv;
|
|
802
832
|
/** The three channels a bundler plugin reports through; `console` satisfies it, as does Rspack's `Logger`. */
|
|
803
833
|
interface FindingLogger {
|
|
804
834
|
error: (message: string) => void;
|
|
@@ -1420,4 +1450,4 @@ type ParseSchemaResult = {
|
|
|
1420
1450
|
* message per failure mode without throwing.
|
|
1421
1451
|
*/
|
|
1422
1452
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1423
|
-
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BUILD_ROOT_ENV, BUILD_TARGET_ENV, BUNDLE_META_PATH_ENV, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type CelldToolchainProbe, type CelldToolchainProbeOptions, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_BUNDLE_META_PATH, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DestructiveEdit, type DetectedFramework, type DevEnvCheck, type DevEnvCheckOptions, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DevTriggerHint, type DevTriggerHintOptions, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type EnvKeyFailure, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type MarkedApiSpec, MissingBuildOutputError, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, STRICT_ADVISORIES_ENV, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, assertBuildTargetMatches, blockingFindingsMessage, buildPackageSecretsBlock, canonicalPath, checkDevEnv, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, describeDevEnvCheck, detectAiAgent, detectFramework, detectLintTools, devTriggerHints, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatDevBannerRow, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readDevVariablesRecord, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, wranglerDotenvFiles, writeApiSpecMarker, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
|
1453
|
+
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BUILD_ROOT_ENV, BUILD_TARGET_ENV, BUNDLE_META_PATH_ENV, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type CelldToolchainProbe, type CelldToolchainProbeOptions, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_BUNDLE_META_PATH, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DestructiveEdit, type DetectedFramework, type DevEnvCheck, type DevEnvCheckOptions, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DevTriggerHint, type DevTriggerHintOptions, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type EnvKeyFailure, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LocalWorkerEnv, type LocalWorkerEnvOptions, type LunoraFormattedLine, type LunoraLineLevel, type MarkedApiSpec, MissingBuildOutputError, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, STRICT_ADVISORIES_ENV, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, assertBuildTargetMatches, blockingFindingsMessage, buildPackageSecretsBlock, canonicalPath, checkDevEnv, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, describeDevEnvCheck, detectAiAgent, detectFramework, detectLintTools, devTriggerHints, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatDevBannerRow, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readDevVariablesRecord, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveLocalWorkerEnv, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, wranglerDotenvFiles, writeApiSpecMarker, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as c,ROOT_SKILL_NAME as l,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as m,writeApiSpecMarker as f}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as N}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{probeCelldToolchain as T}from"./packem_shared/probeCelldToolchain-DxDttfHy.mjs";import{startCelldDevSession as g,writeCelldDevProjection as V}from"./packem_shared/startCelldDevSession-DQ7YylR_.mjs";import{D1_PLACEHOLDER_ID as u}from"./packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{BUILD_ROOT_ENV as P,BUILD_TARGET_ENV as C,BUNDLE_META_PATH_ENV as F,CODEGEN_ENV as M,DEFAULT_BUNDLE_META_PATH as U,LAZY_FUNCTIONS_ENV as B,STRICT_ADVISORIES_ENV as G,isCodegenDisabled as b,isLazyFunctionsEnabled as y,resolveLazyFunctions as k}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as w}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as H}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as W,projectUsesUmbrella as Y}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{checkDevEnv as z,describeDevEnvCheck as q}from"./packem_shared/checkDevEnv-egiW2lSF.mjs";import{acceptsConnection as Z,startDevProcess as Q}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as ee,DEV_DAEMON_ENV as re,DEV_HANDOFF_ENV as oe,DEV_LOG_FILE as te,DEV_LOG_FILE_ENV as ae,DEV_STATE_DIR as Ee,DEV_STATE_FILE as ie,claimDevServerState as se,clearDevServerState as ne,isDevServerReady as _e,isProcessAlive as ce,isRecordedProcessCurrent as le,readDevServerState as pe,readLiveDevServerState as De,updateDevServerState as de,writeDevServerState as Ae}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{devTriggerHints as fe,formatDevBannerRow as Se}from"./packem_shared/devTriggerHints-CN_RJxWW.mjs";import{DEV_VARS_EXAMPLE_FILE as ve,DEV_VARS_FILE as Ne,DEV_VARS_KEY_PATTERN as Re,escapeRegExp as Te,parseDevVariableEntries as xe,readDevVariablesRecord as ge,removeDevVariableLine as Ve,upsertDevVariableLine as Ie,wranglerDotenvFiles as ue}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";import{DEV_WORKER_ENV_VALUE as Pe,DEV_WORKER_ENV_VAR as Ce,ensureDevWorkerEnv as Fe}from"./packem_shared/DEV_WORKER_ENV_VALUE-FoysLtF0.mjs";import{createDiscoveryCache as Ue}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as Ge,deployTargetIds as be,isRunnableTarget as ye,planToolchainInvocation as ke,resolveDeployDriver as he,runnableTargetIds as we,targetRunsOwnDevServer as je}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CAJl2nEI.mjs";import{default as Ke}from"./packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs";import{inferLunoraBindings as Ye,secretSourcesFromBindings as Je}from"./packem_shared/inferLunoraBindings-Biq1OW9V.mjs";import{LINKED_PROJECT_DIR as qe,LINKED_PROJECT_FILE as Xe,readLinkedProject as Ze,writeLinkedProject as Qe}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as er,applyLintIgnores as rr,detectLintTools as or}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as ar,reportCodegenFindings as Er}from"./packem_shared/blockingFindingsMessage-BQ9z7cie.mjs";import{LUNORA_EVENT_SOURCE as sr,formatLunoraEvent as nr}from"./packem_shared/LUNORA_EVENT_SOURCE-Cq0oj0_9.mjs";import{LUNORA_TAG as cr,advisoryLine as lr,lunoraLine as pr}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as dr}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as mr,detectInstalledManagers as fr,detectPackageManager as Sr,execArgsFor as Lr,installArgsFor as vr,runScriptArgsFor as Nr,runScriptCommand as Rr,toolchainExecArgs as Tr}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{PACKAGE_SECRETS_REGISTRY as gr,mintableSecretKeysFor as Vr,secretsForPackages as Ir}from"./packem_shared/PACKAGE_SECRETS_REGISTRY-CPWkw-qE.mjs";import{runPostCodegenHook as Or}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as Cr,interpretRemote as Fr,readProjectRemotePreference as Mr,readProjectTarget as Ur,resolveProjectTarget as Br,resolveTargetOrThrow as Gr}from"./packem_shared/assertBuildTargetMatches-tkKAa5zl.mjs";import{readProjectDependencies as yr,readProjectDependencyNames as kr,readProjectManifest as hr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as jr,isInteractive as Hr,promptMultiSelect as Kr,promptSelect as Wr,promptText as Yr,promptYesNo as Jr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as qr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Zr,ensureDevVariables as Qr,ensureDevVarsExample as $r,fillDevSecrets as eo,generateSecretValue as ro,isMintableSecretKey as oo,isPlaceholderValue as to,planDevSecretsFill as ao,planDevVariablesAugment as Eo,planDevVariablesScaffold as io,requiredSecrets as so,writeDevVariablesFileAtomically as no}from"./packem_shared/buildPackageSecretsBlock-DrSD60vH.mjs";import{applyAdditiveEdit as co,classifyEdit as lo}from"./packem_shared/applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as Do}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as mo,resolveServerModule as fo,scaffoldPolicyFile as So,wireRlsIntoProcedure as Lo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as No}from"./packem_shared/discoverSchemaInfo-DRPnqgif.mjs";import{ACCENT as To,BADGES as xo,BADGE_COLUMN_WIDTH as go,LUNA_ART as Vo,LUNA_BUNNY as Io,LUNA_NAME as uo,LUNA_SIGNOFF as Oo,STEP_BADGE_NAMES as Po,badgeLead as Co,badgeWidth as Fo,padBadge as Mo,paintAnswer as Uo,paintBadge as Bo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as bo,DURABLE_OBJECT_BINDINGS as yo,GENERATED_CLASS_MODULES as ko,GENERATED_MODULE_DURABLE_OBJECTS as ho,MERGED_DURABLE_OBJECTS_MODULE as wo,isMergedProject as jo,isMergedRoleModule as Ho}from"./packem_shared/COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{discoverWorkflowInfo as Wo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";import{ENV_FILENAME as Jo}from"@lunora/codegen";export{To as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,xo as BADGES,go as BADGE_COLUMN_WIDTH,P as BUILD_ROOT_ENV,C as BUILD_TARGET_ENV,F as BUNDLE_META_PATH_ENV,M as CODEGEN_ENV,bo as COMPOSED_WORKER_ENTRY,u as D1_PLACEHOLDER_ID,U as DEFAULT_BUNDLE_META_PATH,Ge as DEFAULT_DEPLOY_TARGET,ee as DEV_BINDINGS_FILE,re as DEV_DAEMON_ENV,oe as DEV_HANDOFF_ENV,te as DEV_LOG_FILE,ae as DEV_LOG_FILE_ENV,Ee as DEV_STATE_DIR,ie as DEV_STATE_FILE,ve as DEV_VARS_EXAMPLE_FILE,Ne as DEV_VARS_FILE,Re as DEV_VARS_KEY_PATTERN,Pe as DEV_WORKER_ENV_VALUE,Ce as DEV_WORKER_ENV_VAR,yo as DURABLE_OBJECT_BINDINGS,Jo as ENV_FILENAME,ko as GENERATED_CLASS_MODULES,ho as GENERATED_MODULE_DURABLE_OBJECTS,B as LAZY_FUNCTIONS_ENV,qe as LINKED_PROJECT_DIR,Xe as LINKED_PROJECT_FILE,Vo as LUNA_ART,Io as LUNA_BUNNY,uo as LUNA_NAME,Oo as LUNA_SIGNOFF,sr as LUNORA_EVENT_SOURCE,er as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,cr as LUNORA_TAG,dr as LunoraReporter,wo as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,gr as PACKAGE_SECRETS_REGISTRY,l as ROOT_SKILL_NAME,Po as STEP_BADGE_NAMES,G as STRICT_ADVISORIES_ENV,Z as acceptsConnection,mr as addArgsFor,lr as advisoryLine,co as applyAdditiveEdit,rr as applyLintIgnores,Cr as assertBuildTargetMatches,Co as badgeLead,Fo as badgeWidth,ar as blockingFindingsMessage,Zr as buildPackageSecretsBlock,N as canonicalPath,z as checkDevEnv,p as claimAgentRulesHint,se as claimDevServerState,lo as classifyEdit,mo as classifyPolicyEdit,A as clearApiSpecMarker,ne as clearDevServerState,jr as createConfirm,Ue as createDiscoveryCache,be as deployTargetIds,q as describeDevEnvCheck,D as detectAgentRules,t as detectAiAgent,W as detectFramework,fr as detectInstalledManagers,or as detectLintTools,Sr as detectPackageManager,fe as devTriggerHints,E as discoverAgentInfo,w as discoverContainerInfo,No as discoverSchemaInfo,Wo as discoverWorkflowInfo,Qr as ensureDevVariables,$r as ensureDevVarsExample,Fe as ensureDevWorkerEnv,Ke as ensureGitignoreEntries,Te as escapeRegExp,Lr as execArgsFor,eo as fillDevSecrets,Se as formatDevBannerRow,nr as formatLunoraEvent,ro as generateSecretValue,Ye as inferLunoraBindings,vr as installArgsFor,Fr as interpretRemote,b as isCodegenDisabled,_e as isDevServerReady,Hr as isInteractive,y as isLazyFunctionsEnabled,jo as isMergedProject,Ho as isMergedRoleModule,oo as isMintableSecretKey,to as isPlaceholderValue,ce as isProcessAlive,le as isRecordedProcessCurrent,ye as isRunnableTarget,pr as lunoraLine,Vr as mintableSecretKeysFor,Mo as padBadge,Uo as paintAnswer,Bo as paintBadge,xe as parseDevVariableEntries,Do as parseSchema,ao as planDevSecretsFill,Eo as planDevVariablesAugment,io as planDevVariablesScaffold,ke as planToolchainInvocation,T as probeCelldToolchain,Y as projectUsesUmbrella,Kr as promptMultiSelect,Wr as promptSelect,Yr as promptText,Jr as promptYesNo,m as readApiSpecMarker,pe as readDevServerState,ge as readDevVariablesRecord,Ze as readLinkedProject,De as readLiveDevServerState,yr as readProjectDependencies,kr as readProjectDependencyNames,hr as readProjectManifest,Mr as readProjectRemotePreference,Ur as readProjectTarget,Ve as removeDevVariableLine,Er as reportCodegenFindings,so as requiredSecrets,he as resolveDeployDriver,k as resolveLazyFunctions,Br as resolveProjectTarget,qr as resolveSchemaDirectory,fo as resolveServerModule,Gr as resolveTargetOrThrow,Or as runPostCodegenHook,Nr as runScriptArgsFor,Rr as runScriptCommand,we as runnableTargetIds,So as scaffoldPolicyFile,Je as secretSourcesFromBindings,Ir as secretsForPackages,g as startCelldDevSession,Q as startDevProcess,H as streamContainerLogs,je as targetRunsOwnDevServer,Tr as toolchainExecArgs,de as updateDevServerState,Ie as upsertDevVariableLine,Lo as wireRlsIntoProcedure,ue as wranglerDotenvFiles,f as writeApiSpecMarker,V as writeCelldDevProjection,Ae as writeDevServerState,no as writeDevVariablesFileAtomically,Qe as writeLinkedProject};
|
|
1
|
+
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as c,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as _,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as m,readApiSpecMarker as A,writeApiSpecMarker as f}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as N}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{probeCelldToolchain as T}from"./packem_shared/probeCelldToolchain-DxDttfHy.mjs";import{startCelldDevSession as g,writeCelldDevProjection as V}from"./packem_shared/startCelldDevSession-DQ7YylR_.mjs";import{D1_PLACEHOLDER_ID as u}from"./packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{BUILD_ROOT_ENV as P,BUILD_TARGET_ENV as C,BUNDLE_META_PATH_ENV as F,CODEGEN_ENV as M,DEFAULT_BUNDLE_META_PATH as U,LAZY_FUNCTIONS_ENV as B,STRICT_ADVISORIES_ENV as G,isCodegenDisabled as b,isLazyFunctionsEnabled as y,resolveLazyFunctions as k}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as w}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as H}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as W,projectUsesUmbrella as Y}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{checkDevEnv as z,describeDevEnvCheck as q}from"./packem_shared/checkDevEnv-BwZSVBbB.mjs";import{acceptsConnection as Z,startDevProcess as Q}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as ee,DEV_DAEMON_ENV as re,DEV_HANDOFF_ENV as oe,DEV_LOG_FILE as te,DEV_LOG_FILE_ENV as ae,DEV_STATE_DIR as Ee,DEV_STATE_FILE as ie,claimDevServerState as se,clearDevServerState as ne,isDevServerReady as ce,isProcessAlive as le,isRecordedProcessCurrent as _e,readDevServerState as pe,readLiveDevServerState as De,updateDevServerState as de,writeDevServerState as me}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{devTriggerHints as fe,formatDevBannerRow as Se}from"./packem_shared/devTriggerHints-CN_RJxWW.mjs";import{DEV_VARS_EXAMPLE_FILE as ve,DEV_VARS_FILE as Ne,DEV_VARS_KEY_PATTERN as Re,escapeRegExp as Te,parseDevVariableEntries as xe,readDevVariablesRecord as ge,removeDevVariableLine as Ve,upsertDevVariableLine as Ie,wranglerDotenvFiles as ue}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";import{DEV_WORKER_ENV_VALUE as Pe,DEV_WORKER_ENV_VAR as Ce,ensureDevWorkerEnv as Fe}from"./packem_shared/DEV_WORKER_ENV_VALUE-FoysLtF0.mjs";import{createDiscoveryCache as Ue}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as Ge,deployTargetIds as be,isRunnableTarget as ye,planToolchainInvocation as ke,resolveDeployDriver as he,runnableTargetIds as we,targetRunsOwnDevServer as je}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CAJl2nEI.mjs";import{default as Ke}from"./packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs";import{inferLunoraBindings as Ye,secretSourcesFromBindings as Je}from"./packem_shared/inferLunoraBindings-Biq1OW9V.mjs";import{LINKED_PROJECT_DIR as qe,LINKED_PROJECT_FILE as Xe,readLinkedProject as Ze,writeLinkedProject as Qe}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as er,applyLintIgnores as rr,detectLintTools as or}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{resolveLocalWorkerEnv as ar}from"./packem_shared/resolveLocalWorkerEnv-C1s-quRt.mjs";import{blockingFindingsMessage as ir,reportCodegenFindings as sr}from"./packem_shared/blockingFindingsMessage-BQ9z7cie.mjs";import{LUNORA_EVENT_SOURCE as cr,formatLunoraEvent as lr}from"./packem_shared/LUNORA_EVENT_SOURCE-Cq0oj0_9.mjs";import{LUNORA_TAG as pr,advisoryLine as Dr,lunoraLine as dr}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as Ar}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Sr,detectInstalledManagers as Lr,detectPackageManager as vr,execArgsFor as Nr,installArgsFor as Rr,runScriptArgsFor as Tr,runScriptCommand as xr,toolchainExecArgs as gr}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{PACKAGE_SECRETS_REGISTRY as Ir,mintableSecretKeysFor as ur,secretsForPackages as Or}from"./packem_shared/PACKAGE_SECRETS_REGISTRY-CPWkw-qE.mjs";import{runPostCodegenHook as Cr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as Mr,interpretRemote as Ur,readProjectRemotePreference as Br,readProjectTarget as Gr,resolveProjectTarget as br,resolveTargetOrThrow as yr}from"./packem_shared/assertBuildTargetMatches-tkKAa5zl.mjs";import{readProjectDependencies as hr,readProjectDependencyNames as wr,readProjectManifest as jr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Kr,isInteractive as Wr,promptMultiSelect as Yr,promptSelect as Jr,promptText as zr,promptYesNo as qr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as Zr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as $r,ensureDevVariables as eo,ensureDevVarsExample as ro,fillDevSecrets as oo,generateSecretValue as to,isMintableSecretKey as ao,isPlaceholderValue as Eo,planDevSecretsFill as io,planDevVariablesAugment as so,planDevVariablesScaffold as no,requiredSecrets as co,writeDevVariablesFileAtomically as lo}from"./packem_shared/buildPackageSecretsBlock-DrSD60vH.mjs";import{applyAdditiveEdit as po,classifyEdit as Do}from"./packem_shared/applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as Ao}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as So,resolveServerModule as Lo,scaffoldPolicyFile as vo,wireRlsIntoProcedure as No}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as To}from"./packem_shared/discoverSchemaInfo-DRPnqgif.mjs";import{ACCENT as go,BADGES as Vo,BADGE_COLUMN_WIDTH as Io,LUNA_ART as uo,LUNA_BUNNY as Oo,LUNA_NAME as Po,LUNA_SIGNOFF as Co,STEP_BADGE_NAMES as Fo,badgeLead as Mo,badgeWidth as Uo,padBadge as Bo,paintAnswer as Go,paintBadge as bo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as ko,DURABLE_OBJECT_BINDINGS as ho,GENERATED_CLASS_MODULES as wo,GENERATED_MODULE_DURABLE_OBJECTS as jo,MERGED_DURABLE_OBJECTS_MODULE as Ho,isMergedProject as Ko,isMergedRoleModule as Wo}from"./packem_shared/COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{discoverWorkflowInfo as Jo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";import{ENV_FILENAME as qo}from"@lunora/codegen";export{go as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,c as AGENT_RULES_HINT_ENV,Vo as BADGES,Io as BADGE_COLUMN_WIDTH,P as BUILD_ROOT_ENV,C as BUILD_TARGET_ENV,F as BUNDLE_META_PATH_ENV,M as CODEGEN_ENV,ko as COMPOSED_WORKER_ENTRY,u as D1_PLACEHOLDER_ID,U as DEFAULT_BUNDLE_META_PATH,Ge as DEFAULT_DEPLOY_TARGET,ee as DEV_BINDINGS_FILE,re as DEV_DAEMON_ENV,oe as DEV_HANDOFF_ENV,te as DEV_LOG_FILE,ae as DEV_LOG_FILE_ENV,Ee as DEV_STATE_DIR,ie as DEV_STATE_FILE,ve as DEV_VARS_EXAMPLE_FILE,Ne as DEV_VARS_FILE,Re as DEV_VARS_KEY_PATTERN,Pe as DEV_WORKER_ENV_VALUE,Ce as DEV_WORKER_ENV_VAR,ho as DURABLE_OBJECT_BINDINGS,qo as ENV_FILENAME,wo as GENERATED_CLASS_MODULES,jo as GENERATED_MODULE_DURABLE_OBJECTS,B as LAZY_FUNCTIONS_ENV,qe as LINKED_PROJECT_DIR,Xe as LINKED_PROJECT_FILE,uo as LUNA_ART,Oo as LUNA_BUNNY,Po as LUNA_NAME,Co as LUNA_SIGNOFF,cr as LUNORA_EVENT_SOURCE,er as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,pr as LUNORA_TAG,Ar as LunoraReporter,Ho as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,Ir as PACKAGE_SECRETS_REGISTRY,_ as ROOT_SKILL_NAME,Fo as STEP_BADGE_NAMES,G as STRICT_ADVISORIES_ENV,Z as acceptsConnection,Sr as addArgsFor,Dr as advisoryLine,po as applyAdditiveEdit,rr as applyLintIgnores,Mr as assertBuildTargetMatches,Mo as badgeLead,Uo as badgeWidth,ir as blockingFindingsMessage,$r as buildPackageSecretsBlock,N as canonicalPath,z as checkDevEnv,p as claimAgentRulesHint,se as claimDevServerState,Do as classifyEdit,So as classifyPolicyEdit,m as clearApiSpecMarker,ne as clearDevServerState,Kr as createConfirm,Ue as createDiscoveryCache,be as deployTargetIds,q as describeDevEnvCheck,D as detectAgentRules,t as detectAiAgent,W as detectFramework,Lr as detectInstalledManagers,or as detectLintTools,vr as detectPackageManager,fe as devTriggerHints,E as discoverAgentInfo,w as discoverContainerInfo,To as discoverSchemaInfo,Jo as discoverWorkflowInfo,eo as ensureDevVariables,ro as ensureDevVarsExample,Fe as ensureDevWorkerEnv,Ke as ensureGitignoreEntries,Te as escapeRegExp,Nr as execArgsFor,oo as fillDevSecrets,Se as formatDevBannerRow,lr as formatLunoraEvent,to as generateSecretValue,Ye as inferLunoraBindings,Rr as installArgsFor,Ur as interpretRemote,b as isCodegenDisabled,ce as isDevServerReady,Wr as isInteractive,y as isLazyFunctionsEnabled,Ko as isMergedProject,Wo as isMergedRoleModule,ao as isMintableSecretKey,Eo as isPlaceholderValue,le as isProcessAlive,_e as isRecordedProcessCurrent,ye as isRunnableTarget,dr as lunoraLine,ur as mintableSecretKeysFor,Bo as padBadge,Go as paintAnswer,bo as paintBadge,xe as parseDevVariableEntries,Ao as parseSchema,io as planDevSecretsFill,so as planDevVariablesAugment,no as planDevVariablesScaffold,ke as planToolchainInvocation,T as probeCelldToolchain,Y as projectUsesUmbrella,Yr as promptMultiSelect,Jr as promptSelect,zr as promptText,qr as promptYesNo,A as readApiSpecMarker,pe as readDevServerState,ge as readDevVariablesRecord,Ze as readLinkedProject,De as readLiveDevServerState,hr as readProjectDependencies,wr as readProjectDependencyNames,jr as readProjectManifest,Br as readProjectRemotePreference,Gr as readProjectTarget,Ve as removeDevVariableLine,sr as reportCodegenFindings,co as requiredSecrets,he as resolveDeployDriver,k as resolveLazyFunctions,ar as resolveLocalWorkerEnv,br as resolveProjectTarget,Zr as resolveSchemaDirectory,Lo as resolveServerModule,yr as resolveTargetOrThrow,Cr as runPostCodegenHook,Tr as runScriptArgsFor,xr as runScriptCommand,we as runnableTargetIds,vo as scaffoldPolicyFile,Je as secretSourcesFromBindings,Or as secretsForPackages,g as startCelldDevSession,Q as startDevProcess,H as streamContainerLogs,je as targetRunsOwnDevServer,gr as toolchainExecArgs,de as updateDevServerState,Ie as upsertDevVariableLine,No as wireRlsIntoProcedure,ue as wranglerDotenvFiles,f as writeApiSpecMarker,V as writeCelldDevProjection,me as writeDevServerState,lo as writeDevVariablesFileAtomically,Qe as writeLinkedProject};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as d,readFileSync as y}from"node:fs";import{join as s,isAbsolute as a,relative as m}from"node:path";import{LunoraError as p}from"@lunora/errors";import{classifyPolicyEdit as k,scaffoldPolicyFile as h,resolveServerModule as l,wireRlsIntoProcedure as v}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as b}from"./write-atomic-
|
|
1
|
+
import{existsSync as d,readFileSync as y}from"node:fs";import{join as s,isAbsolute as a,relative as m}from"node:path";import{LunoraError as p}from"@lunora/errors";import{classifyPolicyEdit as k,scaffoldPolicyFile as h,resolveServerModule as l,wireRlsIntoProcedure as v}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as b}from"./write-atomic-BzViTZCw.mjs";const D="/__lunora/policy-scaffold",u=r=>r==="unknown-procedure"?404:r==="already-wired"||r==="destructive"?409:422,f=(r,o,e)=>{let t;try{t=b(r,o)}catch(n){return{body:{error:n instanceof Error?n.message:String(n),ok:!1},status:500}}return{body:{...e,diagnostics:t,ok:!0},status:200}},g=r=>({body:{edit:r,message:"Rewriting an existing policy predicate changes evaluation semantics and must be done by hand. The scaffolder only adds new, deny-by-default rules.",needsManualEdit:!0,ok:!1},status:409}),w=(r,o)=>{const e=h(o,l(r.projectRoot));if(!e.ok)return{body:{error:e.reason,ok:!1},status:u(e.reason)};const t=r.schemaDirectory??"lunora",n=s(r.projectRoot,t,e.fileName);return d(n)?{body:{error:"file-exists",fileName:e.fileName,ok:!1},status:409}:(c(n,e.source),f(r,{path:n,text:e.source},{fileName:e.fileName}))},R=(r,o,e)=>{if(typeof e!="string"||e.length===0||a(e)||e.includes("\\"))return;const t=s(r,o),n=s(t,`${e}.ts`),i=m(t,n);if(!(i.startsWith("..")||a(i)))return n},N=(r,o)=>{const e=R(r.projectRoot,r.schemaDirectory??"lunora",o.filePath);if(e===void 0||!d(e))return{body:{error:"unknown-procedure",ok:!1},status:404};const t=v(y(e,"utf8"),o,l(r.projectRoot));return t.ok?(c(e,t.text),f(r,{path:e,text:t.text},{exportName:o.exportName})):{body:{error:t.reason,ok:!1},status:u(t.reason)}},E=r=>{if(r.method!=="POST")return{body:{error:"method-not-allowed",ok:!1},status:405};const{body:o}=r;if(o==null||typeof o!="object"||typeof o.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};const e=o;if(k(e)==="destructive")return g(e);if(e.kind==="scaffoldPolicy")return w(r,e);if(e.kind==="wireRls")return N(r,e);throw new p("INTERNAL",`unhandled additive policy edit kind: ${String(e.kind)}`)};export{D as POLICY_SCAFFOLD_ENDPOINT,E as handlePolicyScaffoldRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MERGED_DURABLE_OBJECT as p}from"./COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{o as R,v as S,b as I,c as j,d as A,e as L,g as f,h as k,i as B,H as C,j as N,R as T,S as w,k as q,l as U,W as G,m as P}from"./validate-bindings-DSMH8bRQ.mjs";import{b as u,p as g,c as _}from"./studio-assets-BKWx838V.mjs";import{validateTailConsumers as W,validateSendEmail as K,validateSecretsRequired as M,validateLogpush as V,validateLimits as x,validatePlacement as H,validateObservability as Q,validateAssets as F,validateCache as Y,validateExports as J,validateCorsVariables as z,validateSchedulerOrigin as X}from"./withTailConsumer-BXOIqXxv.mjs";import{isCacheEnabled as Z,WORKERS_CACHE_MIN_DATE as E}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as ee}from"./mergeWranglerEnvironment-
|
|
1
|
+
import{MERGED_DURABLE_OBJECT as p}from"./COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{o as R,v as S,b as I,c as j,d as A,e as L,g as f,h as k,i as B,H as C,j as N,R as T,S as w,k as q,l as U,W as G,m as P}from"./validate-bindings-DSMH8bRQ.mjs";import{b as u,p as g,c as _}from"./studio-assets-BKWx838V.mjs";import{validateTailConsumers as W,validateSendEmail as K,validateSecretsRequired as M,validateLogpush as V,validateLimits as x,validatePlacement as H,validateObservability as Q,validateAssets as F,validateCache as Y,validateExports as J,validateCorsVariables as z,validateSchedulerOrigin as X}from"./withTailConsumer-BXOIqXxv.mjs";import{isCacheEnabled as Z,WORKERS_CACHE_MIN_DATE as E}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as ee}from"./mergeWranglerEnvironment-CxT2PV1N.mjs";const v=t=>u(t)?new Set([...g(t.producers).map(i=>i.queue),...g(t.consumers).flatMap(i=>[i.queue,i.dead_letter_queue])].filter(i=>_(i))):new Set,b=(t,i,n)=>{const e=u(t)?t.account_id:void 0;return _(e)?e:_(i.account_id)?i.account_id:_(n)?n:void 0},te=(t,i,n,e=process.env.CLOUDFLARE_ACCOUNT_ID)=>{if(i===void 0||!u(t.env))return;const a=t.env[i],r=v(u(a)?a.queues:void 0);if(r.size===0)return;const s=b(a,t,e),m=[{account:b(void 0,t,e),names:v(t.queues),scope:"the top level"},...Object.entries(t.env).filter(([c])=>c!==i).map(([c,o])=>({account:b(o,t,e),names:v(u(o)?o.queues:void 0),scope:`env.${c}`}))].filter(c=>s===void 0||c.account===void 0||c.account===s);for(const c of r){const o=m.filter(({names:l})=>l.has(c)).map(({scope:l})=>l);o.length>0&&n.push(`env.${i}.queues names queue "${c}", which ${o.join(" and ")} also ${o.length===1?"names":"name"}. Queue names are unique per Cloudflare account, so deployed to one account the environments share that queue: messages produced in one are consumed by the other. Give env.${i} its own name (e.g. "${c}-${i}") unless the sharing is intended — the renamed queue starts empty, and messages already in "${c}" stay there.`)}},ie=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),O=t=>Array.isArray(t)?t.flatMap((i,n)=>ie(i)?[[n,i]]:[]):[],y=t=>typeof t.binding=="string"?t.binding:"",se=(t,i,n)=>{for(const[e,a]of O(t.kv_namespaces))typeof a.id=="string"&&a.id!==""||n.push(`kv_namespaces[${String(e)}] ("${y(a)}") is not created yet and the schema pins data to "${i}" — create it with \`wrangler kv namespace create <name> --jurisdiction=${i}\`; a namespace's jurisdiction cannot be changed afterwards`)},ae=(t,i,n)=>{for(const[e,a]of O(t.r2_buckets)){const r=a.jurisdiction;if(r===i)continue;const s=typeof r=="string"?`names the "${r}" jurisdiction`:"names no jurisdiction";n.push(`r2_buckets[${String(e)}] ("${y(a)}") ${s}, but the schema pins data to "${i}" — create the bucket with \`wrangler r2 bucket create <name> --jurisdiction=${i}\` and set "jurisdiction": "${i}" on the binding`)}},ne=(t,i,n)=>{const e=i?.jurisdiction;e!==void 0&&(se(t,e,n),ae(t,e,n))},D="2026-04-07",me="web_socket_auto_reply_to_close",h="2026-10-01",$="durable_object_io_tasks_prevent_eviction",oe="durable_object_io_tasks_do_not_prevent_eviction",re=/^\d{4}-\d{2}-\d{2}$/,ce=(t,i,n)=>{t>=h||i.includes($)||i.includes(oe)||n.push(`compatibility_date "${t}" predates "${h}", so pending I/O (waitUntil, cross-Durable-Object RPC, service-binding calls, timers) does not keep a Durable Object alive once its last client disconnects — live-query refreshes and durable streams can be cut off mid-flight. Set compatibility_date >= "${h}" or add the "${$}" compatibility flag`)},de=(t,i,n)=>{const{error:e,merged:a,unverifiedKeys:r}=ee(t,i);return e!==void 0?{error:e,wrangler:a}:(r.length>0&&n.push(`env.${String(i)} overrides ${r.join(", ")}, which this validator doesn't have a verified inheritance rule for — validated against the TOP-LEVEL value only. Double-check ${r.length===1?"it":"them"} by hand for "${String(i)}".`),{wrangler:a})},le=(t,i,n)=>{const e=[],a=[];if(!t||typeof t!="object")return e.push("wrangler config is not a valid object"),{errors:e,valid:!1,warnings:a};const{error:r,wrangler:s}=de(t,n,a);if(r!==void 0)return e.push(r),{errors:e,valid:!1,warnings:a};R(s.durable_objects?.bindings).find(d=>d.name==="SHARD"&&(d.class_name==="ShardDO"||d.class_name===p))||e.push(`durable_objects.bindings must include { "name": "SHARD", "class_name": "ShardDO" } (or "${p}" when the app merges its Durable Objects) — your dev server auto-reconciles this on startup, or add the binding manually`),S(s,e);const o=s.compatibility_date??"",l=re.test(o);o&&!l?e.push(`compatibility_date must be in YYYY-MM-DD format (got "${o}")`):o<D&&e.push(`compatibility_date must be >= "${D}" (got "${o||"<missing>"}")`),Z(s)&&l&&o<E&&e.push(`cache.enabled requires compatibility_date >= "${E}" (got "${o||"<missing>"}")`),l&&ce(o,s.compatibility_flags??[],a),I(s,i,e),ne(s,i,a),j(s,e),A(s,i?.vectorIndexNames??[],e),W(s,e),L(s,e,a),f(s.workflows,"workflows",G,e),k(s,e),B(s,e),te(t,n,a),f(s.secrets_store_secrets,"secrets_store_secrets",P,e);for(const d of C)N(s,d,e,a);for(const d of T)f(s[d.key],d.key,d,e);for(const d of w)q(s,d,e);return U(s,e),K(s,e,a),M(s,e),V(s,e),x(s,e),H(s,e),Q(s,e,a),F(s,e),Y(s,e),J(s,e),z(s,e),X(s,n,a),{errors:e,valid:e.length===0,warnings:a}},pe=le;export{D as REQUIRED_COMPATIBILITY_DATE,me as REQUIRED_FLAG,pe as validateWrangler,le as validateWranglerConfig};
|
package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-Dbdgz4G6.mjs → SCHEMA_EDIT_ENDPOINT-FM9ZC-gV.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as a,readFileSync as d}from"node:fs";import{classifyEdit as l,applyAdditiveEdit as c}from"./applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as u}from"./parseSchema-D1Wbr1qv.mjs";import{w as f,r as p}from"./write-atomic-
|
|
1
|
+
import{existsSync as a,readFileSync as d}from"node:fs";import{classifyEdit as l,applyAdditiveEdit as c}from"./applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as u}from"./parseSchema-D1Wbr1qv.mjs";import{w as f,r as p}from"./write-atomic-BzViTZCw.mjs";import{join as m}from"node:path";const F="/__lunora/schema-edit",b=t=>t==="destructive"||t==="duplicate-table"||t==="duplicate-column"||t==="duplicate-index"?409:t==="unknown-table"?404:t==="invalid-identifier"||t==="invalid-validator"?400:422,y=t=>({body:{error:t.reason,ok:!1},status:422}),k=t=>{if(!a(t))return{response:{body:{error:"no-schema-file",ok:!1},status:404}};const e=u(d(t,"utf8"));return e.ok?{tables:e.tables}:{response:y(e)}},g=t=>({body:{edit:t,message:"This edit changes stored data and must go through a migration. Review the migration before applying.",needsMigration:!0,ok:!1},status:409}),h=(t,e)=>{const r=t.body;if(r==null||typeof r!="object"||typeof r.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};if(l(r)==="destructive")return g(r);if(!a(e))return{body:{error:"no-schema-file",ok:!1},status:404};const o=c(d(e,"utf8"),r);if(!o.ok)return{body:{error:o.reason,ok:!1},status:b(o.reason)};f(e,o.text);let i;try{i=p(t,{path:e,text:o.text})}catch(s){return{body:{error:s instanceof Error?s.message:String(s),ok:!1},status:500}}const n=u(o.text);return{body:{diagnostics:i,ok:!0,tables:n.ok?n.tables:[]},status:200}},R=t=>{const e=m(t.projectRoot,t.schemaDirectory??"lunora","schema.ts");if(t.method==="GET"){const r=k(e);return"response"in r?r.response:{body:{ok:!0,tables:r.tables},status:200}}return t.method==="POST"?h(t,e):{body:{error:"method-not-allowed",ok:!1},status:405}};export{F as SCHEMA_EDIT_ENDPOINT,R as handleSchemaEditRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveAdminToken as A}from"./devVariablesStamp-BQkGEn9d.mjs";import{handleAdvisorProceduresRequest as I,ADVISOR_PROCEDURES_ENDPOINT as O}from"./ADVISOR_PROCEDURES_ENDPOINT-BPnqzAgT.mjs";import{sendStudioDocument as _,sendStudioAsset as h}from"./sendStudioAsset-B81Pex91.mjs";import{isStandaloneModulePath as y,studioAssetsStamp as N,loadStudioAssets as E,readStandaloneAsset as H,assetContentType as R}from"./assetContentType-CUb5bpbI.mjs";import v from"./createStudioDocumentCache-XBG1aWbl.mjs";import{detectAgentRules as C}from"./AGENT_RULES_DIR-Bd6JPtNa.mjs";import{handlePolicyScaffoldRequest as L,POLICY_SCAFFOLD_ENDPOINT as b}from"./POLICY_SCAFFOLD_ENDPOINT-
|
|
1
|
+
import{resolveAdminToken as A}from"./devVariablesStamp-BQkGEn9d.mjs";import{handleAdvisorProceduresRequest as I,ADVISOR_PROCEDURES_ENDPOINT as O}from"./ADVISOR_PROCEDURES_ENDPOINT-BPnqzAgT.mjs";import{sendStudioDocument as _,sendStudioAsset as h}from"./sendStudioAsset-B81Pex91.mjs";import{isStandaloneModulePath as y,studioAssetsStamp as N,loadStudioAssets as E,readStandaloneAsset as H,assetContentType as R}from"./assetContentType-CUb5bpbI.mjs";import v from"./createStudioDocumentCache-XBG1aWbl.mjs";import{detectAgentRules as C}from"./AGENT_RULES_DIR-Bd6JPtNa.mjs";import{handlePolicyScaffoldRequest as L,POLICY_SCAFFOLD_ENDPOINT as b}from"./POLICY_SCAFFOLD_ENDPOINT-DSMpLzsw.mjs";import x from"./renderStudioHtml-CRDTNivi.mjs";import{handleSchemaEditRequest as $,SCHEMA_EDIT_ENDPOINT as k}from"./SCHEMA_EDIT_ENDPOINT-FM9ZC-gV.mjs";import{handleSeedRequest as U,SEED_ENDPOINT as g}from"./SEED_ENDPOINT-C1fhrehH.mjs";import{serveJsonHandler as j}from"./serveJsonHandler-B8_GE6QC.mjs";import{transportRejectionReason as F}from"./ALLOW_FORWARDED_ENV-BUndghJx.mjs";import"./STUDIO_WRITE_TEMP_SUFFIX-BTTELz3K.mjs";const i="/__lunora",M=`${i}/studio.js`,m=`${i}/styles.css`,P=/\/$/,q={[b]:L,[k]:$,[g]:U,[O]:I},w=new Set(["127.0.0.1","::1","localhost"]),st=t=>t!==void 0&&t!==!1&&!w.has(t),T=t=>t===void 0||t==="/"?"":t.replace(P,""),nt=t=>`${T(t)}${i}`,B=t=>{try{return new URL(t,"http://localhost").pathname}catch{const d=t.indexOf("?");return d===-1?t:t.slice(0,d)}},at=t=>{const{logger:d,projectRoot:c}=t,u=T(t.base);let l,S;const p=v(c,()=>x({adminToken:A(c),advisorProcedures:!0,basePath:i,dataEditable:!0,rulesInstalled:C(c).installed,runAsIdentity:!0,schemaEditable:!0,scriptSrc:M,styleHref:m})),D=(s,o,e)=>{const n=N();if((l===void 0||n!==S)&&(l=E(d),S=n),l===void 0){e.statusCode=501,e.setHeader("Content-Type","text/plain"),e.end("Lunora studio assets not found — install and build @lunora/studio.");return}const a=s===m,r=s.slice(s.lastIndexOf("/")+1);if(a){h(o,e,l.styles,"text/css; charset=utf-8",r,n);return}const f=H(r);if(f===void 0){e.statusCode=404,e.setHeader("Content-Type","text/plain"),e.end("Not found");return}h(o,e,f,R(r),r,n)};return(s,o,e)=>{const n=B(s.url??"").replace(P,""),a=u!==""&&n.startsWith(u)?n.slice(u.length):n;if(a!==i&&!a.startsWith(`${i}/`)){e();return}if(t.isNonLoopbackBind||F(s,d)!==void 0){o.statusCode=403,o.setHeader("Content-Type","text/plain"),o.end("Lunora studio is only available on loopback hosts in dev.");return}const r=q[a];if(r!==void 0){j(s,o,r,c,{apiSpec:t.apiSpec,lazyFunctions:t.lazyFunctions,schemaDirectory:t.schemaDirectory});return}if(a===m||y(a)){D(a,s,o);return}_(o,p())}};export{i as STUDIO_PATH,M as STUDIO_SCRIPT_PATH,m as STUDIO_STYLE_PATH,at as createStudioMiddleware,st as isNonLoopbackHost,B as requestPathname,nt as studioMountPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as d}from"node:fs";import{dirname as y,join as h}from"node:path";import{discoverSchemaInfo as v}from"./discoverSchemaInfo-DRPnqgif.mjs";import{MERGED_DURABLE_OBJECT as i,GENERATED_DIRECTORY as w,MERGED_ROLE_DURABLE_OBJECTS as u,COMPOSED_ENTRY_DURABLE_OBJECTS as E,GENERATED_CLASS_MODULES as $,isFrameworkDurableObject as k}from"./COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{l as D,r as R,a as j,i as x}from"./studio-assets-BKWx838V.mjs";import{o as O,f as A}from"./validate-bindings-DSMH8bRQ.mjs";import{validateSchedulerOrigin as _}from"./withTailConsumer-BXOIqXxv.mjs";import{mergeWranglerEnvironment as S}from"./mergeWranglerEnvironment-
|
|
1
|
+
import{existsSync as d}from"node:fs";import{dirname as y,join as h}from"node:path";import{discoverSchemaInfo as v}from"./discoverSchemaInfo-DRPnqgif.mjs";import{MERGED_DURABLE_OBJECT as i,GENERATED_DIRECTORY as w,MERGED_ROLE_DURABLE_OBJECTS as u,COMPOSED_ENTRY_DURABLE_OBJECTS as E,GENERATED_CLASS_MODULES as $,isFrameworkDurableObject as k}from"./COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{l as D,r as R,a as j,i as x}from"./studio-assets-BKWx838V.mjs";import{o as O,f as A}from"./validate-bindings-DSMH8bRQ.mjs";import{validateSchedulerOrigin as _}from"./withTailConsumer-BXOIqXxv.mjs";import{mergeWranglerEnvironment as S}from"./mergeWranglerEnvironment-CxT2PV1N.mjs";import{findWranglerFile as W,readWranglerJsonc as C}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{validateWranglerConfig as T}from"./REQUIRED_COMPATIBILITY_DATE-BqFeetpX.mjs";const b=r=>Array.isArray(r)?r:[],L=(r,o,t)=>Object.entries(r?.images??{}).flatMap(([s,n])=>{const e=n?.dockerfile;return typeof e!="string"||d(e.startsWith("/")?e:h(o,e))?[]:[`containers images["${s}"] dockerfile "${e}" does not exist (resolved relative to ${t}); create the Dockerfile`]}),I=(r,o)=>{const t=r?.directory;if(typeof t!="string"||t.length===0||d(t.startsWith("/")?t:h(o,t)))return[];const s=x(r)?"it holds the Studio documents `lunora codegen` writes; run codegen before deploy":"it is created by the client build; run the build before deploy";return[`assets.directory "${t}" does not exist yet — ${s}`]},P=(r,o,t)=>{const s=[];for(const n of b(r)){const e=n?.image;typeof e=="string"&&(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes("Dockerfile"))&&!d(e.startsWith("/")?e:h(o,e))&&s.push(`containers image "${e}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`),s.push(...L(n,o,t))}return s},B=(r,o)=>{const t=r?.vectorIndexNames??[],s=[];if(t.length>0&&s.push({message:e=>`schema declares vector index(es) ${t.map(l=>`"${l}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${e}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),r?.hasD1GlobalTable&&s.push({message:e=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${e}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),r?.hasHyperdriveGlobalTable&&s.push({message:e=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${e}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(async () => (await import("postgres")).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),s.length===0)return[];const n=j(o,new Set(s.map(e=>e.method)));return n===void 0?[]:s.filter(e=>!n.chained.has(e.method)).map(e=>e.message(n.site))},G="does not export it",M=(r,o)=>{if(o.exports?.has(i)===!0&&u.has(r))return`This app merges its Durable Objects (\`durableObjects.merge\` in lunora.config), so ${i} hosts ${r}: bind only \`SHARD\` to "${i}" and drop the SCHEDULER / SHARD_REGISTRY bindings. Do that only if this Worker has never been deployed — a deployed ${r} namespace keeps its data, which the merged class cannot reach; turn \`durableObjects.merge\` off to keep it.`;if(r===i)return`${i} is the merged class (\`durableObjects.merge\` in lunora.config), and merging cannot be undone once deployed: the shard data lives in ${i}. Turn \`durableObjects.merge\` back on. Only a Worker that has never been deployed may rebind SHARD to "ShardDO".`;if(o.kind!=="composed")return`Re-export it from the module that defines it (\`export { ${r} } from "./…";\`), or add it to the app builder's own export (\`export const { ${r} } = app;\`).`;const t=`it exports ${E.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${$.map(s=>`${s}.ts`).join(" / ")} declarations`;return k(r)?`\`@lunora/vite\` generates that entry — ${t}, and ${r} is not among them. Class-A composition does not carry ${r}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${r}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},N=(r,o)=>{const t=o.exports;if(t===void 0)return[];const s=[];for(const e of O(r.durable_objects?.bindings))typeof e.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"durable_objects.bindings"});for(const e of b(r.workflows))typeof e?.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"workflows"});for(const[e,l]of Object.entries(r.exports??{}))l?.type==="workflow"&&s.push({className:e,label:"workflows"});return s.filter(e=>!t.has(e.className)).map(e=>`${e.label} declares class "${e.className}" but the ${o.kind==="composed"?"composed class-A worker entry":"worker entry"} (${o.path}) ${G} — wrangler refuses to bundle a Worker whose ${e.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${M(e.className,o)}`)},U=r=>[...A(r.migrations)].filter(o=>u.has(o)).map(o=>`migrations create class "${o}", which this app hosts in ${i} because it merges its Durable Objects (\`durableObjects.merge\`). Before the first deploy, replace "${o}" with "${i}" in new_sqlite_classes; a Worker already deployed with "${o}" keeps its data there and cannot merge — turn \`durableObjects.merge\` off.`),H=r=>r?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${r.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],ee=r=>{const o=r.schemaDir??"lunora",t=W(r.projectRoot);if(!t){const c=`wrangler.jsonc not found in ${r.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:s}=C(t);if(s===void 0){const c=`failed to parse ${t} as JSONC.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:e}=S(s,r.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:l,info:m}=v(r.projectRoot,o,r.cache),a=T(s,m,r.environment);l!==void 0&&a.warnings.push(`schema parse failed in ${o}/schema.ts: ${l}`);const g=y(t),f=D(e.main,r.projectRoot,t),p=R(f,r.projectRoot,o);return a.errors.push(...P(e.containers??[],g,t)),a.warnings.push(...H(f)),p!==void 0&&a.errors.push(...N(e,p)),p?.exports?.has(i)===!0&&(a.errors.push(...U(e)),d(h(r.projectRoot,o,w,"scheduler.ts"))&&_(e,r.environment,a.warnings,"the merged LunoraDO hosts the scheduler")),a.errors.push(...B(m,r.projectRoot)),a.warnings.push(...I(e.assets,g)),a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{G as UNEXPORTED_CLASS_MARKER,ee as validateWranglerProject};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{validateWranglerProject as c}from"./UNEXPORTED_CLASS_MARKER-
|
|
1
|
+
import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{validateWranglerProject as c}from"./UNEXPORTED_CLASS_MARKER-BZEXldUo.mjs";const m=(e,o,t)=>{const r=c({cache:e.cache,projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
|
|
2
2
|
`));for(const a of r.report.warnings)o(i(`wrangler validator: ${a}`));if(r.problems.length>0)throw new n("INTERNAL",["[lunora] wrangler configuration is missing bindings required by your schema.",` file: ${r.wranglerPath}`,"",...r.problems.map(a=>` - ${a}`),"",` ${t}`].join(`
|
|
3
3
|
`))};export{m as assertWranglerSatisfiesSchema};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{existsSync as E}from"node:fs";import{ENV_FILENAME as m}from"@lunora/codegen";import{ENV_FILENAME as oe}from"@lunora/codegen";import{i as A}from"./secret-key-xi4VK8Jw.mjs";import{buildBindingManifest as b}from"./BINDING_MANIFEST_VERSION-CR06-eW7.mjs";import{readProjectWrangler as y,readWranglerJsonc as R}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{resolveLocalWorkerEnv as N,activeScope as D}from"./resolveLocalWorkerEnv-C1s-quRt.mjs";import{join as $}from"node:path";const S=Symbol.for("lunora.env"),O=e=>{if(typeof e!="function")return;let t;try{t=Reflect.get(e,S)}catch{return}return typeof t=="function"?t:void 0},L=[/^sk_/u,/^pk_/u,/^rk_/u,/^ghp_/u,/^gho_/u,/^ghs_/u,/^ghr_/u,/^github_pat_/u,/^xox[baprs]-/u,/^AKIA/u,/^AIza/u,/^Bearer\s/u],T=/[\w./+-]{24,}/gu,P=/^[\w./+-]+$/u,I=/\b(?:(?:sk|pk|rk|ghp|gho|ghs|ghr)_[\w./+-]*|github_pat_[\w./+-]*|xox[baprs]-[\w./+-]*)/gu,C=/\b(?:AKIA|AIza)[\w./+-]+|Bearer\s+[\w./+-]+/gu,x=/:\/\/([\w.%+-]*):[\w.%+\-!$&'()*,;=~]+@/gu,l="[redacted]",j=e=>{if(L.some(n=>n.test(e)))return!0;const t=e.trim();return t.length>=24&&P.test(t)},g=new Set([`
|
|
2
|
+
`,"\r","\u2028","\u2029"]),K=(e,t)=>{const n=e.charAt(t);let r=-1,o=t+1;for(;o<e.length;){const s=e.charAt(o);if(s===n)return o;if(g.has(s))break;const a=e.charAt(o+1);s==="\\"&&o+1<e.length&&!g.has(a)?(a===n&&(r=o+1),o+=2):o+=1}return r},V=(e,t)=>{let n="",r=0;for(;r<e.length;){const o=e.charAt(r),s=o==='"'||o==="'"?K(e,r):-1;s===-1?(n+=o,r+=1):(n+=t(e.slice(r,s+1),e.slice(r+1,s)),r=s+1)}return n},M=/\b(?<key>[A-Za-z_]\w*)\s*[=:]\s*(?:"(?:[^"\\\n]|\\[^\n])*"|'(?:[^'\\\n]|\\[^\n])*'|\S+)/gu,f=e=>{let t=e;return t=V(t,(n,r)=>j(r)?l:n),t=t.replaceAll(x,(n,r)=>`://${r}:${l}@`),t=t.replaceAll(I,l),t=t.replaceAll(C,l),t=t.replaceAll(M,(n,...r)=>{const o=r.at(-1);return o?.key!==void 0&&A(o.key)?`${o.key}=${l}`:n}),t=t.replaceAll(T,l),t},U=e=>{if(e.configPath===void 0)return y(e.projectRoot);if(E(e.configPath))try{return{parsed:R(e.configPath).parsed,path:e.configPath}}catch{return{parsed:void 0,path:e.configPath}}},F=async e=>{const{createJiti:t}=await import("jiti");return t(e,{interopDefault:!1,moduleCache:!1}).import(e)},p=3,v=/[\w-]/u,B=(e,t,n)=>{let r="",o=0,s=e.indexOf(t);for(;s!==-1;){const a=e.charAt(s-1),c=e.charAt(s+t.length),d=!v.test(a)&&!v.test(c);r+=e.slice(o,s)+(d?n:t),o=s+t.length,s=e.indexOf(t,o)}return r+e.slice(o)},H=(e,t)=>{const n=t[e.key];if(typeof n!="string")return{...e,message:f(e.message)};const r=[];if(URL.canParse(n)){const{password:c}=new URL(n);r.push(c);try{r.push(decodeURIComponent(c))}catch{}}let o=n;for(const c of r)o=o.replace(`:${c}@`,`:${l}@`);const s=A(e.key)||f(n)!==n;let{message:a}=e;o!==n?a=a.replaceAll(n,o):n.length>=p&&(a=s?a.replaceAll(n,l):B(a,n,l));for(const c of r.filter(d=>d.length>=p).toSorted((d,u)=>u.length-d.length))a=a.replaceAll(c,l);return{...e,message:f(a)}},W=e=>e instanceof Error?e.message:String(e),q=async e=>{const t=$(e.projectRoot,e.schemaDirectory,m);if(!E(t))return{kind:"absent"};const n=await(e.load??F)(t),r=Object.values(n??{}).map(i=>O(i)).find(i=>i!==void 0);if(r===void 0)return{kind:"absent"};const o=e.processEnv??process.env,s=o.CLOUDFLARE_ENV,a=e.environment??(s===""?void 0:s),c=U(e);if(e.configPath!==void 0&&c===void 0)return{error:`${e.configPath} does not exist`,kind:"unloadable"};if(c!==void 0&&c.parsed===void 0)return{error:`${c.path} could not be read as JSONC`,kind:"unloadable"};const d=N({config:c?.parsed,configPath:c?.path,environment:a,processEnv:o,projectRoot:e.projectRoot,vars:e.vars}),{env:u}=d,_=D(c?.parsed,a),k=new Set(e.withheld),w=new Set(c===void 0?[]:b(_).bindings.filter(i=>i.type!=="queue_consumer").map(i=>i.binding).filter(i=>!k.has(i))),h=r(u).filter(i=>!w.has(i.key)).map(i=>H(i,u));return h.length===0?{kind:"valid"}:{failures:h,kind:"invalid",sources:d.sources}},ee=async e=>{try{return await q(e)}catch(t){return{error:f(W(t)),kind:"unloadable"}}},te=(e,t,{wasInvalid:n=!1}={})=>{const r=`${t}/${m}`;if(e.kind==="unloadable")return{level:"info",message:`${r}: the dev env could not be checked, so a missing key surfaces on first read instead: ${e.error}`};if(e.kind==="valid"&&n)return{level:"info",message:`${r}: the dev env satisfies the contract again`};if(e.kind==="absent"&&n)return{level:"info",message:`${r}: no env contract is loaded any more, so the warning above no longer applies`};if(e.kind!=="invalid")return;const o=e.sources.length===0?"no env files":e.sources.join(" + "),s=e.failures.map(a=>` - ${a.key}: ${a.message}`);return{level:"warn",message:[`${r}: ${String(e.failures.length)} key(s) missing or invalid in the dev env (${o}) — the first request that reads one will fail:`,...s].join(`
|
|
3
|
+
`)}};export{oe as ENV_FILENAME,ee as checkDevEnv,te as describeDevEnvCheck};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=["ai_search","ai_search_namespaces","analytics","artifacts","containers","d1_databases","durable_objects","hyperdrive","k2","kv_namespaces","queues","r2_buckets","secrets","secrets_store_secrets","services","tail_consumers","vars","vectorize","workflows"],a=["assets","compatibility_date","compatibility_flags","exports","logpush","main","migrations","observability","placement"],_=(s,t)=>{if(t===void 0)return{merged:s,unverifiedKeys:[]};const n=s.env??void 0,o=n!==void 0&&Object.hasOwn(n,t)?n[t]:void 0;if(o===void 0){const e=Object.keys(s.env??{}).toSorted((f,m)=>f.localeCompare(m)),v=e.length>0?` (declared: ${e.join(", ")}).`:" (no environments are declared).";return{error:`--env "${t}" names no environment declared in wrangler.jsonc's "env" block${v}`,merged:s,unverifiedKeys:[]}}const r={...s},c=Object.keys(o).filter(e=>e!=="env");for(const e of c)a.includes(e)&&(r[e]=o[e]);for(const e of i)r[e]=o[e];const d=new Set([...i,...a]),l=c.filter(e=>!d.has(e)).map(String);return{merged:r,unverifiedKeys:l}};export{i as NON_INHERITABLE_KEYS,_ as mergeWranglerEnvironment};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dirname as O,join as f}from"node:path";import{expand as E}from"dotenv-expand";import{readDevVariablesRecord as u,wranglerDotenvFiles as g}from"./DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";const d=(e,r,o)=>{const s=e[r];if(s===void 0)return o;switch(s.toLowerCase()){case"false":return!1;case"true":return!0;default:throw new Error(`Expected ${r} to be "true" or "false", but got ${JSON.stringify(s)}`)}},p=(e,r)=>{const o=e?.env??void 0;return(r!==void 0&&o!==void 0&&Object.hasOwn(o,r)?o[r]:void 0)??e??{}},h=(e,r)=>{const o=r===void 0?[".dev.vars"]:[`.dev.vars.${r}`,".dev.vars"];for(const s of o){const c=u(f(e,s));if(c!==void 0)return{file:s,values:c}}},j=(e,r,o,s)=>{const c=Object.create(null),v=[];for(const a of g(r)){let t;try{t=u(f(e,a))}catch{continue}t!==void 0&&(Object.assign(c,t),v.push(a))}const n=Object.create(null);if(o)for(const[a,t]of Object.entries(s))t!==void 0&&(n[a]=t);return E({parsed:c,processEnv:n}),{files:v,values:n}},y=e=>{const r=e.processEnv??process.env,o=e.configPath===void 0?e.projectRoot:O(e.configPath),s=p(e.config,e.environment),c=Object.assign(Object.create(null),s.vars),v=e.config===void 0?[]:["wrangler vars"],n=s.secrets??void 0;let a;const t=h(o,e.environment);if(t!==void 0)a=t.values,v.push(t.file);else if(d(r,"CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV",!0)){const i=n!==void 0||d(r,"CLOUDFLARE_INCLUDE_PROCESS_ENV",!1),l=j(o,e.environment,i,r);a=l.values,v.push(...l.files,...i?["process.env"]:[])}const b=new Set(Array.isArray(n?.required)?n.required.filter(i=>typeof i=="string"):[]);for(const[i,l]of Object.entries(a??{}))(n===void 0||i in c||b.has(i))&&(c[i]=l);return{env:{...c,...e.vars},sources:v}};export{p as activeScope,y as resolveLocalWorkerEnv};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{relative as l,resolve as f,dirname as m}from"node:path";import{resolveWorkerEntry as b}from"./COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{s as w,b as g}from"./studio-assets-BKWx838V.mjs";import{s as y}from"./spa-assets-wX8rTPEQ.mjs";import{findWranglerFile as A,readWranglerJsonc as q}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{variableKeyLines as P,scanWranglerVariablesForSecrets as O}from"./scanWranglerVariablesForSecrets-BQIPpHpH.mjs";const c=(s,i)=>{const r=s?.producers;return(Array.isArray(r)?r:[]).flatMap(e=>g(e)&&typeof e.binding=="string"&&typeof e.queue=="string"?[{binding:e.binding,queue:e.queue,...i===void 0?{}:{env:i}}]:[])},B=(s,i)=>{const r=A(s),t=r===void 0?void 0:q(r),e=t?.parsed,o=b(s).path,d=o===void 0?{}:{workerEntry:o};if(r===void 0||t?.text===void 0||e===void 0)return{...d,wranglerQueueProducers:[],wranglerVariables:[]};const p=P(t.text),u=[...new Set([e.assets,...Object.values(e.env??{}).map(n=>n?.assets)].flatMap(n=>y(n)??[]))],a=w(s,e,i);return{...u.length===0?{}:{spaAssetsBindings:u},...a===void 0?{}:{studioAssets:{binding:a.binding,directory:l(s,f(m(r),a.directory))}},...d,wranglerQueueProducers:[...c(e.queues),...Object.entries(e.env??{}).flatMap(([n,v])=>c(v?.queues,n))],wranglerVariables:O(g(e.vars)?e.vars:void 0,l(s,r),n=>p.get(n))}};export{B as wranglerCodegenInputs};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{existsSync as s,statSync as a,writeFileSync as p,renameSync as d,rmSync as g}from"node:fs";import{join as m}from"node:path";import{runCodegen as f,CodegenDiagnosticError as j,refreshCodegenProject as u,createCodegenProject as y,findTsconfig as S,tsconfigFingerprint as C,projectConfigCandidatePaths as h}from"@lunora/codegen";import{wranglerCodegenInputs as l}from"./wranglerCodegenInputs
|
|
1
|
+
import{existsSync as s,statSync as a,writeFileSync as p,renameSync as d,rmSync as g}from"node:fs";import{join as m}from"node:path";import{runCodegen as f,CodegenDiagnosticError as j,refreshCodegenProject as u,createCodegenProject as y,findTsconfig as S,tsconfigFingerprint as C,projectConfigCandidatePaths as h}from"@lunora/codegen";import{wranglerCodegenInputs as l}from"./wranglerCodegenInputs--ngEbVLe.mjs";import{isCodegenDisabled as w,CODEGEN_ENV as n}from"./BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{recordStudioWrite as P,STUDIO_WRITE_TEMP_SUFFIX as $}from"./STUDIO_WRITE_TEMP_SUFFIX-BTTELz3K.mjs";const F=o=>({apiSpec:o.apiSpec,lazyFunctions:o.lazyFunctions,lunoraDirectory:o.schemaDirectory??"lunora",projectRoot:o.projectRoot,...l(o.projectRoot)});let r;const c=o=>{const t=a(o);return`${o}:${String(t.mtimeMs)}:${String(t.size)}`},E=o=>{const t=S(o);return[t===void 0?"":`${c(t)}
|
|
2
2
|
${C(t)}`,...h(o).filter(e=>s(e)).map(e=>c(e))].join(`
|
|
3
3
|
`)},R=o=>{const t=E(o);return r?.lunoraDirectory===o&&r.key===t?(u(r.project,o),r.project):(r={key:t,lunoraDirectory:o,project:y(o)},r.project)},x=(o,t)=>{if(w(process.env[n]))return[`codegen is off (${n}=0 / \`lunora dev --no-codegen\`) — the source was written but \`_generated/\` was NOT regenerated`];try{const e=m(o.projectRoot,o.schemaDirectory??"lunora");f({...F(o),project:R(e)})}catch(e){if(r=void 0,e instanceof j)return[e.message];throw e}return P(t.path,t.text),[]},z=(o,t)=>{const e=`${o}${$}`;try{p(e,t,"utf8"),d(e,o)}catch(i){throw g(e,{force:!0}),i}};export{x as r,z as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devVariablesStamp as t,parseDevVariable as r,resolveAdminToken as a}from"../packem_shared/devVariablesStamp-BQkGEn9d.mjs";import{ADVISOR_PROCEDURES_ENDPOINT as d,handleAdvisorProceduresRequest as n}from"../packem_shared/ADVISOR_PROCEDURES_ENDPOINT-BPnqzAgT.mjs";import{sendStudioAsset as u,sendStudioDocument as i}from"../packem_shared/sendStudioAsset-B81Pex91.mjs";import{assetContentType as l,isStandaloneModulePath as p,loadStudioAssets as D,readStandaloneAsset as T,resolveStandaloneDirectory as f,studioAssetsStamp as _}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{default as P}from"../packem_shared/createStudioDocumentCache-XBG1aWbl.mjs";import{STUDIO_PATH as c,STUDIO_SCRIPT_PATH as I,STUDIO_STYLE_PATH as O,createStudioMiddleware as x,isNonLoopbackHost as R,requestPathname as h,studioMountPath as N}from"../packem_shared/STUDIO_PATH-
|
|
1
|
+
import{devVariablesStamp as t,parseDevVariable as r,resolveAdminToken as a}from"../packem_shared/devVariablesStamp-BQkGEn9d.mjs";import{ADVISOR_PROCEDURES_ENDPOINT as d,handleAdvisorProceduresRequest as n}from"../packem_shared/ADVISOR_PROCEDURES_ENDPOINT-BPnqzAgT.mjs";import{sendStudioAsset as u,sendStudioDocument as i}from"../packem_shared/sendStudioAsset-B81Pex91.mjs";import{assetContentType as l,isStandaloneModulePath as p,loadStudioAssets as D,readStandaloneAsset as T,resolveStandaloneDirectory as f,studioAssetsStamp as _}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{default as P}from"../packem_shared/createStudioDocumentCache-XBG1aWbl.mjs";import{STUDIO_PATH as c,STUDIO_SCRIPT_PATH as I,STUDIO_STYLE_PATH as O,createStudioMiddleware as x,isNonLoopbackHost as R,requestPathname as h,studioMountPath as N}from"../packem_shared/STUDIO_PATH-CWaCBuYC.mjs";import{POLICY_SCAFFOLD_ENDPOINT as H,handlePolicyScaffoldRequest as L}from"../packem_shared/POLICY_SCAFFOLD_ENDPOINT-DSMpLzsw.mjs";import{default as U}from"../packem_shared/renderStudioHtml-CRDTNivi.mjs";import{SCHEMA_EDIT_ENDPOINT as F,handleSchemaEditRequest as M}from"../packem_shared/SCHEMA_EDIT_ENDPOINT-FM9ZC-gV.mjs";import{SEED_ENDPOINT as b,handleSeedRequest as W}from"../packem_shared/SEED_ENDPOINT-C1fhrehH.mjs";import{serveJsonHandler as y}from"../packem_shared/serveJsonHandler-B8_GE6QC.mjs";import{STUDIO_WRITE_TEMP_SUFFIX as j,consumeStudioWrite as w}from"../packem_shared/STUDIO_WRITE_TEMP_SUFFIX-BTTELz3K.mjs";import{ALLOW_FORWARDED_ENV as X,headerValue as g,isLoopbackAddress as z,transportRejectionReason as B}from"../packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs";export{d as ADVISOR_PROCEDURES_ENDPOINT,X as ALLOW_FORWARDED_ENV,H as POLICY_SCAFFOLD_ENDPOINT,F as SCHEMA_EDIT_ENDPOINT,b as SEED_ENDPOINT,c as STUDIO_PATH,I as STUDIO_SCRIPT_PATH,O as STUDIO_STYLE_PATH,j as STUDIO_WRITE_TEMP_SUFFIX,l as assetContentType,w as consumeStudioWrite,P as createStudioDocumentCache,x as createStudioMiddleware,t as devVariablesStamp,n as handleAdvisorProceduresRequest,L as handlePolicyScaffoldRequest,M as handleSchemaEditRequest,W as handleSeedRequest,g as headerValue,z as isLoopbackAddress,R as isNonLoopbackHost,p as isStandaloneModulePath,D as loadStudioAssets,r as parseDevVariable,T as readStandaloneAsset,U as renderStudioHtml,h as requestPathname,a as resolveAdminToken,f as resolveStandaloneDirectory,u as sendStudioAsset,i as sendStudioDocument,y as serveJsonHandler,_ as studioAssetsStamp,N as studioMountPath,B as transportRejectionReason};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.468",
|
|
4
4
|
"description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bindings",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@lunora/codegen": "^1.0.0-alpha.
|
|
61
|
+
"@lunora/codegen": "^1.0.0-alpha.427",
|
|
62
62
|
"@lunora/container": "1.0.0-alpha.108",
|
|
63
63
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
64
64
|
"@lunora/seed": "^1.0.0-alpha.282",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{existsSync as b}from"node:fs";import{ENV_FILENAME as k}from"@lunora/codegen";import{ENV_FILENAME as fe}from"@lunora/codegen";import{i as w}from"./secret-key-xi4VK8Jw.mjs";import{buildBindingManifest as O}from"./BINDING_MANIFEST_VERSION-CR06-eW7.mjs";import{readProjectWrangler as N,readWranglerJsonc as S}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{dirname as L,join as g}from"node:path";import{expand as $}from"dotenv-expand";import{readDevVariablesRecord as y,wranglerDotenvFiles as P}from"./DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";const C=Symbol.for("lunora.env"),T=e=>{if(typeof e!="function")return;let t;try{t=Reflect.get(e,C)}catch{return}return typeof t=="function"?t:void 0},I=[/^sk_/u,/^pk_/u,/^rk_/u,/^ghp_/u,/^gho_/u,/^ghs_/u,/^ghr_/u,/^github_pat_/u,/^xox[baprs]-/u,/^AKIA/u,/^AIza/u,/^Bearer\s/u],V=/[\w./+-]{24,}/gu,j=/^[\w./+-]+$/u,x=/\b(?:(?:sk|pk|rk|ghp|gho|ghs|ghr)_[\w./+-]*|github_pat_[\w./+-]*|xox[baprs]-[\w./+-]*)/gu,F=/\b(?:AKIA|AIza)[\w./+-]+|Bearer\s+[\w./+-]+/gu,U=/:\/\/([\w.%+-]*):[\w.%+\-!$&'()*,;=~]+@/gu,u="[redacted]",K=e=>{if(I.some(n=>n.test(e)))return!0;const t=e.trim();return t.length>=24&&j.test(t)},p=new Set([`
|
|
2
|
-
`,"\r","\u2028","\u2029"]),M=(e,t)=>{const n=e.charAt(t);let r=-1,o=t+1;for(;o<e.length;){const s=e.charAt(o);if(s===n)return o;if(p.has(s))break;const c=e.charAt(o+1);s==="\\"&&o+1<e.length&&!p.has(c)?(c===n&&(r=o+1),o+=2):o+=1}return r},q=(e,t)=>{let n="",r=0;for(;r<e.length;){const o=e.charAt(r),s=o==='"'||o==="'"?M(e,r):-1;s===-1?(n+=o,r+=1):(n+=t(e.slice(r,s+1),e.slice(r+1,s)),r=s+1)}return n},B=/\b(?<key>[A-Za-z_]\w*)\s*[=:]\s*(?:"(?:[^"\\\n]|\\[^\n])*"|'(?:[^'\\\n]|\\[^\n])*'|\S+)/gu,h=e=>{let t=e;return t=q(t,(n,r)=>K(r)?u:n),t=t.replaceAll(U,(n,r)=>`://${r}:${u}@`),t=t.replaceAll(x,u),t=t.replaceAll(F,u),t=t.replaceAll(B,(n,...r)=>{const o=r.at(-1);return o?.key!==void 0&&w(o.key)?`${o.key}=${u}`:n}),t=t.replaceAll(V,u),t},m=(e,t,n)=>{const r=e[t];if(r===void 0)return n;switch(r.toLowerCase()){case"false":return!1;case"true":return!0;default:throw new Error(`Expected ${t} to be "true" or "false", but got ${JSON.stringify(r)}`)}},D=(e,t)=>(t===void 0?void 0:e?.env?.[t])??e??{},H=(e,t)=>{const n=t===void 0?[".dev.vars"]:[`.dev.vars.${t}`,".dev.vars"];for(const r of n){const o=y(g(e,r));if(o!==void 0)return{file:r,values:o}}},W=(e,t,n,r)=>{const o={},s=[];for(const a of P(t)){let i;try{i=y(g(e,a))}catch{continue}i!==void 0&&(Object.assign(o,i),s.push(a))}const c={};if(n)for(const[a,i]of Object.entries(r))i!==void 0&&(c[a]=i);return $({parsed:o,processEnv:c}),{files:s,values:c}},J=e=>{const t=e.processEnv??process.env,n=e.configPath===void 0?e.projectRoot:L(e.configPath),r=D(e.config,e.environment),o={...r.vars},s=e.config===void 0?[]:["wrangler vars"],c=r.secrets??void 0;let a;const i=H(n,e.environment);if(i!==void 0)a=i.values,s.push(i.file);else if(m(t,"CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV",!0)){const d=c!==void 0||m(t,"CLOUDFLARE_INCLUDE_PROCESS_ENV",!1),v=W(n,e.environment,d,t);a=v.values,s.push(...v.files,...d?["process.env"]:[])}const f=new Set(Array.isArray(c?.required)?c.required.filter(d=>typeof d=="string"):[]);for(const[d,v]of Object.entries(a??{}))(c===void 0||d in o||f.has(d))&&(o[d]=v);return{env:{...o,...e.vars},sources:s}},z=e=>{if(e.configPath===void 0)return N(e.projectRoot);if(b(e.configPath))try{return{parsed:S(e.configPath).parsed,path:e.configPath}}catch{return{parsed:void 0,path:e.configPath}}},G=async e=>{const{createJiti:t}=await import("jiti");return t(e,{interopDefault:!1,moduleCache:!1}).import(e)},_=3,A=/[\w-]/u,Q=(e,t,n)=>{let r="",o=0,s=e.indexOf(t);for(;s!==-1;){const c=e.charAt(s-1),a=e.charAt(s+t.length),i=!A.test(c)&&!A.test(a);r+=e.slice(o,s)+(i?n:t),o=s+t.length,s=e.indexOf(t,o)}return r+e.slice(o)},X=(e,t)=>{const n=t[e.key];if(typeof n!="string")return{...e,message:h(e.message)};const r=[];if(URL.canParse(n)){const{password:a}=new URL(n);r.push(a);try{r.push(decodeURIComponent(a))}catch{}}let o=n;for(const a of r)o=o.replace(`:${a}@`,`:${u}@`);const s=w(e.key)||h(n)!==n;let{message:c}=e;o!==n?c=c.replaceAll(n,o):n.length>=_&&(c=s?c.replaceAll(n,u):Q(c,n,u));for(const a of r.filter(i=>i.length>=_).toSorted((i,f)=>f.length-i.length))c=c.replaceAll(a,u);return{...e,message:h(c)}},Y=e=>e instanceof Error?e.message:String(e),Z=async e=>{const t=g(e.projectRoot,e.schemaDirectory,k);if(!b(t))return{kind:"absent"};const n=await(e.load??G)(t),r=Object.values(n??{}).map(l=>T(l)).find(l=>l!==void 0);if(r===void 0)return{kind:"absent"};const o=e.processEnv??process.env,s=o.CLOUDFLARE_ENV,c=e.environment??(s===""?void 0:s),a=z(e);if(e.configPath!==void 0&&a===void 0)return{error:`${e.configPath} does not exist`,kind:"unloadable"};if(a!==void 0&&a.parsed===void 0)return{error:`${a.path} could not be read as JSONC`,kind:"unloadable"};const i=J({config:a?.parsed,configPath:a?.path,environment:c,processEnv:o,projectRoot:e.projectRoot,vars:e.vars}),{env:f}=i,d=D(a?.parsed,c),v=new Set(e.withheld),R=new Set(a===void 0?[]:O(d).bindings.filter(l=>l.type!=="queue_consumer").map(l=>l.binding).filter(l=>!v.has(l))),E=r(f).filter(l=>!R.has(l.key)).map(l=>X(l,f));return E.length===0?{kind:"valid"}:{failures:E,kind:"invalid",sources:i.sources}},ie=async e=>{try{return await Z(e)}catch(t){return{error:h(Y(t)),kind:"unloadable"}}},le=(e,t,{wasInvalid:n=!1}={})=>{const r=`${t}/${k}`;if(e.kind==="unloadable")return{level:"info",message:`${r}: the dev env could not be checked, so a missing key surfaces on first read instead: ${e.error}`};if(e.kind==="valid"&&n)return{level:"info",message:`${r}: the dev env satisfies the contract again`};if(e.kind==="absent"&&n)return{level:"info",message:`${r}: no env contract is loaded any more, so the warning above no longer applies`};if(e.kind!=="invalid")return;const o=e.sources.length===0?"no env files":e.sources.join(" + "),s=e.failures.map(c=>` - ${c.key}: ${c.message}`);return{level:"warn",message:[`${r}: ${String(e.failures.length)} key(s) missing or invalid in the dev env (${o}) — the first request that reads one will fail:`,...s].join(`
|
|
3
|
-
`)}};export{fe as ENV_FILENAME,ie as checkDevEnv,le as describeDevEnvCheck};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const c=["ai_search","ai_search_namespaces","analytics","artifacts","containers","d1_databases","durable_objects","hyperdrive","k2","kv_namespaces","queues","r2_buckets","secrets","secrets_store_secrets","services","tail_consumers","vars","vectorize","workflows"],i=["assets","compatibility_date","compatibility_flags","exports","logpush","main","migrations","observability","placement"],m=(s,n)=>{if(n===void 0)return{merged:s,unverifiedKeys:[]};const t=s.env?.[n];if(t===void 0){const e=Object.keys(s.env??{}).toSorted((v,f)=>v.localeCompare(f)),l=e.length>0?` (declared: ${e.join(", ")}).`:" (no environments are declared).";return{error:`--env "${n}" names no environment declared in wrangler.jsonc's "env" block${l}`,merged:s,unverifiedKeys:[]}}const r={...s},o=Object.keys(t).filter(e=>e!=="env");for(const e of o)i.includes(e)&&(r[e]=t[e]);for(const e of c)r[e]=t[e];const a=new Set([...c,...i]),d=o.filter(e=>!a.has(e)).map(String);return{merged:r,unverifiedKeys:d}};export{c as NON_INHERITABLE_KEYS,m as mergeWranglerEnvironment};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{relative as d,resolve as p,dirname as v}from"node:path";import{s as b,b as l}from"./studio-assets-BKWx838V.mjs";import{s as f}from"./spa-assets-wX8rTPEQ.mjs";import{findWranglerFile as m,readWranglerJsonc as w}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{variableKeyLines as A,scanWranglerVariablesForSecrets as q}from"./scanWranglerVariablesForSecrets-BQIPpHpH.mjs";const u=(i,n)=>{const s=i?.producers;return(Array.isArray(s)?s:[]).flatMap(e=>l(e)&&typeof e.binding=="string"&&typeof e.queue=="string"?[{binding:e.binding,queue:e.queue,...n===void 0?{}:{env:n}}]:[])},V=(i,n)=>{const s=m(i),a=s===void 0?void 0:w(s),e=a?.parsed;if(s===void 0||a?.text===void 0||e===void 0)return{wranglerQueueProducers:[],wranglerVariables:[]};const g=A(a.text),o=[...new Set([e.assets,...Object.values(e.env??{}).map(r=>r?.assets)].flatMap(r=>f(r)??[]))],t=b(i,e,n);return{...o.length===0?{}:{spaAssetsBindings:o},...t===void 0?{}:{studioAssets:{binding:t.binding,directory:d(i,p(v(s),t.directory))}},wranglerQueueProducers:[...u(e.queues),...Object.entries(e.env??{}).flatMap(([r,c])=>u(c?.queues,r))],wranglerVariables:q(l(e.vars)?e.vars:void 0,d(i,s),r=>g.get(r))}};export{V as wranglerCodegenInputs};
|