Skip to content

release 0.2.10#600

Merged
cm-dyoshikawa merged 43 commits into
mainfrom
canary
Nov 5, 2025
Merged

release 0.2.10#600
cm-dyoshikawa merged 43 commits into
mainfrom
canary

Conversation

cm-dyoshikawa and others added 30 commits October 27, 2025 21:18
Dependabotの実行間隔をmonthlyに変更
- Add modular-mcp.json to .gitignore
- Add descriptions to existing MCP servers (Serena, Context7, chrome-devtools)
- Add fetch MCP server for web content retrieval
- Update rulesync.jsonc: rename experimental flags and enable modularMcp

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
RuleSync設定とMCP設定の更新
Windowsでzenn-cliが最低限動作することを確認するためのE2E workflowを追加しました。

## 仕様の変更
- Windows環境でzenn-cliのinitコマンドが正常に動作することを確認する新しいワークフローを追加

## コードの変更
- `.github/workflows/e2e.yml` を新規作成
  - buildジョブ: ubuntu-latestでビルドし、zenn-cliのdistディレクトリをキャッシュに保存
  - e2eジョブ: windows-latestでキャッシュからdistを復元し、initコマンドを実行してエラーが出ないことを確認

## その他・備考
- Windowsでのビルドは問題があるため、ubuntu-latestでビルドしたものをキャッシュ経由で共有する方式を採用

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
LinuxとWindows間でキャッシュを共有するために enableCrossOsArchive を有効化しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
openパッケージをバンドルから除外し、外部依存として扱うことでクロスプラットフォーム対応を改善しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
openパッケージを外部依存として扱うため、実行時に必要なdependenciesに移動しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
openパッケージの依存関係の変更に伴いロックファイルを更新しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
distディレクトリの内容を確認するデバッグステップを追加しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Windows PowerShell用のコマンドに修正しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
エラー出力を確実にキャプチャするようにPowerShellスクリプトを改善しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
openパッケージをexternalとしてビルドする際にESMパッケージとして正しく扱うように修正しました。

仕様の変更:
- openパッケージをdynamic importで読み込むように変更

コードの変更:
- packages/zenn-cli/src/server/lib/server.ts
  - import文を削除し、open()呼び出し箇所でdynamic importを使用
  - listening イベントハンドラをasync関数に変更
- packages/zenn-cli/rspack.server.js
  - externals設定でopenパッケージを'import open'として扱うように変更
  - ESMパッケージであることを明示するコメントを追加

その他・備考:
- openパッケージv10はESM専用のため、CommonJSのrequireでは読み込めない問題を解決
- dynamic importを使用することでクロスプラットフォーム対応を維持

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
修正前のコメントでは「dynamic importで読み込む」と記載していたが、
実際の実装は静的なESM importを使用しているため、コメントを修正。

- 誤: dynamic importで読み込む
- 正: ESM importとして扱う

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed from dynamic import('open') to static import to simplify the code while maintaining the same functionality. The 'open' package is now imported at the top of the file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
すべてのzennコマンド(init, new:article, new:book, list:articles, list:books, preview)のテストを追加しました。

主な変更点:
- new:article/new:bookコマンドの対話型プロンプトに自動応答する仕組みを実装
- ファイル/ディレクトリが正しく作成されることを検証
- previewコマンドをバックグラウンドで起動し、HTTPリクエストでサーバー起動を確認してから停止する処理を実装
- 各コマンドのエラーハンドリングとメッセージを改善

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This change streamlines the E2E workflow to focus on basic installation and execution checks:
- Use production dependencies only (--prod flag) to test the actual deployment scenario
- Remove detailed command tests (new:article, new:book, list:*, preview) which are now covered by comprehensive tests in a previous commit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ndencies

This change modifies the E2E workflow to install all packages, removing the exclusion of devDependencies during installation. This adjustment ensures that the workflow has access to all necessary packages for testing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
仕様の変更:
- E2Eワークフローで個別のコマンドテストを廃止し、Vitestベースの統合E2Eテストスイートを実行するように変更

