This document records the local procedure used to separate the historical
combined miku-docx2md repository into:
miku-docx2md: TypeScript / Node.js product core, CLI, CLI bundle, Web /
adapter runtime bundle, tests, and upstream contractmiku-docx2md-web: browser UI, Single-file Web App generation, lht-cmn,
browser adapters, browser tests, and Web release artifactsThe dependency direction is:
miku-docx2md-web -> miku-docx2md
Do not make the main application depend on the Web repository.
Confirm the two repositories before deleting files.
miku-docx2mdmiku-docx2md-web../miku-docx2md-web when presentmiku-docx2mdmiku-docx2md-webUse the Web repository as read-only context while cleaning the main application repository.
Before cleaning the main repository, make sure the Web repository already has the moved Web surface.
Expected Web-side ownership:
index-src.htmlindex.htmlmiku-docx2md-src.htmlmiku-docx2md.htmlsrc/ts/main.tssrc/ts/browser-zip.tssrc/ts/browser-assets-export.tssrc/css/lht-cmn/The Web README should record the upstream main application repository and the
local development link, such as file:../miku-docx2md or an equivalent
documented upstream path.
In miku-docx2md, remove Web-only files after the Web repository is ready.
Remove:
lht-cmn/Keep:
src/ts/ product core modulesAfter removing Web HTML generation, npm run build should only regenerate the
runtime JavaScript required by the Node runtime.
The main repository should not build index.html or miku-docx2md.html.
Recommended main-side build roles:
npm run build: transpile core TypeScript modules for Node runtime loadingnpm run build:bundle: generate CLI bundle under bundle/npm run build:runtime: generate Web / adapter runtime bundle under
bundle/npm run build:all: generate both release bundlesRelease workflow generated-file checks should match the remaining generated files. After Web separation, the main repository should not check Web HTML artifacts.
Generate a separate runtime artifact for Web and other adapter repositories.
bundle/miku-docx2md.mjs CLI bundle, Node CLI entrypoint
bundle/miku-docx2md-runtime.mjs Web / adapter runtime bundle
bundle/miku-docx2md-sources.tgz source archive
The runtime bundle should embed only the core modules from dist/js/. It
should not include CLI argument parsing, fs file I/O, process.exit, or other
CLI-only behavior.
The runtime bundle exports:
versionembeddedCorePathsloadDocx2mdRuntime(options?)loadDocx2mdRuntimeloadDocx2mdRuntime() returns the core docx2md API from the module registry.
Adapters such as miku-docx2md-web can call this runtime API instead of
reading private src/ts files or duplicating core module order.
Expected runtime-bundle use from the Web repository:
miku-docx2md-runtime-<version>.mjs release
asset for reproducible Web builds.The separated miku-docx2md-web repository now uses a vendored upstream
runtime release asset as its normal product-core dependency.
Current recorded boundary:
miku-docx2md-web version: 1.0.0miku-docx2md GitHub Release v1.0.0vendor/miku-docx2md-runtime.mjsvendor/miku-docx2md-runtime.jsonmiku-docx2md-runtime-1.0.0.mjsThe Web repository no longer needs a file:../miku-docx2md package dependency
or DOCX2MD_UPSTREAM_ROOT for normal builds. Its normal dependency direction
is now:
miku-docx2md-web -> miku-docx2md GitHub Release runtime asset
The Web repository owns browser UI, browser adapters, browser tests, and Single-file Web App distribution. Product conversion semantics, diagnostics, asset manifest behavior, and Markdown rendering remain owned by this main application repository.
Update main repository documents so they no longer present browser UI behavior as main-repository-owned behavior.
Update at least:
README.mddocs/usage.mddocs/quality-check.mddocs/docx2md-impl-spec.mddocs/docx2md-spec.mdTODO.md when it tracks migration workThe docs should say that browser UI and Single-file Web App artifacts are owned
by miku-docx2md-web.
After Web separation, src/js/ is no longer Web distribution source. Move it
out of source control by making the runtime loader and bundle builder read from
a generated directory instead.
Current generated runtime shape:
src/ts/ source of truth
dist/js/ generated runtime JavaScript, ignored by Git
bundle/ generated CLI bundle artifacts, ignored by Git
Required steps:
scripts/lib/docx2md-module-order.mjs from src/js/... paths to
dist/js/... paths.src/ts/....scripts/build-miku-docx2md.mjs so it writes transpiled output to
dist/js/.scripts/lib/docx2md-node-runtime.mjs and
scripts/build-cli-bundle.mjs so they read generated runtime modules from
dist/js/.dist/ to .gitignore if it is not already ignored.src/js/*.js files from Git.src/js/ to dist/js/.dist/ is ignored
and regenerated in CI, use a generated-file existence check instead of a Git
diff check for generated JS.scripts/build-runtime-bundle.mjs to generate
bundle/miku-docx2md-runtime.mjs from dist/js/.bundle/miku-docx2md-runtime.mjs
and converts a representative DOCX fixture through the runtime API.This follow-up is now the intended main-repository shape. Confirm the CLI, tests, and bundle builder all use the generated runtime directory consistently.
Run main-side verification after cleanup:
npm install
npm run build
npm run test:unit
npm run build:bundle
npm run build:runtime
npm run smoke:bundle
npm run smoke:runtime
npm run smoke:version
npx tsc --noEmit
git diff --check
git status --short
If node_modules/ was removed locally, npm run build can fail because the
build script imports typescript. Run npm install before build verification.