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
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

# 검증과 배포를 한 워크플로에 둔다 — deploy 가 quality/build 를 `needs` 로
# 기다리므로 검사가 깨진 채 배포가 나가는 일이 없다.
on:
pull_request:
push:
branches: [main]
workflow_dispatch: # 코드 변경 없이 다시 배포하고 싶을 때

concurrency:
group: ci-${{ github.ref }}
# PR 은 새 커밋이 오면 이전 검사를 버린다. main 은 배포가 도중에 끊기면 안 되므로 두지 않는다.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
quality:
name: 타입·린트
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4 # 버전은 package.json 의 packageManager 를 따른다
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile

- run: pnpm typecheck
- run: pnpm lint

build:
name: 빌드
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile

- run: pnpm build

- name: 산출물 크기
run: |
{
echo "### 빌드 산출물"
echo '```'
du -sh dist
find dist -type f -exec ls -lh {} + | awk '{print $5, $9}'
echo '```'
} >> "$GITHUB_STEP_SUMMARY"

# 배포 잡이 다시 빌드하지 않도록 넘겨준다(검사한 그 산출물이 그대로 나간다).
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: dist

deploy:
name: GitHub Pages 배포
if: github.event_name != 'pull_request'
needs: [quality, build]
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v5
with:
enablement: true # 저장소에 Pages 가 아직 꺼져 있어도 켠다
- uses: actions/deploy-pages@v4
id: deployment
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
12 changes: 12 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"plugins": ["typescript", "unicorn"],
"categories": {
"correctness": "error",
"suspicious": "warn"
},
"rules": {
"curly": "error"
},
"ignorePatterns": ["**/dist", "**/node_modules", "**/.astro", "**/*.md"]
}
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# gravitype
# Gravitype

> 타이핑한 글자가 물리 객체가 되어 떨어지고, 쌓이고, 무너지는 웹 장난감.

**배포**: https://99mini.github.io/gravitype/

글자를 입력하면 그 글자가 질량과 형태를 가진 물체가 되어 화면에 떨어진다.
폰을 기울이고 흔들어서 쌓인 글자 더미를 무너뜨린다.

## 기술

| 항목 | 선택 |
| --- | --- |
| 프레임워크 | Astro (SSG + CSR, 서버 없음) |
| 물리 | matter.js |
| 렌더 | Canvas 2D 직접 렌더 |
| 언어 | TypeScript |
| 배포 | GitHub Actions → GitHub Pages |

## 명령

```sh
pnpm install
pnpm dev # 개발 서버
pnpm build # 정적 빌드 (dist/)
pnpm typecheck # astro check
pnpm lint # oxlint
```

## 로드맵 (작은 PR 단위)

- [x] PR 1 — Astro 스캐폴드 + GitHub Pages 배포 파이프라인
- [ ] PR 2 — matter.js 월드, 바닥·벽, 캔버스 렌더 루프
- [ ] PR 3 — 탭 → 키보드 → 글자 낙하 (IME 조합 처리 포함)
- [ ] PR 4 — 잉크 면적 질량 + 원형/막대 특수 충돌체
- [ ] PR 5 — 기울기 중력 / 흔들기 임펄스
- [ ] PR 6 — 드래그로 집어 던지기
- [ ] PR 7 — 키보드 대응 동적 바닥 (visualViewport)
- [ ] PR 8 — 물체 수 제한·성능 정리 + 지우기 연출
- [ ] PR 9 — URL 공유 및 재생, 스크린샷 공유
- [ ] PR 10 — 첫 진입 힌트 다듬기, OG 이미지·메타태그

상세 기획은 PRD 참고. 물리 상수는 한 파일(`src/lib/constants.ts`)에 모은다.
9 changes: 9 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check
import { defineConfig } from "astro/config";

// GitHub Pages 서브패스(https://99mini.github.io/gravitype) 배포.
// base 를 빼먹으면 자산 경로가 전부 깨진다 — PRD Day 0 의 대표적 함정.
export default defineConfig({
site: "https://99mini.github.io",
base: "/gravitype",
});
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "gravitype",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"typecheck": "astro check",
"lint": "oxlint",
"lint:fix": "oxlint --fix && oxfmt ."
},
"dependencies": {
"astro": "^7.2.2"
},
"devDependencies": {
"@astrojs/check": "^0.9.10",
"oxfmt": "^0.62.0",
"oxlint": "^1.77.0",
"typescript": "^5.9.2"
},
"engines": {
"node": ">=22"
},
"packageManager": "pnpm@10.33.0"
}
Loading
Loading