Skip to content

feat(data): rework @scope42/data as a format-agnostic frontmatter loader#441

Merged
erikhofer merged 34 commits intomainfrom
feat/data-frontmatter-refactor
Apr 23, 2026
Merged

feat(data): rework @scope42/data as a format-agnostic frontmatter loader#441
erikhofer merged 34 commits intomainfrom
feat/data-frontmatter-refactor

Conversation

@erikhofer
Copy link
Copy Markdown
Member

Summary

  • Replaces the old YAML-whole-file parser with a scope42.yaml-driven workspace loader using gray-matter + picomatch
  • Reduces per-type schemas to frontmatter-only Zod schemas (status, relations, tags); body is returned as raw text
  • Migrates example/ workspace (15 items) to new Markdown-frontmatter format and adds FORMAT.md documenting the format

What changed

  • packages/scope42-data: new WorkspaceConfig Zod schema, per-type frontmatter schemas, rewritten Workspace.readItems(), 57 tests passing, lint clean
  • example/: new scope42.yaml + 15 migrated items (5 issues, 2 risks, 4 improvements, 4 decisions)
  • FORMAT.md: format specification at repo root
  • examples/data-processing: points at new example/ workspace and loads all 15 items end-to-end

⚠️ Known breakage: app/

app/ will fail to build after this PR — it imports types and helpers that no longer exist (IssueId, getItemTypeFromId, Workspace write APIs, etc.). This is intentional: app/ is being removed in the follow-up issue #434. Do not attempt to fix app/ here.

Test plan

  • npm --workspace packages/scope42-data run lint — clean
  • npm --workspace packages/scope42-data run build — success
  • npm --workspace packages/scope42-data test — 57/57 pass
  • npm --workspace examples/data-processing run lint — clean
  • npm --workspace examples/data-processing run gen — prints all 15 items

Closes #432

erikhofer and others added 24 commits April 19, 2026 15:21
… utils+commons

- model/index.ts: export frontmatter schemas + Item = Issue | Risk | Improvement | Decision
- io/adapters/*.ts: file-level doc comments
- delete utils.ts (id+status helpers obsoleted by the refactor)
- delete model/commons.ts (nullsafeOptional/DeserializableDate no longer used)
- src/index.ts: drop utils re-export
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for scope42 canceled.

Name Link
🔨 Latest commit 2d372f3
🔍 Latest deploy log https://app.netlify.com/projects/scope42/deploys/69ea59c023804200086e38aa

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 20, 2026

⚠️ No Changeset found

Latest commit: 2d372f3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for scope42-website canceled.

Name Link
🔨 Latest commit 2d372f3
🔍 Latest deploy log https://app.netlify.com/projects/scope42-website/deploys/69ea59c023804200086e38ae

Comment thread packages/scope42-data/src/model/relation-patterns.ts Outdated
Comment thread packages/scope42-data/src/model/risk.ts
Comment thread packages/scope42-data/src/model/workspace-config.ts
Comment thread FORMAT.md
Comment thread packages/scope42-data/src/io/adapters/api.ts
erikhofer and others added 2 commits April 23, 2026 19:36
- restore api.ts with JSDoc; update adapters to import from './api'
- remove RELATION_TYPE_PATTERNS (belongs to linter, see #433)
- add version: z.literal(2) to WorkspaceConfigSchema
- add comment on Risk independence from aim42 issue hierarchy
- update example scope42.yaml and FORMAT.md for current schema

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@erikhofer erikhofer merged commit 2818b76 into main Apr 23, 2026
5 checks passed
@erikhofer erikhofer deleted the feat/data-frontmatter-refactor branch April 23, 2026 17:43
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.

Rework @scope42/data for Markdown frontmatter + workspace config

1 participant