chore: fork — remove vendor CI, repoint release checks to Neuron Gitea
This commit is contained in:
Vendored
+11
@@ -5,6 +5,15 @@ import { InstanceState } from "@/effect/instance-state"
|
||||
|
||||
type State = Record<string, string | undefined>
|
||||
|
||||
/**
|
||||
* Env is the runtime environment authority for the process.
|
||||
*
|
||||
* The snapshot captured at instance start serves reads (`get`/`all`) without
|
||||
* touching `process.env` on every lookup, while writes (`set`/`remove`) are
|
||||
* written through to `process.env` so that lazily-reading SDKs (AWS, SAP, ...)
|
||||
* and spawned child processes observe them. The two views can only diverge if
|
||||
* something mutates `process.env` behind this service — don't do that.
|
||||
*/
|
||||
export interface Interface {
|
||||
readonly get: (key: string) => Effect.Effect<string | undefined>
|
||||
readonly all: () => Effect.Effect<State>
|
||||
@@ -26,10 +35,12 @@ const layer = Layer.effect(
|
||||
const set = Effect.fn("Env.set")(function* (key: string, value: string) {
|
||||
const env = yield* InstanceState.get(state)
|
||||
env[key] = value
|
||||
process.env[key] = value
|
||||
})
|
||||
const remove = Effect.fn("Env.remove")(function* (key: string) {
|
||||
const env = yield* InstanceState.get(state)
|
||||
delete env[key]
|
||||
delete process.env[key]
|
||||
})
|
||||
|
||||
return Service.of({ get, all, set, remove })
|
||||
|
||||
Reference in New Issue
Block a user