Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release/v0.1.0-beta.10をmainブランチにマージ #197

Merged
merged 52 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d085680
update: マルチモジュール化: srcディレクトリをcore配下に移動
YuukiToriyama Feb 25, 2024
3ccd2ee
add: マルチモジュール化: ワークスペース全体を設定するCargo.tomlを追加
YuukiToriyama Feb 25, 2024
59ddad0
add: マルチモジュール化: 結合試験モジュールが認識されなくなったので`tests`にCargo.tomlを追加
YuukiToriyama Feb 25, 2024
93b9ce0
update: マルチモジュール化: testsクレートで必要な依存関係を記載
YuukiToriyama Feb 25, 2024
2a24f3d
update: マルチモジュール化: テストデータのファイルパスを修正
YuukiToriyama Feb 25, 2024
17b478e
update: マルチモジュール化: `package.version`,`package.edition`,`package.autho…
YuukiToriyama Feb 25, 2024
9bbd17c
update: マルチモジュール化: `core/Cargo.toml`におけるexcludeの設定が不要になったため削除
YuukiToriyama Feb 25, 2024
5f0821e
update: マルチモジュール化: workspace.resolverに`2`を設定
YuukiToriyama Feb 25, 2024
07b1ede
fix: ワークスペースの導入: `wasm-pack build` `wasm-pack test`の実行前に`core`に入るステップを追加
YuukiToriyama Feb 26, 2024
d7ad724
fix: ワークスペースの導入: `wasm-pack build`の実行前にcoreディレクトリに入るように変更
YuukiToriyama Feb 26, 2024
d2f74eb
fix: ワークスペースの導入: `wasm-pack test`の実行前にcoreディレクトリに入るように変更
YuukiToriyama Feb 26, 2024
2cc57d0
Merge pull request #177 from YuukiToriyama/feature/cargo-workspace/co…
YuukiToriyama Feb 26, 2024
dec0afe
update: ワークスペースの導入: `description`, `repository`, `license`, `keywords…
YuukiToriyama Feb 26, 2024
8da8431
add: ワークスペースの導入: `wasm`モジュールを作成
YuukiToriyama Feb 28, 2024
352a16e
update: ワークスペースの導入: `wasm-bindgen*`クレートのバージョン管理をルートのCargo.tomlでするように変更
YuukiToriyama Feb 26, 2024
421957e
update: ワークスペースの導入: testモジュールでの`japanese_address_parser::Parser`の使用箇所…
YuukiToriyama Feb 28, 2024
5650ba9
update: ワークスペースの導入: coreモジュールでの`japanese_address_parser::Parser`の使用箇所を削除
YuukiToriyama Feb 28, 2024
ae82bc4
Merge pull request #179 from YuukiToriyama/feature/cargo-workspace/re…
YuukiToriyama Feb 28, 2024
e99a1ec
Merge branch 'main' into feature/cargo-workspace/merge/main_f145995
YuukiToriyama Mar 2, 2024
78edd92
Merge pull request #189 from YuukiToriyama/feature/cargo-workspace/me…
YuukiToriyama Mar 2, 2024
fd17b74
update: ワークスペースの導入: `update-cratesio.yaml`のジョブのworking-directoryを`cor…
YuukiToriyama Mar 5, 2024
d3ce437
update: ワークスペースの導入: `wasm-pack-test.yaml`のジョブに`working-directory`の設定を追加
YuukiToriyama Mar 5, 2024
83e3a2d
update: ワークスペースの導入: `ghpages.yaml`のジョブに`working-directory`の設定を追加
YuukiToriyama Mar 5, 2024
c9c9b6d
update: ワークスペースの導入: `upload-npmjs.yaml`のジョブに`working-directory`の設定を追加
YuukiToriyama Mar 5, 2024
00f375b
update: ワークスペースの導入: coreモジュールに定義していた`Parser`をwasmモジュールに移動
YuukiToriyama Mar 6, 2024
eea1d0b
update: ワークスペースの導入: `wasm-pack`ジョブのworking-directoryを変更
YuukiToriyama Mar 6, 2024
bcb3ff3
update: ワークスペースの導入: LICENSEファイルを`wasm`にコピー
YuukiToriyama Mar 6, 2024
4d0d3c1
update: ワークスペースの導入: `ghpages.yaml`を修正
YuukiToriyama Mar 6, 2024
b404037
update: ワークスペースの導入: `free-test.yaml`の修正
YuukiToriyama Mar 6, 2024
024d071
Merge pull request #190 from YuukiToriyama/feature/cargo-workspace/fi…
YuukiToriyama Mar 6, 2024
e6bf091
update: ワークスペースの導入: `core`にLICENSEファイルを追加
YuukiToriyama Mar 6, 2024
2d97696
update: ワークスペースの導入: `core`のCargo.tomlに`package.readme`の設定を追加
YuukiToriyama Mar 6, 2024
a7d9a62
Merge pull request #191 from YuukiToriyama/feature/cargo-workspace/co…
YuukiToriyama Mar 6, 2024
82b4a10
update: ワークスペースの導入: `wasm`のCargo.tomlに`package.readme`の設定を追加
YuukiToriyama Mar 6, 2024
2911336
add: PullRequestのテンプレートを追加
YuukiToriyama Mar 6, 2024
8d59ffa
add: Issueのテンプレートを追加
YuukiToriyama Mar 6, 2024
e361b24
add: 貢献方法を記載したCONTRIBUTING.mdを追加
YuukiToriyama Mar 6, 2024
60152b6
package.versionを変更
YuukiToriyama Mar 6, 2024
f6ad773
update: ワークスペースの導入: `upload-npmjs.yaml`が正しく動作するように修正
YuukiToriyama Mar 22, 2024
2755897
survey: ワークスペースの導入: `upload-npmjs.yaml`の動作確認用コミット
YuukiToriyama Mar 22, 2024
a4eace3
Revert "survey: ワークスペースの導入: `upload-npmjs.yaml`の動作確認用コミット"
YuukiToriyama Mar 22, 2024
3750dec
update: ワークスペースの導入: `ghpages.yaml`が適切に動くように修正
YuukiToriyama Mar 22, 2024
0fa5b23
survey: ワークスペースの導入: `ghpages.yaml`の動作確認用コミット
YuukiToriyama Mar 22, 2024
1eaab9b
Revert "survey: ワークスペースの導入: `ghpages.yaml`の動作確認用コミット"
YuukiToriyama Mar 22, 2024
fa9d836
update: ワークスペースの導入: `core/Cargo.toml`から`wasm-bindgen`及び`wasm-bindgen-…
YuukiToriyama Mar 22, 2024
5f5b18c
Merge pull request #194 from YuukiToriyama/feature/cargo-workspace/wa…
YuukiToriyama Mar 22, 2024
ba275ab
Merge branch 'main' into feature/cargo-workspace/merge/main_005bbc2
YuukiToriyama Mar 22, 2024
18006b2
Merge pull request #195 from YuukiToriyama/feature/cargo-workspace/me…
YuukiToriyama Mar 22, 2024
82a81b7
Merge branch 'release/v0.1.0-beta.10' into feature/cargo-workspace/ma…
YuukiToriyama Mar 22, 2024
e1a0ccd
Merge pull request #196 from YuukiToriyama/feature/cargo-workspace/ma…
YuukiToriyama Mar 22, 2024
1a5c43d
Merge pull request #193 from YuukiToriyama/feature/contribution-guide
YuukiToriyama Mar 22, 2024
b4df849
Merge pull request #192 from YuukiToriyama/feature/issue-pr-templates
YuukiToriyama Mar 22, 2024
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
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/01-city_orthographical_variant_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 表記ゆれの報告(市区町村レベル)
description: 市区町村名の表記ゆれを報告します
title: "表記ゆれの報告: 「」と「」の表記ゆれ"
labels: ["表記ゆれ"]
body:
- type: markdown
id: introduction
attributes:
value: "市区町村レベルでの表記ゆれを報告するためのテンプレートです"
- type: textarea
id: variety-of-notation
attributes:
label: 対応すべき表記ゆれ
description: 対応すべき表記ゆれを箇条書きで記入してください
placeholder: "- 茨城県鹿島市"
validations:
required: true
- type: input
id: formal-notation
attributes:
label: 正式な表記
description: 市区町村名の正式な表記を https://yuukitoriyama.github.io/geolonia-japanese-addresses-accompanist/都道府県名/master.json で確認し、記入してください。
placeholder: "- 茨城県鹿嶋市"
validations:
required: true
- type: textarea
id: reference
attributes:
label: 表記ゆれが確認できる資料/URL
description: 表記ゆれが確認できる資料についての情報や、ウェブサイトのURLを記載してください。
placeholder: "行政機関のHPやタウンページの記載など"
validations:
required: true
- type: checkboxes
id: checklist
attributes:
label: チェックリスト
description: Issueを作成する前に以下の項目を確認してください
options:
- label: "入力した内容に個人情報が含まれていないことを確認しました。"
required: true
validations:
required: true
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/02-town_orthographical_variant_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 表記ゆれの報告(町名レベル)
description: 町名の表記ゆれを報告します
title: "表記ゆれの報告: 「」と「」の表記ゆれ"
labels: ["表記ゆれ"]
body:
- type: markdown
id: introduction
attributes:
value: "町名レベルでの表記ゆれを報告するためのテンプレートです"
- type: textarea
id: variety-of-notation
attributes:
label: 対応すべき表記ゆれ
description: 対応すべき表記ゆれを箇条書きで記入してください
placeholder: "- 東京都千代田区丸ノ内"
validations:
required: true
- type: input
id: formal-notation
attributes:
label: 正式な表記
description: 町名の正式な表記を https://geolonia.github.io/japanese-addresses/api/ja/都道府県名/市区町村名.json で確認し、記入してください。
placeholder: "- 東京都千代田区丸の内"
validations:
required: true
- type: textarea
id: reference
attributes:
label: 表記ゆれが確認できる資料/URL
description: 表記ゆれが確認できる資料についての情報や、ウェブサイトのURLを記載してください。
placeholder: "行政機関のHPやタウンページの記載など"
validations:
required: true
- type: checkboxes
id: checklist
attributes:
label: チェックリスト
description: Issueを作成する前に以下の項目を確認してください
options:
- label: "入力した内容に個人情報が含まれていないことを確認しました。"
required: true
validations:
required: true
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/99-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: 汎用Issueテンプレート
about: それ以外のIssueはこちらから
title: ''
labels: ''
assignees: YuukiToriyama

