diff --git a/.github/ISSUE_TEMPLATE/together.md b/.github/ISSUE_TEMPLATE/together.md
new file mode 100644
index 00000000..755e2c04
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/together.md
@@ -0,0 +1,31 @@
+---
+name: 함께하는 곳 신청
+about: Braillify를 사용하고 있는 곳을 소개해 주세요.
+title: '[함께하는 곳] '
+---
+
+신청 내용과 로고는 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 적지 마세요.
+
+## 함께할 곳
+
+- 구분 (기업·기관·학교·단체):
+- 이름 (20자 이내):
+
+## 사용 내용
+
+- 사용 상태 (사용 중·도입 준비 중):
+- 사용처 이름:
+- 사용처 주소 (선택):
+- 어디에 어떤 용도로 쓰나요:
+- 사용 방식:
+- 사용 시작 시기 (선택):
+
+## 로고
+
+밝은 바탕용 PNG 또는 JPG 로고 한 개를 첨부해 주세요 (2MB 이하).
+
+## 공개 동의
+
+- [ ] 이름과 로고를 braillify.kr ‘함께하는 곳’에 게시하는 데 동의합니다.
+
+GitHub 계정이 없거나 게시 중단을 원하시면 contact@devfive.kr로 알려 주세요.
diff --git a/.github/workflows/pr-ci-validation.yml b/.github/workflows/pr-ci-validation.yml
new file mode 100644
index 00000000..62e982a0
--- /dev/null
+++ b/.github/workflows/pr-ci-validation.yml
@@ -0,0 +1,176 @@
+name: PR CI validation
+
+on:
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ go:
+ name: Go archive validation - ${{ matrix.platform }}
+ runs-on: ${{ matrix.runner }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - { runner: windows-latest, target: x86_64-pc-windows-gnu, platform: windows-amd64 }
+ - { runner: ubuntu-latest, target: x86_64-unknown-linux-gnu, platform: linux-amd64 }
+ - { runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, platform: linux-arm64 }
+ - { runner: macos-14, target: aarch64-apple-darwin, platform: darwin-arm64 }
+ - { runner: macos-15-intel, target: x86_64-apple-darwin, platform: darwin-amd64 }
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ toolchain: stable
+ target: ${{ matrix.target }}
+ cache: false
+ - uses: actions/setup-go@v5
+ with:
+ go-version: stable
+ cache: false
+ - name: Build native library
+ run: cargo build --release --target ${{ matrix.target }} -p braillify-go
+ - name: Remove passive LLVM bitcode
+ if: runner.os != 'macOS'
+ shell: bash
+ run: |
+ rustup component add llvm-tools
+ sysroot=$(rustc --print sysroot)
+ host=$(rustc -vV | sed -n 's/^host: //p')
+ archive=target/${{ matrix.target }}/release/libbraillify_go.a
+ objcopy="$sysroot/lib/rustlib/$host/bin/llvm-objcopy"
+ if [ "$RUNNER_OS" = Windows ]; then objcopy="$objcopy.exe"; fi
+ "$objcopy" --remove-section=.llvmbc --remove-section=.llvmcmd "$archive" "$archive.cleaned"
+ mv "$archive.cleaned" "$archive"
+ - name: Prepare and verify macOS test archive
+ if: runner.os == 'macOS'
+ shell: bash
+ run: |
+ rustup component add llvm-tools
+ sysroot=$(rustc --print sysroot)
+ host=$(rustc -vV | sed -n 's/^host: //p')
+ tools="$sysroot/lib/rustlib/$host/bin"
+ archive=target/${{ matrix.target }}/release/libbraillify_go.a
+ candidate="$RUNNER_TEMP/go-macos-candidate.a"
+ "$tools/llvm-objcopy" '--remove-section=__LLVM,__bitcode' '--remove-section=__LLVM,__cmdline' "$archive" "$candidate"
+ python3 scripts/test_verify_macos_go_archive.py
+ python3 scripts/verify-macos-go-archive.py "$archive" "$candidate" "$tools"
+ - name: Copy native library
+ shell: bash
+ run: |
+ mkdir -p packages/go/libs/${{ matrix.platform }}
+ if [ "$RUNNER_OS" = macOS ]; then
+ cp "$RUNNER_TEMP/go-macos-candidate.a" packages/go/libs/${{ matrix.platform }}/libbraillify_go.a
+ rm "$RUNNER_TEMP/go-macos-candidate.a"
+ else
+ cp target/${{ matrix.target }}/release/libbraillify_go.a packages/go/libs/${{ matrix.platform }}/
+ fi
+ - name: Test
+ working-directory: packages/go
+ run: go test -v ./...
+
+ go-release-cross-build:
+ name: Go release cross-build - linux-arm64
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ toolchain: stable
+ target: aarch64-unknown-linux-gnu
+ cache: false
+ - name: Install cross-compilation tools (Linux ARM64)
+ run: |
+ test "$(uname -m)" = x86_64
+ sudo apt-get update
+ sudo apt-get install -y gcc-aarch64-linux-gnu
+ - name: Build native library
+ run: cargo build --release --target aarch64-unknown-linux-gnu -p braillify-go
+ env:
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
+ - name: Remove passive LLVM bitcode and verify archive
+ shell: bash
+ run: |
+ rustup component add llvm-tools
+ sysroot=$(rustc --print sysroot)
+ host=$(rustc -vV | sed -n 's/^host: //p')
+ archive=target/aarch64-unknown-linux-gnu/release/libbraillify_go.a
+ objcopy="$sysroot/lib/rustlib/$host/bin/llvm-objcopy"
+ ar t "$archive" > "$RUNNER_TEMP/members-before"
+ aarch64-linux-gnu-nm -g --defined-only --just-symbols "$archive" 2>/dev/null | LC_ALL=C sort > "$RUNNER_TEMP/symbols-before"
+ test -s "$RUNNER_TEMP/symbols-before"
+ "$objcopy" --remove-section=.llvmbc --remove-section=.llvmcmd "$archive" "$archive.cleaned"
+ mv "$archive.cleaned" "$archive"
+ test -s "$archive"
+ ar t "$archive" > "$RUNNER_TEMP/members-after"
+ aarch64-linux-gnu-nm -g --defined-only --just-symbols "$archive" 2>/dev/null | LC_ALL=C sort > "$RUNNER_TEMP/symbols-after"
+ cmp "$RUNNER_TEMP/members-before" "$RUNNER_TEMP/members-after"
+ cmp "$RUNNER_TEMP/symbols-before" "$RUNNER_TEMP/symbols-after"
+ aarch64-linux-gnu-objdump -f "$archive" > "$RUNNER_TEMP/archive-format"
+ grep -q 'architecture: aarch64' "$RUNNER_TEMP/archive-format"
+ "$sysroot/lib/rustlib/$host/bin/llvm-objdump" -h "$archive" > "$RUNNER_TEMP/archive-sections"
+ if grep -Eq '\.llvmbc|\.llvmcmd' "$RUNNER_TEMP/archive-sections"; then exit 1; fi
+
+ rust-coverage:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ toolchain: 1.98.1
+ components: rustfmt
+ cache: false
+ - run: cargo install cargo-tarpaulin --version 0.37.3
+ - name: Format like publish coverage
+ shell: bash
+ run: |
+ rustup toolchain install stable --profile minimal --component rustfmt
+ echo 'max_width = 100000' > .rustfmt.toml
+ echo 'tab_spaces = 4' >> .rustfmt.toml
+ echo 'newline_style = "Unix"' >> .rustfmt.toml
+ echo 'fn_call_width = 100000' >> .rustfmt.toml
+ echo 'fn_params_layout = "Compressed"' >> .rustfmt.toml
+ echo 'chain_width = 100000' >> .rustfmt.toml
+ echo 'merge_derives = true' >> .rustfmt.toml
+ echo 'use_small_heuristics = "Default"' >> .rustfmt.toml
+ cargo +stable fmt
+ - run: bun run test:rust
+
+ node-coverage:
+ runs-on: ${{ matrix.runner }}
+ strategy:
+ fail-fast: false
+ matrix:
+ runner: [ubuntu-latest, windows-latest, macos-latest]
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+ - uses: actions/setup-python@v7
+ with:
+ python-version: '3.14'
+ - uses: astral-sh/setup-uv@v10.0.1
+ - run: uv pip install maturin --system
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ toolchain: stable
+ components: clippy, rustfmt
+ cache: false
+ - run: bun install
+ - run: bun run build
+ - run: bun run lint
+ - run: bun test
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index b4aeafee..f9149f4c 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -55,12 +55,23 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo tarpaulin and fmt
run: |
- cargo install cargo-tarpaulin
rustup component add rustfmt clippy
+ - name: Install Linux coverage toolchain
+ if: runner.os == 'Linux'
+ run: |
+ rustup toolchain install 1.98.1 --profile minimal
+ cargo install cargo-tarpaulin --version 0.37.3
+ - name: Install coverage tool
+ if: runner.os != 'Linux'
+ run: cargo install cargo-tarpaulin
- name: Install dependencies
run: bun install
- name: Build
run: bun run build
+ - name: Verify image test prerequisites
+ shell: bash
+ run: |
+ bun -e 'const { existsSync } = require("node:fs"); const exe = process.platform === "win32" ? "target/release/braillify.exe" : "target/release/braillify"; const chrome = process.env.CHROME_PATH || Bun.which("google-chrome") || Bun.which("chromium") || (process.platform === "win32" ? "C:/Program Files/Google/Chrome/Application/chrome.exe" : process.platform === "darwin" ? "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" : ""); if (!existsSync(exe) || !chrome || !(Bun.which(chrome) || existsSync(chrome))) throw new Error("Image integration tests require the release CLI and Chrome");'
- name: Lint
run: bun run lint
- name: reformat
@@ -78,6 +89,8 @@ jobs:
- name: Test (Rust coverage)
timeout-minutes: 20
run: bun run test:rust
+ env:
+ RUSTUP_TOOLCHAIN: ${{ runner.os == 'Linux' && '1.98.1' || 'stable' }}
- name: Test (Node)
timeout-minutes: 10
# Windows에서 중첩된 `bun run`이 테스트 완료 후 간헐적으로 멈추므로 직접 실행한다.
@@ -336,6 +349,28 @@ jobs:
retention-days: 1
- uses: actions/deploy-pages@v5
+ together-approval-replies:
+ name: Notify approved partners
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
+ needs: deploy-landing
+ runs-on: ubuntu-latest
+ concurrency:
+ group: together-approval-replies
+ cancel-in-progress: false
+ permissions:
+ contents: read
+ issues: write
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+ - run: bun scripts/send-together-replies.ts
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
# publish
changepacks:
name: changepacks
@@ -1238,6 +1273,40 @@ jobs:
- name: Build native library
run: cargo build --release --target ${{ matrix.target }} -p braillify-go
+ - name: Probe Apple bitcode removal without changing the archive
+ if: runner.os == 'macOS'
+ shell: bash
+ run: |
+ archive=target/${{ matrix.target }}/release/libbraillify_go.a
+ work=$(mktemp -d)
+ trap 'rm -rf "$work"' EXIT
+ if xcrun bitcode_strip "$archive" -r -o "$work/candidate.a"; then
+ ar -t "$archive" > "$work/before-members"
+ ar -t "$work/candidate.a" > "$work/after-members"
+ nm -gUj "$archive" | LC_ALL=C sort > "$work/before-symbols"
+ nm -gUj "$work/candidate.a" | LC_ALL=C sort > "$work/after-symbols"
+ if cmp -s "$work/before-members" "$work/after-members" && cmp -s "$work/before-symbols" "$work/after-symbols"; then
+ echo 'Apple bitcode_strip retained archive members and exported symbols; candidate not installed.'
+ else
+ echo 'Apple bitcode_strip changed archive members or exported symbols; candidate not installed.'
+ fi
+ else
+ echo 'Apple bitcode_strip rejected this static archive; original retained.'
+ fi
+
+ - name: Remove passive LLVM bitcode (Linux and Windows)
+ if: runner.os != 'macOS'
+ shell: bash
+ run: |
+ rustup component add llvm-tools
+ sysroot=$(rustc --print sysroot)
+ host=$(rustc -vV | sed -n 's/^host: //p')
+ archive=target/${{ matrix.target }}/release/libbraillify_go.a
+ objcopy="$sysroot/lib/rustlib/$host/bin/llvm-objcopy"
+ if [ "$RUNNER_OS" = Windows ]; then objcopy="$objcopy.exe"; fi
+ "$objcopy" --remove-section=.llvmbc --remove-section=.llvmcmd "$archive" "$archive.cleaned"
+ mv "$archive.cleaned" "$archive"
+
- name: Copy native library
run: |
mkdir -p packages/go/libs/${{ matrix.platform }}
@@ -1302,6 +1371,19 @@ jobs:
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
+ - name: Remove passive LLVM bitcode (Linux and Windows)
+ if: runner.os != 'macOS'
+ shell: bash
+ run: |
+ rustup component add llvm-tools
+ sysroot=$(rustc --print sysroot)
+ host=$(rustc -vV | sed -n 's/^host: //p')
+ archive=target/${{ matrix.target }}/release/libbraillify_go.a
+ objcopy="$sysroot/lib/rustlib/$host/bin/llvm-objcopy"
+ if [ "$RUNNER_OS" = Windows ]; then objcopy="$objcopy.exe"; fi
+ "$objcopy" --remove-section=.llvmbc --remove-section=.llvmcmd "$archive" "$archive.cleaned"
+ mv "$archive.cleaned" "$archive"
+
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
diff --git a/.gitignore b/.gitignore
index 13354d85..afb16757 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,9 @@ test_status.json
# Paged test results emitted by `cargo test test_by_testcase` and served to the
# landing page. Generated artifact, never committed.
apps/landing/public/test-status/
+apps/landing/public/together.json
+apps/landing/public/together/cert/
+apps/landing/public/together/badge/
.venv
__pycache__
.pytest_cache
diff --git a/apps/landing/.devup/public-assets.json b/apps/landing/.devup/public-assets.json
new file mode 100644
index 00000000..8be885ec
--- /dev/null
+++ b/apps/landing/.devup/public-assets.json
@@ -0,0 +1,115 @@
+{
+ "version": 1,
+ "assets": [
+ {
+ "path": "/images/together/action-dot.svg",
+ "identity": "image/svg+xml:888051ea02f8686a39bb6cfed715c2388edeaeed20cd7050e2227fabdcb992d9:",
+ "sha256": "dd06c5c7030e97feab500b06fd6dce153cb34abf71c2b93785e251a2d8043e6b",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "9602ccae1cc309d25f8b0be62228e41c6e385214d6f4b43e630091b7ff763997",
+ "sources": [
+ "I445:4786;397:5704:node"
+ ]
+ },
+ {
+ "path": "/images/together/alert.svg",
+ "identity": "image/svg+xml:16a0bfbf1717231aed694fead6bc1445bc7b1a9ca4aca2dd910049b599a27b54:",
+ "sha256": "ab8c961202e4ea1bb0e152eb328e24951dd2fe090f1aa96fa99331b6ff4f06fc",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "40e5ca286a8543f54d8225c488d3bb6133c1403b1469c3377854731802b3efea",
+ "sources": [
+ "456:11966:node"
+ ]
+ },
+ {
+ "path": "/images/together/cross.svg",
+ "identity": "image/svg+xml:e005ba5f49c7f17dbf3ad6c530d4f484665ad51acd3d427027825cebcd85de70:",
+ "sha256": "b3025fa8e23b1a9c4d751d63a6078456e22176b976b8ac0243d15e72ef8bc8c9",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "fbe30455db54627e742b996183628088b55a5ea7b8d46207a388e80e79442c14",
+ "sources": [
+ "450:5865:node"
+ ]
+ },
+ {
+ "path": "/images/together/dialog-close.svg",
+ "identity": "image/svg+xml:5e8f45e7e2cf47fcfbdd74e4deb87c9b921f8e695fd17081524b8ca9333a3359:",
+ "sha256": "1be5f957b7ff357beb94d149c9dcd45809aed405bf9db48bf1e152790336ca02",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "7296b087f2722b74901341623ad63ddf10f82283c4484e17c6844980f28cfecf",
+ "sources": [
+ "I402:8270;397:5872;304:1512:node"
+ ]
+ },
+ {
+ "path": "/images/together/dialog-external.svg",
+ "identity": "image/svg+xml:4a8aabbdf9ae3851ecef0dc0ffb7fac07f630809f679b94a0e716628852ecd17:",
+ "sha256": "cce0e2d78776038ebdaf3ef168477e31b3bd6c3b698b2115cf6cd2e481591c80",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "55926549a7fd9151dfbb8b57c9c767f13bbda929e44761b97b80effaa7c6deed",
+ "sources": [
+ "I402:8270;397:5906;397:5704:node"
+ ]
+ },
+ {
+ "path": "/images/together/field-alert.svg",
+ "identity": "image/svg+xml:c3aed7104c36ce5341f1b8086cdd3d40c2b72d29a82b9abed383ea1cebc836bb:",
+ "sha256": "7341dc2e7bff1bea159ce84589bafafdb6fc82dd28e37e452221902897992ee9",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "432ee018027bd4105989bb77872b08c2cf076b13e8d397b0b56b439bb76427db",
+ "sources": [
+ "402:7921:node"
+ ]
+ },
+ {
+ "path": "/images/together/notice-desktop.svg",
+ "identity": "image/svg+xml:311c2f05d34929d913f2018f5bf452a53197bbc31b599556253c6ff559bd98d9:",
+ "sha256": "121b258044dfebbc9125c78c0ffaa06cc2b4bee893e8615d6ad2a1787c8446a4",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "1594ba2c01a5568d5792ff18c7ade2df052e24d17a0bf779910f3092744d2af2",
+ "sources": [
+ "402:8831:node"
+ ]
+ },
+ {
+ "path": "/images/together/notice-mobile.svg",
+ "identity": "image/svg+xml:37e369d3a52496351714e0e1c7704f76634c876b9ec9542cea18beaaeff147d1:",
+ "sha256": "719fcecb89be624974a10f01ce521ec12f61ecf48752a53dc4e63066e1022634",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "78495887788f85cad68c9b7df3390fd692aa36ba5b09b8c61f1a785e5e38c9a9",
+ "sources": [
+ "402:8833:node"
+ ]
+ },
+ {
+ "path": "/images/together/selected-mobile.svg",
+ "identity": "image/svg+xml:f701a7341c3c3b6d13fc1f993101a273f6412a04f7d4ba4f129bac6cc3be0d29:",
+ "sha256": "3a1315f721d179dc7ea9e315d3a8566fbb905e84069a50b4b3b7f1fb429853bf",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "cf7c5ea57763d1653fd962bf9293db01404885fd9c899887b22bcd0725a45147",
+ "sources": [
+ "397:5809:node"
+ ]
+ },
+ {
+ "path": "/images/together/selected-pc.svg",
+ "identity": "image/svg+xml:0408161ff7053244456d9d13d57bef439f97af77be4c42392cdc38aaeac297f8:",
+ "sha256": "7081bc21af6b0fb8fec4a707fea3b9ee9474496fa4acb8ef57101cfbcb5a18c1",
+ "mimeType": "image/svg+xml",
+ "mask": false,
+ "geometry": "ca701f936f80cf2cdfe6319eec0888a37869d511b0a8b1197ce3712536a5dc63",
+ "sources": [
+ "397:5800:node"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/apps/landing/TOGETHER.md b/apps/landing/TOGETHER.md
new file mode 100644
index 00000000..40ad1f4a
--- /dev/null
+++ b/apps/landing/TOGETHER.md
@@ -0,0 +1,17 @@
+# 함께하는 곳 목록
+
+신청 이슈는 공개 데이터가 아니다. 실제 사용과 공개 동의, 로고를 확인한 뒤 관리자가 PR에서 `together.json`에 승인 순서대로 항목을 추가한다. 이슈 번호는 중복할 수 없다.
+
+```json
+{
+ "issue": 123,
+ "kind": "학교",
+ "name": "이름",
+ "logo": "/images/together/asset-123.png",
+ "approvedAt": "2026-11-20"
+}
+```
+
+로고는 `public/images/together/`의 밝은 바탕용 PNG 또는 JPG 한 개로, 2 MiB 이하여야 한다. 빌드는 입력의 공개 필드만 `public/together.json`으로 생성하며 잘못된 기록이나 로고는 거부한다. 게시 중단 요청 시 해당 항목과 더 이상 다른 항목이 사용하지 않는 로고 파일을 같은 PR에서 제거한다. 공유 중인 로고는 남기며, 참조되지 않는 `asset-*` 로고가 있으면 빌드가 실패한다.
+
+빌드에는 `cargo build --release -p braillify`로 만든 점역 CLI와 Chrome이 필요하다. 인증 이미지와 밝은·어두운 배지는 빌드에서 생성한다. main 배포가 끝난 뒤 공개 목록과 여섯 PNG가 실제로 제공되는지 확인하고, 아직 답글이 없는 이슈에만 GitHub Actions가 답글을 단다.
diff --git a/apps/landing/assets/together/LICENSE.txt b/apps/landing/assets/together/LICENSE.txt
new file mode 100644
index 00000000..b2fd4697
--- /dev/null
+++ b/apps/landing/assets/together/LICENSE.txt
@@ -0,0 +1,94 @@
+Copyright (c) 2015-10-09 Spoqa (spoqa.com), with Reserved Font Name Spoqa Han Sans.
+Copyright (c) 2015-10-09 Spoqa (spoqa.com), with Reserved Font Name Spoqa Han Sans JP.
+Copyright (c) 2020-11-30 Spoqa (spoqa.com), with Reserved Font Name Spoqa Han Sans Neo.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION AND CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/apps/landing/assets/together/SpoqaHanSansNeo-Bold.woff2 b/apps/landing/assets/together/SpoqaHanSansNeo-Bold.woff2
new file mode 100644
index 00000000..da1dd600
Binary files /dev/null and b/apps/landing/assets/together/SpoqaHanSansNeo-Bold.woff2 differ
diff --git a/apps/landing/assets/together/SpoqaHanSansNeo-Medium.woff2 b/apps/landing/assets/together/SpoqaHanSansNeo-Medium.woff2
new file mode 100644
index 00000000..0e9b8d74
Binary files /dev/null and b/apps/landing/assets/together/SpoqaHanSansNeo-Medium.woff2 differ
diff --git a/apps/landing/devup.json b/apps/landing/devup.json
index 7669cec3..c46b6304 100644
--- a/apps/landing/devup.json
+++ b/apps/landing/devup.json
@@ -12,6 +12,8 @@
"success": "#16887F",
"warning": "#FF9800",
"error": "#EA1C5D",
+ "togetherError": "#C8124B",
+ "togetherPlaceholder": "rgba(43, 43, 43, 0.55)",
"info": "#2196F3",
"base": "#FFF",
"negativeBase": "#000",
@@ -31,6 +33,8 @@
"success": "#3F8580",
"warning": "#FF9800",
"error": "#EA1C5D",
+ "togetherError": "#EA1C5D",
+ "togetherPlaceholder": "rgba(235, 235, 235, 0.55)",
"info": "#2196F3",
"base": "#000",
"negativeBase": "#FFF",
@@ -458,4 +462,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/apps/landing/package.json b/apps/landing/package.json
index a715f421..6396d817 100644
--- a/apps/landing/package.json
+++ b/apps/landing/package.json
@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
- "build": "next build",
+ "build": "bun ../../scripts/generate-together.ts && next build",
"start": "next start"
},
"dependencies": {
diff --git a/apps/landing/public/images/together/action-dot.svg b/apps/landing/public/images/together/action-dot.svg
new file mode 100644
index 00000000..f46cc013
--- /dev/null
+++ b/apps/landing/public/images/together/action-dot.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/landing/public/images/together/alert.svg b/apps/landing/public/images/together/alert.svg
new file mode 100644
index 00000000..0422de06
--- /dev/null
+++ b/apps/landing/public/images/together/alert.svg
@@ -0,0 +1,5 @@
+
diff --git a/apps/landing/public/images/together/cross.svg b/apps/landing/public/images/together/cross.svg
new file mode 100644
index 00000000..722e36d0
--- /dev/null
+++ b/apps/landing/public/images/together/cross.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/landing/public/images/together/dialog-close.svg b/apps/landing/public/images/together/dialog-close.svg
new file mode 100644
index 00000000..bf30b4ce
--- /dev/null
+++ b/apps/landing/public/images/together/dialog-close.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/landing/public/images/together/dialog-external.svg b/apps/landing/public/images/together/dialog-external.svg
new file mode 100644
index 00000000..6e380f43
--- /dev/null
+++ b/apps/landing/public/images/together/dialog-external.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/landing/public/images/together/field-alert.svg b/apps/landing/public/images/together/field-alert.svg
new file mode 100644
index 00000000..d50d09d1
--- /dev/null
+++ b/apps/landing/public/images/together/field-alert.svg
@@ -0,0 +1,5 @@
+
diff --git a/apps/landing/public/images/together/notice-desktop.svg b/apps/landing/public/images/together/notice-desktop.svg
new file mode 100644
index 00000000..bcf0bbfd
--- /dev/null
+++ b/apps/landing/public/images/together/notice-desktop.svg
@@ -0,0 +1,5 @@
+
diff --git a/apps/landing/public/images/together/notice-mobile.svg b/apps/landing/public/images/together/notice-mobile.svg
new file mode 100644
index 00000000..6d4026b2
--- /dev/null
+++ b/apps/landing/public/images/together/notice-mobile.svg
@@ -0,0 +1,5 @@
+
diff --git a/apps/landing/public/images/together/selected-mobile.svg b/apps/landing/public/images/together/selected-mobile.svg
new file mode 100644
index 00000000..d9c8cd28
--- /dev/null
+++ b/apps/landing/public/images/together/selected-mobile.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/landing/public/images/together/selected-pc.svg b/apps/landing/public/images/together/selected-pc.svg
new file mode 100644
index 00000000..db0583ed
--- /dev/null
+++ b/apps/landing/public/images/together/selected-pc.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/landing/src/app/together/Together.tsx b/apps/landing/src/app/together/Together.tsx
new file mode 100644
index 00000000..25d680c5
--- /dev/null
+++ b/apps/landing/src/app/together/Together.tsx
@@ -0,0 +1,486 @@
+'use client'
+
+import { Box, Center, Flex, Text, VStack } from '@devup-ui/react'
+import Link from 'next/link'
+import { useEffect, useRef, useState } from 'react'
+
+import {
+ Controls as Choice,
+ field,
+ fieldLabel,
+ primaryAction,
+ retryAction,
+ secondaryAction,
+} from '@/components/together/Controls'
+import { loadTogetherList, type Partner } from '@/lib/together-list'
+import { previewDescription } from '@/lib/together-preview'
+
+const kinds = ['기업', '기관', '학교', '단체']
+
+export default function Together() {
+ const [kind, setKind] = useState('기업')
+ const [name, setName] = useState('')
+ const [braille, setBraille] = useState('')
+ const [partners, setPartners] = useState(null)
+ const [failed, setFailed] = useState(false)
+ const [attempt, setAttempt] = useState(0)
+ const [visible, setVisible] = useState(60)
+ const [announcement, setAnnouncement] = useState('')
+ const focusId = useRef(null)
+
+ useEffect(() => {
+ let cancelled = false
+ const timeout = setTimeout(() => {
+ import('braillify')
+ .then(
+ (mod) =>
+ !cancelled &&
+ setBraille(
+ mod.translateToUnicode(name || '이름을 입력하면 여기에 표시돼요'),
+ ),
+ )
+ .catch(() => {
+ if (!cancelled) setBraille('')
+ })
+ }, 200)
+ return () => {
+ cancelled = true
+ clearTimeout(timeout)
+ }
+ }, [name])
+
+ useEffect(() => {
+ const controller = new AbortController()
+ let active = true
+ loadTogetherList(controller.signal)
+ .then((data: Partner[]) => {
+ if (!active) return
+ setPartners(data)
+ const id = /^#org-(\d+)$/.exec(window.location.hash)?.[1]
+ const index = data.findIndex((item) => String(item.issue) === id)
+ if (index >= 0) {
+ focusId.current = data[index].issue
+ setVisible(Math.ceil((index + 1) / 60) * 60)
+ }
+ })
+ .catch(() => {
+ if (active) setFailed(true)
+ })
+ return () => {
+ active = false
+ controller.abort()
+ }
+ }, [attempt])
+
+ useEffect(() => {
+ if (focusId.current === null) return
+ const element = document.getElementById(`org-${focusId.current}`)
+ if (element) {
+ element.focus()
+ element.scrollIntoView({
+ block: 'center',
+ behavior: window.matchMedia('(prefers-reduced-motion: reduce)').matches
+ ? 'instant'
+ : 'smooth',
+ })
+ focusId.current = null
+ }
+ }, [partners, visible])
+
+ const register = `/together/register?${new URLSearchParams({ kind, name })}`
+ return (
+
+
+
+ Braillify와 함께하는 곳
+
+
+ Braillify를 쓰고 있는 기업·기관·학교·단체를 소개합니다. 신청하면 실제
+ 사용을 확인한 뒤 이곳에 함께 소개해 드려요.
+
+
+
+
+
+
+
+ 미리 보기
+
+
+
+
+
+
+
+
+
+
+ 로고
+
+
+
+
+
+
+ {name || '이름을 입력하면 여기에 표시돼요'}
+
+
+ {braille}
+
+
+
+
+
+ 위 {kind}
+ {kind === '기업' || kind === '기관' ? '은' : '는'} Braillify와
+ 함께하는 {kind}입니다.
+
+
+ 위 {kind}
+ {kind === '기업' || kind === '기관' ? '은' : '는'} Braillify와
+ 함께하는 {kind}입니다.
+
+
+ braillify.kr/together · 승인 연월
+
+
+ braillify.kr/together · 승인 연월
+
+
+
+
+ {previewDescription(name, kind, braille)}
+
+
+
+
+ 우리 이름으로 미리 보기
+
+
+ 승인되면 이 인증 이미지를 GitHub 답글로 보내 드려요.
+
+
+
+
+ 구분
+
+
+ {kinds.map((value) => (
+ setKind(value)}
+ type="radio"
+ >
+ {value}
+
+ ))}
+
+
+
+
+ 이 이름으로 신청하기
+
+
+
+
+
+
+
+
+ 함께하는 곳
+
+ {partners && partners.length > 10 && (
+ 지금 {partners.length}곳이 함께하고 있어요
+ )}
+ {failed ? (
+
+
+
+
+ 목록을 불러오지 못했어요.
+ 잠시 뒤
+ 다시 확인해 주세요.
+
+
+
+
+ ) : !partners ? (
+
+ ) : partners.length === 0 ? (
+
+
+ ⠿
+
+
+ 첫 번째로 함께해 주세요
+
+
+ ) : (
+
+ {partners.slice(0, visible).map((item) => (
+
+
+
+ {item.kind}
+
+
+
+
+
+
+ {item.name}
+
+
+ ))}
+
+ )}
+ {announcement}
+ {partners && visible < partners.length && (
+
+ )}
+
+
+
+
+ 게시를 멈추고 싶으면 contact@devfive.kr로 알려 주세요.
+
+
+
+ )
+}
diff --git a/apps/landing/src/app/together/page.tsx b/apps/landing/src/app/together/page.tsx
new file mode 100644
index 00000000..f58c1599
--- /dev/null
+++ b/apps/landing/src/app/together/page.tsx
@@ -0,0 +1,9 @@
+import type { Metadata } from 'next'
+
+import Together from './Together'
+
+export const metadata: Metadata = { title: '함께하는 곳' }
+
+export default function TogetherPage() {
+ return
+}
diff --git a/apps/landing/src/app/together/register/Register.tsx b/apps/landing/src/app/together/register/Register.tsx
new file mode 100644
index 00000000..e1a85e40
--- /dev/null
+++ b/apps/landing/src/app/together/register/Register.tsx
@@ -0,0 +1,971 @@
+'use client'
+
+import { Box, Center, css, Flex, Text, VStack } from '@devup-ui/react'
+import Link from 'next/link'
+import { useEffect, useRef, useState } from 'react'
+
+import {
+ consentControl,
+ Controls as Choice,
+ errorMessage,
+ field,
+ primaryAction,
+ secondaryAction,
+} from '@/components/together/Controls'
+import { applicationIssue } from '@/lib/together-application'
+import {
+ type ApplicationErrors,
+ type ApplicationField,
+ validateApplication,
+} from '@/lib/together-validation'
+
+const kinds = ['기업', '기관', '학교', '단체']
+const requiredMark = css({ color: '$togetherError', marginLeft: '4px' })
+const dateHint = css({
+ color: '$togetherPlaceholder',
+ typography: 'body',
+ fontSize: '16px',
+ lineHeight: ['normal', null, null, '1.8'],
+})
+const formField = css({
+ display: 'flex',
+ flexDirection: 'column',
+ gap: ['8px', null, null, '10px'],
+ color: '$title',
+ typography: 'bodyBold',
+})
+const methods = [
+ 'Node.js',
+ 'Python',
+ 'Rust',
+ '.NET',
+ 'C',
+ 'Go',
+ 'JVM',
+ 'Ruby',
+ 'HTTP API',
+ '기타',
+]
+
+export default function Register() {
+ const [kind, setKind] = useState('기업')
+ const [name, setName] = useState('')
+ const [since, setSince] = useState('')
+ const [dateAnnouncement, setDateAnnouncement] = useState('')
+ const [dateFocused, setDateFocused] = useState(false)
+ const [supportsPicker, setSupportsPicker] = useState(false)
+ const [selected, setSelected] = useState([])
+ const [issue, setIssue] = useState | null>(null)
+ const [copied, setCopied] = useState(false)
+ const [errors, setErrors] = useState({})
+ const dialog = useRef(null)
+ const dateInput = useRef(null)
+ const datePicker = useRef(null)
+ const pendingFocus = useRef(null)
+ useEffect(() => {
+ setSupportsPicker(
+ typeof HTMLInputElement.prototype.showPicker === 'function',
+ )
+ }, [])
+ useEffect(() => {
+ const params = new URLSearchParams(window.location.search)
+ const initialKind = params.get('kind')
+ if (initialKind && kinds.includes(initialKind)) setKind(initialKind)
+ setName((params.get('name') || '').slice(0, 20))
+ }, [])
+ useEffect(() => {
+ if (issue) dialog.current?.showModal()
+ }, [issue])
+ useEffect(() => {
+ if (!pendingFocus.current) return
+ document.getElementById(`application-${pendingFocus.current}`)?.focus()
+ pendingFocus.current = null
+ }, [errors])
+
+ function clearError(fieldName: ApplicationField) {
+ setErrors((current) => {
+ if (!current[fieldName]) return current
+ const next = { ...current }
+ delete next[fieldName]
+ return next
+ })
+ }
+
+ function updateSince(value: string) {
+ setSince(value)
+ setDateAnnouncement(
+ value ? `사용 시작 시기 ${value} 선택됨` : '사용 시작 시기가 지워졌어요',
+ )
+ }
+
+ function submit(event: React.FormEvent) {
+ event.preventDefault()
+ const form = event.currentTarget
+ const data = new FormData(form)
+ const dateInput = form.elements.namedItem('since') as HTMLInputElement
+ if (!dateInput.validity.valid) {
+ dateInput.reportValidity()
+ return
+ }
+ const urlInput = form.elements.namedItem('url') as HTMLInputElement
+ const nextErrors = validateApplication({
+ name,
+ product: String(data.get('product') || ''),
+ purpose: String(data.get('purpose') || ''),
+ methods: selected,
+ consent: data.has('consent'),
+ urlInvalid: urlInput.validity.typeMismatch,
+ })
+ const first = (
+ ['name', 'product', 'url', 'purpose', 'methods', 'consent'] as const
+ ).find((fieldName) => nextErrors[fieldName])
+ pendingFocus.current = first || null
+ setErrors(nextErrors)
+ if (first) {
+ return
+ }
+ setIssue(
+ applicationIssue({
+ kind,
+ name,
+ status: String(data.get('status')),
+ product: String(data.get('product')),
+ url: String(data.get('url')),
+ purpose: String(data.get('purpose')),
+ methods: selected,
+ since: String(data.get('since')),
+ consent: data.has('consent'),
+ }),
+ )
+ }
+ return (
+
+
+
+ 함께하는 곳 신청
+
+
+ Braillify를 실제로 쓰고 있는 곳을 확인해 ‘함께하는 곳’에 소개합니다.
+ 신청은 GitHub 이슈로 받고, 매주 한 번 확인해요.
+
+
+
+
+
+
+
+ 함께할 곳
+
+
+
+
+ 구분
+
+ *
+
+
+
+ {kinds.map((value) => (
+ setKind(value)}
+ type="radio"
+ >
+ {value}
+
+ ))}
+
+
+
+
+
+ 로고
+
+ *
+
+
+
+
+
+ 로고 파일은 다음 단계 GitHub 화면에서 올려요. PNG·JPG 1개,
+ 2MB 이하.
+
+
+
+
+
+
+ 사용 내용
+
+
+
+
+
+ 사용 상태
+
+ *
+
+
+
+ 도입 준비 중이면 사용을 시작한 뒤 소개해 드려요.
+
+
+
+ {['사용 중', '도입 준비 중'].map((value, index) => (
+
+ {value}
+
+ ))}
+
+
+
+
+
+
+
+
+ 사용 방식
+
+ *
+
+
+
+ 여러 개 고를 수 있어요
+
+
+ 필수 항목, 하나 이상 선택해 주세요
+
+
+
+ {methods.map((value, index) => (
+ {
+ setSelected(
+ e.target.checked
+ ? [...selected, value]
+ : selected.filter((item) => item !== value),
+ )
+ if (e.target.checked) clearError('methods')
+ }}
+ type="checkbox"
+ >
+ {value}
+
+ ))}
+
+ {errors.methods && (
+
+ {errors.methods}
+
+ )}
+
+
+
+
+ setDateFocused(false)}
+ onChange={(event) => updateSince(event.target.value)}
+ onFocus={() => setDateFocused(true)}
+ style={{
+ color: !since && !dateFocused ? 'transparent' : undefined,
+ }}
+ type="date"
+ value={since}
+ />
+ {supportsPicker && (
+ <>
+ updateSince(event.target.value)}
+ style={{
+ position: 'absolute',
+ right: 0,
+ top: 0,
+ width: '32px',
+ height: '100%',
+ opacity: 0,
+ pointerEvents: 'none',
+ }}
+ tabIndex={-1}
+ type="date"
+ value={since}
+ />
+ {
+ try {
+ const picker = window.matchMedia(
+ '(max-width: 767px)',
+ ).matches
+ ? dateInput.current
+ : datePicker.current
+ if (picker?.showPicker) picker.showPicker()
+ else {
+ setSupportsPicker(false)
+ dateInput.current?.focus()
+ }
+ } catch {
+ setSupportsPicker(false)
+ dateInput.current?.focus()
+ }
+ }}
+ position="absolute"
+ right="0"
+ top="0"
+ type="button"
+ w="32px"
+ />
+ >
+ )}
+ {!since && !dateFocused && (
+
+ 예: 2026-09-01
+
+ )}
+
+
+ {dateAnnouncement}
+
+
+
+
+
+ 공개 동의
+
+
+
+
+ 공개 동의
+
+ *
+
+
+
+ {
+ if (e.target.checked) clearError('consent')
+ }}
+ required
+ type="checkbox"
+ />
+
+
+ 이름과 로고를 braillify.kr ‘함께하는 곳’에 게시하는 데
+ 동의합니다.
+
+
+ 게시를 멈추고 싶으면 contact@devfive.kr로 알려 주세요.
+
+
+
+ {errors.consent && (
+
+ {errors.consent}
+
+ )}
+
+
+
+
+
+ 신청 내용과 로고는 GitHub 이슈로 공개돼요. 이메일·전화번호 같은
+ 개인 정보는 쓰지 마세요.
+
+
+
+
+ 이전으로
+
+
+
+
+
+
+
+ 신청은 이렇게 진행돼요
+
+
+ 신청은 이렇게 진행돼요
+
+
+ {[
+ '이 페이지에서 신청 내용을 써요',
+ 'GitHub 이슈에 로고를 올려 제출해요',
+ '매주 한 번 실제 사용을 확인해요',
+ '승인되면 목록에 소개하고 이슈로 알려 드려요',
+ ].map((step, index) => (
+
+
+
+ {index + 1}
+
+
+
+ {step}
+
+
+ ))}
+
+
+
+ GitHub 계정이 없으면 신청 내용과 로고를 contact@devfive.kr로 보내
+ 주세요.
+
+
+
+
+
+ )
+}
diff --git a/apps/landing/src/app/together/register/page.tsx b/apps/landing/src/app/together/register/page.tsx
new file mode 100644
index 00000000..013d94b3
--- /dev/null
+++ b/apps/landing/src/app/together/register/page.tsx
@@ -0,0 +1,9 @@
+import type { Metadata } from 'next'
+
+import Register from './Register'
+
+export const metadata: Metadata = { title: '함께하는 곳 신청' }
+
+export default function RegisterPage() {
+ return
+}
diff --git a/apps/landing/src/components/Header/MobileMenu.tsx b/apps/landing/src/components/Header/MobileMenu.tsx
index 98baa7a6..34733b6c 100644
--- a/apps/landing/src/components/Header/MobileMenu.tsx
+++ b/apps/landing/src/components/Header/MobileMenu.tsx
@@ -175,6 +175,16 @@ export default function MobileMenu() {
>
테스트 케이스
+
+ 함께하는 곳
+
+
+
+
+
+
+ 함께하는 곳
+
+
+
+
& { children: ReactNode }) {
+ return (
+
+ )
+}
+
+export const field = css({
+ appearance: 'none',
+ width: '100%',
+ minHeight: ['48px', null, null, '52px'],
+ padding: ['12px', null, null, '13px 16px'],
+ border: '1px solid $primary',
+ borderRadius: '12px',
+ background: '$containerBackground',
+ color: '$text',
+ typography: 'body',
+ _focusVisible: { outline: '2px solid $link', outlineOffset: '2px' },
+ selectors: {
+ '&[data-registration-field]': {
+ fontSize: '16px',
+ lineHeight: ['normal', null, null, '1.8'],
+ },
+ '&::placeholder': {
+ color: '$togetherPlaceholder',
+ opacity: 1,
+ },
+ '&[aria-invalid="true"]': { border: '2px solid $togetherError' },
+ '&[data-multiline]': {
+ height: ['120px', null, null, '140px'],
+ resize: 'vertical',
+ },
+ },
+})
+
+export const fieldLabel = css({
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '8px',
+ color: '$title',
+ typography: 'bodyBold',
+})
+
+export const errorMessage = css({
+ display: 'inline-flex',
+ alignItems: 'center',
+ gap: '6px',
+ color: '#C8124B',
+ _themeDark: { color: '$title' },
+ typography: 'docsCaption',
+ selectors: {
+ '&::before': {
+ content: '""',
+ flexShrink: 0,
+ width: '16px',
+ height: '16px',
+ backgroundColor: 'currentColor',
+ maskImage: 'url(/images/together/field-alert.svg)',
+ maskPosition: 'center',
+ maskRepeat: 'no-repeat',
+ maskSize: 'contain',
+ },
+ },
+})
+
+export const consentControl = css({
+ appearance: 'none',
+ flexShrink: 0,
+ width: '24px',
+ height: '24px',
+ border: '1.5px solid $primary',
+ borderRadius: '5px',
+ background: '$containerBackground',
+ cursor: 'pointer',
+ _checked: { bg: '$primary', color: '$base' },
+ _focusVisible: { outline: '2px solid $link', outlineOffset: '2px' },
+ selectors: {
+ '&[aria-invalid="true"]': { border: '2px solid $togetherError' },
+ '&:checked::after': {
+ content: '"✓"',
+ display: 'block',
+ textAlign: 'center',
+ fontSize: '18px',
+ lineHeight: '20px',
+ },
+ },
+})
+
+export const primaryAction = css({
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ border: '1px solid $primary',
+ borderRadius: '1000px',
+ padding: '17px 32px',
+ background: '$primary',
+ color: '$base',
+ typography: 'button',
+ cursor: 'pointer',
+ textDecoration: 'none',
+ _hover: { opacity: 0.8 },
+ _focusVisible: { outline: '2px solid $link', outlineOffset: '2px' },
+})
+
+export const secondaryAction = css({
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ border: '1px solid $primary',
+ borderRadius: '1000px',
+ padding: '17px 32px',
+ background: '$containerBackground',
+ color: '$text',
+ typography: 'button',
+ cursor: 'pointer',
+ textDecoration: 'none',
+ _hover: { bg: '$menuHover' },
+ _focusVisible: { outline: '2px solid $link', outlineOffset: '2px' },
+})
+
+export const retryAction = css({
+ border: 'none',
+ padding: '0',
+ background: 'transparent',
+ color: '$text',
+ typography: 'docsCaption',
+ textDecoration: 'underline',
+ cursor: 'pointer',
+ _focusVisible: { outline: '2px solid $link', outlineOffset: '2px' },
+})
diff --git a/apps/landing/src/lib/together-application.test.ts b/apps/landing/src/lib/together-application.test.ts
new file mode 100644
index 00000000..8c2847b6
--- /dev/null
+++ b/apps/landing/src/lib/together-application.test.ts
@@ -0,0 +1,35 @@
+import { expect, test } from 'bun:test'
+
+import { applicationIssue } from './together-application'
+
+const application = {
+ kind: '학교',
+ name: '점자 학교',
+ status: '사용 중',
+ product: '학습 앱',
+ url: 'https://example.com/?a=1&b=2',
+ purpose: '안내 문장을 점자로 보여 줍니다.',
+ methods: ['Node.js', 'Rust'],
+ since: '2026년',
+ consent: true,
+}
+
+test('신청 내용을 GitHub 이슈 주소와 본문에 보존한다', () => {
+ const result = applicationIssue(application)
+ const url = new URL(result.url)
+ expect(url.searchParams.get('title')).toContain(application.name)
+ expect(url.searchParams.get('body')).toBe(result.body)
+ expect(result.body).toContain(application.url)
+ expect(result.body).toContain('Node.js, Rust')
+ expect(result.copyRequired).toBe(false)
+})
+
+test('긴 신청 내용은 본문을 복사하도록 짧은 주소를 제공한다', () => {
+ const result = applicationIssue({
+ ...application,
+ purpose: '가'.repeat(5000),
+ })
+ expect(result.copyRequired).toBe(true)
+ expect(new URL(result.url).searchParams.has('body')).toBe(false)
+ expect(result.body).toContain('가'.repeat(5000))
+})
diff --git a/apps/landing/src/lib/together-application.ts b/apps/landing/src/lib/together-application.ts
new file mode 100644
index 00000000..9892bcd4
--- /dev/null
+++ b/apps/landing/src/lib/together-application.ts
@@ -0,0 +1,40 @@
+export interface TogetherApplication {
+ kind: string
+ name: string
+ status: string
+ product: string
+ url: string
+ purpose: string
+ methods: string[]
+ since: string
+ consent: boolean
+}
+
+export function applicationIssue(application: TogetherApplication) {
+ const body = [
+ '## 함께할 곳',
+ `구분: ${application.kind}`,
+ `이름: ${application.name}`,
+ '',
+ '## 사용 내용',
+ `사용 상태: ${application.status}`,
+ `사용처 이름: ${application.product}`,
+ `사용처 주소: ${application.url || '없음'}`,
+ `용도: ${application.purpose}`,
+ `사용 방식: ${application.methods.join(', ')}`,
+ `사용 시작 시기: ${application.since || '없음'}`,
+ '',
+ `공개 동의: ${application.consent ? '동의' : '동의하지 않음'}`,
+ '',
+ '## 로고',
+ '여기에 밝은 바탕용 PNG 또는 JPG 로고 1개(2MB 이하)를 첨부해 주세요.',
+ ].join('\n')
+
+ const url = new URL('https://github.com/dev-five-git/braillify/issues/new')
+ url.searchParams.set('title', `[함께하는 곳] ${application.name}`)
+ url.searchParams.set('body', body)
+ // shortcut: very long URLs require copying the body, until GitHub accepts larger issue URLs reliably.
+ const copyRequired = url.toString().length > 1800
+ if (copyRequired) url.searchParams.delete('body')
+ return { body, url: url.toString(), copyRequired }
+}
diff --git a/apps/landing/src/lib/together-list.test.ts b/apps/landing/src/lib/together-list.test.ts
new file mode 100644
index 00000000..5d37b309
--- /dev/null
+++ b/apps/landing/src/lib/together-list.test.ts
@@ -0,0 +1,110 @@
+import { expect, spyOn, test } from 'bun:test'
+
+import { loadTogetherList } from './together-list'
+
+test('기본 요청으로 공개 목록을 가져온다', async () => {
+ const request = spyOn(globalThis, 'fetch').mockResolvedValue(
+ Response.json([]),
+ )
+ try {
+ expect(await loadTogetherList(new AbortController().signal)).toEqual([])
+ expect(request).toHaveBeenCalledWith('/together.json', {
+ signal: expect.any(AbortSignal),
+ })
+ } finally {
+ request.mockRestore()
+ }
+})
+
+test('빈 목록과 승인된 목록을 반환한다', async () => {
+ expect(
+ await loadTogetherList(
+ new AbortController().signal,
+ async () => Response.json([]),
+ 50,
+ ),
+ ).toEqual([])
+ const item = {
+ issue: 1,
+ kind: '학교',
+ name: '학교',
+ logo: '/images/together/asset-1.png',
+ }
+ expect(
+ await loadTogetherList(
+ new AbortController().signal,
+ async () => Response.json([item]),
+ 50,
+ ),
+ ).toEqual([item])
+})
+
+test('실패, 잘못된 응답 및 시간 초과는 오류로 처리한다', async () => {
+ await expect(
+ loadTogetherList(
+ new AbortController().signal,
+ async () => new Response('', { status: 500 }),
+ 50,
+ ),
+ ).rejects.toThrow()
+ await expect(
+ loadTogetherList(
+ new AbortController().signal,
+ async () => Response.json([{ issue: 1 }]),
+ 50,
+ ),
+ ).rejects.toThrow()
+ await expect(
+ loadTogetherList(
+ new AbortController().signal,
+ async () => Response.json({}),
+ 50,
+ ),
+ ).rejects.toThrow()
+ await expect(
+ loadTogetherList(
+ new AbortController().signal,
+ () => new Promise(() => {}),
+ 10,
+ ),
+ ).rejects.toThrow()
+})
+
+test('시간 초과 후 다시 시도하면 새 목록을 읽는다', async () => {
+ let calls = 0
+ const request = async () => {
+ calls++
+ if (calls === 1) return await new Promise(() => {})
+ return Response.json([])
+ }
+ await expect(
+ loadTogetherList(new AbortController().signal, request, 10),
+ ).rejects.toThrow()
+ expect(
+ await loadTogetherList(new AbortController().signal, request, 50),
+ ).toEqual([])
+})
+
+test('화면을 떠나면 진행 중인 요청을 취소한다', async () => {
+ const controller = new AbortController()
+ let requestSignal: AbortSignal | null | undefined
+ const pending = loadTogetherList(
+ controller.signal,
+ (_input, init) => {
+ requestSignal = init?.signal
+ return new Promise(() => {})
+ },
+ 1000,
+ )
+ controller.abort()
+ await expect(pending).rejects.toThrow()
+ expect(requestSignal?.aborted).toBe(true)
+})
+
+test('이미 취소된 요청은 데이터를 반환하지 않는다', async () => {
+ const controller = new AbortController()
+ controller.abort()
+ await expect(
+ loadTogetherList(controller.signal, async () => Response.json([]), 50),
+ ).rejects.toThrow()
+})
diff --git a/apps/landing/src/lib/together-list.ts b/apps/landing/src/lib/together-list.ts
new file mode 100644
index 00000000..57274e47
--- /dev/null
+++ b/apps/landing/src/lib/together-list.ts
@@ -0,0 +1,66 @@
+export type Partner = {
+ issue: number
+ kind: string
+ name: string
+ logo: string
+}
+
+export async function loadTogetherList(
+ signal: AbortSignal,
+ request: (
+ input: RequestInfo | URL,
+ init?: RequestInit,
+ ) => Promise = fetch,
+ timeoutMs = 3000,
+): Promise {
+ const controller = new AbortController()
+ const abort = () => controller.abort()
+ signal.addEventListener('abort', abort, { once: true })
+ if (signal.aborted) abort()
+ const timer = setTimeout(abort, timeoutMs)
+ try {
+ const cancelled = new Promise((_, reject) => {
+ if (controller.signal.aborted) reject(new Error('List request cancelled'))
+ else
+ controller.signal.addEventListener(
+ 'abort',
+ () => reject(new Error('List request cancelled')),
+ { once: true },
+ )
+ })
+ return await Promise.race([
+ cancelled,
+ (async () => {
+ const response = await request('/together.json', {
+ signal: controller.signal,
+ })
+ if (!response.ok) throw new Error('List request failed')
+ const data: unknown = await response.json()
+ if (!Array.isArray(data)) throw new Error('Invalid list')
+ const seen = new Set()
+ for (const item of data) {
+ if (
+ !item ||
+ typeof item !== 'object' ||
+ !Number.isSafeInteger(item.issue) ||
+ item.issue <= 0 ||
+ seen.has(item.issue) ||
+ !['기업', '기관', '학교', '단체'].includes(item.kind) ||
+ typeof item.name !== 'string' ||
+ !item.name.trim() ||
+ typeof item.logo !== 'string' ||
+ !/^\/images\/together\/asset-[a-zA-Z0-9_-]+\.(png|jpg|jpeg)$/.test(
+ item.logo,
+ )
+ )
+ throw new Error('Invalid list entry')
+ seen.add(item.issue)
+ }
+ return data as Partner[]
+ })(),
+ ])
+ } finally {
+ clearTimeout(timer)
+ signal.removeEventListener('abort', abort)
+ }
+}
diff --git a/apps/landing/src/lib/together-preview.test.ts b/apps/landing/src/lib/together-preview.test.ts
new file mode 100644
index 00000000..21b36fbf
--- /dev/null
+++ b/apps/landing/src/lib/together-preview.test.ts
@@ -0,0 +1,15 @@
+import { expect, test } from 'bun:test'
+
+import { previewDescription } from './together-preview'
+
+test('스크린리더 미리 보기에 이름, 구분과 점역을 담는다', () => {
+ expect(previewDescription('점자 학교', '학교', '⠨⠎')).toBe(
+ '미리 보기: 점자 학교, 학교, 점자 ⠨⠎',
+ )
+})
+
+test('이름이 비어 있으면 안내를 읽는다', () => {
+ expect(previewDescription('', '기업', '')).toContain(
+ '이름을 입력하면 여기에 표시돼요',
+ )
+})
diff --git a/apps/landing/src/lib/together-preview.ts b/apps/landing/src/lib/together-preview.ts
new file mode 100644
index 00000000..949b7a61
--- /dev/null
+++ b/apps/landing/src/lib/together-preview.ts
@@ -0,0 +1,7 @@
+export function previewDescription(
+ name: string,
+ kind: string,
+ braille: string,
+) {
+ return `미리 보기: ${name || '이름을 입력하면 여기에 표시돼요'}, ${kind}, 점자 ${braille}`
+}
diff --git a/apps/landing/src/lib/together-validation.test.ts b/apps/landing/src/lib/together-validation.test.ts
new file mode 100644
index 00000000..a99fc6df
--- /dev/null
+++ b/apps/landing/src/lib/together-validation.test.ts
@@ -0,0 +1,37 @@
+import { expect, test } from 'bun:test'
+
+import { validateApplication } from './together-validation'
+
+test('빈 필수 항목마다 안내를 반환한다', () => {
+ expect(
+ validateApplication({
+ name: ' ',
+ product: '',
+ purpose: '',
+ methods: [],
+ consent: false,
+ urlInvalid: false,
+ }),
+ ).toEqual({
+ name: '이름을 입력해 주세요',
+ product: '사용처 이름을 입력해 주세요',
+ purpose: '사용 용도를 입력해 주세요',
+ methods: '하나 이상 골라 주세요',
+ consent: '동의해야 신청할 수 있어요',
+ })
+})
+
+test('유효한 입력은 오류가 없고 잘못된 선택 주소는 거부한다', () => {
+ const valid = {
+ name: '학교',
+ product: '앱',
+ purpose: '교육',
+ methods: ['Rust'],
+ consent: true,
+ urlInvalid: false,
+ }
+ expect(validateApplication(valid)).toEqual({})
+ expect(validateApplication({ ...valid, urlInvalid: true })).toEqual({
+ url: '올바른 주소를 입력해 주세요',
+ })
+})
diff --git a/apps/landing/src/lib/together-validation.ts b/apps/landing/src/lib/together-validation.ts
new file mode 100644
index 00000000..f04a9144
--- /dev/null
+++ b/apps/landing/src/lib/together-validation.ts
@@ -0,0 +1,21 @@
+export type ApplicationField =
+ 'name' | 'product' | 'url' | 'purpose' | 'methods' | 'consent'
+export type ApplicationErrors = Partial>
+
+export function validateApplication(data: {
+ name: string
+ product: string
+ purpose: string
+ methods: string[]
+ consent: boolean
+ urlInvalid: boolean
+}): ApplicationErrors {
+ const errors: ApplicationErrors = {}
+ if (!data.name.trim()) errors.name = '이름을 입력해 주세요'
+ if (!data.product.trim()) errors.product = '사용처 이름을 입력해 주세요'
+ if (data.urlInvalid) errors.url = '올바른 주소를 입력해 주세요'
+ if (!data.purpose.trim()) errors.purpose = '사용 용도를 입력해 주세요'
+ if (!data.methods.length) errors.methods = '하나 이상 골라 주세요'
+ if (!data.consent) errors.consent = '동의해야 신청할 수 있어요'
+ return errors
+}
diff --git a/apps/landing/together.json b/apps/landing/together.json
new file mode 100644
index 00000000..fe51488c
--- /dev/null
+++ b/apps/landing/together.json
@@ -0,0 +1 @@
+[]
diff --git a/packages/go/cgo.go b/packages/go/cgo.go
index 3048345d..668bbf0a 100644
--- a/packages/go/cgo.go
+++ b/packages/go/cgo.go
@@ -5,7 +5,7 @@ package braillify
#cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/libs/darwin-arm64 -lbraillify_go -lm -lpthread
#cgo linux,amd64 LDFLAGS: -L${SRCDIR}/libs/linux-amd64 -lbraillify_go -lm -lpthread -ldl
#cgo linux,arm64 LDFLAGS: -L${SRCDIR}/libs/linux-arm64 -lbraillify_go -lm -lpthread -ldl
-#cgo windows,amd64 LDFLAGS: -L${SRCDIR}/libs/windows-amd64 -lbraillify_go -lntdll -lws2_32 -lbcrypt -ladvapi32 -luserenv
+#cgo windows,amd64 LDFLAGS: -L${SRCDIR}/libs/windows-amd64 -lbraillify_go -lntdll -lws2_32 -lbcrypt -ladvapi32 -luserenv -lsynchronization
#include
#include
diff --git a/plugin.ts b/plugin.ts
index 9633b543..2c48b6ec 100644
--- a/plugin.ts
+++ b/plugin.ts
@@ -7,18 +7,13 @@ plugin({
const jsPath = `${path.slice(0, -5)}.js`
const glue = await import(jsPath)
const bytes = await Bun.file(path).arrayBuffer()
- const instantiated = await WebAssembly.instantiate(bytes, {
+ const { instance } = await WebAssembly.instantiate(bytes, {
'./index_bg.js': {
__wbindgen_cast_0000000000000001:
glue.__wbindgen_cast_0000000000000001,
__wbindgen_init_externref_table: glue.__wbindgen_init_externref_table,
},
})
- const instance =
- instantiated instanceof WebAssembly.Instance
- ? instantiated
- : instantiated.instance
-
return {
exports: Object.fromEntries(Object.entries(instance.exports)),
loader: 'object',
diff --git a/scripts/generate-together.ts b/scripts/generate-together.ts
new file mode 100644
index 00000000..a1d2d609
--- /dev/null
+++ b/scripts/generate-together.ts
@@ -0,0 +1,15 @@
+import { readFile } from 'node:fs/promises'
+import { dirname, join, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+import { validatePartners } from './together-data'
+import { generateTogetherImages, pruneTogetherImages } from './together-images'
+import { publishPartners, validatePartnerLogos } from './together-publish'
+
+const landing = resolve(dirname(fileURLToPath(import.meta.url)), '../apps/landing')
+const partners = validatePartners(JSON.parse(await readFile(join(landing, 'together.json'), 'utf8')))
+const publicDir = join(landing, 'public')
+await validatePartnerLogos(partners, publicDir)
+await generateTogetherImages(partners, publicDir)
+await pruneTogetherImages(partners, publicDir)
+await publishPartners(partners, publicDir)
diff --git a/scripts/send-together-replies.ts b/scripts/send-together-replies.ts
new file mode 100644
index 00000000..1c694ed2
--- /dev/null
+++ b/scripts/send-together-replies.ts
@@ -0,0 +1,10 @@
+import { readFile } from 'node:fs/promises'
+import { dirname, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+import { validatePartners } from './together-data'
+import { sendApprovalReplies } from './together-replies'
+
+const path = resolve(dirname(fileURLToPath(import.meta.url)), '../apps/landing/together.json')
+const partners = validatePartners(JSON.parse(await readFile(path, 'utf8')))
+await sendApprovalReplies(partners, process.env.GITHUB_TOKEN || '')
diff --git a/scripts/test_verify_macos_go_archive.py b/scripts/test_verify_macos_go_archive.py
new file mode 100644
index 00000000..6d0e8c6e
--- /dev/null
+++ b/scripts/test_verify_macos_go_archive.py
@@ -0,0 +1,70 @@
+import importlib.util
+import os
+import struct
+import subprocess
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+
+spec = importlib.util.spec_from_file_location("archive_verifier", Path(__file__).with_name("verify-macos-go-archive.py"))
+verifier = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(verifier)
+
+
+class MachOArchiveTests(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.temp = tempfile.TemporaryDirectory(prefix="braillify-macho-test-")
+ cls.work = Path(cls.temp.name)
+ sysroot = subprocess.check_output(["rustc", "--print", "sysroot"], text=True).strip()
+ version = subprocess.check_output(["rustc", "-vV"], text=True)
+ host = next(line.removeprefix("host: ") for line in version.splitlines() if line.startswith("host: "))
+ cls.tools = Path(sysroot) / "lib" / "rustlib" / host / "bin"
+ suffix = ".exe" if os.name == "nt" else ""
+ target = host if host.endswith("apple-darwin") else "x86_64-apple-darwin"
+ source = cls.work / "sample.rs"
+ source.write_text('#![no_std]\n#[unsafe(no_mangle)] pub extern "C" fn sample(x: u32) -> u32 { x.wrapping_add(1) }\n', encoding="utf-8")
+ obj = cls.work / "sample.o"
+ cls.original = cls.work / "original.a"
+ cls.candidate = cls.work / "candidate.a"
+ subprocess.run(["rustc", "--crate-type=lib", "--emit=obj", "-Cembed-bitcode=yes", "--target", target, str(source), "-o", str(obj)], check=True)
+ subprocess.run([str(cls.tools / ("llvm-ar" + suffix)), "rcs", str(cls.original), str(obj)], check=True)
+ subprocess.run([str(cls.tools / ("llvm-objcopy" + suffix)), "--remove-section=__LLVM,__bitcode", "--remove-section=__LLVM,__cmdline", str(cls.original), str(cls.candidate)], check=True)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.temp.cleanup()
+
+ def test_transformed_archive_preserves_metadata(self):
+ for inspect in (verifier.members, verifier.symbols, verifier.sections, verifier.relocations, verifier.metadata, verifier.load_commands, verifier.linker_hints):
+ self.assertEqual(inspect(self.tools, self.original), inspect(self.tools, self.candidate))
+
+ def test_native_section_flag_change_is_rejected(self):
+ data = bytearray(self.candidate.read_bytes())
+ start = data.find(b"\xcf\xfa\xed\xfe")
+ self.assertGreaterEqual(start, 0)
+ command = start + 32
+ for _ in range(struct.unpack_from(" {
+ expect(validatePartners([approved])).toEqual([approved])
+ expect(validatePartners([{ ...approved, privateNotes: 'not public' }])).toEqual([approved])
+})
+
+test('중복 이슈와 외부 또는 경로 이탈 로고를 거부한다', () => {
+ expect(() => validatePartners([approved, approved])).toThrow()
+ expect(() => validatePartners([{ ...approved, logo: 'https://example.com/a.png' }])).toThrow()
+ expect(() => validatePartners([{ ...approved, logo: '/images/together/../secret.png' }])).toThrow()
+})
+
+test('유효하지 않은 이름, 구분, 승인 일자와 이슈 번호를 거부한다', () => {
+ expect(() => validatePartners([{ ...approved, name: '가'.repeat(21) }])).toThrow()
+ expect(() => validatePartners([{ ...approved, kind: '기타' }])).toThrow()
+ expect(() => validatePartners([{ ...approved, approvedAt: '2026-02-30' }])).toThrow()
+ expect(() => validatePartners([{ ...approved, issue: -1 }])).toThrow()
+})
+
+test('잘못된 로고는 이전 공개 목록을 덮어쓰지 않는다', async () => {
+ const publicDir = await mkdtemp(join(tmpdir(), 'braillify-together-'))
+ const output = join(publicDir, 'together.json')
+ const logos = join(publicDir, 'images', 'together')
+ await mkdir(logos, { recursive: true })
+ await writeFile(join(logos, 'asset-123.png'), 'not a PNG')
+ await writeFile(output, 'previous')
+ await expect(publishPartners([approved], publicDir)).rejects.toThrow()
+ expect(await readFile(output, 'utf8')).toBe('previous')
+})
+
+test('확인된 로고와 공개 기록으로 목록을 만든다', async () => {
+ const publicDir = await mkdtemp(join(tmpdir(), 'braillify-together-'))
+ const logos = join(publicDir, 'images', 'together')
+ await mkdir(logos, { recursive: true })
+ await writeFile(join(logos, 'asset-123.png'), Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))
+ await publishPartners([approved], publicDir)
+ expect(JSON.parse(await readFile(join(publicDir, 'together.json'), 'utf8'))).toEqual([approved])
+})
+
+test('로고 폴더가 없어도 빈 목록을 게시할 수 있다', async () => {
+ const publicDir = await mkdtemp(join(tmpdir(), 'braillify-together-'))
+ await publishPartners([], publicDir)
+ expect(JSON.parse(await readFile(join(publicDir, 'together.json'), 'utf8'))).toEqual([])
+})
+
+test('게시 중단된 로고는 공유하지 않을 때 제거해야 한다', async () => {
+ const publicDir = await mkdtemp(join(tmpdir(), 'braillify-together-'))
+ const logos = join(publicDir, 'images', 'together')
+ await mkdir(logos, { recursive: true })
+ await writeFile(join(logos, 'asset-123.png'), Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))
+ await expect(publishPartners([], publicDir)).rejects.toThrow('Unreferenced')
+ await publishPartners([approved, { ...approved, issue: 124 }], publicDir)
+ expect(JSON.parse(await readFile(join(publicDir, 'together.json'), 'utf8'))).toHaveLength(2)
+})
diff --git a/scripts/together-data.ts b/scripts/together-data.ts
new file mode 100644
index 00000000..0f85ae38
--- /dev/null
+++ b/scripts/together-data.ts
@@ -0,0 +1,26 @@
+export interface Partner {
+ issue: number
+ kind: '기업' | '기관' | '학교' | '단체'
+ name: string
+ logo: string
+ approvedAt: string
+}
+
+// Only maintainer-reviewed records belong in this list; an issue is not approval.
+export function validatePartners(input: unknown): Partner[] {
+ if (!Array.isArray(input)) throw new Error('Partner data must be an array')
+ const seen = new Set()
+ return input.map((entry: unknown) => {
+ if (!entry || typeof entry !== 'object' || Array.isArray(entry)) throw new Error('Invalid partner')
+ const { issue, kind, name, logo, approvedAt } = entry as Record
+ if (!Number.isSafeInteger(issue) || (issue as number) <= 0 || seen.has(issue as number)) throw new Error('Invalid or duplicate issue')
+ if (typeof kind !== 'string' || !['기업', '기관', '학교', '단체'].includes(kind)) throw new Error('Invalid kind')
+ if (typeof name !== 'string' || !name.trim() || Array.from(name).length > 20 || /[\r\n\u0000-\u001f]/.test(name)) throw new Error('Invalid name')
+ if (typeof logo !== 'string' || !/^\/images\/together\/asset-[a-zA-Z0-9_-]+\.(png|jpg|jpeg)$/.test(logo)) throw new Error('Invalid logo')
+ if (typeof approvedAt !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(approvedAt)) throw new Error('Invalid approval date')
+ const date = new Date(`${approvedAt}T00:00:00Z`)
+ if (Number.isNaN(date.valueOf()) || date.toISOString().slice(0, 10) !== approvedAt) throw new Error('Invalid approval date')
+ seen.add(issue as number)
+ return { issue, kind, name, logo, approvedAt } as Partner
+ })
+}
diff --git a/scripts/together-image-utils.ts b/scripts/together-image-utils.ts
new file mode 100644
index 00000000..b573e7d7
--- /dev/null
+++ b/scripts/together-image-utils.ts
@@ -0,0 +1,58 @@
+import { mkdtemp, readdir, realpath, rm, unlink } from 'node:fs/promises'
+import { join } from 'node:path'
+import { spawnSync, type SpawnSyncReturns } from 'node:child_process'
+
+import type { Partner } from './together-data'
+
+export function chromeFailure(result: SpawnSyncReturns, label: string, elapsed: number, outputExists: boolean) {
+ const diagnostics = [...(result.stderr || '').matchAll(/\b(?:ERROR|WARNING):[a-zA-Z0-9_.-]+\(\d+\)/g)].map((match) => match[0])
+ const code = (result.error as NodeJS.ErrnoException | undefined)?.code || 'none'
+ return `Chrome image generation failed: ${label} elapsed=${Math.round(elapsed)}ms status=${result.status} error=${code} outputExistsAfter=${outputExists} (may predate invocation) stderr=${diagnostics.join(',') || '(no recognized diagnostics)'}`
+}
+
+export async function withChromeProfile(work: string, run: (profile: string) => T | Promise): Promise {
+ const profile = await mkdtemp(join(work, 'profile-'))
+ try { return await run(profile) } finally { await rm(profile, { recursive: true, force: true }) }
+}
+
+export const escapeHtml = (value: string) => value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"')
+
+export function translateName(executable: string, name: string) {
+ const result = spawnSync(executable, ['--', name], { encoding: 'utf8' })
+ if (result.status !== 0) throw new Error(`Braille generation failed: ${result.stderr || result.error}`)
+ return result.stdout
+}
+
+export function brailleSvg(text: string) {
+ const cells = Array.from(text)
+ const scale = Math.min(1, 960 / (cells.length * 22 || 1))
+ const radius = Math.max(2, 3 * scale)
+ const width = cells.length ? (cells.length - 1) * 22 * scale + 9 * scale + 2 * radius : 0
+ if (width > 960) throw new Error('Braille is too long to fit')
+ const height = (cells.some((cell) => ((cell.codePointAt(0)! - 0x2800) & 0xc0) !== 0) ? 27 : 18) * scale + 2 * radius
+ const circles = cells.flatMap((cell, index) => {
+ const bits = cell.codePointAt(0)! - 0x2800
+ if (bits < 0 || bits > 255) throw new Error('Invalid braille cell')
+ return [0, 1, 2, 3, 4, 5, 6, 7].filter((bit) => bits & (1 << bit)).map((bit) => {
+ const x = index * 22 * scale + radius + (bit < 3 || bit === 6 ? 0 : 9 * scale)
+ const y = radius + [0, 9, 18, 0, 9, 18, 27, 27][bit] * scale
+ return ``
+ })
+ }).join('')
+ return ``
+}
+
+export async function pruneTogetherImages(partners: Partner[], publicDir: string) {
+ const safeRoot = await realpath(publicDir)
+ const approved = new Set(partners.map((partner) => String(partner.issue)))
+ for (const group of ['cert', 'badge']) {
+ const directory = join(safeRoot, 'together', group)
+ let resolved: string
+ try { resolved = await realpath(directory) } catch (error) { if ((error as NodeJS.ErrnoException).code === 'ENOENT') continue; throw error }
+ if (!resolved.startsWith(`${safeRoot}${process.platform === 'win32' ? '\\' : '/'}`)) throw new Error('Image directory is outside public directory')
+ for (const entry of await readdir(resolved, { withFileTypes: true })) {
+ const match = group === 'cert' ? /^org-(\d+)(?:@2x)?\.png$/.exec(entry.name) : /^org-(\d+)-(?:light|dark)(?:@2x)?\.png$/.exec(entry.name)
+ if (entry.isFile() && match && !approved.has(match[1])) await unlink(join(resolved, entry.name))
+ }
+ }
+}
diff --git a/scripts/together-images.test.ts b/scripts/together-images.test.ts
new file mode 100644
index 00000000..ecf96a09
--- /dev/null
+++ b/scripts/together-images.test.ts
@@ -0,0 +1,123 @@
+import { expect, test } from 'bun:test'
+import { existsSync } from 'node:fs'
+import { mkdir, mkdtemp, readFile, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { spawnSync } from 'node:child_process'
+
+import { brailleSvg, chromeFailure, escapeHtml, pruneTogetherImages, translateName, withChromeProfile } from './together-image-utils'
+
+const cli = join(import.meta.dir, '..', 'target', 'release', process.platform === 'win32' ? 'braillify.exe' : 'braillify')
+const chrome = process.env.CHROME_PATH || Bun.which('google-chrome') || Bun.which('chromium') || (process.platform === 'win32' ? 'C:/Program Files/Google/Chrome/Application/chrome.exe' : process.platform === 'darwin' ? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' : '')
+const canRender = existsSync(cli) && !!chrome && (!!Bun.which(chrome) || existsSync(chrome))
+
+test('Chrome 실패 진단은 프로세스 상태와 비공개 정보가 제거된 stderr를 포함한다', () => {
+ const result = spawnSync(process.execPath, ['-e', 'process.stderr.write("[ERROR:renderer.cc(42)] secret /private/path\\n"); process.exit(7)'], { encoding: 'utf8' })
+ const message = chromeFailure(result, 'badge.png', 123, true)
+ expect(message).toContain('badge.png')
+ expect(message).toContain('123ms')
+ expect(message).toContain('status=7')
+ expect(message).toContain('outputExistsAfter=true (may predate invocation)')
+ expect(message).toContain('ERROR:renderer.cc(42)')
+ expect(message).not.toContain('secret')
+ expect(message).not.toContain('/private/path')
+ const timedOut = spawnSync(process.execPath, ['-e', 'setTimeout(() => {}, 2000)'], { encoding: 'utf8', timeout: 100 })
+ const timeoutMessage = chromeFailure(timedOut, 'cert.png', 100, false)
+ expect(timeoutMessage).toContain('status=null')
+ expect(timeoutMessage).toContain('error=ETIMEDOUT')
+ expect(timeoutMessage).toContain('outputExistsAfter=false (may predate invocation)')
+ expect(timeoutMessage).toContain('stderr=(no recognized diagnostics)')
+})
+
+test('Chrome 프로필은 성공과 실패 직후 정리한다', async () => {
+ const work = await mkdtemp(join(tmpdir(), 'braillify-profiles-'))
+ let first = ''
+ expect(await withChromeProfile(work, async (profile) => {
+ first = profile
+ await writeFile(join(profile, 'data'), 'temporary')
+ return 'done'
+ })).toBe('done')
+ expect(existsSync(first)).toBe(false)
+ let second = ''
+ await expect(withChromeProfile(work, async (profile) => {
+ second = profile
+ await writeFile(join(profile, 'data'), 'temporary')
+ throw new Error('render failed')
+ })).rejects.toThrow('render failed')
+ expect(second).not.toBe(first)
+ expect(existsSync(second)).toBe(false)
+ expect(existsSync(work)).toBe(true)
+})
+
+test.skipIf(!canRender && !process.env.CI)('승인된 곳의 인증 이미지와 배지의 크기를 생성한다', async () => {
+ const { generateTogetherImages } = await import('./together-images')
+ const root = await mkdtemp(join(tmpdir(), 'braillify-render-'))
+ const logos = join(root, 'images', 'together')
+ await mkdir(logos, { recursive: true })
+ await writeFile(join(logos, 'asset-123.png'), await readFile(join(import.meta.dir, '../apps/landing/public/og-image.png')))
+ await generateTogetherImages([{ issue: 123, name: '점자 학교', kind: '학교', logo: '/images/together/asset-123.png', approvedAt: '2026-11-20' }], root)
+ for (const [file, width, height] of [
+ ['cert/org-123.png', 1200, 630], ['cert/org-123@2x.png', 2400, 1260],
+ ['badge/org-123-light.png', 300, 80], ['badge/org-123-dark.png', 300, 80],
+ ['badge/org-123-light@2x.png', 600, 160], ['badge/org-123-dark@2x.png', 600, 160],
+ ] as const) {
+ const png = await readFile(join(root, 'together', file))
+ expect(png.subarray(0, 8)).toEqual(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))
+ expect([png.readUInt32BE(16), png.readUInt32BE(20)]).toEqual([width, height])
+ }
+}, 300_000)
+
+test.skipIf(!existsSync(cli))('하이픈으로 시작하는 이름도 점역한다', () => {
+ expect(translateName(cli, '-학교')).toMatch(/^[\u2800-\u28ff]+$/u)
+})
+
+test.skipIf(!existsSync(cli))('Chrome 실행 오류의 원인을 표시한다', async () => {
+ const { generateTogetherImages } = await import('./together-images')
+ const root = await mkdtemp(join(tmpdir(), 'braillify-render-error-'))
+ const logos = join(root, 'images', 'together')
+ await mkdir(logos, { recursive: true })
+ await writeFile(join(logos, 'asset-123.png'), await readFile(join(import.meta.dir, '../apps/landing/public/og-image.png')))
+ const previous = process.env.CHROME_PATH
+ process.env.CHROME_PATH = join(root, 'missing-chrome')
+ try {
+ await expect(generateTogetherImages([{ issue: 123, name: '학교', kind: '학교', logo: '/images/together/asset-123.png', approvedAt: '2026-11-20' }], root)).rejects.toThrow(/Chrome logo check failed:.*missing-chrome/)
+ } finally {
+ if (previous === undefined) delete process.env.CHROME_PATH
+ else process.env.CHROME_PATH = previous
+ }
+})
+
+test('점역 실행 파일이 없으면 오류를 반환한다', () => {
+ expect(() => translateName(join(tmpdir(), 'missing-braillify-executable'), '학교')).toThrow('Braille generation failed')
+})
+
+test('점역 셀의 볼록한 점만 그린다', () => {
+ const svg = brailleSvg('⠁⠀⠿')
+ expect((svg.match(/ brailleSvg('A')).toThrow()
+})
+
+test('긴 점자는 960px 안에 맞추고 점 지름을 4px 이상 유지한다', () => {
+ const svg = brailleSvg('⠿'.repeat(100))
+ const width = Number(/width="([\d.]+)"/.exec(svg)?.[1])
+ const radius = Number(/ r="([\d.]+)"/.exec(svg)?.[1])
+ expect(width).toBeLessThanOrEqual(960)
+ expect(radius).toBeGreaterThanOrEqual(2)
+})
+
+test('공개 이름이 HTML로 실행되지 않는다', () => {
+ expect(escapeHtml('`
+ const badge = (dark: boolean) => `
함께하는 ${kind}
${date} · braillify.kr
`
+ for (const scale of [1, 2]) {
+ const suffix = scale === 2 ? '@2x' : ''
+ const checkLogo = ``
+ await render(cert + checkLogo, 1200, 630, join(publicDir, 'together/cert', `org-${partner.issue}${suffix}.png`), scale, true)
+ for (const color of ['light', 'dark']) await render(badge(color === 'dark'), 300, 80, join(publicDir, 'together/badge', `org-${partner.issue}-${color}${suffix}.png`), scale)
+ }
+ }
+ } finally { await rm(work, { recursive: true, force: true }) }
+}
diff --git a/scripts/together-publish.ts b/scripts/together-publish.ts
new file mode 100644
index 00000000..5fb80cef
--- /dev/null
+++ b/scripts/together-publish.ts
@@ -0,0 +1,37 @@
+import { readFile, readdir, realpath, stat, writeFile } from 'node:fs/promises'
+import { join, sep } from 'node:path'
+
+import type { Partner } from './together-data'
+
+export async function validatePartnerLogos(partners: Partner[], root: string) {
+ const publicDir = await realpath(root)
+ const logoDir = join(publicDir, 'images', 'together')
+ let names: string[]
+ try {
+ const resolved = await realpath(logoDir)
+ if (!resolved.startsWith(`${publicDir}${sep}`)) throw new Error('Logo directory is outside public directory')
+ names = await readdir(resolved)
+ } catch (error) {
+ if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
+ names = []
+ }
+ const referenced = new Set(partners.map((partner) => partner.logo.slice('/images/together/'.length)))
+ for (const name of names) {
+ if (/^asset-[a-zA-Z0-9_-]+\.(png|jpg|jpeg)$/i.test(name) && !referenced.has(name)) throw new Error(`Unreferenced logo must be removed: ${name}`)
+ }
+ for (const partner of partners) {
+ const filename = await realpath(join(publicDir, partner.logo.slice(1)))
+ if (!filename.startsWith(`${publicDir}${sep}`)) throw new Error(`Logo is outside public directory: ${partner.logo}`)
+ const info = await stat(filename)
+ if (!info.isFile() || info.size > 2 * 1024 * 1024) throw new Error(`Invalid logo size: ${partner.logo}`)
+ const bytes = await readFile(filename)
+ const png = bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))
+ const jpeg = bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff
+ if (partner.logo.endsWith('.png') ? !png : !jpeg) throw new Error(`Invalid logo format: ${partner.logo}`)
+ }
+}
+
+export async function publishPartners(partners: Partner[], root: string) {
+ await validatePartnerLogos(partners, root)
+ await writeFile(join(root, 'together.json'), `${JSON.stringify(partners)}\n`)
+}
diff --git a/scripts/together-replies.test.ts b/scripts/together-replies.test.ts
new file mode 100644
index 00000000..16e70760
--- /dev/null
+++ b/scripts/together-replies.test.ts
@@ -0,0 +1,51 @@
+import { expect, test } from 'bun:test'
+
+import { approvalMessage, publishedPartner, sendApprovalReplies } from './together-replies'
+
+const partner = { issue: 123, kind: '학교' as const, name: '점자 학교', logo: '/images/together/asset-123.png', approvedAt: '2026-11-20' }
+
+test('승인 답글에는 고유 카드와 인증 이미지 및 두 배지 링크가 있다', () => {
+ const message = approvalMessage(partner)
+ expect(message).toContain('https://braillify.kr/together#org-123')
+ expect(message).toContain('https://braillify.kr/together/cert/org-123.png')
+ expect(message).toContain('https://braillify.kr/together/badge/org-123-light.png')
+ expect(message).toContain('https://braillify.kr/together/badge/org-123-dark.png')
+ expect(message).toContain('')
+})
+
+test('배포된 공개 기록이 승인 기록과 정확히 일치할 때만 통과한다', () => {
+ expect(publishedPartner([partner], partner)).toBe(true)
+ expect(publishedPartner([{ ...partner, name: '다른 곳' }], partner)).toBe(false)
+ expect(publishedPartner([], partner)).toBe(false)
+})
+
+test('배포 이미지가 없으면 이슈에 답글을 보내지 않는다', async () => {
+ const requests: string[] = []
+ const request = async (input: string | URL | Request) => {
+ const url = String(input)
+ requests.push(url)
+ return url.endsWith('/together.json')
+ ? Response.json([partner])
+ : new Response('missing', { status: 404 })
+ }
+ await expect(sendApprovalReplies([partner], 'token', request as typeof fetch)).rejects.toThrow()
+ expect(requests.some((url) => url.startsWith('https://api.github.com'))).toBe(false)
+})
+
+test('배포 확인 후에만 답글을 달고 기존 봇 답글은 반복하지 않는다', async () => {
+ let sent = 0
+ let existing = false
+ const request = async (input: string | URL | Request, init?: RequestInit) => {
+ const url = String(input)
+ if (url.endsWith('/together.json')) return Response.json([partner])
+ if (url.startsWith('https://braillify.kr/')) {
+ expect(init?.headers).toBeUndefined()
+ return new Response(new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), { headers: { 'content-type': 'image/png' } })
+ }
+ if (init?.method === 'POST') { sent++; existing = true; return Response.json({}) }
+ return Response.json(existing ? [{ user: { login: 'github-actions[bot]' }, body: '' }] : [])
+ }
+ await sendApprovalReplies([partner], 'token', request as typeof fetch)
+ await sendApprovalReplies([partner], 'token', request as typeof fetch)
+ expect(sent).toBe(1)
+})
diff --git a/scripts/together-replies.ts b/scripts/together-replies.ts
new file mode 100644
index 00000000..b33116e9
--- /dev/null
+++ b/scripts/together-replies.ts
@@ -0,0 +1,67 @@
+import type { Partner } from './together-data'
+
+const origin = 'https://braillify.kr'
+const html = (text: string) => text.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"')
+const markdown = (text: string) => text.replace(/([\\`*_{}\[\]()#+.!|>-])/g, '\\$1')
+
+export function publishedPartner(data: unknown, partner: Partner) {
+ return Array.isArray(data) && data.some((item) => item && Object.keys(partner).every((key) => item[key] === partner[key as keyof Partner]))
+}
+
+export function approvalMessage(partner: Partner) {
+ const id = `org-${partner.issue}`
+ const card = `${origin}/together#${id}`
+ const cert = `${origin}/together/cert/${id}`
+ const badge = `${origin}/together/badge/${id}`
+ const [year, month] = partner.approvedAt.split('-')
+ const alt = `Braillify와 함께하는 ${partner.kind} · ${year}년 ${Number(month)}월 승인`
+ const embed = (color: string) => `
`
+ return [
+ ``,
+ '승인됐어요. Braillify와 함께해 주셔서 고마워요.',
+ `${markdown(partner.name)}를 함께하는 곳에 올렸어요.`,
+ card,
+ `[인증 이미지 PNG 내려받기 (1200×630)](${cert}.png) · [2배 크기 (2400×1260)](${cert}@2x.png)`,
+ '누리집 배지 (밝은 바탕용 · 어두운 바탕용):',
+ `[밝은 배지](${badge}-light.png) · [2배](${badge}-light@2x.png) · [어두운 배지](${badge}-dark.png) · [2배](${badge}-dark@2x.png)`,
+ '```html', embed('light'), '```', '```html', embed('dark'), '```',
+ '게시를 멈추고 싶으면 contact@devfive.kr로 알려 주세요.',
+ ].join('\n\n')
+}
+
+export async function sendApprovalReplies(partners: Partner[], token: string, request: typeof fetch = fetch) {
+ if (!token) throw new Error('GITHUB_TOKEN is required')
+ if (!partners.length) return
+ const listing = await request(`${origin}/together.json`, { redirect: 'error', cache: 'no-store' })
+ if (!listing.ok) throw new Error('Published listing unavailable')
+ const data: unknown = await listing.json()
+ for (const partner of partners) {
+ if (!publishedPartner(data, partner)) throw new Error(`Published listing differs for issue ${partner.issue}`)
+ const id = `org-${partner.issue}`
+ const paths = [`cert/${id}.png`, `cert/${id}@2x.png`, ...['light', 'dark'].flatMap((color) => [`badge/${id}-${color}.png`, `badge/${id}-${color}@2x.png`])]
+ for (const path of paths) {
+ const response = await request(`${origin}/together/${path}`, { redirect: 'error', cache: 'no-store' })
+ if (!response.ok || !(response.headers.get('content-type') || '').toLowerCase().startsWith('image/png')) throw new Error(`Published image unavailable: ${path}`)
+ const bytes = new Uint8Array(await response.arrayBuffer())
+ if (bytes.length < 8 || ![137, 80, 78, 71, 13, 10, 26, 10].every((byte, i) => bytes[i] === byte)) throw new Error(`Invalid published image: ${path}`)
+ }
+ }
+ const headers = { Authorization: `Bearer ${token}`, Accept: 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28' }
+ for (const partner of partners) {
+ const endpoint = `https://api.github.com/repos/dev-five-git/braillify/issues/${partner.issue}/comments`
+ const marker = ``
+ let alreadySent = false
+ for (let page = 1; ; page++) {
+ const response = await request(`${endpoint}?per_page=100&page=${page}`, { headers, redirect: 'error' })
+ if (!response.ok) throw new Error(`Unable to read issue ${partner.issue} comments`)
+ const comments: Array<{ body?: string; user?: { login?: string } }> = await response.json()
+ if (!Array.isArray(comments)) throw new Error('Invalid GitHub response')
+ if (comments.some((comment) => comment.user?.login === 'github-actions[bot]' && comment.body?.includes(marker))) alreadySent = true
+ if (alreadySent || comments.length < 100) break
+ }
+ if (!alreadySent) {
+ const response = await request(endpoint, { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify({ body: approvalMessage(partner) }), redirect: 'error' })
+ if (!response.ok) throw new Error(`Unable to reply to issue ${partner.issue}`)
+ }
+ }
+}
diff --git a/scripts/verify-macos-go-archive.py b/scripts/verify-macos-go-archive.py
new file mode 100644
index 00000000..afbec11a
--- /dev/null
+++ b/scripts/verify-macos-go-archive.py
@@ -0,0 +1,178 @@
+"""Verify that removing embedded LLVM sections preserves a Mach-O archive."""
+
+import hashlib
+import re
+import subprocess
+import sys
+from pathlib import Path
+
+
+def lines(tool, *args):
+ process = subprocess.Popen([str(tool), *map(str, args)], stdout=subprocess.PIPE, text=True, encoding="utf-8")
+ assert process.stdout is not None
+ with process.stdout as output:
+ yield from output
+ if process.wait():
+ raise RuntimeError(f"{tool.name} failed")
+
+
+def members(tools, archive):
+ result = list(lines(tools / "llvm-ar", "t", archive))
+ if not result:
+ raise ValueError("archive has no members")
+ return result
+
+
+def symbols(tools, archive):
+ result = []
+ member = None
+ for line in lines(tools / "llvm-nm", "--no-llvm-bc", "-m", archive):
+ line = line.rstrip("\n")
+ if line.endswith(":"):
+ member = line
+ elif member and "(" in line and "(__LLVM," not in line:
+ result.append((member, line))
+ if not result:
+ raise ValueError("archive has no native symbols")
+ return sorted(result)
+
+
+def sections(tools, archive):
+ digest = hashlib.sha256()
+ section = False
+ section_count = 0
+ for line in lines(tools / "llvm-objdump", "-s", archive):
+ member = re.search(r"\(([^()]*)\):\s*file format", line)
+ if member:
+ digest.update(f"member:{member.group(1)}\n".encode())
+ section = False
+ continue
+ match = re.match(r"Contents of section (.*?):", line)
+ if match:
+ name = match.group(1)
+ section = not name.startswith("__LLVM,")
+ if section:
+ section_count += 1
+ digest.update(f"section:{name}\n".encode())
+ continue
+ if section and re.match(r"^\s*[0-9a-fA-F]{4,}\s", line):
+ digest.update(line.encode())
+ if not section_count:
+ raise ValueError("archive has no native sections")
+ return digest.hexdigest()
+
+
+def relocations(tools, archive):
+ digest = hashlib.sha256()
+ count = 0
+ for line in lines(tools / "llvm-readobj", "--relocations", archive):
+ if line.startswith("File:"):
+ line = re.sub(r"^File: .*\(([^()]*)\)$", r"File: \1", line.rstrip()) + "\n"
+ count += 1
+ digest.update(line.encode())
+ if not count:
+ raise ValueError("archive has no relocation records")
+ return digest.hexdigest()
+
+
+def metadata(tools, archive):
+ digest = hashlib.sha256()
+ section = None
+ segment = False
+ count = 0
+ for line in lines(tools / "llvm-readobj", "--file-headers", "--macho-segment", "--macho-version-min", "--macho-linker-options", "--macho-data-in-code", "--macho-indirect-symbols", "--sections", archive):
+ if line.startswith("File:"):
+ line = re.sub(r"^File: .*\(([^()]*)\)$", r"File: \1", line.rstrip()) + "\n"
+ count += 1
+ if line == " Section {\n":
+ section = [line]
+ continue
+ if section is not None:
+ section.append(line)
+ if line == " }\n":
+ if not any("Segment: __LLVM " in item for item in section):
+ for item in section:
+ if not re.match(r"\s*(Index|Offset|RelocationOffset):", item):
+ digest.update(item.encode())
+ section = None
+ continue
+ if line == "Segment {\n":
+ segment = True
+ elif segment and line == "}\n":
+ segment = False
+ if re.match(r"\s*SizeOfLoadCommands:", line):
+ continue
+ if segment and re.match(r"\s*(Size|fileoff|filesize|nsects):", line):
+ continue
+ digest.update(line.encode())
+ if not count or section is not None:
+ raise ValueError("archive has invalid Mach-O metadata")
+ return digest.hexdigest()
+
+
+def load_commands(tools, archive):
+ allowed = {"LC_SEGMENT_64", "LC_VERSION_MIN_MACOSX", "LC_BUILD_VERSION", "LC_SYMTAB", "LC_DYSYMTAB", "LC_DATA_IN_CODE", "LC_LINKER_OPTION", "LC_LINKER_OPTIMIZATION_HINT"}
+ result = []
+ block = None
+ member = None
+
+ def finish():
+ if not block:
+ return
+ command = next((item.split()[1] for item in block if re.match(r"\s*cmd LC_", item)), None)
+ if command not in allowed:
+ raise ValueError(f"unsupported Mach-O load command: {command}")
+ # Offsets and symbol-table counts legitimately change when LLVM sections disappear.
+ ignored = r"\s*(fileoff|filesize|nsects|dataoff|symoff|stroff|nsyms|strsize|ilocalsym|nlocalsym|iextdefsym|nextdefsym|iundefsym|nundefsym|tocoff|ntoc|modtaboff|nmodtab|extrefsymoff|nextrefsyms|indirectsymoff|nindirectsyms|extreloff|nextrel|locreloff|nlocrel)\b"
+ kept = []
+ for item in block:
+ if command == "LC_SEGMENT_64" and item.strip() == "Section":
+ break
+ if not re.match(ignored, item) and not (command == "LC_SEGMENT_64" and re.match(r"\s*cmdsize\b", item)):
+ kept.append(item)
+ result.append((member, tuple(kept)))
+
+ for line in lines(tools / "llvm-objdump", "--macho", "--private-headers", archive):
+ match = re.search(r"\(([^()]*)\):\s*$", line)
+ if match:
+ finish()
+ block = None
+ member = match.group(1)
+ elif re.match(r"Load command \d+", line):
+ finish()
+ block = []
+ elif member is not None and block is not None:
+ block.append(line.rstrip())
+ finish()
+ if not result:
+ raise ValueError("archive has no Mach-O load commands")
+ return result
+
+
+def linker_hints(tools, archive):
+ digest = hashlib.sha256()
+ count = 0
+ for line in lines(tools / "llvm-objdump", "--macho", "--link-opt-hints", archive):
+ if line.startswith("Archive :"):
+ line = "Archive\n"
+ elif re.search(r"\(([^()]*)\):\s*$", line):
+ line = re.sub(r"^.*\(([^()]*)\):\s*$", r"member:\1", line.rstrip()) + "\n"
+ count += 1
+ digest.update(line.encode())
+ if not count:
+ raise ValueError("archive has no Mach-O members")
+ return digest.hexdigest()
+
+
+def main():
+ if len(sys.argv) != 4:
+ raise SystemExit("usage: verify-macos-go-archive.py ORIGINAL CANDIDATE LLVM_BIN_DIR")
+ original, candidate, tools = map(Path, sys.argv[1:])
+ for name, inspect in (("members", members), ("native symbols", symbols), ("non-LLVM sections", sections), ("relocations", relocations), ("Mach-O metadata", metadata), ("load commands", load_commands), ("linker optimization hints", linker_hints)):
+ if inspect(tools, original) != inspect(tools, candidate):
+ raise SystemExit(f"macOS archive {name} differ")
+ print(f"macOS archive {name} match", flush=True)
+
+
+if __name__ == "__main__":
+ main()