Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
18 changes: 18 additions & 0 deletions .claude/commands/generate-gitattributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .gitattributes 生成コマンド

`.distignore`ファイルから`.gitattributes`を生成します。

## 処理内容

1. `.distignore`ファイルを読み込む
2. コメント行(#で始まる)と空行を除外
3. 各行の末尾に` export-ignore`を追加
4. Composer(Packagist)専用の除外項目を追加:
- `sharee.php`(プラグインのメインファイルはComposerでは不要)
5. `.gitattributes`ファイルに書き出す

## 実行

上記の手順に従って`.gitattributes`を生成し、差分があれば報告してください。

$ARGUMENTS
25 changes: 25 additions & 0 deletions .claude/commands/translate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 翻訳ファイル更新コマンド

このコマンドはWordPressプラグインの翻訳ファイルを更新・翻訳・コンパイルします。

## 作業手順

1. `composer i18n:update` を実行してpot/poファイルを生成・更新する
2. `languages/sharee-ja.po`を読み込む
3. 未翻訳のエントリ(`msgstr ""`が空のもの)を見つける
4. 各エントリを日本語に翻訳してファイルを更新する
5. `composer i18n:compile` を実行してmo/jsonにコンパイルする

## 翻訳のルール

- WordPressプラグインの管理画面で使われる文字列です
- 技術用語は適切な日本語に訳してください
- プレースホルダー(%s, %d, %1$s など)はそのまま維持してください
- HTMLタグがある場合はそのまま維持してください
- 簡潔で分かりやすい日本語を心がけてください

## 実行

上記の手順に従って翻訳作業を行い、完了したら変更内容のサマリーを報告してください。

$ARGUMENTS
12 changes: 12 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"permissions": {
"allow": [
"Bash(volta run npm start:*)",
"mcp__chrome-devtools__list_console_messages",
"Bash(composer i18n:update:*)",
"Bash(composer i18n:compile:*)"
],
"deny": [],
"ask": []
}
}
28 changes: 28 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Development directories
.git/
.github/
.claude/
bin/
tests/
node_modules/
src/
wp/
wordpress/

# Development files
.browserslistrc
.editorconfig
.eslintrc
.stylelintrc.json
.gitattributes
.gitignore
.wp-env.json
.phpunit.result.cache
.distignore
CLAUDE.md
composer.lock
gulpfile.js
package.json
package-lock.json
phpunit.xml
phpcs.ruleset.xml
15 changes: 12 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
tests/ export-ignore
.git/ export-ignore
.github/ export-ignore
.claude/ export-ignore
bin/ export-ignore
tests/ export-ignore
node_modules/ export-ignore
src/ export-ignore
wp/ export-ignore
wordpress/ export-ignore
.browserslistrc export-ignore
.editorconfig export-ignore
.eslintrc export-ignore
.stylelintrc.json export-ignore
.github/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.wp-env.json export-ignore
.phpunit.result.cache export-ignore
.distignore export-ignore
CLAUDE.md export-ignore
composer.lock export-ignore
sharee.php export-ignore
gulpfile.js export-ignore
package.json export-ignore
package-lock.json export-ignore
phpunit.xml export-ignore
phpcs.ruleset.xml export-ignore
sharee.php export-ignore
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer

- name: Install dependencies
run: composer install --no-dev --prefer-dist --no-interaction

- name: Build package
run: bash bin/build.sh

Expand Down
6 changes: 3 additions & 3 deletions app/Hametuha/Sharee/Screen/BillingList.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function admin_enqueue_script( $page ) {
if ( 'users_page_user-billing' !== $page ) {
return;
}
wp_enqueue_script( 'sharee-billing-helper' );
wp_enqueue_script( 'sharee-billing-list-helper' );
wp_localize_script(
'sharee-billing-helper',
'sharee-billing-list-helper',
'ShareeBilling',
[
'endpoint' => admin_url( 'admin-ajax.php' ),
Expand Down Expand Up @@ -100,7 +100,7 @@ function ( $key ) {
[
'success' => true,
// translators: %s indicates amount of records, %d is number of records.
'message' => sprintf( __( '%s fixed. Reload window.', 'sharee' ), sprintf( _n( '%d record is', '%d records are', $done ), $done ) ),
'message' => sprintf( __( '%s fixed. Reload window.', 'sharee' ), sprintf( _n( '%d record is', '%d records are', $done, 'sharee' ), $done ) ),
]
);
} catch ( \Exception $e ) {
Expand Down
8 changes: 6 additions & 2 deletions assets/css/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/admin.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 23 additions & 22 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@

set -e

# Remove development files from release
rm -rf ./.git
rm -rf ./.github
rm -rf ./.claude
rm -rf ./bin
rm -rf ./tests
rm -rf ./vendor
rm -rf ./wp
rm -rf ./node_modules
rm -rf ./src
rm -f ./.gitattributes
rm -f ./.gitignore
rm -f ./.wp-env.json
rm -f ./.eslintrc
rm -f ./.stylelintrc.json
rm -f ./.phpunit.result.cache
rm -f ./composer.lock
rm -f ./package.json
rm -f ./package-lock.json
rm -f ./phpunit.xml
rm -f ./phpcs.ruleset.xml
rm -f ./CLAUDE.md
# Remove development files from release based on .distignore
if [ ! -f .distignore ]; then
echo "Error: .distignore file not found"
exit 1
fi

# Read .distignore into array first (to avoid issues when deleting the file itself)
targets=()
while IFS= read -r line || [ -n "$line" ]; do
# Skip comments and empty lines
[[ "$line" =~ ^#.*$ ]] && continue
[[ -z "$line" ]] && continue
# Remove trailing slash for consistency
targets+=("${line%/}")
done < .distignore

# Remove each entry
for target in "${targets[@]}"; do
if [ -e "$target" ]; then
rm -rf "$target"
echo "Removed: $target"
fi
done
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "phpunit",
"lint": "phpcs --standard=phpcs.ruleset.xml $(find ./app -name '*.php')",
"fix": "phpcbf --standard=phpcs.ruleset.xml $(find ./app -name '*.php')",
"i18n:pot": "vendor/bin/wp i18n make-pot ./ languages/sharee.pot --exclude=src --domain=sharee",
"i18n:pot": "vendor/bin/wp i18n make-pot ./ languages/sharee.pot --exclude=src,wordpress --domain=sharee",
"i18n:po": "vendor/bin/wp i18n update-po languages/sharee.pot languages",
"i18n:mo": "vendor/bin/wp i18n make-mo languages",
"i18n:json": "vendor/bin/wp i18n make-json languages languages --no-purge",
Expand Down
Binary file modified languages/sharee-ja.mo
Binary file not shown.
Loading
Loading