---

### 概要
-

### その他
-
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### 変更点
-

### 確認すべき項目
- [ ] `cargo fmt`
- [ ] `cargo test`

### 備考
-
2 changes: 1 addition & 1 deletion .github/scripts/free_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {Parser} = require("../../pkg");
const {Parser} = require("../../wasm/pkg");
const readline = require("readline");
const fs = require("fs");

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/free-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ jobs:
return commit.data.object.sha

- name: Install wasm-pack
working-directory: wasm
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build wasm module
working-directory: wasm
run: wasm-pack build --target nodejs --scope toriyama

- name: Setup Node.js
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ghpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ jobs:
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Unit Testing for Wasm module
working-directory: wasm
run: wasm-pack test --firefox --headless
- name: Build wasm module
run: wasm-pack build --target web --scope toriyama --features debug
working-directory: wasm
run: wasm-pack build --target web --scope toriyama --out-name japanese_address_parser --features debug
- name: Move files
run: |
mkdir ./publish
rm ./pkg/.gitignore
mv ./pkg ./publish
rm ./wasm/pkg/.gitignore
mv ./wasm/pkg ./publish
mv ./public ./publish
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/upload-cratesio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: core
steps:
- uses: actions/checkout@v4

Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/upload-npmjs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: wasm
steps:
- uses: actions/checkout@v4