コードの変更:
- .github/workflows/e2e.yml: 個別のinitコマンドテストを削除し、`pnpm -C packages/zenn-cli e2e`による統合テスト実行に置き換え
- packages/zenn-cli/package.json: `e2e`スクリプトを追加
- packages/zenn-cli/e2e.ts: 全zennコマンド(init, new:article, new:book, list:articles, list:books, preview)のE2Eテストを実装
- packages/zenn-cli/vitest.e2e.config.ts: E2Eテスト用のVitest設定ファイルを追加
- packages/zenn-cli/tsconfig.e2e.json: E2Eテスト用のTypeScript設定ファイルを追加
- packages/zenn-cli/tsconfig.json: `commands.e2e.ts`をincludeに追加
- pnpm-lock.yaml: 依存関係の更新

その他・備考:
- E2Eテストは実際のファイルシステムを使用し、一時ディレクトリで実行されます
- 各テストは独立したテストディレクトリを使用し、クリーンアップも自動で行われます

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added comments to clarify the build process for zenn-editor packages on Linux and the restoration of zenn-cli bundle files from actions/cache for E2E tests on Windows.
- This update improves the workflow's efficiency by leveraging cached artifacts across different operating systems.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
commands.e2e.ts は E2E テストファイルであり、通常のビルドプロセスに含める必要がないため、tsconfig.json の include から除外しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
E2Eテストファイルを整理し、クロスプラットフォーム対応を改善しました。

仕様の変更:
- E2Eテストファイルを packages/zenn-cli/e2e.ts から packages/zenn-cli/src/e2e/e2e.ts に移動
- src配下に配置することでプロジェクト構造を統一

コードの変更:
- e2e.ts: __dirname から process.cwd() に変更し、実行時のworking directoryを基準にパス解決
- e2e.ts: パス連結を './dist/server/zenn.js' から join('dist', 'server', 'zenn.js') に変更し、Windows環境でも正しく動作するように改善
- tsconfig.e2e.json: include パスを新しいファイル位置に更新
- vitest.e2e.config.ts: include パスを新しいファイル位置に更新

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## 仕様の変更

なし

## コードの変更

- `src/e2e/helper.ts` を新規作成
  - `getZennCliPath()`: zenn CLI のパスを取得し、存在しない場合はエラーを投げる
  - `execZennCommand()`: zenn CLI コマンドを実行するヘルパー関数
- `src/e2e/e2e.ts` にテストを追加
  - `new:article` コマンドのE2Eテスト(デフォルトと --slug オプション)
  - `new:book` コマンドのE2Eテスト(デフォルトと --slug オプション)
  - 既存の `init` コマンドテストをリファクタリング
- `vitest.e2e.config.ts` にシングルワーカー設定を追加
  - `pool: 'forks'` と `singleFork: true` を設定

## その他・備考

- E2Eテストは必ずシングルワーカーで実行されるように設定
- ファイル作成の確認とエラーなく実行されることを検証
- すべてのテストが正常に合格

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## 仕様の変更

なし

## コードの変更

- `src/e2e/e2e.ts` から --slug オプション付きテストを削除
  - デフォルトの動作確認のみに簡略化

## その他・備考

- テスト数を3つに削減(init, new:article, new:book)
- すべてのテストが正常に合格

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## 仕様の変更

なし

## コードの変更

- `src/e2e/e2e.ts` にテストを追加
  - `list:articles` コマンドのE2Eテスト
  - `list:books` コマンドのE2Eテスト

## その他・備考

- 最低限のテストのみ実装(エラーなく実行されることを確認)
- すべてのテストが正常に合格

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## 仕様の変更

なし

## コードの変更

- `src/e2e/helper.ts` に `logIfFailed` 関数を追加
  - コマンド実行結果が失敗している場合にログを出力
- `src/e2e/e2e.ts` で `logIfFailed` を使用するようリファクタリング
  - 重複していたエラーログ出力処理を共通化

