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

Add static API endpoints for Japanese holidays under v1/ path #10

Merged
merged 47 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8c08253
chore(dependabot): Add Dependabot configuration for Cargo dependencies
46ki75 Nov 2, 2024
ee6e3b5
chore(dependabot): Add assignee to Dependabot configuration
46ki75 Nov 2, 2024
9511afc
Merge pull request #1 from 46ki75/chore/dependabot
46ki75 Nov 2, 2024
087388c
feat: Add pull request template for improved contribution guidelines
46ki75 Nov 2, 2024
d816fd0
chore: Add bug report template for improved issue tracking
46ki75 Nov 2, 2024
d5c64c4
Merge pull request #2 from 46ki75/chore/github-features
46ki75 Nov 2, 2024
8918b3f
chore(devcontainer): Set up development container with custom bash co…
46ki75 Nov 2, 2024
6eaa855
chore(devcontainer): Update Dockerfile to use Rust base image and ins…
46ki75 Nov 2, 2024
44bbfb5
Merge pull request #3 from 46ki75/chore/devcontainer
46ki75 Nov 2, 2024
507d606
feat: Implement CSV fetching with error handling using reqwest and th…
46ki75 Nov 2, 2024
e60ed77
feat: Refactor CSV fetching and decoding with error handling and enco…
46ki75 Nov 2, 2024
499c7b6
test: Add unit tests for to_utf8 function handling Shift JIS encoding
46ki75 Nov 2, 2024
efe6101
Merge pull request #4 from 46ki75/feature/decode-sjis
46ki75 Nov 2, 2024
84df18d
feat: Add CSV parsing functionality and update dependencies
46ki75 Nov 2, 2024
f7b7a25
feat: Integrate chrono for date handling and add date_format module
46ki75 Nov 2, 2024
fc219e6
test: Add unit tests for date deserialization handling various formats
46ki75 Nov 2, 2024
d78ed33
refactor: Update deserialize_from_csv to use Self for improved clarity
46ki75 Nov 2, 2024
9dac6a7
feat: Add response module with Response struct for serialization
46ki75 Nov 2, 2024
f9a928e
feat: Make Holiday fields public and implement conversion from Holida…
46ki75 Nov 2, 2024
53dc4d7
feat: Enhance Response struct with date components and update main to…
46ki75 Nov 2, 2024
1feb1ec
feat: Add methods to Holiday struct for retrieving first and last hol…
46ki75 Nov 2, 2024
1bd2fbb
Merge pull request #5 from 46ki75/feature/deserialize-csv
46ki75 Nov 2, 2024
6663af6
feat: Add InvalidDate error variant and handle date retrieval errors …
46ki75 Nov 3, 2024
a045d55
feat: Implement holiday date checking and update output in main
46ki75 Nov 3, 2024
ca1c039
feat: Update Response struct to support optional holiday names and ad…
46ki75 Nov 3, 2024
bf0e0b8
feat: Add serde_json dependency and implement JSON serialization for …
46ki75 Nov 3, 2024
44edc0b
feat: Add file I/O error handling and implement response saving to JS…
46ki75 Nov 3, 2024
d67660d
feat: Refactor response saving to use dynamic directory and update sa…
46ki75 Nov 3, 2024
4f4395f
feat: Add day_of_week and day_of_week_ja fields to Response struct an…
46ki75 Nov 3, 2024
d636d30
test: Add unit tests for Response struct conversion methods and Japan…
46ki75 Nov 3, 2024
ccd31c1
fix: Remove unnecessary comment in test for holiday response conversion
46ki75 Nov 3, 2024
533a977
feat: Add ResponseList struct for managing holiday responses and impl…
46ki75 Nov 3, 2024
84a00b7
Merge pull request #6 from 46ki75/feature/output
46ki75 Nov 3, 2024
a86a67a
feat: Enhance holiday response processing with monthly and yearly agg…
46ki75 Nov 3, 2024
14fb46e
Merge pull request #7 from 46ki75/feature/yearly
46ki75 Nov 3, 2024
e14a44e
ci(workflows): Add GitHub Actions workflow for running unit tests
46ki75 Nov 3, 2024
706e905
ci(workflows): Add GitHub Actions workflow for build and deployment
46ki75 Nov 3, 2024
eb996c4
ci(workflows): Update permissions for build and deployment workflow
46ki75 Nov 3, 2024
c8010b6
Merge pull request #8 from 46ki75/chore/github-actions
46ki75 Nov 3, 2024
12c7a35
docs: Add README for Japanese Holidays REST API
46ki75 Nov 3, 2024
3a5c7c1
docs: Improve clarity and detail in README for Japanese Holidays API
46ki75 Nov 3, 2024
d86669b
docs: Update README to include full API base path and enhance endpoin…
46ki75 Nov 3, 2024
a6b9a26
docs: Enhance README for Japanese Holidays API with static file detai…
46ki75 Nov 3, 2024
8be5ca4
docs: Update README for Japanese Holidays API to improve clarity and …
46ki75 Nov 3, 2024
85b2eb2
docs: Clarify request format for checking specific holiday dates in R…
46ki75 Nov 3, 2024
3b22bb7
chore: Add MIT License file to the repository
46ki75 Nov 3, 2024
8973836
Merge pull request #9 from 46ki75/feature/docs
46ki75 Nov 3, 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
20 changes: 20 additions & 0 deletions .devcontainer/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
parse_git_branch() {
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

PS1="\n"
PS1+="\[\e[32m\]\u"
PS1+="\[\e[30m\]@"
PS1+="\[\e[33m\]\h "
PS1+="\[\e[34m\]\w"
PS1+="\[\e[35m\]\$(parse_git_branch)"
PS1+="\n"
PS1+="\[\e[30m\]\$ "
PS1+="\[\e[0m\]"

unset color_prompt force_color_prompt

# >>> GPG GIT SIGN
export GPG_TTY=$(tty)
# <<< GPG GIT SIGN
. "/home/shirayuki/.deno/env"
7 changes: 7 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM rust:latest

RUN apt-get update -y \
&& cargo install cargo-binstall \
&& cargo binstall cargo-watch

COPY .bashrc /root/.bashrc
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Dev Container",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"ms-azuretools.vscode-docker",
"Gruntfuggly.todo-tree",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"usernamehw.errorlens",
"Gruntfuggly.todo-tree",
"VisualStudioExptTeam.vscodeintellicode",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"fill-labs.dependi"
]
}
}
}
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: バグ報告
about: バグが発生したときはこちらのテンプレートで報告をお願いします。
title: ""
labels: bug
assignees: "46ki75"
---

## バグ内容

### 問題

バグの概要を教えてください。

### 期待される結果

期待される内容や動作を教えてください。

### 実際の結果

実際に得られた内容や動作を教えてください。

## 詳細

無ければ割愛してください。
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
target-branch: "develop"
assignees:
- "46ki75"
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Description

<!-- Briefly describe the changes and the purpose of this pull request. -->

## Checklist

- [ ] All unit tests have passed.

## Related Issues

<!-- List any related issues or PRs if applicable. Example: Closes #123 -->

## Additional Notes

<!-- Add any other context or information about this pull request here. -->
44 changes: 44 additions & 0 deletions .github/workflows/build-deploy-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy (v1)

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
name: cargo run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: install Rustc
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run Build
run: cargo run

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: build
runs-on: ubuntu-latest
name: Deploy to GitHub Pages
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
23 changes: 23 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit Test

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: install Rustc
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run Unit Tests
run: cargo test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
dist/
Loading