Expand All @@ -22,7 +25,24 @@ jobs:
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build wasm module
run: wasm-pack build --release --target web --scope toriyama
run: wasm-pack build --release --target web --scope toriyama --out-name japanese_address_parser

# package.jsonの`name`が`@toriyama/wasm`になっているため、`@toriyama/japanese-address-parser`に書き換える
- name: Check if jq command is available
run: |
which jq
jq --version

- name: Edit package.name
run: |
cat pkg/package.json | jq '.name = "@toriyama/japanese-address-parser"' > tmp.json
mv tmp.json pkg/package.json

- name: Check if package.name was changed
run: |
# package.nameが正しく置換されているかを確認している。
# 正しく置換されていればJSONファイルを表示し、置換されていなければエラーを返しJobを中断させる。
cat pkg/package.json | jq 'if .name == "@toriyama/japanese-address-parser" then . else error("package.nameが正しく置換されていない") end'

- name: Upload wasm to npmjs.com
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/wasm-pack-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
wasm-pack:
runs-on: ubuntu-latest
defaults:
run:
working-directory: wasm
steps:
- uses: actions/checkout@v4
- name: Install wasm-pack
Expand Down
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## How to contribute to `japanese-address-parser`
`japanese-address-parser`に興味を持っていただきありがとうございます。
このライブラリは[@YuukiToriyama](https://github.com/YuukiToriyama)による個人プロジェクトですが、皆さんのコントリビューションを歓迎します!
以下ではコントリビューションの手順について説明いたします。

### 地名の表記ゆれを発見した場合
地名の表記ゆれを発見した場合はIssueで報告していただけると助かります。
市区町村名の表記ゆれと町名の表記ゆれでそれぞれIssueフォームを用意しているので適当なものを選んでください。
なる早で返信いたします。
ご自身で解決できそうな場合は、IssueのAssigniesにご自身を指定していただき、PRを投げてもらっても構いません。

### クラッシュを報告する場合
ライブラリがクラッシュした場合は、汎用Issueテンプレートから報告をお願いします。
使用しているRustのバージョン、ライブラリのバージョン、クラッシュログなどを添付していただけると対応可能です。

### PRの作成方法
#### 前提知識
このリポジトリでは簡素化したGit-flow方式でのブランチ管理を行なっています。具体的には以下のようになっています。
- `main`ブランチが全ての親ブランチ
- 何か修正を行なう場合は`main`ブランチから`feature/*`ブランチを切る
- リリースを行なう場合は`main`ブランチから`release/vX.Y.Z`ブランチを切る
- リリースに含めたい`feature`ブランチを`release/vX.Y.Z`にマージする
- タグ`vX.Y.Z`を打つ
- リリースが完了したら`main`ブランチにマージする

何か修正を行ないたい場合は`main`ブランチから修正ブランチを切ってくださいますようお願いします。
また、PRを作成する際は、とりあえず`main`ブランチに対して投げてください。こちらで対応する`feature`ブランチを作成し、マージ先をそちらに変更いたします。

#### 具体的な作成方法
1. リポジトリをフォークする
2. mainブランチが最新になっていることを確認する
3. mainブランチからfeatureブランチを切り開発を行なう
4. フォーク元のリポジトリのmainブランチに対してPullRequestを発行する
41 changes: 12 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
[package]
name = "japanese-address-parser"
version = "0.1.0-beta.9"
[workspace]
members = [
"core",
"wasm",
"tests"
]
resolver = "2"

[workspace.package]
version = "0.1.0-beta.10"
edition = "2021"
description = "A Rust Library to parse japanses addresses."
authors = ["Yuuki Toriyama <[email protected]>"]
repository = "https://github.com/YuukiToriyama/japanese-address-parser"
authors = ["Yuuki Toriyama <[email protected]>"]
license = "MIT"
keywords = ["parser", "geo", "wasm"]
categories = ["parser-implementations", "wasm"]
exclude = [
"public/*",
"tests/*",
".github/*",
]

[lib]
crate-type = ["rlib", "cdylib"]

[features]
debug = []

[dependencies]
console_error_panic_hook = "0.1.7"
itertools = "0.12.0"
js-sys = "0.3.67"
nom = "7.1.3"
regex = "1.10.2"
reqwest = { version = "0.11.23", default-features = false, features = ["json", "rustls-tls", "blocking"] }
serde = { version = "1.0.192", features = ["derive"] }
serde-wasm-bindgen = "0.6.1"
[workspace.dependencies]
wasm-bindgen = "0.2.89"
wasm-bindgen-futures = "0.4.39"

[dev-dependencies]
csv = "1.3.0"
test-case = "3.3.1"
tokio = { version = "1.35.1", features = ["rt", "macros"] }
wasm-bindgen-test = "0.3.38"
27 changes: 27 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "japanese-address-parser"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
authors.workspace = true
license.workspace = true
readme = "../README.md"
keywords.workspace = true
categories.workspace = true

[lib]
crate-type = ["rlib", "cdylib"]

[dependencies]
itertools = "0.12.0"
js-sys = "0.3.67"
nom = "7.1.3"
regex = "1.10.2"
reqwest = { version = "0.11.23", default-features = false, features = ["json", "rustls-tls", "blocking"] }
serde = { version = "1.0.192", features = ["derive"] }

[dev-dependencies]
test-case = "3.3.1"
tokio = { version = "1.35.1", features = ["rt", "macros"] }
wasm-bindgen-test = { workspace = true }
21 changes: 21 additions & 0 deletions core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 ToriChan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub mod api;
pub mod entity;
mod err;
pub mod parser;
mod util;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "tests"
version.workspace = true
edition.workspace = true
authors.workspace = true
publish = false

[[test]]
name = "integration_tests"
path = "integration_tests.rs"

[dev-dependencies]
csv = "1.3.0"
japanese-address-parser = { path = "../core"}
serde = { version = "1.0.197", features = ["derive"] }
tokio = { version = "1.35.1", features = ["rt", "macros"] }
4 changes: 2 additions & 2 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use csv::ReaderBuilder;
use japanese_address_parser::api::{Api, ApiImpl};
use japanese_address_parser::parser;
use japanese_address_parser::parser::parse;
use serde::Deserialize;
use std::fs::File;
use std::panic;
Expand Down Expand Up @@ -30,7 +30,7 @@ pub async fn run_data_driven_tests(file_path: &str) {
let mut success_count = 0;
for record in &records {
let api = ApiImpl::new();
let result = parser::parse(api, &record.address).await;
let result = parse(api, &record.address).await;

let test_result = panic::catch_unwind(|| {
assert_eq!(result.address.prefecture, record.prefecture);
Expand Down
Loading
Loading