Skip to content

馃摝 Implement headless crossref-utils + crossref-cli monorepo - #28

Merged
stevejpurves merged 6 commits into
mainfrom
feat/spike-ts-sdk-impl
Sep 17, 2026
Merged

stevejpurves merged 6 commits into
mainfrom
feat/spike-ts-sdk-impl

Conversation

@stevejpurves

Copy link
Copy Markdown
Contributor

Summary

  • Split the repo into packages/crossref-utils (in-memory library) and packages/crossref-cli (FS / myst-cli / prompts), following the SPIKE plan.
  • Library: abstractFromMdast, DOI helpers (generateDoi / suggestDois), logger-based *FromMyst, no Curvenote DOI defaults (callers pass resolveDoiData).
  • Validation: validateDeposit(xml, schema) takes a caller-supplied schema bundle (no SDK download); CLI downloads/caches Crossref schemas/ and builds the bundle for multi-version targeting.
  • Docs: docs/validation.md, updates to SDK.md / README.

Test plan

  • npm install && npm run build && npm test
  • npm run lint (utils + cli)
  • Spot-check crossref validate after build (schema cache under ~/.cache/crossref-cli/schemas/)
  • Confirm library import works without network for validate when schema is passed in-memory

@stevejpurves
stevejpurves marked this pull request as draft September 16, 2026 14:34
@stevejpurves
stevejpurves requested a review from fwkoch September 16, 2026 14:34
@stevejpurves

Copy link
Copy Markdown
Contributor Author

@fwkoch based on updated plans and discussion, I took a stab at the split

@stevejpurves
stevejpurves marked this pull request as ready for review September 16, 2026 14:35

@fwkoch fwkoch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scanning through this PR, the -utils vs -cli split looks pretty much exactly as I'd expect. I haven't had a chance to test it out yet, but I'll use the new -cli for building the SciPy proceedings crossref deposit in the next couple weeks.

There's a few outstanding pieces - improve random DOI generation, bring xml validation into js, get rid of "curvenote" - but all these are outside the scope of "monorepo with headless -utils and -cli"

import { addDoiToConfig } from './utils.js';
import { selectNewDois } from './generate.js';

/** CLI default landing-page resolver (org-specific; not in crossref-utils). */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest crossref-cli should not have "curvenote" in it either. It should be a generic tool built on the generic utils. But I don't think this extra removal is critical for this PR; getting it out of utils is a start.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh but this really isn't in scope for this PR, based on it's title. All good for now. 馃憤

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fwkoch on

bring xml validation into js

You mean as opposed to the wasm approach that we ar trying out here?

Implement headless library package with abstractFromMdast, DOI helpers,
validateDeposit (xerces-wasm), logger-based MyST adapters, and no Curvenote
DOI defaults in the library. CLI keeps FS/prompts and org-specific resolvers.
@stevejpurves
stevejpurves changed the base branch from feat/spike-ts-sdk to main September 17, 2026 18:57
@stevejpurves
stevejpurves merged commit 086d722 into main Sep 17, 2026
@stevejpurves
stevejpurves deleted the feat/spike-ts-sdk-impl branch September 17, 2026 19:01
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.

2 participants