Skip to content

feat: add unstable-procedure submodule for high-level functions#248

Closed
takker99 wants to merge 1 commit into
mainfrom
pr-unstable-procedure
Closed

feat: add unstable-procedure submodule for high-level functions#248
takker99 wants to merge 1 commit into
mainfrom
pr-unstable-procedure

Conversation

@takker99

Copy link
Copy Markdown
Owner

Summary

Create a new unstable-procedure/ submodule for high-level functions that compose multiple API requests, separating them from the thin fetch wrapper unstable-api/.

Changes

New module: unstable-procedure/

  • list-pages-stream.ts: Migrated from api/pages/project.ts. Changed error handling from throw to Result type (option-t), yielding createErr on failure and returning.
  • get-links-stream.ts: Migrated from api/pages/project/search/titles.ts. Same throw → Result conversion.
  • upload-to-gcs.ts: Migrated from rest/uploadToGCS.ts. Logic unchanged; only import paths updated.

Modified files

  • api/pages/project.ts: listPagesStream / ensureResponse removed, @deprecated re-export added
  • api/pages/project/search/titles.ts: getLinksStream removed, @deprecated re-export added
  • rest/mod.ts: uploadToGCS export removed
  • deno.jsonc: ./unstable-procedure export added

Deleted

  • rest/uploadToGCS.ts: Moved to unstable-procedure/upload-to-gcs.ts

Design

Submodule Error handling Philosophy
unstable-api/ throw / Response Thin fetch wrapper, no option-t
unstable-procedure/ Result (option-t) High-level multi-request operations

…adToGCS

Move high-level functions from unstable-api/ and rest/ into a new
unstable-procedure/ submodule, converting stream functions from
throw-based error handling to Result type.

- unstable-procedure/list-pages-stream.ts: migrated from api/pages/project.ts
  (throw → Result yield)
- unstable-procedure/get-links-stream.ts: migrated from
  api/pages/project/search/titles.ts (throw → Result yield)
- unstable-procedure/upload-to-gcs.ts: migrated from rest/uploadToGCS.ts
  (unchanged, Result-based)
- api/pages/project.ts: add @deprecated re-export
- api/pages/project/search/titles.ts: add @deprecated re-export
- rest/mod.ts: remove uploadToGCS export
- rest/uploadToGCS.ts: deleted
- deno.jsonc: add ./unstable-procedure export
@takker99

takker99 commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

OpenCodeが誤ってmainにdirect pushしてしまった (6fdcf9b )。
branch protectionが効いているはずなんだけどな……なんでこうなった?
ひとまずこのPRはcloseする。

@takker99 takker99 closed this Jun 26, 2026
@takker99 takker99 deleted the pr-unstable-procedure branch June 26, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant