Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f403f8b
電気料金シミュレーション実装
tsbs0514 Aug 7, 2025
ec93c5c
github action追加
tsbs0514 Aug 7, 2025
1f29cb1
playwrightのci最適化
tsbs0514 Aug 7, 2025
bffe5aa
nextの設定を追加
tsbs0514 Aug 7, 2025
1fdf856
ymlアップデート
tsbs0514 Aug 7, 2025
131cfe7
Create nextjs.yml
tsbs0514 Aug 7, 2025
83f3d3d
nextjs.yml アップデート
tsbs0514 Aug 7, 2025
23895d2
Update GitHub Actions workflow for frontend challenge 2 - fix package…
tsbs0514 Aug 7, 2025
d8febb7
修正
tsbs0514 Aug 7, 2025
c9c4f6c
Detect package manager削除
tsbs0514 Aug 7, 2025
69eeec9
dependencyのpathを明確化
tsbs0514 Aug 7, 2025
3113679
修正
tsbs0514 Aug 7, 2025
3263ac2
全体的に見直し
tsbs0514 Aug 7, 2025
13dcebd
高速化のためe2eスキップ
tsbs0514 Aug 7, 2025
8659670
path修正
tsbs0514 Aug 7, 2025
18d69f5
Fix API 405 error - implement client-side area check for static export
tsbs0514 Aug 7, 2025
b1b9bd8
共通化
tsbs0514 Aug 7, 2025
327428c
path周り修正
tsbs0514 Aug 7, 2025
3512c02
不要package削除
tsbs0514 Aug 7, 2025
35597b0
電力会社の選択肢が絞られているかチェックするテストを追加
tsbs0514 Aug 10, 2025
7ee5f16
areaCheck.tsをリファクタ
tsbs0514 Aug 10, 2025
170782a
description追加
tsbs0514 Aug 10, 2025
af597ec
test修正
tsbs0514 Aug 10, 2025
26a7b4a
UIのpaddingを統一
tsbs0514 Aug 10, 2025
4d6c6e4
useElectricForm.tsをリファクタ
tsbs0514 Aug 10, 2025
f0ae55b
共通の定数モジュールを追加
tsbs0514 Aug 10, 2025
d296142
フォームの制御形のロジックをhooksにまとめる
tsbs0514 Aug 11, 2025
47c1a1c
useElectricForm.tsを分割
tsbs0514 Aug 12, 2025
d62ea49
電力会社が 'other' の場合は空配列を返すよう変更
tsbs0514 Aug 12, 2025
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
113 changes: 113 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Frontend Challenge 2 - Electric Simulation App
# Deploy to GitHub Pages
name: Deploy Electric Simulation App

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
paths:
- "frontend_challenge_2/challenges/tsbs0514/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "frontend_challenge_2/challenges/tsbs0514/package-lock.json"

- name: Setup Pages
uses: actions/configure-pages@v5
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
static_site_generator: next
# GitHub Pages subdirectory deployment
base_path: "/e-coding-challenge"

- name: Restore cache
uses: actions/cache@v4
with:
path: |
frontend_challenge_2/challenges/tsbs0514/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('frontend_challenge_2/challenges/tsbs0514/package-lock.json') }}-${{ hashFiles('frontend_challenge_2/challenges/tsbs0514/**.[jt]s', 'frontend_challenge_2/challenges/tsbs0514/**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('frontend_challenge_2/challenges/tsbs0514/package-lock.json') }}-

- name: Install dependencies
working-directory: frontend_challenge_2/challenges/tsbs0514
run: npm ci

# Uncomment the following lines if you want to run E2E tests in CI
# - name: Install Playwright browsers
# working-directory: frontend_challenge_2/challenges/tsbs0514
# run: npx playwright install chromium

- name: Run tests
working-directory: frontend_challenge_2/challenges/tsbs0514
run: npm test

# Uncomment the following lines if you want to run E2E tests in CI
# - name: Run E2E tests
# working-directory: frontend_challenge_2/challenges/tsbs0514
# run: npm run test:e2e
# env:
# CI: true
# timeout-minutes: 5

- name: Build with Next.js
working-directory: frontend_challenge_2/challenges/tsbs0514
run: npm run build
env:
NODE_ENV: production
GITHUB_PAGES: true

- name: Debug build output
working-directory: frontend_challenge_2/challenges/tsbs0514
run: |
echo "Build output directory contents:"
ls -la out/
echo "Checking for index.html:"
find out/ -name "index.html" -type f

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: frontend_challenge_2/challenges/tsbs0514/out

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
68 changes: 68 additions & 0 deletions .serena/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
# * For C, use cpp
# * For JavaScript, use typescript
# Special requirements:
# * csharp: Requires the presence of a .sln file in the project folder.
language: typescript

# whether to use the project's gitignore file to ignore files
# Added on 2025-04-07
ignore_all_files_in_gitignore: true
# list of additional paths to ignore
# same syntax as gitignore, so you can use * and **
# Was previously called `ignored_dirs`, please update your config if you are using that.
# Added (renamed)on 2025-04-07
ignored_paths: []

# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false


# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file or directory.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []

# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""

project_name: "e-coding-challenge"
80 changes: 80 additions & 0 deletions frontend_challenge_2/challenges/tsbs0514/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage
/test-results
/playwright-report

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# IDE
.vscode/
.idea/
*.swp
*.swo

# OS
Thumbs.db

# Jest
/jest-results
/jest-coverage

# MSW
/public/mockServiceWorker.js

# Build outputs
dist/
*.tgz

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Yarn Integrity file
.yarn-integrity

# macOS
.DS_Store

# MCP
.serena
Loading