Skip to content

feat!: markdown-transform 1.0.1 / cicero-core 1.0.1, tsc+webpack build, browser support#157

Merged
dselman merged 4 commits into
mainfrom
ds-markdown-transform-1.0.1
Jun 4, 2026
Merged

feat!: markdown-transform 1.0.1 / cicero-core 1.0.1, tsc+webpack build, browser support#157
dselman merged 4 commits into
mainfrom
ds-markdown-transform-1.0.1

Conversation

@dselman
Copy link
Copy Markdown
Contributor

@dselman dselman commented Jun 4, 2026

Upgrades template-engine to the TypeScript Accord Project stack, switches the build to the AP-standard tsc + webpack pattern, and makes the full author/run loop work in the browser.

Dependency upgrade

  • @accordproject/cicero-core 0.26.0 -> 1.0.1
  • markdown-common/markdown-template/markdown-html 0.18.0 -> 1.0.1 (now dedupes — the stale 0.18.0 tree is gone)
  • concerto-core/util/vocabulary 4.0.3 -> 4.1.4, concerto-codegen 4.0.1 -> 4.1.3
  • TemplateArchiveProcessor: deep import cicero-core/types/src/script -> cicero-core/lib/script; drop the now-typed-away { options } arg to fromMarkdownTemplate
  • remove redundant markdown declare module .d.ts shims (1.0.1 ships real types)

Build (rollup -> tsc + webpack)

  • tsc -p tsconfig.build.json -> lib/index.js (CJS) + lib/index.d.ts; main/types move to lib/, the rollup ESM output is dropped
  • webpack UMD browser bundle -> umd/template-engine.js (browser field), node fallbacks, no source map
  • re-export ModelManager + TemplateMarkTransformer so one browser bundle runs the whole flow with a single concerto instance
  • publish includes only lib/ + umd/ (3.6MB packed)

Browser

  • in-browser parse -> type-check -> compile TS logic -> evaluate works (uses the bundled TypeScript, not a CDN import) — the Template Playground loop
  • new e2e/ Playwright workspace loads the UMD bundle into headless Chromium and runs a real generate()
  • README documents browser usage + source/compiled-archive caveats

CI

  • build on Node.js 22 across ubuntu/macos/windows (drop 20.x), add a Browser E2E (Chromium) job, keep code coverage

BREAKING CHANGE

main moves from dist/index.js (bundled CJS + ESM) to lib/index.js (unbundled CJS); the separate ESM build is dropped. Requires Node.js >= 22. Templates must target Cicero ^1.0.0.

Generated with Claude Code

Consume the TypeScript rewrite of the Accord Project markdown stack and the matching
cicero-core release.

- @accordproject/cicero-core 0.26.0 -> 1.0.1
- @accordproject/markdown-common/template/html 0.18.0 -> 1.0.1
- @accordproject/concerto-core/util/vocabulary 4.0.3 -> 4.1.4, concerto-codegen 4.0.1 -> 4.1.3
  (cicero-core 1.0.1 and markdown 1.0.1 require concerto ^4.1.3)
- markdown-transform now dedupes to 1.0.1; the stale transitive 0.18.0 tree is gone
- TemplateArchiveProcessor: fix the deep import (cicero-core/types/src/script ->
  cicero-core/lib/script, now that cicero-core ships its types under lib/) and drop the
  bogus `{ options }` arg to the now-typed fromMarkdownTemplate (it only accepts `{ verbose? }`)
- bump the typescript test archive's cicero range ^0.26.0 -> ^1.0.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: dselman <danscode@selman.org>
@dselman dselman requested a review from a team June 4, 2026 08:00
@coveralls
Copy link
Copy Markdown

coveralls commented Jun 4, 2026

Coverage Report for CI Build 26942285029

Coverage increased (+18.0%) to 81.49%