## その他・備考

- コードの重複を削減
- すべてのテストが正常に合格

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## 仕様の変更

なし

## コードの変更

- `src/e2e/helper.ts` に `execZennPreview` 関数を追加
  - preview コマンドを起動し、指定時間後に自動終了
  - 起動時エラーの有無を確認
- `src/e2e/e2e.ts` に preview コマンドのテストを追加
  - 3秒間起動してエラーがないことを確認
- すべてのテストケース名を日本語に統一

## その他・備考

- preview コマンドはフォアグラウンドで常駐するため、タイムアウトで自動終了
- 全6テストが正常に合格

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
cm-dyoshikawa and others added 13 commits November 4, 2025 22:04
GitHub Actions workflow上でE2Eテストの実行ステップにPowerShellを明示的に指定しました。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- E2EテストをUbuntuとWindowsの両方で実行するようmatrixを追加
- OS別にテスト実行ステップを条件分岐
- distディレクトリ確認ステップを削除してワークフローを簡素化

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Windows環境でscriptが実行できるように修正
canaryブランチの最新変更を取り込みました。

- バージョン0.2.10-alpha.2への更新
- Windows環境でのscript実行の修正を含む変更をマージ
- package.jsonのcleanスクリプトをcanaryの形式に統一しつつ、e2eスクリプトを保持
- Added a step to build zenn-cli before restoring the dist directory from cache in the E2E workflow.
…s before restoring the dist directory from cache.
zenn-cliのWindows互換性を向上し、E2Eテストワークフローを追加
@cm-dyoshikawa cm-dyoshikawa added the release リリース label Nov 5, 2025
@cm-dyoshikawa cm-dyoshikawa self-assigned this Nov 5, 2025
Comment thread .github/workflows/e2e.yml
Comment on lines +36 to +65
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v5

- uses: pnpm/action-setup@v4
with:
version: 10.18.3

- name: パッケージをインストール
run: pnpm install

- name: zenn-cliのdistディレクトリをキャッシュから復元
uses: actions/cache/restore@v4
with:
path: packages/zenn-cli/dist
key: zenn-cli-dist-${{ github.sha }}
enableCrossOsArchive: true

- name: zenn-cliのE2Eテストを実行 (Windows)
if: runner.os == 'Windows'
run: pnpm -C packages/zenn-cli e2e
shell: pwsh

- name: zenn-cliのE2Eテストを実行 (Linux)
if: runner.os == 'Linux'
run: pnpm -C packages/zenn-cli e2e

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 7 months ago

To resolve the problem, a permissions block needs to be added. The recommended, best practice is to add a permissions: mapping at the root of the workflow YAML file (i.e., before jobs:), which applies to all jobs unless overridden. Since none of the steps in this workflow require write access to contents or pull requests, the minimal required permission is likely contents: read. Thus, the change involves adding these lines after the name: and on: sections (before jobs:) in .github/workflows/e2e.yml:

permissions:
  contents: read

No imports, additional external methods, or definitions are needed; the change is only to the workflow YAML file.

Suggested changeset 1
.github/workflows/e2e.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -7,6 +7,9 @@
       - canary
     types: [opened, synchronize]
 
+permissions:
+  contents: read
+
 jobs:
   # zenn-editor packagesをwindowsでビルドする環境は整っていないため、linux環境でビルドして、zenn-cliのバンドルファイルをactions/cacheに保存しておく
   build:
EOF
@@ -7,6 +7,9 @@
- canary
types: [opened, synchronize]

permissions:
contents: read

jobs:
# zenn-editor packagesをwindowsでビルドする環境は整っていないため、linux環境でビルドして、zenn-cliのバンドルファイルをactions/cacheに保存しておく
build:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@cm-dyoshikawa cm-dyoshikawa marked this pull request as ready for review November 5, 2025 07:25
@cm-dyoshikawa cm-dyoshikawa merged commit 30b6feb into main Nov 5, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release リリース

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants