@hia-doc/dotnetdoc-runner 0.1.2 → 0.1.3

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 CHANGED
@@ -1,8 +1,12 @@
1
1
  # @hia-doc/dotnetdoc-runner
2
2
 
3
3
  Standalone runner and CLI for compiler-generated .NET XML documentation files,
4
- C# source inputs, ASP.NET endpoint surface inputs and `.sln`/`.csproj`
5
- structure discovery.
4
+ C# source inputs, ASP.NET endpoint surface inputs, ASP.NET/Razor markup comment
5
+ inputs and `.sln`/`.csproj` structure discovery.
6
+
7
+ DotNetDoc 独立 runner 与 CLI,支持编译器 XML documentation、C# 源码、
8
+ ASP.NET endpoint surface、ASP.NET/Razor 标记层注释,以及 `.sln`/`.csproj`
9
+ 结构发现。
6
10
 
7
11
  ```sh
8
12
  hia-dotnetdoc --config dotnetdoc.config.json
@@ -11,3 +15,10 @@ hia-dotnetdoc --config dotnetdoc.config.json
11
15
  This package emits DotNetDoc extraction artifacts, HIA document artifacts,
12
16
  optional source relation artifacts, ASP.NET endpoint extraction artifacts and a
13
17
  documentation producer result manifest without embedding private source text.
18
+
19
+ `dotnet-markup-comments` inputs emit `dotnetdoc-markup-comment-extraction` and
20
+ matching HIA document artifacts for `.aspx`, `.ascx`, `.cshtml` and `.razor`
21
+ files.
22
+
23
+ `dotnet-markup-comments` input 会为 `.aspx`、`.ascx`、`.cshtml`、`.razor`
24
+ 文件输出 `dotnetdoc-markup-comment-extraction` 与对应 HIA document。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hia-doc/dotnetdoc-runner",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Standalone .NET XML documentation runner and CLI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,9 +36,9 @@
36
36
  "LICENSE"
37
37
  ],
38
38
  "dependencies": {
39
- "@hia-doc/dotnet-source-extractor": "0.1.2",
40
- "@hia-doc/dotnet-xml-doc-extractor": "0.1.2",
41
- "@hia-doc/dotnetdoc-adapter": "0.1.2",
42
- "@hia-doc/dotnetdoc-spec": "0.1.2"
39
+ "@hia-doc/dotnet-source-extractor": "0.1.3",
40
+ "@hia-doc/dotnet-xml-doc-extractor": "0.1.3",
41
+ "@hia-doc/dotnetdoc-adapter": "0.1.3",
42
+ "@hia-doc/dotnetdoc-spec": "0.1.3"
43
43
  }
44
44
  }
package/src/index.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  import { readFile, mkdir, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
 
4
- import { extractAspNetEndpoints, extractDotnetProjectDiscovery, extractDotnetSourceFiles } from "@hia-doc/dotnet-source-extractor";
4
+ import { extractAspNetEndpoints, extractDotnetMarkupComments, extractDotnetProjectDiscovery, extractDotnetSourceFiles } from "@hia-doc/dotnet-source-extractor";
5
5
  import { extractDotnetXmlDocs } from "@hia-doc/dotnet-xml-doc-extractor";
6
- import { dotnetAspNetEndpointsToHiaDocument, dotnetProjectDiscoveryToHiaDocument, dotnetXmlDocsToHiaDocument } from "@hia-doc/dotnetdoc-adapter";
6
+ import { dotnetAspNetEndpointsToHiaDocument, dotnetMarkupCommentsToHiaDocument, dotnetProjectDiscoveryToHiaDocument, dotnetXmlDocsToHiaDocument } from "@hia-doc/dotnetdoc-adapter";
7
7
  import {
8
8
  DOTNETDOC_ASPNET_ENDPOINT_EXTRACTION_CONTRACT,
9
9
  DOTNETDOC_CSHARP_SOURCE_EXTRACTION_CONTRACT,
10
+ DOTNETDOC_MARKUP_COMMENT_EXTRACTION_CONTRACT,
10
11
  DOTNETDOC_PROJECT_DISCOVERY_CONTRACT,
11
12
  DOTNETDOC_SOURCE_RELATION_CONTRACT,
12
13
  DOTNETDOC_SOURCE_RELATION_CONTRACT_VERSION,
@@ -20,9 +21,9 @@ export {
20
21
  } from "./schema.mjs";
21
22
  import { DOTNETDOC_CONFIG_SCHEMA_ID, DOTNETDOC_CONFIG_SCHEMA_VERSION } from "./schema.mjs";
22
23
 
23
- export const DOTNETDOC_RUNNER_VERSION = "0.1.2";
24
- export const DOTNETDOC_INPUT_KINDS = Object.freeze(["dotnet-xml-doc", "dotnet-csharp-source", "dotnet-aspnet-surface", "dotnet-project"]);
25
- export const DOTNETDOC_OUTPUT_KINDS = Object.freeze(["dotnetdoc-extraction", "hia-document", "dotnetdoc-source-relation", "dotnetdoc-aspnet-endpoint-extraction", "dotnetdoc-project-discovery"]);
24
+ export const DOTNETDOC_RUNNER_VERSION = "0.1.3";
25
+ export const DOTNETDOC_INPUT_KINDS = Object.freeze(["dotnet-xml-doc", "dotnet-csharp-source", "dotnet-aspnet-surface", "dotnet-markup-comments", "dotnet-project"]);
26
+ export const DOTNETDOC_OUTPUT_KINDS = Object.freeze(["dotnetdoc-extraction", "hia-document", "dotnetdoc-source-relation", "dotnetdoc-aspnet-endpoint-extraction", "dotnetdoc-markup-comment-extraction", "dotnetdoc-project-discovery"]);
26
27
 
27
28
  const RESULT_CONTRACT = "documentation-producer-result";
28
29
  const RESULT_CONTRACT_VERSION = "0.1.0-draft";
@@ -204,21 +205,28 @@ async function processInput(input, request) {
204
205
  ? await processCSharpSourceInput(input, request)
205
206
  : input.kind === "dotnet-aspnet-surface"
206
207
  ? await processAspNetEndpointInput(input, request)
207
- : await processProjectDiscoveryInput(input, request);
208
+ : input.kind === "dotnet-markup-comments"
209
+ ? await processMarkupCommentInput(input, request)
210
+ : await processProjectDiscoveryInput(input, request);
208
211
  const hiaDocument = dotnetdoc.contract === DOTNETDOC_ASPNET_ENDPOINT_EXTRACTION_CONTRACT
209
212
  ? dotnetAspNetEndpointsToHiaDocument(dotnetdoc, {
210
213
  id: input.hiaDocumentId,
211
214
  title: input.title
212
215
  })
213
- : dotnetdoc.contract === DOTNETDOC_PROJECT_DISCOVERY_CONTRACT
214
- ? dotnetProjectDiscoveryToHiaDocument(dotnetdoc, {
216
+ : dotnetdoc.contract === DOTNETDOC_MARKUP_COMMENT_EXTRACTION_CONTRACT
217
+ ? dotnetMarkupCommentsToHiaDocument(dotnetdoc, {
215
218
  id: input.hiaDocumentId,
216
219
  title: input.title
217
220
  })
218
- : dotnetXmlDocsToHiaDocument(dotnetdoc, {
219
- id: input.hiaDocumentId,
220
- title: input.title
221
- });
221
+ : dotnetdoc.contract === DOTNETDOC_PROJECT_DISCOVERY_CONTRACT
222
+ ? dotnetProjectDiscoveryToHiaDocument(dotnetdoc, {
223
+ id: input.hiaDocumentId,
224
+ title: input.title
225
+ })
226
+ : dotnetXmlDocsToHiaDocument(dotnetdoc, {
227
+ id: input.hiaDocumentId,
228
+ title: input.title
229
+ });
222
230
 
223
231
  const dotnetdocPath = `${input.artifactBasePath}.dotnetdoc.json`;
224
232
  const hiaPath = `${input.artifactBasePath}.hia.json`;
@@ -427,6 +435,13 @@ async function processAspNetEndpointInput(input, request) {
427
435
  });
428
436
  }
429
437
 
438
+ async function processMarkupCommentInput(input, request) {
439
+ return extractDotnetMarkupComments({
440
+ workspaceRoot: request.workspaceRoot,
441
+ paths: [input.path]
442
+ });
443
+ }
444
+
430
445
  async function processProjectDiscoveryInput(input, request) {
431
446
  return extractDotnetProjectDiscovery({
432
447
  workspaceRoot: request.workspaceRoot,
@@ -473,7 +488,7 @@ function normalizeSafeRelativePath(value, label) {
473
488
  }
474
489
 
475
490
  function stripKnownInputExtension(value) {
476
- return value.replace(/\.(?:xml|cs|csproj|sln)$/i, "");
491
+ return value.replace(/\.(?:xml|cs|csproj|sln|aspx|ascx|master|cshtml|razor)$/i, "");
477
492
  }
478
493
 
479
494
  function safeArtifactId(value) {
package/src/schema.mjs CHANGED
@@ -32,7 +32,7 @@ export const DOTNETDOC_CONFIG_JSON_SCHEMA = Object.freeze({
32
32
  additionalProperties: false,
33
33
  required: ["kind", "path"],
34
34
  properties: {
35
- kind: { enum: ["dotnet-xml-doc", "dotnet-csharp-source", "dotnet-aspnet-surface", "dotnet-project"] },
35
+ kind: { enum: ["dotnet-xml-doc", "dotnet-csharp-source", "dotnet-aspnet-surface", "dotnet-markup-comments", "dotnet-project"] },
36
36
  path: relativePath,
37
37
  applicationRoot: relativePath,
38
38
  artifactBasePath: relativePath,