tazuna 0.15.0 → 0.16.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/dist/cli.js CHANGED
File without changes
@@ -469,6 +469,7 @@ export function packCommand(argv) {
469
469
  plan,
470
470
  procedure,
471
471
  instruction,
472
+ ...(output.environmentBlock === undefined ? {} : { environment: output.environmentBlock }),
472
473
  ...(docsTail === undefined ? {} : { docs: docsTail }),
473
474
  ...(dbSchema === undefined
474
475
  ? {}
@@ -55,9 +55,22 @@
55
55
  * (操作と期待する DB の変化を checks/*.verify.md で出させ、ユーザーが ashiato verify で
56
56
  * 手順どおりに操作して、照合の結果を貼る)を足す。有効になる条件は v8 と同じ
57
57
  * (docs/db/schema.md の有無)。無いときの本文は v8 と同じ(版数の行だけ)。
58
+ *
59
+ * v10 (2026-11-02、手順文の見直し 2026-10-26 と コメント方針の試行 2026-10-28):
60
+ * - 「コード中のコメント」の節を足す(なぜだけを書く、変更の経緯・日付・担当者は changes.md の
61
+ * 概要へ、古いコードをコメントアウトで残さない、既存の修正履歴のコメントを手本にしない、
62
+ * 変更する範囲の食い違うコメントは直す)。v9 は「既存コードの流儀に合わせる」だけで、
63
+ * レガシーの「2019/09/20 鈴木 MOD START」形式を AI が真似ていた(検証の記録は設計書 §17)
64
+ * - solution 構成の型の規則を、パックの <environment>(.vbproj から読んだ Visual Basic と
65
+ * .NET Framework の版・Option・参照。services/environmentSummary.ts)に従わせる。
66
+ * 「Option Strict On を前提に」の決め打ちをやめる
67
+ * - 自己検証の表の「空行・インデント込みで逐語一致か」の列を「呼んでいる既存のメソッド・
68
+ * プロパティ・コントロール・列がパック内にあるか」に替える(添付の読み取りでは空行が
69
+ * 見えず確かめようがない。照合の空白・空行の差は適用ツールが吸収する)。方針の段にも
70
+ * 同じ確かめを置く(changes.md を出す前に直せるように)。コメントと環境の確認を自己検証に足す
58
71
  */
59
72
  import { PACK_COMMAND, TOOL_NAME } from "../../brand.js";
60
- export const PROCEDURE_VERSION = 9;
73
+ export const PROCEDURE_VERSION = 10;
61
74
  /** 構成の種類(設定ファイルの kind と同じ。手順文の表現の切り替えに使う) */
62
75
  export const PROCEDURE_LAYOUTS = ["solution", "generic"];
63
76
  export const DEFAULT_PROCEDURE_LAYOUT = "solution";
@@ -93,24 +106,35 @@ export const PROCEDURE_TEMPLATE = `<!-- ${TOOL_NAME} procedure v${PROCEDURE_VERS
93
106
  ## 判断の原則
94
107
 
95
108
  - 分からないことは推測で埋めず、質問してください。特に{{LAYOUT:ASK_EXAMPLES}}が読み取れないときは、変更を出さずに質問だけで回答を終えてください
96
- - 既存コードの流儀(命名・エラー処理・DB アクセスの書き方)に合わせてください。パック内に同種の処理があれば、それを手本にしてください
109
+ - 既存コードの流儀(命名・エラー処理・DB アクセスの書き方)に合わせてください。パック内に同種の処理があれば、それを手本にしてください。ただしコメントは次の「コード中のコメント」に従います
97
110
  {{LAYOUT:TYPE_RULE}}
98
111
  - 影響範囲は最小にしてください。求められていないリファクタリングはしないでください
112
+
113
+ ## コード中のコメント
114
+
115
+ - コメントには「なぜそうするか」(業務上の決まり、外部の仕様や制約、回避策の理由)だけを書いてください。コードを読めば分かる「何をしているか」は書かないでください
116
+ - 変更の経緯(追加・修正・削除した旨、日付、担当者、「〜に変更」など)はコードに書かず、changes.md の CHANGES の概要に書いてください。変更の履歴は git に残ります
117
+ - 古いコードをコメントアウトして残さないでください。不要になったコードは削除します
118
+ - 既存コードにある修正履歴のコメント(日付・担当者・START / END の印など)は、書き方の手本にしないでください
119
+ - 今回変更する範囲にあるコメントが、変更後のコードと食い違う、または不要になった場合は、同じ変更で直すか削除してください。変更する範囲の外のコメントには触れないでください
99
120
  {{DOCS_SECTIONS}}{{TEST_SECTIONS}}{{DB_SECTIONS}}`;
100
121
  // ---- 「回答の構成」の部品。モードごとに番号を振って組み立てる ----
101
122
  const INVESTIGATE_BODY = `読んだファイルと、関係するシンボル(クラス・メソッド・コントロール名)を箇条書きで挙げてください。
102
123
  変更対象の処理がどこから呼ばれ、何を呼ぶかを 1〜3 行で述べてください。`;
103
124
  const POLICY_BODY_COMMON = `何をどう変えるかを述べてください。検討して採らなかった案があれば理由とともに 1 行で。
104
- リスク(既存動作への影響、未確認の前提)を挙げてください。`;
125
+ リスク(既存動作への影響、未確認の前提)を挙げてください。
126
+ 変更で呼ぶ既存のメソッド・プロパティ・コントロール・列は、パック内で定義を確かめたものだけにしてください。見つからないものは推測で呼ばず、質問してください。`;
105
127
  const CHANGES_BODY = `<instruction> の規約どおり changes.md を出してください。`;
106
128
  const VERIFY_HEAD = `changes.md の SEARCH ブロックごとに、次を表で確認してください。
107
- | ファイル | ブロック | パック内に全文があるか | 空行・インデント込みで逐語一致か | ファイル内で一意か |
129
+ | ファイル | ブロック | パック内に全文があるか | ファイル内で一意か | 呼んでいる既存のメソッド・プロパティ・コントロール・列がパック内にあるか |
108
130
  加えて次を確認してください。
109
- - 同じファイルへの SEARCH ブロック同士が重なっていない`;
131
+ - 同じファイルへの SEARCH ブロック同士が重なっていない
132
+ - 追加・変更したコメントに、変更の経緯(日付・担当者・「追加」「修正」など)やコメントアウトした古いコードが入っていない`;
110
133
  const VERIFY_TAIL = `問題があれば changes.md を修正してから回答を確定してください。`;
111
- /** 自己検証の確認項目のうち構成の種類で変わる行(solution は v6 と同一) */
134
+ /** 自己検証の確認項目のうち構成の種類で変わる行 */
112
135
  const VERIFY_LAYOUT_LINES = {
113
136
  solution: [
137
+ "- <environment> の Visual Basic と .NET Framework の版で使えない構文・API を使っていない",
114
138
  "- Handles 句のイベント名・コントロール名が <ui_summary> と一致している",
115
139
  "- Designer.vb / .resx / Generated / src/generated を変更していない",
116
140
  "- 新規ファイルは create で出し、.vbproj を編集していない",
@@ -124,11 +148,12 @@ const VERIFY_LAYOUT_LINES = {
124
148
  function verifyBody(layout) {
125
149
  return [VERIFY_HEAD, ...VERIFY_LAYOUT_LINES[layout], VERIFY_TAIL].join("\n");
126
150
  }
127
- /** 後方互換: solution 構成の自己検証本文(v6 と同一) */
151
+ /** 後方互換: solution 構成の自己検証本文 */
128
152
  const VERIFY_BODY = verifyBody("solution");
129
153
  /**
130
154
  * 構成の種類で差し替える語句・行({{LAYOUT:<名前>}})。行ごと消える項目は
131
- * 末尾の改行まで含めて置換する(READ_UI_SUMMARY)。solution は v6 の文面そのまま。
155
+ * 末尾の改行まで含めて置換する(READ_UI_SUMMARY)。solution の TYPE_RULE は v10 で
156
+ * <environment> を参照する 2 行に変えた(それ以外は v6 の文面そのまま)。
132
157
  */
133
158
  export const LAYOUT_TEXT = {
134
159
  solution: {
@@ -137,7 +162,7 @@ export const LAYOUT_TEXT = {
137
162
  READ_UI_SUMMARY: "- <ui_summary> は Designer.vb からの要約です。コントロール名・型はここから引いてください。Designer.vb 本体は変更対象にしません\n",
138
163
  READ_NEW_FILES: "- 新規ファイルは changes.md の create で出してください。.vbproj は編集しないでください(適用ツールが登録します)。パスは <file_summary> に示す物理パスの規則で書いてください",
139
164
  ASK_EXAMPLES: "「どのフォームか」「既存のどの処理に合わせるか」「例外時の挙動」",
140
- TYPE_RULE: "- Option Strict On を前提に、型変換は明示してください",
165
+ TYPE_RULE: "- 構文と API は、<environment> に書かれた Visual Basic と .NET Framework の版で使えるものだけにしてください(新しい Visual Studio でビルドしていても、古い構文は通ります)。パック内の既存コードで使われている構文は使って構いません\n- Option Strict が Off のプロジェクトでも、型変換は明示してください",
141
166
  },
142
167
  generic: {
143
168
  NOTE: ", layout: generic",
@@ -249,6 +249,10 @@ export function buildPromptText(tail, packFileName) {
249
249
  "添付内の <file> の内容を現在のコードとして正に扱ってください。",
250
250
  ];
251
251
  let content = "";
252
+ if (tail.environment !== undefined) {
253
+ header.push("続く <environment> は .vbproj から読み取ったビルド環境です(添付にも同じものがあります)。");
254
+ content = appendRawBlock(content, `${tail.environment}\n`);
255
+ }
252
256
  if (tail.docs !== undefined) {
253
257
  const docs = promptDocs(tail.docs.docs, tail.docs.decision);
254
258
  const kinds = promptTemplateKinds(tail.docs.decision.mode);
@@ -0,0 +1,154 @@
1
+ /**
2
+ * .vbproj のビルド環境の要約(<environment>。手順文 v10、2026-11-02)。
3
+ *
4
+ * パックには .vbproj 本体が入らないため、AI には Visual Basic の言語の版・.NET Framework の版・
5
+ * Option の設定・参照が見えなかった。VS2013 世代(Visual Basic 12.0)では文字列補間 $"..."・
6
+ * NameOf・?. がビルドエラーになるのに、手順文は「Option Strict On を前提に」と決め打ちだった
7
+ * (2026-10-26 の手順文の見直しの改善候補 1、設計書 §25.7)。
8
+ *
9
+ * 値は静的に読んだもの(parseVbproj の environment)をそのまま載せる。言語の版の指定
10
+ * (LangVersion)が無い旧スタイルのプロジェクトだけは、ToolsVersion の Visual Studio の既定の版と
11
+ * 「みなす」と明記して上限を書く(推測したことを宣言する。原則 3)。新しい Visual Studio で
12
+ * ビルドしていても古い構文は通るため、低い方に倒して困ることはない。
13
+ *
14
+ * 純粋関数。I/O なし。
15
+ */
16
+ /** ToolsVersion → その形式を作る Visual Studio と、その既定の Visual Basic の版 */
17
+ const TOOLS_VERSIONS = {
18
+ "2.0": { studio: "Visual Studio 2005", vb: 8 },
19
+ "3.5": { studio: "Visual Studio 2008", vb: 9 },
20
+ "4.0": { studio: "Visual Studio 2010 / 2012", vb: 10, note: "古い方の Visual Studio 2010" },
21
+ "12.0": { studio: "Visual Studio 2013", vb: 12 },
22
+ "14.0": { studio: "Visual Studio 2015", vb: 14 },
23
+ "15.0": { studio: "Visual Studio 2017", vb: 15 },
24
+ current: { studio: "Visual Studio 2019 以降", vb: 16 },
25
+ };
26
+ /** 版ごとに増えた主な構文(上限より新しいものを「使えない」として挙げる。15.0 より後は細かいので載せない) */
27
+ const VB_FEATURES = [
28
+ { vb: 9, features: ["LINQ", "ラムダ式", "If 演算子", "Option Infer の型推論"] },
29
+ { vb: 10, features: ["自動実装プロパティ", "コレクション初期化子 From", "暗黙の行継続", "複数行のラムダ・Sub ラムダ"] },
30
+ { vb: 11, features: ["Async / Await", "Iterator / Yield"] },
31
+ {
32
+ vb: 14,
33
+ features: [
34
+ '文字列補間 $"..."',
35
+ "NameOf",
36
+ "Null 条件演算子 ?.",
37
+ "複数行の文字列リテラル",
38
+ "ReadOnly 自動実装プロパティ",
39
+ ],
40
+ },
41
+ { vb: 15, features: ["タプル", "2 進数リテラル &B"] },
42
+ ];
43
+ /** 参照・Imports を並べる上限(超えた分は件数だけ) */
44
+ const LIST_LIMIT = 40;
45
+ function formatVersion(vb) {
46
+ return Number.isInteger(vb) ? `${vb}.0` : String(vb);
47
+ }
48
+ /** 上限より新しい版の構文を「14.0 以降の …、15.0 以降の …」の形で */
49
+ function unavailableFeatures(limit) {
50
+ const parts = VB_FEATURES.filter((entry) => entry.vb > limit).map((entry) => {
51
+ const features = entry.features.join("・");
52
+ // 英数字で始まるときは和文との間を空ける(「11.0 以降の Async」)
53
+ return `${formatVersion(entry.vb)} 以降の${/^[\x21-\x7e]/.test(features) ? " " : ""}${features}`;
54
+ });
55
+ return parts.length === 0 ? undefined : `${parts.join("、")} は使えない`;
56
+ }
57
+ function joinLimited(values) {
58
+ if (values.length <= LIST_LIMIT) {
59
+ return values.join(", ");
60
+ }
61
+ return `${values.slice(0, LIST_LIMIT).join(", ")} ほか ${values.length - LIST_LIMIT} 件`;
62
+ }
63
+ /** 構成で値が分かれるときは併記する */
64
+ function joinValues(values) {
65
+ return values.length <= 1 ? (values[0] ?? "") : `${values.join(" / ")}(構成で分かれる)`;
66
+ }
67
+ /** Visual Basic の言語の版の行 */
68
+ function describeLanguage(source, environment) {
69
+ const numeric = environment.langVersions
70
+ .map((value) => Number.parseFloat(value))
71
+ .filter((value) => Number.isFinite(value));
72
+ if (environment.langVersions.length > 0) {
73
+ if (numeric.length === 0) {
74
+ return `${joinValues(environment.langVersions)}(LangVersion の指定)`;
75
+ }
76
+ const limit = Math.min(...numeric);
77
+ const unavailable = unavailableFeatures(limit);
78
+ const lower = environment.langVersions.length > 1 ? "。低い方に合わせる" : "";
79
+ return `${formatVersion(limit)} まで(LangVersion の指定: ${environment.langVersions.join(" / ")}${lower})${unavailable === undefined ? "" : `。${unavailable}`}`;
80
+ }
81
+ if (source.style === "sdk") {
82
+ return "SDK の既定(LangVersion の指定なし。SDK スタイルは Visual Studio 2017 以降の形式)";
83
+ }
84
+ const toolsVersion = environment.toolsVersion;
85
+ const known = toolsVersion === undefined ? undefined : TOOLS_VERSIONS[toolsVersion.toLowerCase()];
86
+ if (toolsVersion === undefined || known === undefined) {
87
+ return toolsVersion === undefined
88
+ ? "不明(ToolsVersion・LangVersion の指定なし)"
89
+ : `不明(ToolsVersion ${toolsVersion}・LangVersion の指定なし)`;
90
+ }
91
+ const unavailable = unavailableFeatures(known.vb);
92
+ return `${formatVersion(known.vb)} まで(LangVersion の指定なし。ToolsVersion ${toolsVersion} は ${known.studio} の形式のため、${known.note ?? known.studio} の既定の Visual Basic ${formatVersion(known.vb)} とみなす)${unavailable === undefined ? "" : `。${unavailable}`}`;
93
+ }
94
+ function describeFramework(environment) {
95
+ if (environment.targetFrameworks.length === 0) {
96
+ return undefined;
97
+ }
98
+ const legacy = environment.targetFrameworks.every((value) => /^v\d/i.test(value));
99
+ return legacy
100
+ ? `.NET Framework: ${joinValues(environment.targetFrameworks)}`
101
+ : `ターゲット フレームワーク: ${joinValues(environment.targetFrameworks)}`;
102
+ }
103
+ function describeOptions(environment) {
104
+ const parts = [
105
+ ["Strict", environment.optionStrict],
106
+ ["Explicit", environment.optionExplicit],
107
+ ["Infer", environment.optionInfer],
108
+ ["Compare", environment.optionCompare],
109
+ ]
110
+ .filter(([, values]) => values.length > 0)
111
+ .map(([name, values]) => `${name} ${joinValues(values)}`);
112
+ return parts.length === 0 ? undefined : `Option: ${parts.join(" / ")}(ファイル先頭の Option 文があればそちらが優先)`;
113
+ }
114
+ function describeSource(source) {
115
+ const head = `- ${source.label}(${source.projectPath})`;
116
+ const environment = source.environment;
117
+ if (environment === undefined) {
118
+ return [head, " - .vbproj を XML として読めなかったため不明"];
119
+ }
120
+ const lines = [
121
+ ` - 形式: ${source.style === "sdk" ? "SDK スタイル" : `旧スタイル${environment.toolsVersion === undefined ? "" : `(ToolsVersion ${environment.toolsVersion})`}`}`,
122
+ ` - Visual Basic: ${describeLanguage(source, environment)}`,
123
+ ];
124
+ const framework = describeFramework(environment);
125
+ if (framework !== undefined) {
126
+ lines.push(` - ${framework}`);
127
+ }
128
+ const options = describeOptions(environment);
129
+ if (options !== undefined) {
130
+ lines.push(` - ${options}`);
131
+ }
132
+ if (environment.rootNamespaces.length > 0) {
133
+ lines.push(` - ルート名前空間: ${joinValues(environment.rootNamespaces)}(ファイルに Namespace を書かなくても、この名前空間に入る)`);
134
+ }
135
+ if (environment.imports.length > 0) {
136
+ lines.push(` - プロジェクト全体の Imports: ${joinLimited(environment.imports)}`);
137
+ }
138
+ if (environment.references.length > 0) {
139
+ lines.push(` - 参照: ${joinLimited(environment.references)}`);
140
+ }
141
+ return [head, ...lines];
142
+ }
143
+ /** <environment> ブロック(閉じタグまで。末尾の改行なし)。プロジェクトが無ければ undefined */
144
+ export function renderEnvironmentBlock(sources) {
145
+ if (sources.length === 0) {
146
+ return undefined;
147
+ }
148
+ return [
149
+ "<environment>",
150
+ ".vbproj から読み取ったビルド環境(静的に読んだ値。Condition は評価せず、構成で値が分かれるときは併記):",
151
+ ...sources.flatMap(describeSource),
152
+ "</environment>",
153
+ ].join("\n");
154
+ }
@@ -23,6 +23,7 @@ import { TOOL_NAME } from "../../brand.js";
23
23
  import { CONFIG_FILE_NAME } from "../slnmixConfig.js";
24
24
  import { isBinaryExtension } from "./binaryExtensions.js";
25
25
  import { summarizeContractSchema } from "./contractSummary.js";
26
+ import { renderEnvironmentBlock } from "./environmentSummary.js";
26
27
  import { decodeShiftJis } from "../../core/encoding.js";
27
28
  import { maskCredentials } from "../../core/mask.js";
28
29
  import { sourceLanguageOf } from "../../core/source-lexer.js";
@@ -550,6 +551,15 @@ export function buildRepomixOutput(title, sources, deps, options) {
550
551
  const rootName = rootDir === undefined ? undefined : path.basename(rootDir);
551
552
  const generic = options.layout === "generic";
552
553
  const configFileName = options.configFileName ?? CONFIG_FILE_NAME;
554
+ const environmentBlock = generic
555
+ ? undefined
556
+ : renderEnvironmentBlock(sources.map((source) => ({
557
+ label: source.label,
558
+ projectPath: (rootDir === undefined ? undefined : relativeWithinRoot(rootDir, source.parseResult.projectPath)) ??
559
+ path.basename(source.parseResult.projectPath),
560
+ style: source.parseResult.projectStyle,
561
+ environment: source.parseResult.environment,
562
+ })));
553
563
  const content = [
554
564
  generic && gitFiles !== undefined
555
565
  ? `このファイルは ${TOOL_NAME} が「${title}」の git が管理しているファイル(git ls-files)に基づき、ソースコードを 1 ファイルにまとめたものです(Repomix 形式)。`
@@ -643,6 +653,7 @@ export function buildRepomixOutput(title, sources, deps, options) {
643
653
  "</notes>",
644
654
  "</file_summary>",
645
655
  "",
656
+ ...(environmentBlock === undefined ? [] : [environmentBlock, ""]),
646
657
  "<directory_structure>",
647
658
  treeLines.join("\n"),
648
659
  "</directory_structure>",
@@ -672,5 +683,6 @@ export function buildRepomixOutput(title, sources, deps, options) {
672
683
  contractSummaryIncluded: contractPlaced,
673
684
  diagnostics,
674
685
  filePaths,
686
+ environmentBlock,
675
687
  };
676
688
  }
@@ -315,6 +315,128 @@ function readSdkProperties(project, diagnostics) {
315
315
  }
316
316
  return result;
317
317
  }
318
+ /** <environment> に載せるプロパティ(要素名は大文字小文字を区別しない) */
319
+ const ENVIRONMENT_PROPERTIES = {
320
+ targetframeworkversion: "targetFrameworks",
321
+ targetframework: "targetFrameworks",
322
+ targetframeworks: "targetFrameworks",
323
+ langversion: "langVersions",
324
+ optionstrict: "optionStrict",
325
+ optionexplicit: "optionExplicit",
326
+ optioninfer: "optionInfer",
327
+ optioncompare: "optionCompare",
328
+ rootnamespace: "rootNamespaces",
329
+ };
330
+ /** 子要素か属性の値(PackageReference の Version は両方の書き方がある) */
331
+ function childOrAttribute(entry, name) {
332
+ for (const [key, value] of Object.entries(entry)) {
333
+ const bare = key.startsWith("@_") ? key.slice(2) : key;
334
+ if (!equalsIgnoreCase(bare, name)) {
335
+ continue;
336
+ }
337
+ const text = asString(value) ?? (isRecord(value) ? asString(value["#text"]) : undefined);
338
+ if (text !== undefined && text.trim() !== "") {
339
+ return text.trim();
340
+ }
341
+ }
342
+ return undefined;
343
+ }
344
+ /** 参照 1 件を表示用に整える(厳密名のうち名前と版だけを残す。HintPath は載せない) */
345
+ function describeReference(tag, entry) {
346
+ const record = isRecord(entry) ? entry : undefined;
347
+ const include = (record === undefined ? undefined : asString(record["@_Include"]))?.trim();
348
+ if (include === undefined || include === "") {
349
+ return undefined;
350
+ }
351
+ if (equalsIgnoreCase(tag, "Reference")) {
352
+ const [name, ...parts] = include.split(",").map((part) => part.trim());
353
+ const version = parts.find((part) => /^version\s*=/i.test(part))?.replace(/^version\s*=\s*/i, "");
354
+ return version === undefined || version === "" ? name : `${name} ${version}`;
355
+ }
356
+ if (equalsIgnoreCase(tag, "ProjectReference")) {
357
+ const name = (record === undefined ? undefined : childOrAttribute(record, "Name")) ??
358
+ include.split(/[\\/]/).pop()?.replace(/\.[^.]+$/, "") ??
359
+ include;
360
+ return `${name}(プロジェクト参照)`;
361
+ }
362
+ if (equalsIgnoreCase(tag, "PackageReference")) {
363
+ const version = record === undefined ? undefined : childOrAttribute(record, "Version");
364
+ return version === undefined ? `${include}(NuGet)` : `${include} ${version}(NuGet)`;
365
+ }
366
+ return `${include}(COM)`;
367
+ }
368
+ /**
369
+ * ビルド環境を読む(手順文 v10 の <environment>)。言語の版・Option・参照など、AI が使える構文と API を
370
+ * 決めるのに要る値だけ。Condition は評価せず、値が分かれていれば出現順にすべて残す
371
+ */
372
+ function readEnvironment(project) {
373
+ const environment = {
374
+ toolsVersion: asString(project["@_ToolsVersion"])?.trim() || undefined,
375
+ targetFrameworks: [],
376
+ langVersions: [],
377
+ optionStrict: [],
378
+ optionExplicit: [],
379
+ optionInfer: [],
380
+ optionCompare: [],
381
+ rootNamespaces: [],
382
+ imports: [],
383
+ references: [],
384
+ };
385
+ const push = (list, value) => {
386
+ if (!list.some((existing) => equalsIgnoreCase(existing, value))) {
387
+ list.push(value);
388
+ }
389
+ };
390
+ for (const group of toArray(project["PropertyGroup"])) {
391
+ if (!isRecord(group)) {
392
+ continue;
393
+ }
394
+ for (const [tag, value] of Object.entries(group)) {
395
+ const key = ENVIRONMENT_PROPERTIES[tag.toLowerCase()];
396
+ if (key === undefined) {
397
+ continue;
398
+ }
399
+ for (const element of toArray(value)) {
400
+ const text = asString(element) ?? (isRecord(element) ? asString(element["#text"]) : undefined);
401
+ if (text === undefined) {
402
+ continue;
403
+ }
404
+ const values = key === "targetFrameworks" ? text.split(";") : [text];
405
+ for (const raw of values) {
406
+ if (raw.trim() !== "") {
407
+ push(environment[key], raw.trim());
408
+ }
409
+ }
410
+ }
411
+ }
412
+ }
413
+ for (const group of toArray(project["ItemGroup"])) {
414
+ if (!isRecord(group)) {
415
+ continue;
416
+ }
417
+ for (const [tag, value] of Object.entries(group)) {
418
+ if (equalsIgnoreCase(tag, "Import")) {
419
+ for (const entry of toArray(value)) {
420
+ const include = isRecord(entry) ? asString(entry["@_Include"])?.trim() : undefined;
421
+ if (include !== undefined && include !== "") {
422
+ push(environment.imports, include);
423
+ }
424
+ }
425
+ continue;
426
+ }
427
+ if (!["Reference", "ProjectReference", "PackageReference", "COMReference"].some((kind) => equalsIgnoreCase(kind, tag))) {
428
+ continue;
429
+ }
430
+ for (const entry of toArray(value)) {
431
+ const described = describeReference(tag, entry);
432
+ if (described !== undefined) {
433
+ push(environment.references, described);
434
+ }
435
+ }
436
+ }
437
+ }
438
+ return environment;
439
+ }
318
440
  /**
319
441
  * SDK スタイルの既定 Compile グロブ(`**\/*.vb`)を展開し、既存の項目と
320
442
  * 重複しないものを resolved の ProjectItem として返す。
@@ -462,6 +584,7 @@ export function parseVbproj(xmlContent, projectPath, deps) {
462
584
  });
463
585
  return result;
464
586
  }
587
+ result.environment = readEnvironment(project);
465
588
  const toolsVersion = asString(project["@_ToolsVersion"]);
466
589
  if (toolsVersion !== undefined) {
467
590
  diagnostics.push({ severity: "info", message: `ToolsVersion: ${toolsVersion}` });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tazuna",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Build with AI chat, without handing over the reins: pack your codebase for the chat, then verify and apply its patches locally (zero dependencies; formerly petari and slnmix)",
5
5
  "keywords": [
6
6
  "cli",
@@ -37,17 +37,18 @@
37
37
  "engines": {
38
38
  "node": ">=20.19.0"
39
39
  },
40
- "devDependencies": {
41
- "@types/node": "^24.3.0",
42
- "typescript": "^5.9.2",
43
- "vitest": "^3.2.4"
44
- },
45
40
  "scripts": {
46
41
  "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
47
42
  "typecheck": "tsc --noEmit",
48
43
  "test": "vitest run",
49
44
  "test:watch": "vitest",
50
45
  "dev": "node src/cli.ts",
46
+ "prepublishOnly": "pnpm typecheck && pnpm test && pnpm build",
51
47
  "gen:sjis": "node scripts/generate-sjis-table.ts"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^24.3.0",
51
+ "typescript": "^5.9.2",
52
+ "vitest": "^3.2.4"
52
53
  }
53
- }
54
+ }