Details

  • Coverage increased (+18.0%) from the base build.
  • Patch coverage: 2 uncovered changes across 1 file (3 of 5 lines covered, 60.0%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
src/TypeScriptToJavaScriptCompiler.ts 2 0 0.0%
Total (3 files) 5 3 60.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/TypeScriptToJavaScriptCompiler.ts 1 61.36%

Coverage Stats

Coverage Status
Relevant Lines: 801
Covered Lines: 682
Line Coverage: 85.14%
Relevant Branches: 474
Covered Branches: 357
Branch Coverage: 75.32%
Branches in Coverage %: Yes
Coverage Strength: 5243.53 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Member

@mttrbrts mttrbrts left a comment

Choose a reason for hiding this comment

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

Do you have a migration guide for the docs site?

import { transform } from '@accordproject/markdown-transform';
import { TypeScriptToJavaScriptCompiler } from './TypeScriptToJavaScriptCompiler';
import Script from '@accordproject/cicero-core/types/src/script';
import Script from '@accordproject/cicero-core/lib/script';
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.

We should export this properly upstream

dselman and others added 3 commits June 4, 2026 09:46
Adopt the Accord Project build pattern (tsc -> lib/, webpack -> umd/) for
consistency across the repos, and verify browser usage end-to-end.

Build
- replace rollup with `tsc -p tsconfig.build.json` -> lib/index.js (CJS) + lib/index.d.ts
  (drops the rollup ESM/bundled output); main/types now point at lib/, worker.js is
  emitted to lib/worker.js (getWorkerPath fallback dist -> lib)
- add a webpack UMD browser bundle -> umd/template-engine.js (browser field), with node
  fallbacks (child_process/fs/os false, path/crypto/stream/buffer shims); no source map
  to keep the published package small
- re-export ModelManager and TemplateMarkTransformer so a single browser bundle can run
  the model -> template -> agreement flow with one concerto instance
- remove the now-redundant markdown `declare module` .d.ts shims (markdown 1.0.1 ships
  real types)

Tests / CI
- add an `e2e/` Playwright workspace that loads umd/template-engine.js into headless
  Chromium and exercises fromMarkdownTemplate + checkTypes (a full browser generate awaits
  the twoslash/webpack TS->JS compiler reconciliation)
- CI: build on Node.js 22 only across ubuntu/macos/windows (drop 20.x), add a Browser E2E
  (Chromium) job, keep code coverage
- publish includes only lib/ + umd/ (3.6MB packed)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: dselman <danscode@selman.org>
…c compilation)

The browser branch of TypeScriptToJavaScriptCompiler.initialize() dynamically imported
typescript from a CDN URL, which webpack cannot resolve in the UMD bundle
('Cannot find module https://...'). twoslash already pulls typescript into the bundle, so
the browser can use the bundled module directly.

This makes the full Playground browser loop work: parse -> type-check -> compile the
template's TypeScript logic to JS -> evaluate, all in the browser. The e2e now does a real
generate() in headless Chromium (regression guard) instead of only parse + checkTypes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: dselman <danscode@selman.org>
- README: add a Browser usage section (UMD bundle / `browser` field, the in-browser
  parse->type-check->compile->eval flow that powers Template Playground, the re-exported
  ModelManager/TemplateMarkTransformer, and the source- vs compiled-archive / Node-only
  caveats)
- bump engines.node to >=22 (required by markdown-transform / cicero-core 1.0.1)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: dselman <danscode@selman.org>
@dselman dselman changed the title feat: upgrade to markdown-transform 1.0.1 / cicero-core 1.0.1 feat!: markdown-transform 1.0.1 / cicero-core 1.0.1, tsc+webpack build, browser support Jun 4, 2026
@dselman
Copy link
Copy Markdown
Contributor Author

dselman commented Jun 4, 2026

Do you have a migration guide for the docs site?

Not yet. Cicero version in template archives will need to be bumped to 1.0.0.

@dselman dselman merged commit 7667cbe into main Jun 4, 2026
9 checks passed
@dselman dselman deleted the ds-markdown-transform-1.0.1 branch June 4, 2026 09:17
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.

3 participants