Feat/conf resolute v257#38
Merged
Merged
Conversation
…rna majors
Engines + CI move to Node 24 (.node-version pins 24.14.0). Major dep bumps:
typescript 5→6, eslint 9→10, vitest 3→4, zod 3→4, lerna-lite 3→5,
commitlint 19→21, @chyzwar/eslint-config 0.2→0.6, @chyzwar/tsconfig 0.3→0.4.
Required source fixes:
- conf/utils.ts: zod 4 renamed ZodOptionalType/ZodNullableType → ZodOptional/ZodNullable
- conf/{service,timer}.ts: replace deprecated z.merge() with z.extend(other.shape)
- ctl/tsconfig.json: explicit "types": ["node"] now needed since the new
shared @chyzwar/tsconfig/lib.json no longer auto-includes node types
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…verview
Covers monorepo scripts, release flow, the conf/ctl split, the
implement<T>().with({...}) zod-interface contract, runtime mixin
pattern for section builders, and INI parser limitations.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
….strictObject)
Collapse pure-string literal unions in exec.ts to z.enum([...])
(StandardOutputSchema, LogLevelSchema, StandardInput, SyslogFacility),
matching the existing convention in kill.ts and parts of service.ts.
Replace the z.string().startsWith(...) as ZodType<`file:${string}`> casts
with z.templateLiteral([prefix, z.string()]) — no more manual type
assertions; Zod 4 infers the template-literal output type natively.
Collapse mixed boolean+string literal unions to z.literal([true, false, ...]):
exec.ts ProtectSystem / ProtectHome / RuntimeDirectoryPreserve,
service.ts FileDescriptorStorePreserve.
Replace .extend(...).extend(...).strict() chains with z.strictObject({...spread})
in service.ts and timer.ts.
Tighten Implements<Model> in utils.ts so optional/nullable fields use
z.ZodType<Strip<T>, Strip<T>> (Strip removes null|undefined) — matches the
shape of z.X().optional() exactly. Non-optional fields use z.ZodType<T, T>.
Bump the explicit annotations on ResourceLimitSchema, ServiceSectionSchema,
and TimerSectionSchema to the two-param form to satisfy the tightened helper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The shared @chyzwar/tsconfig/lib.json sets module to "Node18" which TS 6.0.3 accepts but older TypeScript versions (e.g. those bundled with IDE ESLint servers) reject during tsconfig validation. Lowercase "nodenext" in each package's tsconfig overrides the parent and resolves identically under TS 6 while remaining valid for older TS too, silencing the IDE parsing error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bring `@systemd-js/conf` in line with the resolute (Ubuntu 25.10 / systemd
v257) manpages. `@see` URLs bumped noble → resolute.
resource.ts:
- Add ~30 missing directives across IO, Network, BPF, Device, CGroup
management, OOM/memory-pressure, and Coredump sections (IODeviceWeight,
IOReadBandwidthMax, IPAddressAllow/Deny, SocketBindAllow/Deny,
RestrictNetworkInterfaces, NFTSet, BPFProgram, DeviceAllow,
DevicePolicy, Slice, Delegate, ManagedOOM*, MemoryPressure*,
CoredumpReceive, MemoryZSwapWriteback, DefaultMemoryMin/Low, …).
- Refactor `ResourceLimit` to `z.templateLiteral` (drops the
`as ZodType<...>` cast and unused `ZodType` import).
- Fix `TasksMax` schema: now accepts `number | "infinity" | \`${number}%\``
instead of bare `z.number()`.
- Fix `CPUQuotaPeriodSec` schema to also accept strings.
service.ts:
- Add `Type=notify-reload` (v250), `RestartMode=debug` (v257), and the
new `ExecReloadPost=` directive (v259).
- Remove duplicate `"forking"` from the `Type` enum.
- Widen time-duration fields to `number | string` (RestartSec,
Restart/RuntimeMaxDelaySec, Timeout{Start,Stop,Abort,}Sec, WatchdogSec,
RuntimeRandomizedExtraSec). Fixes a round-trip bug where the INI parser
coerces `RestartSec=30` to a JS number that the old schema rejected.
- JSDoc audit pass: 11 verbatim fixes against the resolute manpage
(PIDFile XDG_RUNTIME_DIR, ExecReload notify-reload interaction,
RestartSteps formula, RestartMaxDelaySec zero-RestartSec condition,
TimeoutStartSec reload timeout, RuntimeMaxSec oneshot hint,
Restart= OOM table row, RestartMode debug-version trailer,
RestartForceExitStatus oneshot caveat, RootDirectoryStartOnly
ExecReloadPost, OOMPolicy oom-kill state).
- Add eight missing `Added in version N.` trailers.
- Fix two stale `@see` cross-references.
Tests: new `resource.test.ts` and v257 cases appended to
`service.test.ts` covering round-trip through the INI emitter/parser,
multi-assignment directives, time-duration string and numeric forms, and
negative cases for invalid enums.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
URLs: - exec.ts, install.ts, kill.ts: bump @see manpage links noble -> resolute - install.ts: adopt new lowercase-hyphenated #install-section-options anchor (replaces noble's URL-encoded "#[install]%20section%20options" which would not resolve on the resolute page) timer.ts content sync (v259): - Add OnTimezoneChange (v242 - documented in the combined JSDoc but never had a field), DeferReactivation (v257), RandomizedOffsetSec (v258) - Drop section-end trailer ("Check systemd.unit(5), ...") leaked into RemainAfterElapse's JSDoc - Fix wrong description on TimerSectionBuilder.toObject() and remove redundant @returns {Type} tags (TS80004) unit.ts content sync (v259): - Full [Unit] section sync. Add 94 directives (25 non-condition, 35 Condition*, 34 Assert*) with verbatim manpage JSDoc, schema entries, and chainable builder setters - Add shared UnitAction / UnitJobMode / UnitCollectMode type aliases and matching const arrays for z.enum - Widen 11 dependency directives (Requires through JoinsNamespaceOf) from string to string[] | string, matching Documentation/Wants/After/Before - Split the 729-line orphan JSDoc into per-directive blocks; drop the "Conditions and Asserts" narrative intro and the inverses-mapping table (already encoded in the type system) - Remove redundant @returns {UnitSection} (TS80004) Note: the prior 3c10bb5 commit message says "v257 (resolute)", but the resolute release now ships systemd 259.5-0ubuntu3. URLs verified via WebFetch against the live manpage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.