refactor(shared): remove unused runtime helpers and exports#10166

merged4
main
cleanup-packages/shared-internals
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago
2 unresolved threads · Jump to file
Selected thread: packages/shared/src/schemaYaml.ts:90 — 🟢 **Low** `src/schemaYaml.ts:90` The retained examples import non-exported `parseYaml` and `stringifyYaml`, so following either documented recipe throws a module import error instead of producing a getter. Update the examples to use the exported APIs or restore those exports. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary> ```text In file @packages/shared/src/schemaYaml.ts around line 90: The retained examples import non-exported `parseYaml` and `stringifyYaml`, so following either documented recipe throws a module import error instead of producing a getter. Update the examples to use the exported APIs or restore those exports. ``` </details> <!-- macroscope-meta: {"kind":"code_review","variant":"f57f0b61c1d8f13d673564c863408287"} -->
0 / 13 viewed13 files changedLine totals unavailable

packages/shared/src/Net.ts · Earlier revision fd0c6e2a · right 66

Original diff
@@ -63,7 +63,7 @@ export class NetService extends Context.Service<NetService, NetServiceShape>()(
   "@t3tools/shared/Net/NetService",
 ) {}
 
-export const make = () => {
+const make = () => {
M
macroscopeappBotSep 5, 2026

src/Net.ts:66

Net.ts is the canonical module that owns construction of NetService, so make should stay part of its public shape (Net.NetService, Net.make, Net.layer) alongside layer. Consider keeping the export so consumers (e.g. tests or alternate layer constructors) can build the service without going through layer.

suggestion
1export const make = () => {

No longer relevant as of b74ac2585843050870808b875fdedfd05ef4695d

J
Julius MarmingeSep 5, 2026

Restored Net.make in b74ac25. The adjacent @public comment explains the required service construction API. The expanded Knip check passes with this deliberate export retained.

packages/shared/src/schemaYaml.ts · Earlier revision d5f8565e · right 90

Original diff
@@ -89,9 +87,7 @@ export function parseYaml<E extends string>(
  *
  * @see {@link parseYaml} for the inverse operation
  */
-export function stringifyYaml(
-  options?: YamlStringifyOptions,
-): SchemaGetter.Getter<string, unknown> {
+function stringifyYaml(options?: YamlStringifyOptions): SchemaGetter.Getter<string, unknown> {
M
macroscopeappBotSep 5, 2026

🟢 Low src/schemaYaml.ts:90

The retained examples import non-exported parseYaml and stringifyYaml, so following either documented recipe throws a module import error instead of producing a getter. Update the examples to use the exported APIs or restore those exports.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
text
1In file @packages/shared/src/schemaYaml.ts around line 90:
2
3The retained examples import non-exported `parseYaml` and `stringifyYaml`, so following either documented recipe throws a module import error instead of producing a getter. Update the examples to use the exported APIs or restore those exports.
J
Julius MarmingeSep 5, 2026

Fixed in 56a7d66. Removed the stale public-import examples from the private YAML getters and kept the valid exported fromYamlString example. The existing YAML suite passes all five tests and the integrated Knip gate passes.