@b4moss/hyogen-md 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -2
- package/README_ja.md +23 -2
- package/dist/build/build.d.ts +2 -0
- package/dist/build/buildDependencyGraph.d.ts +22 -0
- package/dist/build/collectDependencies.d.ts +8 -0
- package/dist/build/collectEntryPaths.d.ts +10 -0
- package/dist/build/isUnderscorePartial.d.ts +4 -0
- package/dist/cli.js +5587 -0
- package/dist/client.js +1022 -895
- package/dist/component/ComponentRegistry.d.ts +11 -0
- package/dist/component/parsePropsContract.d.ts +10 -0
- package/dist/component/renderComponent.d.ts +17 -0
- package/dist/component/validateProps.d.ts +7 -0
- package/dist/config/defineConfig.d.ts +5 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +143 -0
- package/dist/config/loadConfig.d.ts +13 -0
- package/dist/config/types.d.ts +26 -0
- package/dist/context/mergeContext.d.ts +3 -0
- package/dist/control/StructureNestTracker.d.ts +14 -0
- package/dist/control/expandControlStructures.d.ts +3 -0
- package/dist/control/parseControlOpener.d.ts +2 -0
- package/dist/control/parseControlStructures.d.ts +2 -0
- package/dist/createError-WZmAl05N.js +30 -0
- package/dist/errors/createError.d.ts +7 -0
- package/dist/errors/formatDiagnosticLog.d.ts +6 -0
- package/dist/errors/formatMessage.d.ts +3 -0
- package/dist/expr/evaluateExpression.d.ts +4 -0
- package/dist/expr/interpolateExpressions.d.ts +4 -0
- package/dist/expr/parseExpression.d.ts +4 -0
- package/dist/frontmatter/parseFrontMatter.d.ts +3 -0
- package/dist/include/VisitStack.d.ts +13 -0
- package/dist/include/expandIncludes.d.ts +18 -0
- package/dist/index.d.ts +11 -113
- package/dist/index.js +753 -625
- package/dist/io/createFsLoader.d.ts +6 -0
- package/dist/io/createNodeLoader.d.ts +4 -0
- package/dist/io/isRemotePath.d.ts +2 -0
- package/dist/io/loadDataSources.d.ts +8 -0
- package/dist/io/parseCsvFromString.d.ts +1 -0
- package/dist/io/parseDataFile.d.ts +1 -0
- package/dist/io/resolveIncludePath.d.ts +1 -0
- package/dist/layout/expandExtendsAndBlocks.d.ts +19 -0
- package/dist/layout/parseBlockOpener.d.ts +8 -0
- package/dist/layout/parseBlockStructures.d.ts +15 -0
- package/dist/layout/parseExtendBlock.d.ts +12 -0
- package/dist/layout/parseExtendDirective.d.ts +5 -0
- package/dist/logic/executeDeclaration.d.ts +6 -0
- package/dist/logic/executeDeclarations.d.ts +6 -0
- package/dist/logic/executeStatement.d.ts +10 -0
- package/dist/logic/hgBlockUtils.d.ts +3 -0
- package/dist/logic/parseDeclaration.d.ts +5 -0
- package/dist/logic/parseStatement.d.ts +3 -0
- package/dist/logic/reservedWords.d.ts +2 -0
- package/dist/logic/stripComments.d.ts +2 -0
- package/dist/markdown/shiftHeadings.d.ts +25 -0
- package/dist/parse/hgMarkers.d.ts +5 -0
- package/dist/parse/parseComponentDirective.d.ts +6 -0
- package/dist/parse/parseIncludeDirective.d.ts +2 -0
- package/dist/parse/scanHgBlocks.d.ts +10 -0
- package/dist/paths/assertWithinRootDir.d.ts +2 -0
- package/dist/paths/findDocRoot.d.ts +1 -0
- package/dist/paths/resolveRenderInput.d.ts +11 -0
- package/dist/paths/resolveTemplatePath.d.ts +9 -0
- package/dist/pipeline/applyFrontMatterOutputOption.d.ts +4 -0
- package/dist/pipeline/executeHgBlocks.d.ts +9 -0
- package/dist/pipeline/joinRemovalSeam.d.ts +12 -0
- package/dist/pipeline/renderDocument.d.ts +22 -0
- package/dist/pipeline/stripHgComments.d.ts +7 -0
- package/dist/renderClient.d.ts +15 -0
- package/dist/renderServer.d.ts +4 -0
- package/dist/security/forbiddenKeys.d.ts +3 -0
- package/dist/security/scanSuspiciousContext.d.ts +6 -0
- package/dist/shims/fs-browser.d.ts +6 -0
- package/dist/shims/fs-promises-browser.d.ts +5 -0
- package/dist/toc/expandToc.d.ts +8 -0
- package/dist/toc/extractHeadings.d.ts +10 -0
- package/dist/toc/formatTocMarkdown.d.ts +7 -0
- package/dist/toc/githubHeadingSlug.d.ts +11 -0
- package/dist/toc/parseTocDirective.d.ts +10 -0
- package/dist/toc/plainifyHeadingText.d.ts +2 -0
- package/dist/types.d.ts +211 -0
- package/package.json +17 -4
package/README.md
CHANGED
|
@@ -40,6 +40,27 @@ Requires **Node.js >= 24**.
|
|
|
40
40
|
|
|
41
41
|
## Quick start
|
|
42
42
|
|
|
43
|
+
### CLI (`hyogen-md`)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx hyogen-md create my-site
|
|
47
|
+
cd my-site
|
|
48
|
+
npm install
|
|
49
|
+
npm run dev # preview with file tree + HMR (default http://127.0.0.1:4173)
|
|
50
|
+
npm run build # write Markdown to outDir (default ./out)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`hyogen.config.js` (or `.ts`):
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { defineConfig } from "@b4moss/hyogen-md/config";
|
|
57
|
+
|
|
58
|
+
export default defineConfig({
|
|
59
|
+
input: "./src/**/*.md",
|
|
60
|
+
// outDir: "./out",
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
43
64
|
### Client / CSR (`@b4moss/hyogen-md/client`)
|
|
44
65
|
|
|
45
66
|
```ts
|
|
@@ -119,9 +140,9 @@ Open `http://localhost:3000` (docs) and `/playground`. Uses `../app` via Vite al
|
|
|
119
140
|
## Status
|
|
120
141
|
|
|
121
142
|
This is **0.x**. APIs and output may change until `1.0.0`.
|
|
122
|
-
Published: **`@b4moss/hyogen-md@0.
|
|
143
|
+
Published: **`@b4moss/hyogen-md@0.13.0`** (git tag `v0.13.0`).
|
|
123
144
|
|
|
124
|
-
Playground UX
|
|
145
|
+
Playground UX ships with the documentation site and is **not** included in the npm tarball.
|
|
125
146
|
|
|
126
147
|
The coverage badge reflects approximate **statement coverage for `app/`** (library) from Vitest (~84%). Initial release goal is ≥50%. Coverage is uploaded to Codecov from `.github/workflows/quality.yml` on pushes to `main`.
|
|
127
148
|
|
package/README_ja.md
CHANGED
|
@@ -40,6 +40,27 @@ npm install @b4moss/hyogen-md
|
|
|
40
40
|
|
|
41
41
|
## クイックスタート
|
|
42
42
|
|
|
43
|
+
### CLI(`hyogen-md`)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx hyogen-md create my-site
|
|
47
|
+
cd my-site
|
|
48
|
+
npm install
|
|
49
|
+
npm run dev # ファイルツリー + HMR プレビュー(既定 http://127.0.0.1:4173)
|
|
50
|
+
npm run build # Markdown を outDir へ出力(既定 ./out)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`hyogen.config.js`(または `.ts`):
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { defineConfig } from "@b4moss/hyogen-md/config";
|
|
57
|
+
|
|
58
|
+
export default defineConfig({
|
|
59
|
+
input: "./src/**/*.md",
|
|
60
|
+
// outDir: "./out",
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
43
64
|
### クライアント / CSR(`@b4moss/hyogen-md/client`)
|
|
44
65
|
|
|
45
66
|
```ts
|
|
@@ -119,9 +140,9 @@ make dev-docs
|
|
|
119
140
|
## ステータス
|
|
120
141
|
|
|
121
142
|
**0.x** です。`1.0.0` まで API・出力は変わりえます。
|
|
122
|
-
公開済み: **`@b4moss/hyogen-md@0.
|
|
143
|
+
公開済み: **`@b4moss/hyogen-md@0.13.0`**(git tag `v0.13.0`)。
|
|
123
144
|
|
|
124
|
-
Playground UX
|
|
145
|
+
Playground UX はドキュメントサイトに含まれ、**npm の tarball には入りません**。
|
|
125
146
|
|
|
126
147
|
coverage バッジはライブラリ(`app/`)の Vitest **statement カバレッジ概算(約 84%)**です。初期リリース目標は 50% 以上。カバレッジは `main` への push 時に `.github/workflows/quality.yml` から Codecov へアップロードされます。
|
|
127
148
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Loader } from '../types.js';
|
|
2
|
+
import { DependencyRef } from './collectDependencies.js';
|
|
3
|
+
export type DependencyEdge = {
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
kind: DependencyRef["kind"];
|
|
7
|
+
};
|
|
8
|
+
export type DependencyGraph = {
|
|
9
|
+
entries: string[];
|
|
10
|
+
dependencies: string[];
|
|
11
|
+
nodes: string[];
|
|
12
|
+
edges: DependencyEdge[];
|
|
13
|
+
};
|
|
14
|
+
export type BuildDependencyGraphOptions = {
|
|
15
|
+
root?: string;
|
|
16
|
+
constrainToRoot?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Walk entries BFS collecting include/component/extend dependencies.
|
|
20
|
+
* Missing deps throw via loader (`file_not_found`).
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildDependencyGraph(entries: string[], loader: Loader, options?: BuildDependencyGraphOptions): Promise<DependencyGraph>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type DependencyRef = {
|
|
2
|
+
kind: "include" | "component" | "extend";
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Statically collect include / component / extend paths from a source string.
|
|
7
|
+
*/
|
|
8
|
+
export declare function collectDependencies(source: string, fromPath?: string): DependencyRef[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CollectEntryPathsOptions = {
|
|
2
|
+
root?: string;
|
|
3
|
+
includeUnderscoreEntries?: boolean;
|
|
4
|
+
cwd?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Expand input paths/globs and apply `_` partial filtering.
|
|
8
|
+
* Duplicate relative paths: last wins (no warning).
|
|
9
|
+
*/
|
|
10
|
+
export declare function collectEntryPaths(input: string | string[], options?: CollectEntryPathsOptions): Promise<string[]>;
|