From 57264dea76e1583a52f064fac798434f76c5e19e Mon Sep 17 00:00:00 2001 From: cssho Date: Sat, 7 Nov 2026 00:17:08 +0900 Subject: [PATCH 1/5] =?UTF-8?q?.gitignore=20=E3=82=92=20dotnet=20new=20git?= =?UTF-8?q?ignore=20=E3=81=A7=E4=BD=9C=E3=82=8A=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 初期テンプレート(VS2015 時代)のままだったため。Claude Code の個人用設定と、リポジトリに含めない実際の郵便番号データ(utf_ken_all.csv など)を追加。 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HNb8H3hV3ndoRpyuu59g1u --- .gitignore | 333 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 316 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 57a1574..c3ed506 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,13 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +## +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files +*.rsuser *.suo *.user *.userosscache @@ -10,6 +16,9 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -17,45 +26,79 @@ [Rr]eleases/ x64/ x86/ -build/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ +[Ll]og/ +[Ll]ogs/ -# Visual Studo 2015 cache/options directory +# Visual Studio 2015/2017 cache/options directory .vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk *.meta *.obj +*.iobj *.pch *.pdb +*.ipdb *.pgc *.pgd *.rsp +# but not Directory.Build.rsp, as it configures directory-level build defaults +!Directory.Build.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log +*.tlog *.vspscc *.vssscc .builds @@ -70,14 +113,21 @@ _Chutzpah* ipch/ *.aps *.ncb +*.opendb *.opensdf *.sdf *.cachefile +*.VC.db +*.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx +*.sap + +# Visual Studio Trace Files +*.e2e # TFS 2012 Local Workspace $tf/ @@ -90,18 +140,29 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding addin-in -.JustCode - # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + # NCrunch _NCrunch_* .*crunch*.local.xml +nCrunchTemp_* # MightyMoose *.mm.* @@ -129,39 +190,71 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings +# Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore -**/packages/* +**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/packages/build/ +!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets -# Windows Azure Build Output +# Microsoft Azure Build Output csx/ *.build.csdef -# Windows Store app package directory +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ # Others -*.[Cc]ache ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.dbproj.schemaview +*.jfm *.pfx *.publishsettings -node_modules/ -bower_components/ +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ # RIA/Silverlight projects Generated_Code/ @@ -173,24 +266,230 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak # SQL Server files *.mdf *.ldf +*.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ +# GhostDoc plugin setting file +*.GhostDoc.xml + # Node.js Tools for Visual Studio .ntvs_analysis.dat +node_modules/ # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea/ + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp + +## ZipConvertCustomerBarCode + +# Claude Code の個人用設定(共有する設定は .claude/settings.json) +.claude/settings.local.json + +# 実際の郵便番号データ(約12万件)はリポジトリに含めない。テストでは TestData の手書きサンプルを使う +utf_ken_all.csv +KEN_ALL.CSV +JIGYOSYO.CSV +ken_all.zip +utf_ken_all.zip +jigyosyo.zip From c9636ce026a9e2aef9032faf9da67c41cf3a70c7 Mon Sep 17 00:00:00 2001 From: cssho Date: Sat, 7 Nov 2026 00:17:08 +0900 Subject: [PATCH 2/5] =?UTF-8?q?.editorconfig=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .cs の UTF-8(BOM 付き)とインデントを明記。改行コードは core.autocrlf に任せ、テストデータは対象外にする。 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HNb8H3hV3ndoRpyuu59g1u --- .editorconfig | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f5f7047 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,31 @@ +# エディターの基本設定(Visual Studio・VS Code・Rider など) +# 改行コードは Git の core.autocrlf に任せるため、end_of_line は指定しない +root = true + +[*] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +# .cs は UTF-8(BOM 付き) +[*.cs] +charset = utf-8-bom + +[*.{csproj,props,targets,xml,yml,yaml,json,mjs,js}] +indent_size = 2 + +[*.sln] +indent_style = tab + +# Markdown は行末の空白2つが改行の意味になるため、削除しない +[*.md] +trim_trailing_whitespace = false + +# テストデータは 1.x の出力や実データの形式に合わせているので、エディターで変更しない +[**/TestData/**] +charset = unset +indent_style = unset +indent_size = unset +insert_final_newline = unset +trim_trailing_whitespace = unset From 1176ddf4a0fa4714459ac27197af4649bc603a67 Mon Sep 17 00:00:00 2001 From: cssho Date: Sat, 7 Nov 2026 00:17:18 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=97=E3=80=81CI=20=E3=81=A7=E3=81=AF=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=82=92=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit アイコンはこのライブラリで描いたカスタマバーコードの先頭4シンボル。CI では TreatWarningsAsErrors で XML ドキュメントコメントの付け忘れなどを止める(依存パッケージの脆弱性の警告 NU1901〜NU1904 は除く)。 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HNb8H3hV3ndoRpyuu59g1u --- Directory.Build.props | 10 ++++++++++ icon.png | Bin 0 -> 1333 bytes 2 files changed, 10 insertions(+) create mode 100644 icon.png diff --git a/Directory.Build.props b/Directory.Build.props index 7eaff55..523e946 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,6 +20,8 @@ git customer-barcode;barcode;japan-post;postal-code;zipcode;カスタマバーコード;郵便番号 README.md + + icon.png true snupkg + true + $(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904 + diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..db85ca415175f673f2f59e70880a318a5dd60e16 GIT binary patch literal 1333 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSEX7WqAsj$Z!;#VfHfV3&LNnt=gcm zC?Y^JDOZYDsiH$e>(xQ;UCX3ycO`TuOy03gTX&)7Rh8dH{q1Fsm)$J6yu|qbjOX7i zQ_IuSB}udUk`yQC ziub+sF}}yV=I)-qna}UMi%?&DqvOO~?XdeFpI1CvF2C%(_TNJ1+lyDfYM!OYPnj*Ot7{-^ae_$J5ZfVos6mzvNo} zcr4g))iGu9d&d*P6MOwcdiOn7uy?umf?>-KxfUBi6RVB_)(u`uFEXz9YRg`!lriIP zvB6BE*WVwm&Rwy;`q#U>9G&CpOThH5bD{1}F&$YVoSJt1Ws>A(e-Ifo(?>xai zhOwtOpy#JtlTBccWk*`=dB=GjX|f_b2ee$Ttu$a*9WtRb!1h(Oz$cflE3_3}e70r( z8R&4~x!=;={mfN|z8i>`+ZJlwt-Zt8ptbLdE#Fb^M!PBdI8LpsW6&yB? za}By$SJ_l<`@i?|(%X(dn;*|iwl`n1cXOOV^d2Agi9s*4m0!-2Twb+u!(5Z4R{KRK zRzH^RRa*Y*Xu+=M|G4ED{sq5$o^aNeji1p<=zfWaDr=p+yqNsXFAtK}{bxTRXIYR| zvFe>z=$r0Tr>-8S`?51v#oAk4u#S8A(QA2wyNkCoH(NZA*#977eY~!!MhE z>u-;}+H5t=(yYSwa$CR55tl02uhMqdc{TU;HIzu|@1Gv9w+r_oS!_U&BF&`OC5VT@r+n}nLOCEcE= uEwo^NFvrQA@k{%G<1 Date: Sat, 7 Nov 2026 00:17:18 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=AE=E5=85=AC?= =?UTF-8?q?=E9=96=8B=E5=BE=8C=E3=81=AB=20GitHub=20Release=20=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit github-release ジョブで、リリースノートをマージした PR から自動生成する。書き込み権限は Trusted Publishing を扱う publish ジョブと分ける。CLAUDE.md にも今回の整備内容を追記。 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HNb8H3hV3ndoRpyuu59g1u --- .github/workflows/build.yml | 18 ++++++++++++++++++ CLAUDE.md | 8 ++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b4b6e0..3b3a5b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,3 +136,21 @@ jobs: - name: nuget.org に公開 # .snupkg(シンボルパッケージ)は同じフォルダーにあれば一緒に公開される run: dotnet nuget push "artifacts/*.nupkg" --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + + # nuget.org に公開したあと、タグの GitHub Release を作る(リリースノートはマージした PR から自動生成) + # 書き込み権限は、Trusted Publishing を扱う publish ジョブとは分けてこのジョブだけに付ける + github-release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: GitHub Release の作成 + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + # v2.1.0-beta.1 のような - を含むタグはプレリリースにする + prerelease=() + if [[ "$GITHUB_REF_NAME" == *-* ]]; then prerelease=(--prerelease); fi + gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --generate-notes --title "$GITHUB_REF_NAME" "${prerelease[@]}" diff --git a/CLAUDE.md b/CLAUDE.md index 9a9a887..ed4a048 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -20,9 +20,9 @@ - `ZipConvertCustomerBarCode.Drawing`: System.Drawing.Common による描画(Windows のみ)。 - `ZipConvertCustomerBarCode.SkiaSharp`: SkiaSharp による描画。名前空間は `SkiaSharp` との衝突を避けるため `ZipConvertCustomerBarCode.Skia`。 - `netstandard2.0` の既定 C# は 7.3。`#if NET8_0_OR_GREATER` の外では `record` や null 許容参照型など新しい構文は使わない。 -- バージョン・著作権表示・パッケージ情報は `Directory.Build.props` にまとめている。 -- 公開メンバーには XML ドキュメントコメントを付ける(`GenerateDocumentationFile` 有効のため、ないと警告になる)。 -- `.cs` ファイルは UTF-8(BOM 付き)。新規ファイルにも BOM を付ける(`.claude/settings.json` のフックが Write / Edit 後に自動で補う)。改行は `core.autocrlf=true` に従う(Windows の作業ツリーでは CRLF、リポジトリ内は LF)。 +- バージョン・著作権表示・パッケージ情報は `Directory.Build.props` にまとめている。パッケージアイコン `icon.png`(128×128)は、このライブラリで描いたバーコードの先頭4シンボル(スタート + 郵便番号3桁)を縦に伸ばしたもの。 +- 公開メンバーには XML ドキュメントコメントを付ける(`GenerateDocumentationFile` 有効のため、ないと警告になる)。CI(`GITHUB_ACTIONS`)では `TreatWarningsAsErrors` で警告をエラーにしている(依存パッケージの脆弱性の警告 NU1901〜NU1904 は除く)。 +- `.cs` ファイルは UTF-8(BOM 付き、`.editorconfig` にも記載)。新規ファイルにも BOM を付ける(`.claude/settings.json` のフックが Write / Edit 後に自動で補う)。改行は `core.autocrlf=true` に従う(Windows の作業ツリーでは CRLF、リポジトリ内は LF)。 ## テスト @@ -38,7 +38,7 @@ ## CI・リリース - `.github/workflows/build.yml`: push・PR で Ubuntu と Windows × コアの両方のビルドをテストし、パッケージを作る。 -- リリースは `v2.0.0` のようなタグを push すると、タグのバージョンで3パッケージを nuget.org に公開する(Trusted Publishing。ワークフローのファイル名 `build.yml` と Environment 名 `release` を nuget.org に登録しているので、どちらも名前を変えない)。nuget.org 側のポリシーは「新しいバージョンの追加のみ」なので、公開済みのバージョンは出し直せない(修正は次のバージョンで出す)。 +- リリースは `v2.0.0` のようなタグを push すると、タグのバージョンで3パッケージを nuget.org に公開する(Trusted Publishing。ワークフローのファイル名 `build.yml` と Environment 名 `release` を nuget.org に登録しているので、どちらも名前を変えない)。nuget.org 側のポリシーは「新しいバージョンの追加のみ」なので、公開済みのバージョンは出し直せない(修正は次のバージョンで出す)。公開後に `github-release` ジョブがタグの GitHub Release を作る(リリースノートはマージした PR から自動生成、`-` を含むタグはプレリリース)。 - 公開ジョブは GitHub の `release` Environment で動く(`v*` タグのみ、cssho の承認後に実行。Secret `NUGET_USER` もこの Environment にある)。`Directory.Build.props` の `VersionPrefix` はローカルと CI のプレリリース版(`2.0.0-ci.N`)用で、公開時はタグのバージョンが優先される。`VersionPrefix` は `PackageValidationBaselineVersion` 以上にしておく(低いとアセンブリのバージョンが基準より低くなり CP0003 エラー)。 - ワークフローのアクションは `.github/workflows/actions.lock`(`gh actions-lock`)でコミットに固定している。`uses:` を追加・変更したら `gh actions-lock` でロックし直し、`gh actions-lock --verify` で確認してから、ロックファイルとワークフローを一緒にコミットする(ワークフローを編集すると、フックが `--verify-local` で漏れを知らせる)。JSON 出力は `--json=valid,findings` のように `=` でつなぐ(空白区切りだとパスとして解釈される)。 - CI の `verify-lockfile.yml` が PR・push・週1回でロックファイルを検証する。アクションの更新は Dependabot(`.github/dependabot.yml`、既定の cooldown でリリースから3日待つ)が、ロックファイルの作り直しも含めて PR にする。 From 5bada0a36b1ed1b8d4393add07e48794ba92b1b1 Mon Sep 17 00:00:00 2001 From: cssho Date: Sat, 7 Nov 2026 00:28:48 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E6=8C=87=E6=91=98=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 脆弱性データを取得できなかったときの NU1900 も CI でエラーにしない - GitHub Release が作成済みならスキップし、ジョブの再実行で失敗しないようにする - アイコンの生成スクリプト tools/GenerateIcon.cs を追加し、バーを中央に置き直す(左右の余白が 24px と 20px だった) - ローカルで CI と同じ警告の確認をする方法を CLAUDE.md に追記 - .gitignore に node_modules/ を戻し、.editorconfig で actions.lock を対象外にする Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HNb8H3hV3ndoRpyuu59g1u --- .editorconfig | 8 +++++++ .github/workflows/build.yml | 5 +++++ .gitignore | 3 +++ CLAUDE.md | 4 ++-- Directory.Build.props | 9 ++++---- icon.png | Bin 1333 -> 1334 bytes tools/GenerateIcon.cs | 42 ++++++++++++++++++++++++++++++++++++ 7 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 tools/GenerateIcon.cs diff --git a/.editorconfig b/.editorconfig index f5f7047..96eea09 100644 --- a/.editorconfig +++ b/.editorconfig @@ -22,6 +22,14 @@ indent_style = tab [*.md] trim_trailing_whitespace = false +# gh actions-lock が生成するロックファイル(YAML)は、手で整形しない +[.github/workflows/actions.lock] +charset = unset +indent_style = unset +indent_size = unset +insert_final_newline = unset +trim_trailing_whitespace = unset + # テストデータは 1.x の出力や実データの形式に合わせているので、エディターで変更しない [**/TestData/**] charset = unset diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b3a5b6..d35d445 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,4 +153,9 @@ jobs: # v2.1.0-beta.1 のような - を含むタグはプレリリースにする prerelease=() if [[ "$GITHUB_REF_NAME" == *-* ]]; then prerelease=(--prerelease); fi + # 手で先に作った場合や、ジョブを再実行した場合は、作成済みの Release をそのまま使う + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then + echo "Release $GITHUB_REF_NAME は作成済みのため、スキップする" + exit 0 + fi gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --generate-notes --title "$GITHUB_REF_NAME" "${prerelease[@]}" diff --git a/.gitignore b/.gitignore index c3ed506..6aa4433 100644 --- a/.gitignore +++ b/.gitignore @@ -483,6 +483,9 @@ $RECYCLE.BIN/ ## ZipConvertCustomerBarCode +# Claude Code のフック(.claude/hooks/*.mjs)に npm の依存を足した場合 +node_modules/ + # Claude Code の個人用設定(共有する設定は .claude/settings.json) .claude/settings.local.json diff --git a/CLAUDE.md b/CLAUDE.md index ed4a048..ce2e0aa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -20,8 +20,8 @@ - `ZipConvertCustomerBarCode.Drawing`: System.Drawing.Common による描画(Windows のみ)。 - `ZipConvertCustomerBarCode.SkiaSharp`: SkiaSharp による描画。名前空間は `SkiaSharp` との衝突を避けるため `ZipConvertCustomerBarCode.Skia`。 - `netstandard2.0` の既定 C# は 7.3。`#if NET8_0_OR_GREATER` の外では `record` や null 許容参照型など新しい構文は使わない。 -- バージョン・著作権表示・パッケージ情報は `Directory.Build.props` にまとめている。パッケージアイコン `icon.png`(128×128)は、このライブラリで描いたバーコードの先頭4シンボル(スタート + 郵便番号3桁)を縦に伸ばしたもの。 -- 公開メンバーには XML ドキュメントコメントを付ける(`GenerateDocumentationFile` 有効のため、ないと警告になる)。CI(`GITHUB_ACTIONS`)では `TreatWarningsAsErrors` で警告をエラーにしている(依存パッケージの脆弱性の警告 NU1901〜NU1904 は除く)。 +- バージョン・著作権表示・パッケージ情報は `Directory.Build.props` にまとめている。パッケージアイコン `icon.png`(128×128)は、このライブラリで作ったバーコードの先頭4シンボル(スタート + 郵便番号3桁)を縦に伸ばし、紺地に白で描いたもの。`dotnet run tools/GenerateIcon.cs -- icon.png` で生成する(色・拡大率・余白もこのスクリプトにある)。 +- 公開メンバーには XML ドキュメントコメントを付ける(`GenerateDocumentationFile` 有効のため、ないと警告になる)。CI(`GITHUB_ACTIONS`)では `TreatWarningsAsErrors` で警告をエラーにしている(依存パッケージの脆弱性の警告 NU1900〜NU1904 は除く)。ローカルで CI と同じ確認をするときは `dotnet build -p:TreatWarningsAsErrors=true` のように付ける。 - `.cs` ファイルは UTF-8(BOM 付き、`.editorconfig` にも記載)。新規ファイルにも BOM を付ける(`.claude/settings.json` のフックが Write / Edit 後に自動で補う)。改行は `core.autocrlf=true` に従う(Windows の作業ツリーでは CRLF、リポジトリ内は LF)。 ## テスト diff --git a/Directory.Build.props b/Directory.Build.props index 523e946..cd8a21a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,7 +20,7 @@ git customer-barcode;barcode;japan-post;postal-code;zipcode;カスタマバーコード;郵便番号 README.md - + icon.png true snupkg @@ -40,11 +40,12 @@ true true - $(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904 + $(WarningsNotAsErrors);NU1900;NU1901;NU1902;NU1903;NU1904 diff --git a/icon.png b/icon.png index db85ca415175f673f2f59e70880a318a5dd60e16..e79e5d4322ccc027880f1525d592cb788684ad20 100644 GIT binary patch delta 918 zcmV;H18MxV3bqQ6Gy(0AHD3ZW+mV(lf2j(JF$hjV^(0h&Q{ZqYiElFL{i6%nom|Pr z&6^&(QEP(d06ZXq4GVceiiRqFR1H6Od3}3$@PpIUKCh|(E*|*j0qqiz`bAAjky6zO zf$T%B_-ZvFTs8n6`2Vj`2>D!Y&#A!=&(5`7Fy|gNJ(X;z311e$vm%m=YEX)Xe~2U@ zNVy*E!@r6_NJHC#A@#>Y)(H2P?f%bhEbZ=tu;T|BMHJ z`4EwIC;3m%(UG|Hu~`8$O*Op8?Qa^cv{G~+$M+RfXacFygNbux;Lh}^wm z^&NkXXMXx&`o7X1H?%#vsy?V0e*#eFZ9 zBHT578vvSHx3ANL{3?*SKNixmQN9W|0MI~o^WfWYaTRz0rBi?iHv1lm;w6F(0Fawf zJ8n&i{^ENeieFykHkUwgtM5U`j|7Ta9Yi+z9)vs*+2};k=z9+GLllh;G(d~*LC6z9 zqk{-n0IO6Q9e`TjbC4&3hS@&{lPR-)AHG_K`nzY`Znhf-+#5Z0+ZkZJCmOR z5fDXoZQy*C`n7+H71y-D(;li&h7lb-?+e@S!u z=(9(4r- zeZJ=)KMDx?+^KZ;aX?S_9){wkCr+iik2?TR#h1Rvp?E3Khtd~8IdyLUnDjjq#bz=$ z5xj;{0NL-lhZMTk_f!-Qh3?HBe>rdldz!{Q^C9(>I8{{Yz|e+SMCPu1O` zihZ$6NRd(KyCYMz>qiHA$16Qv=@c+SQ>wEIg0}<`%(pEq9SSXqO4o4u;Qq^PH}63m z%N!fLrfI`R4pJwI+aU~LNmJwjJy>wzw#=dTzn*XNc~^jPtJ}7%Nw~x=2zCOfThyR* sRjKOV0(qwp7GD2jpf^+Plk@~F6eE^h|2v8w>Hq)$07*qoM6N<$f~lmo6aWAK delta 921 zcmV;K17`fT3bhK5Gy&|9HD3aB(~*`de`y{RV-TE#>Pe{lroiD)65nLf`$reDJGqjL zn>Rgnqt*n^0eC2JS!r}s0O8Ie~3sD zf|Lt_6=SQ~zQXCju;O-=?p%}Fd7VT4QxR#8d{T;>svZiFe6Z3RMK^2fj*dhi`OkRp zmk$wXcar}E9UX~FADb0G(^S)&fTUuZj$$E@Ef{h{)Y5 zR^RdGc;=@crtd5LaYNgqtLlTAe<1*M-X^5Tsp^C)xSNN*@6Mw96j0}qFY@3oeev1)R@D1nEUuF=14omP0tOJ?uMLdaVz0&XeJx+qug?{eQ3EHFkOC!t zPMX^vSKmXBKU@Kfb5M-=9)dhkj5&yAea}Ijh-MuW48STy)~PT6t5lG6P(A8<5b{Lz zs4F1o^F0UoQ9#h=PNln#1A4;uFcddEaVp(?+yQ_pzVtl~#Y=%cl)ebcse1#!r0=09 zHj}xD;5C#2$bQ#7q|m*-r=oZ$bZ_>5$bmB`|0?*eVsQ_@6*NF~{2xiYRJu7G!015l zcnCb>Z7_<3syunN|Go32+d=t*|z0ULae%Oh=JY=qn@Xo*Aclsj!_ir8>VA zk$dACjUuP|#c;ak{tF)f{!{7aV9iYi4*@z7-*glu1%5vt79Y9v;A5`;2gn|OIdEop zs_qt5?2BbWii|?v9hs_KKRVDmUg_~lr+^unQk`88yd{vJ+P1WGD6}XlUBl^v`!Ba$ z)q^^gIW~Ar(}s^6q)rsKLm0x6rpN<&u;9XNnM3b?U2XHKD?qu`ZQIr)Tw)glI|0-! vYEZhWRP}Fxyi*7Zum3U7o0;#E^#m;x3IARH$WW)d00000NkvXXu0mjf^a8;` diff --git a/tools/GenerateIcon.cs b/tools/GenerateIcon.cs new file mode 100644 index 0000000..39032e7 --- /dev/null +++ b/tools/GenerateIcon.cs @@ -0,0 +1,42 @@ +// パッケージアイコン icon.png(128x128)を生成する。 +// 実行: dotnet run tools/GenerateIcon.cs -- icon.png +// +// このライブラリでカスタマバーコードを作り、先頭4シンボル(スタート + 郵便番号3桁)のバー配置(GetBars)を +// 横2倍・縦7倍に伸ばして、紺の角丸の背景に白で描く(ライブラリの出力は白地に黒だが、アイコンでは色を反転している)。 +// バーのある範囲を上下左右の中央に置く。 +#:project ../ZipConvertCustomerBarCode.SkiaSharp/ZipConvertCustomerBarCode.SkiaSharp.csproj +using SkiaSharp; +using ZipConvertCustomerBarCode; + +const int Size = 128; +const int ScaleX = 2; +const int ScaleY = 7; +const int Symbols = 4; +const int CellWidth = 12; +var background = new SKColor(0x1F, 0x3A, 0x5F); + +var code = BarCode.Create("2630023", "千葉市稲毛区緑町3丁目30-8 郵便ビル403号"); +var bars = code.GetBars().Where(b => b.X < Symbols * CellWidth).ToList(); + +// バーのある範囲(スタート記号の先頭は空き枠なので、シンボルの枠ではなくバーで測る) +var left = bars.Min(b => b.X) * ScaleX; +var right = bars.Max(b => b.X + b.Width) * ScaleX; +var top = bars.Min(b => b.Y) * ScaleY; +var bottom = bars.Max(b => b.Y + b.Height) * ScaleY; +var offsetX = (Size - (right - left)) / 2 - left; +var offsetY = (Size - (bottom - top)) / 2 - top; + +using var bitmap = new SKBitmap(Size, Size); +using var canvas = new SKCanvas(bitmap); +canvas.Clear(SKColors.Transparent); +using var backgroundPaint = new SKPaint { Color = background, IsAntialias = true }; +canvas.DrawRoundRect(new SKRect(0, 0, Size, Size), 20, 20, backgroundPaint); +using var barPaint = new SKPaint { Color = SKColors.White }; +foreach (var bar in bars) +{ + canvas.DrawRect(offsetX + bar.X * ScaleX, offsetY + bar.Y * ScaleY, bar.Width * ScaleX, bar.Height * ScaleY, barPaint); +} + +using var data = bitmap.Encode(SKEncodedImageFormat.Png, 100); +File.WriteAllBytes(args.Length > 0 ? args[0] : "icon.png", data.ToArray()); +Console.WriteLine($"バーの範囲: x={offsetX + left}〜{offsetX + right - 1}, y={offsetY + top}〜{offsetY + bottom - 1}");