@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.
Files changed (83) hide show
  1. package/README.md +23 -2
  2. package/README_ja.md +23 -2
  3. package/dist/build/build.d.ts +2 -0
  4. package/dist/build/buildDependencyGraph.d.ts +22 -0
  5. package/dist/build/collectDependencies.d.ts +8 -0
  6. package/dist/build/collectEntryPaths.d.ts +10 -0
  7. package/dist/build/isUnderscorePartial.d.ts +4 -0
  8. package/dist/cli.js +5587 -0
  9. package/dist/client.js +1022 -895
  10. package/dist/component/ComponentRegistry.d.ts +11 -0
  11. package/dist/component/parsePropsContract.d.ts +10 -0
  12. package/dist/component/renderComponent.d.ts +17 -0
  13. package/dist/component/validateProps.d.ts +7 -0
  14. package/dist/config/defineConfig.d.ts +5 -0
  15. package/dist/config/index.d.ts +3 -0
  16. package/dist/config/index.js +143 -0
  17. package/dist/config/loadConfig.d.ts +13 -0
  18. package/dist/config/types.d.ts +26 -0
  19. package/dist/context/mergeContext.d.ts +3 -0
  20. package/dist/control/StructureNestTracker.d.ts +14 -0
  21. package/dist/control/expandControlStructures.d.ts +3 -0
  22. package/dist/control/parseControlOpener.d.ts +2 -0
  23. package/dist/control/parseControlStructures.d.ts +2 -0
  24. package/dist/createError-WZmAl05N.js +30 -0
  25. package/dist/errors/createError.d.ts +7 -0
  26. package/dist/errors/formatDiagnosticLog.d.ts +6 -0
  27. package/dist/errors/formatMessage.d.ts +3 -0
  28. package/dist/expr/evaluateExpression.d.ts +4 -0
  29. package/dist/expr/interpolateExpressions.d.ts +4 -0
  30. package/dist/expr/parseExpression.d.ts +4 -0
  31. package/dist/frontmatter/parseFrontMatter.d.ts +3 -0
  32. package/dist/include/VisitStack.d.ts +13 -0
  33. package/dist/include/expandIncludes.d.ts +18 -0
  34. package/dist/index.d.ts +11 -113
  35. package/dist/index.js +753 -625
  36. package/dist/io/createFsLoader.d.ts +6 -0
  37. package/dist/io/createNodeLoader.d.ts +4 -0
  38. package/dist/io/isRemotePath.d.ts +2 -0
  39. package/dist/io/loadDataSources.d.ts +8 -0
  40. package/dist/io/parseCsvFromString.d.ts +1 -0
  41. package/dist/io/parseDataFile.d.ts +1 -0
  42. package/dist/io/resolveIncludePath.d.ts +1 -0
  43. package/dist/layout/expandExtendsAndBlocks.d.ts +19 -0
  44. package/dist/layout/parseBlockOpener.d.ts +8 -0
  45. package/dist/layout/parseBlockStructures.d.ts +15 -0
  46. package/dist/layout/parseExtendBlock.d.ts +12 -0
  47. package/dist/layout/parseExtendDirective.d.ts +5 -0
  48. package/dist/logic/executeDeclaration.d.ts +6 -0
  49. package/dist/logic/executeDeclarations.d.ts +6 -0
  50. package/dist/logic/executeStatement.d.ts +10 -0
  51. package/dist/logic/hgBlockUtils.d.ts +3 -0
  52. package/dist/logic/parseDeclaration.d.ts +5 -0
  53. package/dist/logic/parseStatement.d.ts +3 -0
  54. package/dist/logic/reservedWords.d.ts +2 -0
  55. package/dist/logic/stripComments.d.ts +2 -0
  56. package/dist/markdown/shiftHeadings.d.ts +25 -0
  57. package/dist/parse/hgMarkers.d.ts +5 -0
  58. package/dist/parse/parseComponentDirective.d.ts +6 -0
  59. package/dist/parse/parseIncludeDirective.d.ts +2 -0
  60. package/dist/parse/scanHgBlocks.d.ts +10 -0
  61. package/dist/paths/assertWithinRootDir.d.ts +2 -0
  62. package/dist/paths/findDocRoot.d.ts +1 -0
  63. package/dist/paths/resolveRenderInput.d.ts +11 -0
  64. package/dist/paths/resolveTemplatePath.d.ts +9 -0
  65. package/dist/pipeline/applyFrontMatterOutputOption.d.ts +4 -0
  66. package/dist/pipeline/executeHgBlocks.d.ts +9 -0
  67. package/dist/pipeline/joinRemovalSeam.d.ts +12 -0
  68. package/dist/pipeline/renderDocument.d.ts +22 -0
  69. package/dist/pipeline/stripHgComments.d.ts +7 -0
  70. package/dist/renderClient.d.ts +15 -0
  71. package/dist/renderServer.d.ts +4 -0
  72. package/dist/security/forbiddenKeys.d.ts +3 -0
  73. package/dist/security/scanSuspiciousContext.d.ts +6 -0
  74. package/dist/shims/fs-browser.d.ts +6 -0
  75. package/dist/shims/fs-promises-browser.d.ts +5 -0
  76. package/dist/toc/expandToc.d.ts +8 -0
  77. package/dist/toc/extractHeadings.d.ts +10 -0
  78. package/dist/toc/formatTocMarkdown.d.ts +7 -0
  79. package/dist/toc/githubHeadingSlug.d.ts +11 -0
  80. package/dist/toc/parseTocDirective.d.ts +10 -0
  81. package/dist/toc/plainifyHeadingText.d.ts +2 -0
  82. package/dist/types.d.ts +211 -0
  83. 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.10.0`** (git tag `v0.10.0`).
143
+ Published: **`@b4moss/hyogen-md@0.13.0`** (git tag `v0.13.0`).
123
144
 
124
- Playground UX is part of the **v0.10.0** product milestone but is **not** included in the npm tarball.
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.10.0`**(git tag `v0.10.0`)。
143
+ 公開済み: **`@b4moss/hyogen-md@0.13.0`**(git tag `v0.13.0`)。
123
144
 
124
- Playground UX は **v0.10.0** マイルストーンに含まれますが、**npm の tarball には入りません**。
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,2 @@
1
+ import { BuildOptions, BuildResult } from '../types.js';
2
+ export declare function build(options: BuildOptions): Promise<BuildResult>;
@@ -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[]>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * True when the basename starts with `_`, or any directory segment starts with `_`.
3
+ */
4
+ export declare function isUnderscorePartial(filePath: string): boolean;