Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aab4b8966f | ||
|
|
686760fc46
|
||
|
|
addbb393e7
|
||
|
|
0bb615140f
|
||
|
|
c122fddc46
|
||
|
|
8715328420
|
||
|
|
414cc60107
|
||
|
|
6a29439c46
|
||
|
|
9923c4ce17 | ||
|
|
4bdf8ded08 | ||
|
|
209a39c331 | ||
|
|
e438197986 | ||
|
|
36f94d7b36 | ||
|
|
29d417ec93 | ||
|
|
14f593c7a7 | ||
|
|
0dc35a9be5 | ||
|
|
e3d0e8b917 | ||
|
|
b148f91635 |
No files matched your search
@@ -0,0 +1,37 @@
|
||||
name: Announce Release to Discord
|
||||
|
||||
# Posts a published release to Discord through the ops repo's
|
||||
# announce-release.yml (which reads the release from the Gitea API).
|
||||
#
|
||||
# Publishing the draft that release.yml opens fires NO `release: published`
|
||||
# workflow: the draft belongs to the job token, and Gitea credits the publish
|
||||
# to its Actions user, whose events start nothing. So after publishing, run
|
||||
# this workflow by hand (Actions → Announce Release to Discord → Run workflow)
|
||||
# with the tag. The `release` trigger stays for a release a person creates.
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Existing release tag to announce
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
permissions:
|
||||
contents: read
|
||||
uses: poli0981/.github/.gitea/workflows/announce-release.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
tag_override: ${{ inputs.tag || '' }}
|
||||
ops_ref: b93b3711b3049a879cfdfd515f7e72c23864da8f
|
||||
# Only the webhooks it needs, not `inherit`, which would hand every
|
||||
# repository secret (the Android signing keys included) to it.
|
||||
secrets:
|
||||
DISCORD_RELEASES_WEBHOOK: ${{ secrets.DISCORD_RELEASES_WEBHOOK }}
|
||||
DISCORD_REPO_WEBHOOK: ${{ secrets.DISCORD_REPO_WEBHOOK }}
|
||||
DISCORD_PING_ROLE_ID: ${{ secrets.DISCORD_PING_ROLE_ID }}
|
||||
@@ -0,0 +1,195 @@
|
||||
name: CI
|
||||
|
||||
# Gitea Actions (ops runbook: poli0981/.github docs/GITEA-MIGRATION.md).
|
||||
# `web` and `rust` run every gate on pull requests and on `main`. On a push to
|
||||
# `main`, `deploy` then publishes the web app to Cloudflare Workers with
|
||||
# wrangler (migration decision D3: Workers Builds pulled from GitHub and is
|
||||
# disconnected), and `smoke` checks production serves that commit.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||||
# Only superseded PR runs are cancelled; every commit on main gets a full run.
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
env:
|
||||
WRANGLER_SEND_METRICS: 'false'
|
||||
|
||||
jobs:
|
||||
# `web` is the check to require on `main` (Gitea branch protection): keep
|
||||
# the job id stable.
|
||||
web:
|
||||
name: Web · lint, typecheck, test, build
|
||||
runs-on: ubuntu-24.04 # Gitea: Docker, docker.gitea.com/runner-images
|
||||
timeout-minutes: 20
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
# Actions are pinned by commit SHA (a tag can be moved; a SHA cannot).
|
||||
# Renovate keeps the SHA and the version comment current.
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
# No dependency needs its install scripts (esbuild, workerd and the Tauri
|
||||
# CLI resolve their platform binaries at runtime), so none get to run.
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Format check
|
||||
run: npm run format:check
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Knip
|
||||
run: npm run knip
|
||||
|
||||
- name: Typecheck (TypeScript 7)
|
||||
run: |
|
||||
npx tsc --version | grep -q '^Version 7\.' || { echo "::error::tsc is not TypeScript 7"; exit 1; }
|
||||
npm run typecheck
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
# Advisory only: a fresh advisory in a transitive dependency must not
|
||||
# turn every unrelated PR red before Renovate opens its fix. The
|
||||
# osv-scanner job (security.yml) and Renovate's OSV PRs are the gate.
|
||||
- name: Audit dependencies
|
||||
run: npm audit --audit-level=high
|
||||
continue-on-error: true
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
# Validates wrangler.jsonc and bundles the Worker exactly as `deploy`
|
||||
# will, without deploying anything.
|
||||
- name: Worker deploy dry run
|
||||
run: npm run cf:check
|
||||
|
||||
rust:
|
||||
name: Tauri · fmt, clippy
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# The libraries Tauri links against on Linux. The job container runs as
|
||||
# root; sudo only where there is one.
|
||||
- name: Install Linux build dependencies
|
||||
run: |
|
||||
SUDO=""; if command -v sudo >/dev/null 2>&1 && [ "$(id -u)" != 0 ]; then SUDO=sudo; fi
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y --no-install-recommends \
|
||||
build-essential pkg-config libssl-dev libwebkit2gtk-4.1-dev libgtk-3-dev \
|
||||
libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
# tauri::generate_context!() embeds the icons (generated, gitignored)
|
||||
# and the built frontend (../dist) at compile time.
|
||||
- name: Generate icons and build the web app
|
||||
run: |
|
||||
npm run tauri:icon
|
||||
npm run build
|
||||
|
||||
# rust-toolchain is pinned to a MASTER commit and given its toolchain:
|
||||
# its `stable` branch is regenerated on top of master, so a commit of
|
||||
# that branch can disappear.
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy, rustfmt
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
workspaces: './src-tauri -> target'
|
||||
|
||||
- name: rustfmt
|
||||
working-directory: src-tauri
|
||||
run: cargo fmt --check
|
||||
|
||||
- name: Clippy
|
||||
working-directory: src-tauri
|
||||
run: cargo clippy --all-targets --locked -- -D warnings
|
||||
|
||||
# Production deploy of https://jsonprism.poli0981.dev after a green `web` on
|
||||
# `main`. CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID are user-level
|
||||
# Actions secrets shared by the web repos; the Worker's own secret
|
||||
# (TURNSTILE_SECRET) lives in Cloudflare and survives every deploy. No
|
||||
# dependency cache: what ships is built from a clean install.
|
||||
deploy:
|
||||
name: Deploy · Cloudflare Workers
|
||||
needs: web
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 20
|
||||
permissions:
|
||||
contents: read
|
||||
concurrency:
|
||||
group: deploy-production
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
# wrangler.jsonc's build.command runs `npm run build` first; the build
|
||||
# stamps GITHUB_SHA into <meta name="jsonprism-commit"> for `smoke`.
|
||||
- name: Deploy to Cloudflare Workers
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
run: npx wrangler deploy --message "main ${GITHUB_SHA:0:8}"
|
||||
|
||||
# Waits until production serves the deployed commit, then checks headers,
|
||||
# routing, redirects and the API (production-smoke.yml, which can also be
|
||||
# run on its own from the Actions page).
|
||||
smoke:
|
||||
name: Production smoke
|
||||
needs: deploy
|
||||
permissions: {}
|
||||
uses: ./.gitea/workflows/production-smoke.yml
|
||||
with:
|
||||
sha: ${{ github.sha }}
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Notify CI Failures
|
||||
|
||||
# A failed run of the workflows below on `main` posts to Discord through the
|
||||
# ops repo's notify-ci-failure.yml (the script is loaded at `ops_ref`, the
|
||||
# same commit as `uses:`). Neither this file nor the shared one checks out the
|
||||
# triggering run's code: they read run metadata only, and pass every
|
||||
# untrusted field to the notifier through `env:`.
|
||||
|
||||
on:
|
||||
workflow_run: # zizmor: ignore[dangerous-triggers]
|
||||
workflows: ['CI', 'Production smoke', 'Security', 'Qodana']
|
||||
types: [completed]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
uses: poli0981/.github/.gitea/workflows/notify-ci-failure.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
ops_ref: b93b3711b3049a879cfdfd515f7e72c23864da8f
|
||||
secrets:
|
||||
DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Notify Release Pipeline
|
||||
|
||||
# Every tag run of the release pipeline (release.yml) and the Discord
|
||||
# announcement reported to Discord through the ops repo's
|
||||
# notify-release-pipeline.yml. Match the exact `name:` of both producers:
|
||||
# renaming either silently breaks this filter.
|
||||
|
||||
on:
|
||||
workflow_run: # zizmor: ignore[dangerous-triggers]
|
||||
workflows:
|
||||
- 'Release Tauri bundles'
|
||||
- 'Announce Release to Discord'
|
||||
types: [completed]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
uses: poli0981/.github/.gitea/workflows/notify-release-pipeline.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
ops_ref: b93b3711b3049a879cfdfd515f7e72c23864da8f
|
||||
# Only the webhook the shared workflow declares, not `inherit`.
|
||||
secrets:
|
||||
DISCORD_RELEASE_PIPELINE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PIPELINE_WEBHOOK }}
|
||||
@@ -1,25 +1,26 @@
|
||||
name: Production smoke
|
||||
|
||||
# Cloudflare Workers Builds deploys every push to main to
|
||||
# https://jsonprism.poli0981.dev. This waits until the site serves the pushed
|
||||
# commit (index.html carries <meta name="jsonprism-commit">), then checks the
|
||||
# security headers, routing, redirects and the API. Failures reach Discord via
|
||||
# Checks https://jsonprism.poli0981.dev: the security headers, routing,
|
||||
# redirects and the API. Called by ci.yml after each deploy from `main`, with
|
||||
# the deployed commit: it first waits until the site serves that commit
|
||||
# (index.html carries <meta name="jsonprism-commit">). Run it by hand from the
|
||||
# Actions page to check production as it is. Failures reach Discord via
|
||||
# notify-ci-failure.yml.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_call:
|
||||
inputs:
|
||||
sha:
|
||||
description: Commit the site must serve before the checks run (empty = check as it is)
|
||||
type: string
|
||||
default: ''
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: production-smoke
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
SITE: https://jsonprism.poli0981.dev
|
||||
UA: jsonprism-smoke (+https://github.com/poli0981/jsonPrism)
|
||||
UA: jsonprism-smoke (+https://git.poli0981.dev/poli0981/jsonPrism)
|
||||
|
||||
jobs:
|
||||
smoke:
|
||||
@@ -32,9 +33,9 @@ jobs:
|
||||
# until then some requests still hit the previous version. Wait until the
|
||||
# commit has been served several times in a row.
|
||||
- name: Wait for this commit to go live
|
||||
if: github.event_name == 'push'
|
||||
if: ${{ inputs.sha != '' }}
|
||||
env:
|
||||
SHA: ${{ github.sha }}
|
||||
SHA: ${{ inputs.sha }}
|
||||
run: |
|
||||
want="${SHA:0:7}"
|
||||
streak=0
|
||||
@@ -53,7 +54,7 @@ jobs:
|
||||
echo "Attempt $attempt: live=${live:-unknown}, waiting for $want"
|
||||
sleep 10
|
||||
done
|
||||
echo "::error::Production did not serve $want within 15 minutes. Check Workers Builds in the Cloudflare dashboard."
|
||||
echo "::error::Production did not serve $want within 15 minutes. Check the deploy job and the Worker in the Cloudflare dashboard."
|
||||
exit 1
|
||||
|
||||
- name: Check headers, routes and API
|
||||
@@ -0,0 +1,102 @@
|
||||
name: Qodana
|
||||
|
||||
# JetBrains Qodana static analysis through the ops repo's reusable-qodana.yml
|
||||
# (the Qodana CLI; JetBrains/qodana-action needs GitHub's API), one linter per
|
||||
# Qodana Cloud project (Ultimate licence):
|
||||
#
|
||||
# typescript - qodana-js (native mode) the repository project jsonprism-js-ts, secret QODANA_TOKEN_TS_JS, qodana.yaml
|
||||
# rust - qodana-rust (Docker, Early Access) src-tauri/ project jsonprism-rust, secret QODANA_TOKEN_RUST, src-tauri/qodana.yaml
|
||||
#
|
||||
# Results: Qodana Cloud and the qodana-report-* artifacts (SARIF and logs; no
|
||||
# code-scanning UI on Gitea). Not a required check. A run without a token
|
||||
# (Renovate's) skips that analysis instead of failing; the reusable also skips
|
||||
# runs started by renovate-bot.
|
||||
#
|
||||
# qodana-rust ships only as a Docker image: it runs on the maintainer's PC
|
||||
# (`windows-latest`, host mode) in Docker Desktop, as root so that the
|
||||
# bootstrap in src-tauri/qodana.yaml can install the libraries Tauri links
|
||||
# against.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: qodana-${{ github.ref }}
|
||||
# Only superseded PR runs are cancelled; every commit on main gets a full run.
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
tokens:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
permissions: {}
|
||||
outputs:
|
||||
typescript: ${{ steps.check.outputs.typescript }}
|
||||
rust: ${{ steps.check.outputs.rust }}
|
||||
steps:
|
||||
- name: Check for the Qodana tokens
|
||||
id: check
|
||||
env:
|
||||
TOKEN_TS_JS: ${{ secrets.QODANA_TOKEN_TS_JS }}
|
||||
TOKEN_RUST: ${{ secrets.QODANA_TOKEN_RUST }}
|
||||
run: |
|
||||
for pair in "typescript:$TOKEN_TS_JS" "rust:$TOKEN_RUST"; do
|
||||
name="${pair%%:*}"
|
||||
if [ -n "${pair#*:}" ]; then
|
||||
echo "$name=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "::notice::No Qodana token for $name in this run: that analysis is skipped."
|
||||
fi
|
||||
done
|
||||
|
||||
typescript:
|
||||
needs: tokens
|
||||
if: ${{ needs.tokens.outputs.typescript == 'true' }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: poli0981/.github/.gitea/workflows/reusable-qodana.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
runs-on: ubuntu-latest
|
||||
linter: qodana-js
|
||||
package-manager: npm
|
||||
node-version-file: .nvmrc
|
||||
# worker-configuration.d.ts is generated and gitignored; without it the
|
||||
# Worker's Env types don't resolve (wrangler builds dist/ first).
|
||||
prepare-command: npm run cf:types
|
||||
artifact-name: qodana-report-typescript
|
||||
secrets:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_TS_JS }}
|
||||
|
||||
rust:
|
||||
needs: tokens
|
||||
if: ${{ needs.tokens.outputs.rust == 'true' }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: poli0981/.github/.gitea/workflows/reusable-qodana.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
runs-on: windows-latest
|
||||
within-docker: true
|
||||
linter: qodana-rust
|
||||
project-dir: src-tauri
|
||||
repository-root: .
|
||||
# The crates go to Qodana's cached directory.
|
||||
extra-args: -u root -e CARGO_HOME=/data/cache/cargo
|
||||
# tauri::generate_context!() refuses to expand without the icons
|
||||
# (generated by the Tauri CLI, gitignored) and the frontend directory
|
||||
# (frontendDist, ../dist): an empty page stands in for the web build,
|
||||
# which the analysis does not need.
|
||||
package-manager: npm
|
||||
node-version-file: .nvmrc
|
||||
prepare-command: >-
|
||||
npm run tauri:icon;
|
||||
New-Item -ItemType Directory -Force dist | Out-Null;
|
||||
Set-Content -Path dist/index.html -Value '<!doctype html><title>stand-in</title>'
|
||||
artifact-name: qodana-report-rust
|
||||
secrets:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_RUST }}
|
||||
@@ -0,0 +1,477 @@
|
||||
# A `vX.Y.Z` tag builds the desktop and Android apps and publishes them to
|
||||
# Cloudflare R2 (ops runbook §3.3, migration guide jsonprism.md):
|
||||
#
|
||||
# https://releases.poli0981.dev/jsonprism/<version>/<file>
|
||||
# https://releases.poli0981.dev/jsonprism/jsonprism-latest.apk (uploaded last)
|
||||
#
|
||||
# then opens a DRAFT Gitea release with the notes and the links (the forge's
|
||||
# disk is not for binaries, runbook §1). Publish the draft in the Gitea UI,
|
||||
# then run announce-release.yml with the tag for Discord: publishing a draft
|
||||
# the job token created fires no workflow (Gitea credits the event to its
|
||||
# Actions user). The apps have no updater: people download a new version by
|
||||
# hand.
|
||||
#
|
||||
# - verify: tests, and the tag must name the version in package.json and
|
||||
# src-tauri/Cargo.toml (tauri.conf.json reads package.json).
|
||||
# - Windows builds on the maintainer's PC (host mode, `windows-latest`): MSI
|
||||
# and NSIS. Linux in the runner's Docker image `ubuntu-22.04` (its glibc is
|
||||
# the floor of the .deb/.rpm/.AppImage). Android (universal APK, the four
|
||||
# ABIs) in Docker with the SDK and a pinned NDK installed in the job
|
||||
# (migration decision D10). No macOS: there is no macOS runner (D9); 2.2.1
|
||||
# was the last macOS build.
|
||||
# - The APK is signed by Gradle (src-tauri/gen/android/app/build.gradle.kts
|
||||
# reads keystore.properties). The keystore secrets exist only in that job,
|
||||
# which runs only for a tag or a manual dispatch (runbook §2 rule 10).
|
||||
# - No dependency caches in release builds: a poisoned cache could end up
|
||||
# inside a shipped installer. Releases are rare; take the extra minutes.
|
||||
# - Manual run without a tag ("Run workflow" on a branch): everything builds
|
||||
# and the files are kept as the `r2-release` artifact for 7 days, but
|
||||
# nothing is uploaded or released (publish-r2.yml refuses a branch ref). An
|
||||
# uploaded file is never replaced (rclone --immutable): to ship a fix, bump
|
||||
# the version.
|
||||
#
|
||||
# The name feeds notify-release-pipeline.yml (and the ops notifier reads
|
||||
# "Tauri" in it): rename both together.
|
||||
name: Release Tauri bundles
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
# Pin the NDK so CI matches local; Tauri otherwise picks the highest
|
||||
# installed one. compileSdk/targetSdk 36 (src-tauri/gen/android).
|
||||
NDK_VERSION: '27.2.12479018'
|
||||
|
||||
jobs:
|
||||
# Nothing gets built for a tag whose code fails the tests or whose version
|
||||
# fields disagree with the tag itself.
|
||||
verify:
|
||||
name: Verify tag and tests
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 20
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Check the tag matches the app version
|
||||
env:
|
||||
TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
|
||||
run: |
|
||||
version=$(node -p "require('./package.json').version")
|
||||
cargo_version=$(sed -n 's/^version = "\(.*\)"$/\1/p' src-tauri/Cargo.toml | head -n 1)
|
||||
[ "$cargo_version" = "$version" ] || { echo "::error::Cargo.toml version $cargo_version does not match package.json $version"; exit 1; }
|
||||
if [ -n "$TAG" ]; then
|
||||
[[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]] || { echo "::error::'$TAG' is not a version tag"; exit 1; }
|
||||
[ "$TAG" = "v$version" ] || { echo "::error::Tag $TAG does not match package.json version $version"; exit 1; }
|
||||
fi
|
||||
echo "version $version, tag ${TAG:-none (dry run)}"
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
windows:
|
||||
name: Build · Windows
|
||||
needs: verify
|
||||
runs-on: windows-latest # host mode on the maintainer's PC
|
||||
timeout-minutes: 90
|
||||
permissions:
|
||||
contents: read
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
package-manager-cache: false
|
||||
|
||||
# rust-toolchain is pinned to a MASTER commit and given its toolchain:
|
||||
# its `stable` branch is regenerated on top of master, so a commit of
|
||||
# that branch can disappear.
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm ci --ignore-scripts --no-audit --no-fund
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
|
||||
# tauri.conf.json: bundle.targets "all" (MSI + NSIS here). The icons are
|
||||
# generated (gitignored); beforeBuildCommand builds the web app.
|
||||
- name: Build the installers
|
||||
run: |
|
||||
npm run tauri:icon
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
npm run tauri -- build
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
|
||||
# One fixed name per kind, so the links never need encoding.
|
||||
- name: Stage the installers
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$version = node -p "require('./package.json').version"
|
||||
$out = Join-Path 'staged' $version
|
||||
New-Item -ItemType Directory -Force $out | Out-Null
|
||||
$bundle = 'src-tauri/target/release/bundle'
|
||||
$kinds = @(
|
||||
@{ Dir = 'msi'; Filter = "*_${version}_*.msi"; Name = "JSONPrism_${version}_x64_en-US.msi" },
|
||||
@{ Dir = 'nsis'; Filter = "*_${version}_*-setup.exe"; Name = "JSONPrism_${version}_x64-setup.exe" }
|
||||
)
|
||||
foreach ($k in $kinds) {
|
||||
$found = @(Get-ChildItem (Join-Path $bundle $k.Dir) -File -Filter $k.Filter)
|
||||
if ($found.Count -ne 1) { Write-Host "::error::expected one $($k.Dir) bundle of $version, found: $($found.Name -join ', ')"; exit 1 }
|
||||
Copy-Item $found[0].FullName (Join-Path $out $k.Name)
|
||||
}
|
||||
Get-ChildItem $out | ForEach-Object { "{0,12} {1}" -f $_.Length, $_.Name }
|
||||
|
||||
- name: Upload the installers
|
||||
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
||||
with:
|
||||
name: desktop-windows
|
||||
path: staged/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
linux:
|
||||
name: Build · Linux
|
||||
needs: verify
|
||||
# The oldest supported Ubuntu keeps the AppImage/deb glibc floor low.
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 90
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
# linuxdeploy is itself an AppImage, and a container has no FUSE.
|
||||
APPIMAGE_EXTRACT_AND_RUN: '1'
|
||||
# linuxdeploy's strip pass fails intermittently on newer ELF sections.
|
||||
NO_STRIP: 'true'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# The job container runs as root; sudo only where there is one.
|
||||
- name: Install Linux build dependencies
|
||||
run: |
|
||||
SUDO=""; if command -v sudo >/dev/null 2>&1 && [ "$(id -u)" != 0 ]; then SUDO=sudo; fi
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y --no-install-recommends \
|
||||
libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf \
|
||||
libssl-dev build-essential curl wget file xdg-utils rpm
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Build the packages
|
||||
run: |
|
||||
npm run tauri:icon
|
||||
npm run tauri -- build
|
||||
|
||||
# One fixed name per kind, so the links never need encoding.
|
||||
- name: Stage the packages
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version=$(node -p "require('./package.json').version")
|
||||
out="staged/$version"
|
||||
mkdir -p "$out"
|
||||
bundle=src-tauri/target/release/bundle
|
||||
stage() { # <glob> <name>
|
||||
local found=()
|
||||
for f in $1; do [ -f "$f" ] && found+=("$f"); done
|
||||
[ "${#found[@]}" -eq 1 ] || { echo "::error::expected one bundle for $1, found ${#found[@]}"; ls -la "$bundle"/*; exit 1; }
|
||||
cp "${found[0]}" "$out/$2"
|
||||
}
|
||||
stage "$bundle/appimage/*.AppImage" "JSONPrism_${version}_amd64.AppImage"
|
||||
stage "$bundle/deb/*.deb" "JSONPrism_${version}_amd64.deb"
|
||||
stage "$bundle/rpm/*.rpm" "JSONPrism_${version}_x86_64.rpm"
|
||||
ls -la "$out"
|
||||
|
||||
- name: Upload the packages
|
||||
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
||||
with:
|
||||
name: desktop-linux
|
||||
path: staged/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
# Android drives the Tauri CLI and signs with the release keystore (see
|
||||
# docs/TAURI-NOTES.md): ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD,
|
||||
# ANDROID_KEY_PASSWORD (optional), ANDROID_KEY_ALIAS (optional, "upload").
|
||||
android:
|
||||
name: Build · Android (APK)
|
||||
needs: verify
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 120
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Java 17
|
||||
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Setup Rust with Android targets
|
||||
uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
||||
|
||||
# The runner image has no Android SDK (migration decision D10): the
|
||||
# command-line tools come from setup-android (only platform-tools), the
|
||||
# rest from sdkmanager.
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
|
||||
with:
|
||||
packages: platform-tools
|
||||
log-accepted-android-sdk-licenses: false
|
||||
|
||||
- name: Install NDK, build-tools and platform
|
||||
run: |
|
||||
sdkmanager "ndk;${NDK_VERSION}" "build-tools;36.1.0" "platforms;android-36" > /dev/null
|
||||
echo "NDK_HOME=$ANDROID_HOME/ndk/${NDK_VERSION}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Generate icons
|
||||
run: npm run tauri:icon
|
||||
|
||||
# The Gradle release signing config reads keystore.properties, written
|
||||
# here and removed with the keystore after the build.
|
||||
- name: Write the keystore
|
||||
env:
|
||||
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "$ANDROID_KEYSTORE_BASE64" ]; then
|
||||
echo "::error::ANDROID_KEYSTORE_BASE64 is not set; cannot sign the release APK."
|
||||
exit 1
|
||||
fi
|
||||
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/upload-keystore.jks"
|
||||
{
|
||||
echo "storePassword=$ANDROID_KEYSTORE_PASSWORD"
|
||||
echo "keyPassword=${ANDROID_KEY_PASSWORD:-$ANDROID_KEYSTORE_PASSWORD}"
|
||||
echo "keyAlias=${ANDROID_KEY_ALIAS:-upload}"
|
||||
echo "storeFile=$RUNNER_TEMP/upload-keystore.jks"
|
||||
} > src-tauri/gen/android/keystore.properties
|
||||
|
||||
# buildSrc's BuildTask runs `npm run -- tauri android android-studio-script`,
|
||||
# so the npm Tauri CLI is enough here.
|
||||
- name: Build the signed APK (universal)
|
||||
run: npm run tauri -- android build --apk
|
||||
|
||||
# The Gradle config falls back to an unsigned build without a keystore:
|
||||
# apksigner makes sure that never ships.
|
||||
- name: Stage the APK
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f "$RUNNER_TEMP/upload-keystore.jks" src-tauri/gen/android/keystore.properties
|
||||
BT=$(find "$ANDROID_HOME/build-tools" -mindepth 1 -maxdepth 1 -type d | sort -V | tail -1)
|
||||
version=$(node -p "require('./package.json').version")
|
||||
dir=src-tauri/gen/android/app/build/outputs/apk/universal/release
|
||||
mapfile -t apks < <(find "$dir" -maxdepth 1 -name '*.apk')
|
||||
[ "${#apks[@]}" -eq 1 ] || { echo "::error::expected one APK in $dir, found ${#apks[@]}"; find src-tauri/gen/android/app/build/outputs -name '*.apk'; exit 1; }
|
||||
"$BT/apksigner" verify --print-certs "${apks[0]}" | grep -i 'SHA-256' || true
|
||||
"$BT/apksigner" verify "${apks[0]}"
|
||||
mkdir -p "staged/$version"
|
||||
cp "${apks[0]}" "staged/$version/JSONPrism_${version}_android-universal.apk"
|
||||
ls -la "staged/$version"
|
||||
|
||||
- name: Remove the keystore
|
||||
if: ${{ always() }}
|
||||
run: rm -f "$RUNNER_TEMP/upload-keystore.jks" src-tauri/gen/android/keystore.properties
|
||||
|
||||
- name: Upload the APK
|
||||
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
||||
with:
|
||||
name: android
|
||||
path: staged/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
assemble:
|
||||
name: Assemble (checksums, notes)
|
||||
needs: [windows, linux, android]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download the Windows installers
|
||||
uses: christopherhx/gitea-download-artifact@75635f32b4c1c41c4b3d64e8f85210112ed4c9c7 # v4
|
||||
with:
|
||||
name: desktop-windows
|
||||
path: r2-release/versioned
|
||||
|
||||
- name: Download the Linux packages
|
||||
uses: christopherhx/gitea-download-artifact@75635f32b4c1c41c4b3d64e8f85210112ed4c9c7 # v4
|
||||
with:
|
||||
name: desktop-linux
|
||||
path: r2-release/versioned
|
||||
|
||||
- name: Download the APK
|
||||
uses: christopherhx/gitea-download-artifact@75635f32b4c1c41c4b3d64e8f85210112ed4c9c7 # v4
|
||||
with:
|
||||
name: android
|
||||
path: r2-release/versioned
|
||||
|
||||
# On a tag, the tag must name the version the apps were built with.
|
||||
- name: Checksums, alias and notes
|
||||
env:
|
||||
TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
|
||||
SERVER: ${{ github.server_url }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version=$(node -p "require('./package.json').version")
|
||||
if [ -n "$TAG" ] && [ "$TAG" != "v$version" ]; then
|
||||
echo "::error::tag $TAG does not match the app version $version (package.json)"; exit 1
|
||||
fi
|
||||
dir="r2-release/versioned/$version"
|
||||
[ "$(find "$dir" -type f | wc -l)" -eq 6 ] || { echo "::error::expected 6 files in $dir"; ls -la "$dir"; exit 1; }
|
||||
(cd "$dir" && sha256sum -- * | sort -k2 > SHA256SUMS.txt)
|
||||
cat "$dir/SHA256SUMS.txt"
|
||||
cp "$dir/JSONPrism_${version}_android-universal.apk" r2-release/jsonprism-latest.apk
|
||||
|
||||
base="https://releases.poli0981.dev/jsonprism/$version"
|
||||
ref="${TAG:-main}"
|
||||
{
|
||||
echo "JSONPrism $version for Windows, Linux and Android: the same app as https://jsonprism.poli0981.dev, which runs in any browser."
|
||||
echo
|
||||
echo "What changed: [CHANGELOG]($SERVER/$REPO/src/$([ -n "$TAG" ] && echo tag || echo branch)/$ref/CHANGELOG.md)."
|
||||
echo
|
||||
echo "**Download**: Windows 10/11 x64 (\`-setup.exe\` or \`.msi\`), Linux x86_64 (\`.AppImage\`, \`.deb\`, \`.rpm\`), Android 12+ (universal \`.apk\`, sideload: allow \"install unknown apps\" for your browser or file manager). No macOS build since 2.2.1: there is no macOS build machine since the move from GitHub."
|
||||
echo
|
||||
while read -r _ name; do
|
||||
echo "- [$name]($base/$name)"
|
||||
done < "$dir/SHA256SUMS.txt"
|
||||
echo "- [SHA256SUMS.txt]($base/SHA256SUMS.txt)"
|
||||
echo
|
||||
echo "The newest APK is always at https://releases.poli0981.dev/jsonprism/jsonprism-latest.apk."
|
||||
echo
|
||||
echo "Verify a download with \`sha256sum -c SHA256SUMS.txt --ignore-missing\`. SHA-256:"
|
||||
echo
|
||||
echo '```'
|
||||
cat "$dir/SHA256SUMS.txt"
|
||||
echo '```'
|
||||
} > notes.md
|
||||
cat notes.md
|
||||
|
||||
- name: Upload the release files
|
||||
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
||||
with:
|
||||
name: r2-release
|
||||
path: r2-release/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload the notes
|
||||
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
||||
with:
|
||||
name: release-notes
|
||||
path: notes.md
|
||||
retention-days: 7
|
||||
|
||||
publish:
|
||||
name: Publish to R2
|
||||
needs: assemble
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: poli0981/.github/.gitea/workflows/publish-r2.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
app: jsonprism
|
||||
artifact: r2-release
|
||||
versioned-dir: versioned
|
||||
feed-files: |
|
||||
jsonprism-latest.apk
|
||||
runs-on: ubuntu-latest
|
||||
secrets:
|
||||
R2_RELEASES_ACCESS_KEY_ID: ${{ secrets.R2_RELEASES_ACCESS_KEY_ID }}
|
||||
R2_RELEASES_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_SECRET_ACCESS_KEY }}
|
||||
|
||||
release:
|
||||
name: Gitea release (draft, notes + links)
|
||||
needs: publish
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: write # VERIFY which of contents / releases Gitea enforces
|
||||
releases: write # (runbook §3.2 item 5)
|
||||
steps:
|
||||
- name: Download the notes
|
||||
uses: christopherhx/gitea-download-artifact@75635f32b4c1c41c4b3d64e8f85210112ed4c9c7 # v4
|
||||
with:
|
||||
name: release-notes
|
||||
path: .
|
||||
|
||||
- name: Create the draft release
|
||||
uses: https://gitea.com/actions/gitea-release-action@5a83c90484ef4355121df5eb60558c8ce66e81ac # v1.3.7
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: JSONPrism ${{ github.ref_name }}
|
||||
body_path: notes.md
|
||||
draft: true
|
||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||
@@ -0,0 +1,91 @@
|
||||
name: Security
|
||||
|
||||
# Gitea has no CodeQL, no dependency review and no code-scanning UI (ops
|
||||
# runbook §1, migration decision D7). This workflow covers:
|
||||
#
|
||||
# workflow-lint actionlint + shellcheck and zizmor on .gitea/workflows/*.yml
|
||||
# scan the ops repo's security.yml: gitleaks (full history,
|
||||
# exceptions in .gitleaksignore), Opengrep (SAST), osv-scanner
|
||||
# (package-lock.json, Cargo.lock; exceptions in
|
||||
# src-tauri/osv-scanner.toml) and cargo-deny
|
||||
# (src-tauri/deny.toml)
|
||||
#
|
||||
# Weekly as well, so a new advisory against an unchanged lockfile turns it red:
|
||||
# Friday 13:19 UTC = 20:19 Vietnam (slot in the ops repo's cron registry; the
|
||||
# runner is the maintainer's PC and only runs 13:00–16:00 UTC).
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: '19 13 * * 5'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: security-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
jobs:
|
||||
# Both linters without Docker: actionlint and shellcheck as release binaries
|
||||
# at pinned versions, SHA-256 verified (the ops repo's ops-lint.yml pins);
|
||||
# zizmor from the hash-locked .github/requirements-ci.txt. Renovate does not
|
||||
# update the binaries: bump version and checksum together, by hand.
|
||||
workflow-lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
ACTIONLINT_VERSION: 1.7.12
|
||||
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 # actionlint_1.7.12_linux_amd64.tar.gz (release checksums file)
|
||||
SHELLCHECK_VERSION: v0.11.0
|
||||
SHELLCHECK_SHA256: 8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198 # shellcheck-v0.11.0.linux.x86_64.tar.xz
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install zizmor
|
||||
run: |
|
||||
python -m pip install --quiet --require-hashes --only-binary :all: -r .github/requirements-ci.txt
|
||||
# The files by name: zizmor only looks for .github/workflows by itself.
|
||||
# Offline: its online audits ask GitHub's API about the actions, with a
|
||||
# token this runner does not have. Any finding at medium or above fails.
|
||||
- name: zizmor (workflow security audit)
|
||||
run: zizmor --offline --min-severity medium --config .github/zizmor.yml .gitea/workflows/*.yml
|
||||
- name: Install actionlint ${{ env.ACTIONLINT_VERSION }} + shellcheck ${{ env.SHELLCHECK_VERSION }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tmp="${RUNNER_TEMP:-/tmp}"
|
||||
bin="$tmp/lint-bin"
|
||||
mkdir -p "$bin"
|
||||
curl -fsSL --retry 3 -o "$tmp/actionlint.tar.gz" \
|
||||
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
|
||||
echo "${ACTIONLINT_SHA256} $tmp/actionlint.tar.gz" | sha256sum -c -
|
||||
tar -xzf "$tmp/actionlint.tar.gz" -C "$bin" actionlint
|
||||
curl -fsSL --retry 3 -o "$tmp/shellcheck.tar.xz" \
|
||||
"https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
|
||||
echo "${SHELLCHECK_SHA256} $tmp/shellcheck.tar.xz" | sha256sum -c -
|
||||
tar -xJf "$tmp/shellcheck.tar.xz" -C "$bin" --strip-components=1 "shellcheck-${SHELLCHECK_VERSION}/shellcheck"
|
||||
echo "$bin" >> "$GITHUB_PATH"
|
||||
# .github/actionlint.yaml ignores only the Gitea features actionlint does
|
||||
# not know; everything else stays an error.
|
||||
- name: actionlint (workflow syntax and expressions)
|
||||
run: |
|
||||
actionlint -version
|
||||
actionlint -color -config-file .github/actionlint.yaml \
|
||||
-shellcheck "$(command -v shellcheck)" .gitea/workflows/*.yml
|
||||
|
||||
scan:
|
||||
permissions:
|
||||
contents: read
|
||||
uses: poli0981/.github/.gitea/workflows/security.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
|
||||
with:
|
||||
node: true
|
||||
rust: true
|
||||
cargo-manifest-path: src-tauri/Cargo.toml
|
||||
@@ -1,6 +0,0 @@
|
||||
github: poli0981
|
||||
ko_fi: skullmute
|
||||
buy_me_a_coffee: skullmute
|
||||
patreon: skullmute
|
||||
custom:
|
||||
- paypal.me/DungDang212
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
name: Accessibility issue
|
||||
about: Something is hard or impossible to use with a keyboard, screen reader, zoom or other assistive technology
|
||||
title: '[A11Y] '
|
||||
labels: ['accessibility', 'needs-triage']
|
||||
assignees: []
|
||||
---
|
||||
|
||||
<!--
|
||||
Thanks for reporting a barrier. You don't need to know the cause: describe
|
||||
what you tried and what happened. See ACCESSIBILITY.md for what JSONPrism
|
||||
supports today and its known limitations:
|
||||
https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/ACCESSIBILITY.md
|
||||
|
||||
Prefer not to post publicly? Email code@poli0981.dev with "Accessibility"
|
||||
in the subject. Security problems go through SECURITY.md instead.
|
||||
-->
|
||||
|
||||
## What were you trying to do?
|
||||
|
||||
For example: convert JSON to CSV, open a file, download the output, run a
|
||||
batch, change an option, get past the consent screen.
|
||||
|
||||
## What happened?
|
||||
|
||||
What you expected, and what you got instead (for example: nothing was
|
||||
announced, focus got stuck, text was unreadable at 200 % zoom).
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Go to '...'
|
||||
2. Press / say '...'
|
||||
3. See '...'
|
||||
|
||||
## Your setup
|
||||
|
||||
- Assistive technology and version: [e.g. NVDA 2026.3, VoiceOver, TalkBack, Narrator, Dragon, screen magnifier, none]
|
||||
- How you use the app: [keyboard only / screen reader / voice control / switch access / zoom or magnification / Windows contrast theme / other]
|
||||
- Platform: [Web / Windows / Linux / Android / macOS (2.2.1 or older)]
|
||||
- JSONPrism version: [e.g. 2.2.1 — see About → Build info]
|
||||
- Browser (web) or OS version (apps): [e.g. Firefox on Windows 11, Safari on macOS 15, Android 15]
|
||||
|
||||
## How much does it block you?
|
||||
|
||||
- [ ] **Critical** — I can't complete the task at all
|
||||
- [ ] **High** — I can, but only with a lot of effort or a workaround
|
||||
- [ ] **Medium** — confusing or inconsistent, but I can finish the task
|
||||
- [ ] **Low** — a minor annoyance
|
||||
|
||||
## Workaround
|
||||
|
||||
Did you find a way around it? It helps others while a fix is on the way.
|
||||
|
||||
## Diagnostics, recordings or screenshots
|
||||
|
||||
Optional. **About → Build info → Copy diagnostics** gives the version,
|
||||
platform and recent log lines (check it for anything private first). A
|
||||
short screen or screen-reader recording also helps.
|
||||
@@ -8,8 +8,10 @@ assignees: []
|
||||
|
||||
<!--
|
||||
Security vulnerabilities do NOT belong in a public issue. Report them
|
||||
privately through https://github.com/poli0981/jsonPrism/security/advisories/new
|
||||
or by email to security@poli0981.dev.
|
||||
privately by email to security@poli0981.dev (see SECURITY.md).
|
||||
|
||||
Something hard or impossible to use with a keyboard, screen reader, zoom or
|
||||
other assistive technology? Use the "Accessibility" template instead.
|
||||
-->
|
||||
|
||||
## Describe the bug
|
||||
@@ -41,10 +43,11 @@ What actually happened. Include the error message and target format.
|
||||
|
||||
## Environment
|
||||
|
||||
- Platform: [Web / Windows / macOS / Linux / Android]
|
||||
- JSONPrism version: [e.g. 2.0.0 — see About → Build info]
|
||||
- Platform: [Web / Windows / Linux / Android / macOS (2.2.1 or older)]
|
||||
- JSONPrism version: [e.g. 2.2.1 — see About → Build info]
|
||||
- Browser (web) or OS version (apps): [e.g. Firefox on Windows 11, Safari on macOS 15, Ubuntu 24.04, Android 15]
|
||||
- Where: [the website https://jsonprism.poli0981.dev / an installed release / a local dev build]
|
||||
- Assistive technology, if any: [e.g. NVDA 2026.3, VoiceOver, keyboard only, 200 % zoom]
|
||||
|
||||
## Diagnostics
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Questions & general discussion
|
||||
url: https://github.com/poli0981/jsonPrism/discussions
|
||||
about: Ask about usage, share workflows, or propose ideas before opening an issue.
|
||||
- name: Issues and merge requests (GitLab mirror)
|
||||
url: https://gitlab.com/poli0981/jsonPrism/-/issues
|
||||
about: The Gitea repository takes no sign-ups. Bug reports, accessibility barriers, converter requests and translation fixes go to the GitLab mirror, which has the same templates. JSONPrism is in maintenance mode and takes no new features.
|
||||
- name: Security vulnerability
|
||||
url: https://github.com/poli0981/jsonPrism/security/advisories/new
|
||||
about: Report security issues privately via a GitHub Security Advisory, or email security@poli0981.dev. Never in a public issue.
|
||||
url: https://jsonprism.poli0981.dev/.well-known/security.txt
|
||||
about: Privately, by e-mail to security@poli0981.dev — never in a public issue. See SECURITY.md.
|
||||
- name: Questions, feature ideas and community chat
|
||||
url: https://discord.gg/2aNR3aVt
|
||||
about: The Discord server. Ideas are read, with no commitment while JSONPrism is in maintenance mode.
|
||||
- name: Live demo
|
||||
url: https://jsonprism.poli0981.dev
|
||||
about: Try the latest deployed build in your browser before filing a bug.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
name: Converter request
|
||||
about: Add or remove a format, when people really need it
|
||||
title: '[CONVERTER] '
|
||||
labels: ['converter', 'needs-triage']
|
||||
assignees: []
|
||||
---
|
||||
|
||||
<!--
|
||||
JSONPrism is in maintenance mode (CONTRIBUTING.md → Maintenance mode): it
|
||||
takes no new features, but a format can still be added or removed when
|
||||
there is a real need. Other ideas are welcome on the Discord server
|
||||
(https://discord.gg/2aNR3aVt), with no commitment.
|
||||
-->
|
||||
|
||||
## Add or remove?
|
||||
|
||||
- [ ] Add a format
|
||||
- [ ] Remove a format
|
||||
|
||||
## Format
|
||||
|
||||
Name, file extension(s), and a link to its specification.
|
||||
|
||||
## Who needs it, and for what?
|
||||
|
||||
The real workflow this serves, or, for a removal, why the format should go.
|
||||
Requests without a concrete use case are closed.
|
||||
|
||||
## Direction
|
||||
|
||||
- [ ] JSON → format
|
||||
- [ ] Format → JSON
|
||||
- [ ] Input only (like JSONC → JSON)
|
||||
|
||||
## Sample
|
||||
|
||||
A small input and the output you expect:
|
||||
|
||||
```json
|
||||
{ "example": "input" }
|
||||
```
|
||||
|
||||
```
|
||||
expected output here
|
||||
```
|
||||
|
||||
## Scope check
|
||||
|
||||
- [ ] It fits the "one JSON → many formats" mission
|
||||
- [ ] It can run entirely on the user's device (no server)
|
||||
- [ ] No format JSONPrism already has covers it
|
||||
- [ ] I checked the latest build at https://jsonprism.poli0981.dev
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature for JSONPrism
|
||||
title: '[FEATURE] '
|
||||
labels: ['enhancement', 'needs-triage']
|
||||
assignees: []
|
||||
---
|
||||
|
||||
## Problem
|
||||
|
||||
What problem does this feature solve? What workflow are you trying to support?
|
||||
|
||||
## Proposed solution
|
||||
|
||||
How would you like JSONPrism to handle it?
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
Other approaches you thought about, and why this one fits better.
|
||||
|
||||
## Platform
|
||||
|
||||
Where would you use it? [All / Web / Windows / macOS / Linux / Android]
|
||||
|
||||
Version you're on: [e.g. 2.0.0 — see About → Build info]
|
||||
|
||||
## Sample data (if applicable)
|
||||
|
||||
If your feature involves a specific JSON shape, paste a sample:
|
||||
|
||||
```json
|
||||
{ "example": "input" }
|
||||
```
|
||||
|
||||
And the expected output:
|
||||
|
||||
```
|
||||
expected output here
|
||||
```
|
||||
|
||||
## Scope check
|
||||
|
||||
- [ ] This fits the "one JSON → many formats" core mission
|
||||
- [ ] This can be done on the user's device (no server required)
|
||||
- [ ] I have a real use case for this (not just hypothetical)
|
||||
- [ ] I checked the latest build at https://jsonprism.poli0981.dev and it doesn't do this yet
|
||||
|
||||
## Additional context
|
||||
|
||||
Links, screenshots, references to similar tools.
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Translation or wording issue
|
||||
about: Wording that doesn't fit a culture or region, or a spelling mistake that could mislead
|
||||
title: '[I18N] '
|
||||
labels: ['i18n', 'needs-triage']
|
||||
assignees: []
|
||||
---
|
||||
|
||||
<!--
|
||||
JSONPrism ships English, Tiếng Việt, 日本語 and 简体中文. The Japanese and
|
||||
Simplified Chinese strings, and parts of the Vietnamese ones, are
|
||||
AI-generated, so corrections from native speakers are very welcome.
|
||||
-->
|
||||
|
||||
## Language
|
||||
|
||||
- [ ] Tiếng Việt (`vi`)
|
||||
- [ ] 日本語 (`ja`)
|
||||
- [ ] 简体中文 (`zh-CN`)
|
||||
- [ ] English (`en`)
|
||||
|
||||
## Where
|
||||
|
||||
The page or screen, and what you were doing: for example the consent
|
||||
screen, the CSV options, an error message.
|
||||
|
||||
## Current text
|
||||
|
||||
Copy the text exactly as shown, or attach a screenshot.
|
||||
|
||||
## Suggested text
|
||||
|
||||
## Why
|
||||
|
||||
- [ ] It doesn't fit the culture, region or usual tone
|
||||
- [ ] A spelling or grammar mistake that could mislead
|
||||
- [ ] The meaning is wrong (mistranslation)
|
||||
- [ ] Other
|
||||
|
||||
Details:
|
||||
@@ -1,13 +1,16 @@
|
||||
<!--
|
||||
Thanks for contributing to JSONPrism!
|
||||
|
||||
Please fill in the sections below. PRs missing required context (no summary,
|
||||
JSONPrism is in maintenance mode (CONTRIBUTING.md → "Maintenance mode"):
|
||||
new features are out of scope, and `feat:` merge requests from outside
|
||||
contributors are closed.
|
||||
|
||||
Please fill in the sections below. Changes missing required context (no summary,
|
||||
no test plan, off-topic preamble) may be closed without review.
|
||||
See CONTRIBUTING.md → "Auto-ignored contributions" for what gets dismissed.
|
||||
|
||||
Fixing an undisclosed security vulnerability? Report it privately first
|
||||
(SECURITY.md: private advisory or security@poli0981.dev) instead of
|
||||
describing it in a public PR.
|
||||
(SECURITY.md: security@poli0981.dev) instead of describing it in public.
|
||||
-->
|
||||
|
||||
## Summary
|
||||
@@ -19,11 +22,22 @@ describing it in a public PR.
|
||||
|
||||
Closes #
|
||||
|
||||
## Scope
|
||||
|
||||
<!-- Required. Tick what this change is. Anything else is out of scope while JSONPrism is in maintenance mode. -->
|
||||
|
||||
- [ ] Bug fix, broken UI/UX or accessibility fix
|
||||
- [ ] Translation or wording fix
|
||||
- [ ] Add or remove a converter, agreed in issue #
|
||||
- [ ] Dependency update, security fix, or major language/runtime/framework upgrade
|
||||
- [ ] Cloudflare / Worker change, or a fix for a website incident
|
||||
- [ ] Docs or tests only
|
||||
|
||||
## Test plan
|
||||
|
||||
<!--
|
||||
Required. These are the checks CI runs; tick what you ran locally.
|
||||
CI must pass before the PR can be merged.
|
||||
CI (on Gitea) must pass before the change can be merged.
|
||||
-->
|
||||
|
||||
- [ ] `npm run format:check`
|
||||
@@ -34,7 +48,8 @@ CI must pass before the PR can be merged.
|
||||
- [ ] `npm run build`
|
||||
- [ ] `npm run cf:check`
|
||||
- [ ] Rust changed: `cargo fmt --check` and `cargo clippy --all-targets --locked -- -D warnings` in `src-tauri/`
|
||||
- [ ] Manual smoke (describe what you clicked / loaded, and on which platform: Web / Windows / macOS / Linux / Android)
|
||||
- [ ] Manual smoke (describe what you clicked / loaded, and on which platform: Web / Windows / Linux / Android)
|
||||
- [ ] UI changed: keyboard-only pass of what changed (visible focus, nothing stuck), accessible names in all four locales, `motion-safe:` animations, no colour-only meaning — see [ACCESSIBILITY.md](https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/ACCESSIBILITY.md#contributor-expectations). Screen reader used, if any:
|
||||
|
||||
## Screenshots / recordings (UI changes only)
|
||||
|
||||
@@ -44,7 +59,7 @@ CI must pass before the PR can be merged.
|
||||
|
||||
<!--
|
||||
JSONPrism's maintainer uses AI co-authoring openly. If an AI tool helped
|
||||
with this PR (code, tests, docs or translations), say which tool and how
|
||||
with this change (code, tests, docs or translations), say which tool and how
|
||||
you used it, so reviewers can calibrate. Either way, you are responsible
|
||||
for every line you submit.
|
||||
-->
|
||||
@@ -54,7 +69,7 @@ for every line you submit.
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] My changes follow the conventions in [CLAUDE.md](https://github.com/poli0981/jsonPrism/blob/main/CLAUDE.md) and [CONTRIBUTING.md](https://github.com/poli0981/jsonPrism/blob/main/CONTRIBUTING.md).
|
||||
- [ ] My changes follow the conventions in [CLAUDE.md](https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/CLAUDE.md) and [CONTRIBUTING.md](https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/CONTRIBUTING.md).
|
||||
- [ ] I added or updated tests where relevant.
|
||||
- [ ] New or changed UI strings are in all four locales (`en`, `vi`, `ja`, `zh-CN`) and the i18n parity test passes.
|
||||
- [ ] App code uses no ES2025 runtime APIs (Iterator helpers, `Set` methods, `Promise.try`, …).
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# actionlint settings (security.yml, job `workflow-lint`, and a local
|
||||
# `actionlint` run from the repo root), as in the ops repo poli0981/.github.
|
||||
# Only Gitea features that actionlint does not know are ignored here;
|
||||
# everything else stays an error.
|
||||
paths:
|
||||
.gitea/workflows/*.yml:
|
||||
ignore:
|
||||
# Gitea's own token scope for releases (ops runbook §3.2 item 5)
|
||||
- 'unknown permission scope "releases"'
|
||||
# Gitea resolves full-URL actions; bare owner/repo goes to github.com (ops runbook §1)
|
||||
- 'specifying action "https://gitea\.com/[^"]+" in invalid format'
|
||||
@@ -1,83 +0,0 @@
|
||||
version: 2
|
||||
|
||||
# Weekly updates, grouped by package family so a family's majors land together:
|
||||
# a lone `eslint` major once left `npm ci` broken on main for four months.
|
||||
# A cooldown skips releases younger than a few days (security updates are exempt).
|
||||
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '08:00'
|
||||
timezone: Asia/Ho_Chi_Minh
|
||||
open-pull-requests-limit: 10
|
||||
versioning-strategy: increase
|
||||
cooldown:
|
||||
default-days: 3
|
||||
semver-major-days: 7
|
||||
labels: [dependencies, npm]
|
||||
ignore:
|
||||
# `typescript` is an alias for the TypeScript 6 API that typescript-eslint
|
||||
# needs; the compiler itself is TypeScript 7 (`@typescript/native`).
|
||||
- dependency-name: typescript
|
||||
versions: ['>=6.1.0']
|
||||
# @types/node follows the Node major in .nvmrc.
|
||||
- dependency-name: '@types/node'
|
||||
update-types: ['version-update:semver-major']
|
||||
groups:
|
||||
eslint:
|
||||
patterns: [eslint, '@eslint/*', typescript-eslint, 'eslint-plugin-*', globals]
|
||||
test:
|
||||
patterns: [vitest, '@vitest/*', jsdom, '@testing-library/*']
|
||||
react:
|
||||
patterns: [react, react-dom, '@types/react', '@types/react-dom', '@vitejs/plugin-react']
|
||||
build:
|
||||
patterns: [vite, tailwindcss, '@tailwindcss/*', tw-animate-css, prettier, 'prettier-plugin-*', knip]
|
||||
i18n:
|
||||
patterns: [i18next, react-i18next]
|
||||
tauri:
|
||||
patterns: ['@tauri-apps/*']
|
||||
codemirror:
|
||||
patterns: ['@codemirror/*', '@uiw/*', '@lezer/*']
|
||||
radix:
|
||||
patterns: ['@radix-ui/*']
|
||||
cloudflare:
|
||||
patterns: [wrangler, '@cloudflare/*', '@marsidev/react-turnstile']
|
||||
npm-minor-patch:
|
||||
update-types: [minor, patch]
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '08:00'
|
||||
timezone: Asia/Ho_Chi_Minh
|
||||
open-pull-requests-limit: 5
|
||||
cooldown:
|
||||
default-days: 3
|
||||
labels: [dependencies, github-actions]
|
||||
groups:
|
||||
actions:
|
||||
patterns: ['*']
|
||||
|
||||
# The Tauri shell. Keep the crate versions in step with the @tauri-apps npm packages.
|
||||
- package-ecosystem: cargo
|
||||
directory: /src-tauri
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '08:00'
|
||||
timezone: Asia/Ho_Chi_Minh
|
||||
open-pull-requests-limit: 5
|
||||
cooldown:
|
||||
default-days: 3
|
||||
semver-major-days: 7
|
||||
labels: [dependencies, rust, tauri]
|
||||
groups:
|
||||
tauri:
|
||||
patterns: ['tauri', 'tauri-*']
|
||||
cargo-minor-patch:
|
||||
update-types: [minor, patch]
|
||||
@@ -1,37 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>JSONPrism has moved</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
<link rel="canonical" href="https://jsonprism.poli0981.dev/" />
|
||||
<!-- Without JavaScript, fall back to the new home page. -->
|
||||
<meta http-equiv="refresh" content="3; url=https://jsonprism.poli0981.dev/" />
|
||||
<script>
|
||||
(function () {
|
||||
// Drop the old project-site prefix; keep the rest of the path, the query and the hash.
|
||||
var path = location.pathname.replace(/^\/jsonprism(?=\/|$)/i, '') || '/';
|
||||
location.replace('https://jsonprism.poli0981.dev' + path + location.search + location.hash);
|
||||
})();
|
||||
</script>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: dark light;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-family: system-ui, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
JSONPrism has moved to
|
||||
<a href="https://jsonprism.poli0981.dev/">jsonprism.poli0981.dev</a>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>JSONPrism has moved</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
<link rel="canonical" href="https://jsonprism.poli0981.dev/" />
|
||||
<!-- Without JavaScript, fall back to the new home page. -->
|
||||
<meta http-equiv="refresh" content="3; url=https://jsonprism.poli0981.dev/" />
|
||||
<script>
|
||||
(function () {
|
||||
// Drop the old project-site prefix; keep the rest of the path, the query and the hash.
|
||||
var path = location.pathname.replace(/^\/jsonprism(?=\/|$)/i, '') || '/';
|
||||
location.replace('https://jsonprism.poli0981.dev' + path + location.search + location.hash);
|
||||
})();
|
||||
</script>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: dark light;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-family: system-ui, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
JSONPrism has moved to
|
||||
<a href="https://jsonprism.poli0981.dev/">jsonprism.poli0981.dev</a>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
# Python tools the workflows run (security.yml: zizmor).
|
||||
# Lock: requirements-ci.txt, regenerated by Renovate (pip-compile manager) or by
|
||||
# the command in its header.
|
||||
zizmor==1.32.0
|
||||
@@ -0,0 +1,18 @@
|
||||
# zizmor for security.yml (job `workflow-lint`), hash-locked. zizmor is a
|
||||
# self-contained wheel with no Python dependencies. Regenerate (and let
|
||||
# Renovate's pip-compile manager keep it current) with:
|
||||
# uv pip compile .github/requirements-ci.in --generate-hashes --python-platform x86_64-manylinux_2_28 --python-version 3.12 -o .github/requirements-ci.txt
|
||||
zizmor==1.32.0 \
|
||||
--hash=sha256:0a999c98015becd9f69919ce01febadfb1c2be9b8ec2ce9ef7eb13ff23ba8eba \
|
||||
--hash=sha256:0cdd38fca6eb34ceb567548548d706332e3535ea66894b9168c048e03207b68c \
|
||||
--hash=sha256:3f404b26791ed06a5ea9eaa0bfd5b973fc5228bac7db8b3c5ec7f0c7ad2ed16d \
|
||||
--hash=sha256:84a6acb975accc13408786a2bd274b572537ca19c933ebbc13e78f3988562071 \
|
||||
--hash=sha256:913fd3943bc1358aa6e23b33fe01cc98bf67af23985258b8fbf24eaa2f8728ea \
|
||||
--hash=sha256:9cd1dd7734042f40ca0faa2a31fb4e9033dede620d996af2f903744b8f04fca9 \
|
||||
--hash=sha256:aa4b4e216321dd5cf202cd79fc83296468f0eed79d850cd65ac8187a6bbc5496 \
|
||||
--hash=sha256:bddcdb0e37d1aa53c9f831c55627a5829d0d552cb0afb4b80fbe16a3a3140366 \
|
||||
--hash=sha256:d34dcfa702875202b4163d90ebb9cc5222f3d1a7d4b72bf796d87b5a15b24194 \
|
||||
--hash=sha256:dd818f99d833b86cd432d5412d620d936b5df074b33404fff8b67acff55d3259 \
|
||||
--hash=sha256:eaedf57859f026a0a7da2a6b574517b1fe01e256c6875b3319a06ee1cee026a7 \
|
||||
--hash=sha256:f0b664d394576e08605fe8094e8e992056d74b808f30c0c9ca9ed227001dcf67
|
||||
# via -r .github/requirements-ci.in
|
||||
@@ -1,132 +0,0 @@
|
||||
name: Announce Release in Discussions
|
||||
|
||||
# Create a Discussion post in the "Announcements" category when a GitHub
|
||||
# Release is published, or by hand. (Per-deploy posts were dropped: web deploys
|
||||
# now happen on every merge through Cloudflare Workers Builds.)
|
||||
#
|
||||
# Prerequisites (one-time manual setup):
|
||||
# 1. Enable Discussions in the repo Settings → Features.
|
||||
# 2. Create a category named "Announcements" (any kind; this workflow
|
||||
# auto-discovers its node ID at runtime).
|
||||
#
|
||||
# Permissions:
|
||||
# • `contents: read` — read commit / release metadata.
|
||||
# • `discussions: write` — required to create the post.
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
message:
|
||||
description: 'Announcement body (Markdown)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: announce-discussion-${{ github.event_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
name: Create Discussion post
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
contents: read
|
||||
discussions: write
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Resolve repository + category IDs
|
||||
id: ids
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
QUERY='query($owner: String!, $name: String!) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
id
|
||||
discussionCategories(first: 25) {
|
||||
nodes { id name }
|
||||
}
|
||||
}
|
||||
}'
|
||||
response=$(gh api graphql \
|
||||
-f query="$QUERY" \
|
||||
-F owner="${{ github.repository_owner }}" \
|
||||
-F name="${{ github.event.repository.name }}")
|
||||
repo_id=$(echo "$response" | jq -r '.data.repository.id')
|
||||
cat_id=$(echo "$response" | jq -r '.data.repository.discussionCategories.nodes[] | select(.name == "Announcements") | .id')
|
||||
if [ -z "$cat_id" ] || [ "$cat_id" = "null" ]; then
|
||||
echo "::error::Discussion category 'Announcements' not found. Enable Discussions and create the category in Settings → Features."
|
||||
exit 1
|
||||
fi
|
||||
echo "repo_id=$repo_id" >> "$GITHUB_OUTPUT"
|
||||
echo "cat_id=$cat_id" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Compose title + body
|
||||
id: msg
|
||||
env:
|
||||
EVENT: ${{ github.event_name }}
|
||||
# `|| ''` guards each value so the env var is always set to an
|
||||
# empty string (not unset) when the source field is missing for
|
||||
# the active event type. Without this, `set -u` blows up below.
|
||||
RELEASE_TAG: ${{ github.event.release.tag_name || '' }}
|
||||
RELEASE_URL: ${{ github.event.release.html_url || '' }}
|
||||
RELEASE_BODY: ${{ github.event.release.body || '' }}
|
||||
DISPATCH_MSG: ${{ inputs.message || '' }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# NL is a literal newline used to assemble multi-line bodies
|
||||
# without breaking the YAML literal-block-scalar indentation.
|
||||
# Concatenating "$VAR""$NL""$NL""$OTHER" gives both interpolation
|
||||
# AND embedded blank lines.
|
||||
NL=$'\n'
|
||||
case "$EVENT" in
|
||||
release)
|
||||
title="Release ${RELEASE_TAG}"
|
||||
body="## ${RELEASE_TAG}${NL}${NL}${RELEASE_BODY}${NL}${NL}[View release →](${RELEASE_URL})"
|
||||
;;
|
||||
workflow_dispatch)
|
||||
title="Announcement"
|
||||
body="${DISPATCH_MSG}"
|
||||
;;
|
||||
*)
|
||||
echo "::error::Unsupported event: ${EVENT}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
{
|
||||
echo "title<<EOF"
|
||||
echo "$title"
|
||||
echo "EOF"
|
||||
echo "body<<EOF"
|
||||
echo "$body"
|
||||
echo "EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create Discussion
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Pass dynamic values through env vars (not literal `${{ ... }}`
|
||||
# substitution) so a title/body containing quotes, backticks, or
|
||||
# other shell-special characters doesn't break the command line.
|
||||
REPO_ID: ${{ steps.ids.outputs.repo_id }}
|
||||
CAT_ID: ${{ steps.ids.outputs.cat_id }}
|
||||
TITLE: ${{ steps.msg.outputs.title }}
|
||||
BODY: ${{ steps.msg.outputs.body }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
MUTATION='mutation($repo: ID!, $cat: ID!, $title: String!, $body: String!) {
|
||||
createDiscussion(input: {repositoryId: $repo, categoryId: $cat, title: $title, body: $body}) {
|
||||
discussion { url }
|
||||
}
|
||||
}'
|
||||
gh api graphql \
|
||||
-f query="$MUTATION" \
|
||||
-F repo="$REPO_ID" \
|
||||
-F cat="$CAT_ID" \
|
||||
-F title="$TITLE" \
|
||||
-F body="$BODY" \
|
||||
--jq '.data.createDiscussion.discussion.url'
|
||||
@@ -1,26 +0,0 @@
|
||||
name: Announce Release to Discord
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Existing release tag to re-announce
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
permissions:
|
||||
contents: read
|
||||
uses: poli0981/.github/.github/workflows/announce-release.yml@c3e118a01d40e95b36b2c3466dc206638c11eb5a # main 2026-07-06
|
||||
with:
|
||||
tag_override: ${{ inputs.tag || '' }}
|
||||
# Only the webhooks it needs, not every repository secret.
|
||||
secrets:
|
||||
DISCORD_RELEASES_WEBHOOK: ${{ secrets.DISCORD_RELEASES_WEBHOOK }}
|
||||
DISCORD_REPO_WEBHOOK: ${{ secrets.DISCORD_REPO_WEBHOOK }}
|
||||
DISCORD_PING_ROLE_ID: ${{ secrets.DISCORD_PING_ROLE_ID }}
|
||||
@@ -1,169 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||||
# Only superseded PR runs are cancelled; every commit on main gets a full run.
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
env:
|
||||
WRANGLER_SEND_METRICS: 'false'
|
||||
|
||||
jobs:
|
||||
web:
|
||||
name: Web · lint, typecheck, test, build
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
# No dependency needs its install scripts (esbuild, workerd and the Tauri
|
||||
# CLI resolve their platform binaries at runtime), so none get to run.
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Format check
|
||||
run: npm run format:check
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Knip
|
||||
run: npm run knip
|
||||
|
||||
- name: Typecheck (TypeScript 7)
|
||||
run: |
|
||||
npx tsc --version | grep -q '^Version 7\.' || { echo "::error::tsc is not TypeScript 7"; exit 1; }
|
||||
npm run typecheck
|
||||
|
||||
- name: Test with coverage
|
||||
run: npm run test:coverage
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Worker deploy dry run
|
||||
run: npm run cf:check
|
||||
|
||||
- name: Upload dist
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload coverage
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage/lcov.info
|
||||
retention-days: 7
|
||||
|
||||
sonar:
|
||||
name: SonarQube Cloud
|
||||
needs: web
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
# Empty for Dependabot and fork PRs, which get no secrets: skip, don't fail.
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
steps:
|
||||
- name: Skip without a token
|
||||
if: env.SONAR_TOKEN == ''
|
||||
run: echo "::notice::SONAR_TOKEN is not available to this run; skipping analysis."
|
||||
|
||||
- name: Checkout
|
||||
if: env.SONAR_TOKEN != ''
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
# Full history so new-code detection and blame work.
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download coverage
|
||||
if: env.SONAR_TOKEN != ''
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage
|
||||
|
||||
- name: Scan
|
||||
if: env.SONAR_TOKEN != ''
|
||||
uses: SonarSource/sonarqube-scan-action@d209202bc7d53ff1cc128f7f907dac145c9d6ae9 # v8.3.0
|
||||
|
||||
rust:
|
||||
name: Tauri · fmt, clippy
|
||||
needs: web
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Linux build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev libgtk-3-dev
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
# generate_context!() embeds the icons and the built frontend at compile time.
|
||||
- name: Generate icons
|
||||
run: npm run tauri:icon
|
||||
|
||||
- name: Download dist
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy, rustfmt
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
workspaces: './src-tauri -> target'
|
||||
|
||||
- name: rustfmt
|
||||
working-directory: src-tauri
|
||||
run: cargo fmt --check
|
||||
|
||||
- name: Clippy
|
||||
working-directory: src-tauri
|
||||
run: cargo clippy --all-targets --locked -- -D warnings
|
||||
@@ -1,17 +0,0 @@
|
||||
name: Notify CI Failures
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI", "Production smoke"]
|
||||
types: [completed]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
uses: poli0981/.github/.github/workflows/notify-ci-failure.yml@c3e118a01d40e95b36b2c3466dc206638c11eb5a # main 2026-07-06
|
||||
secrets:
|
||||
DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
|
||||
@@ -1,17 +0,0 @@
|
||||
name: Notify Release Pipeline
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Release Tauri bundles"]
|
||||
types: [completed]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
uses: poli0981/.github/.github/workflows/notify-release-pipeline.yml@c3e118a01d40e95b36b2c3466dc206638c11eb5a # main 2026-07-06
|
||||
secrets:
|
||||
DISCORD_RELEASE_PIPELINE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PIPELINE_WEBHOOK }}
|
||||
@@ -1,45 +0,0 @@
|
||||
name: Pages redirect
|
||||
|
||||
# GitHub Pages used to host the web app at poli0981.github.io/jsonPrism/. It now
|
||||
# serves only a redirect to https://jsonprism.poli0981.dev that keeps the path,
|
||||
# so old links from YouTube, Discord and READMEs still land on the right page.
|
||||
# Run it by hand after changing .github/pages-redirect/.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy redirect
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
|
||||
|
||||
- name: Upload the redirect pages
|
||||
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
||||
with:
|
||||
path: .github/pages-redirect
|
||||
|
||||
- name: Deploy
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
|
||||
@@ -1,340 +0,0 @@
|
||||
name: Release Tauri bundles
|
||||
|
||||
# Builds the desktop bundles and the Android APK for a version tag into ONE
|
||||
# draft release, then adds SHA256SUMS.txt and build-provenance attestations.
|
||||
# The maintainer publishes the draft, which triggers the announcements.
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Existing version tag to (re)build, e.g. v2.0.0
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: release-${{ inputs.tag || github.ref_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
TAG: ${{ inputs.tag || github.ref_name }}
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
name: Verify tag and tests
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- name: Validate tag format
|
||||
run: |
|
||||
[[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]] || { echo "::error::'$TAG' is not a version tag"; exit 1; }
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: refs/tags/${{ env.TAG }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Check the tag matches the app version
|
||||
id: version
|
||||
run: |
|
||||
version=$(node -p "require('./package.json').version")
|
||||
cargo_version=$(sed -n 's/^version = "\(.*\)"$/\1/p' src-tauri/Cargo.toml | head -n 1)
|
||||
[ "$TAG" = "v$version" ] || { echo "::error::Tag $TAG does not match package.json version $version"; exit 1; }
|
||||
[ "$cargo_version" = "$version" ] || { echo "::error::Cargo.toml version $cargo_version does not match $version"; exit 1; }
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
# One draft for the whole matrix: parallel "find or create" calls used to
|
||||
# race and split the assets across duplicate drafts.
|
||||
create-release:
|
||||
name: Create draft release
|
||||
needs: verify
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
permissions:
|
||||
contents: write
|
||||
outputs:
|
||||
release_id: ${{ steps.release.outputs.result }}
|
||||
steps:
|
||||
- name: Create or reuse the draft
|
||||
id: release
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const tag = process.env.TAG;
|
||||
const { owner, repo } = context.repo;
|
||||
const releases = await github.paginate(github.rest.repos.listReleases, { owner, repo, per_page: 100 });
|
||||
const existing = releases.find((r) => r.tag_name === tag);
|
||||
if (existing) {
|
||||
if (!existing.draft) throw new Error(`Release ${tag} is already published; delete it or tag a new version.`);
|
||||
core.info(`Reusing draft ${existing.id}`);
|
||||
return existing.id;
|
||||
}
|
||||
const { data } = await github.rest.repos.createRelease({
|
||||
owner,
|
||||
repo,
|
||||
tag_name: tag,
|
||||
name: `JSONPrism ${tag}`,
|
||||
draft: true,
|
||||
prerelease: tag.includes('-'),
|
||||
body: [
|
||||
'Native builds for Windows, macOS (universal) and Linux, plus an Android APK (sideload, Android 12+). The web app runs at https://jsonprism.poli0981.dev.',
|
||||
'',
|
||||
'Verify a download with `sha256sum -c SHA256SUMS.txt --ignore-missing`, or check its build provenance with `gh attestation verify <file> --repo poli0981/jsonPrism`.',
|
||||
'',
|
||||
'Android: download the `.apk`, then allow "install unknown apps" for your browser or file manager.',
|
||||
'',
|
||||
`See the [CHANGELOG](https://github.com/${owner}/${repo}/blob/${tag}/CHANGELOG.md) for details.`,
|
||||
].join('\n'),
|
||||
});
|
||||
return data.id;
|
||||
|
||||
desktop:
|
||||
name: Build · ${{ matrix.platform.name }}
|
||||
needs: create-release
|
||||
runs-on: ${{ matrix.platform.runner }}
|
||||
timeout-minutes: 45
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- name: Windows
|
||||
runner: windows-latest
|
||||
args: ''
|
||||
- name: macOS (universal)
|
||||
runner: macos-14
|
||||
args: '--target universal-apple-darwin'
|
||||
# The oldest supported Ubuntu keeps the AppImage/deb glibc floor low.
|
||||
- name: Linux
|
||||
runner: ubuntu-22.04
|
||||
args: ''
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: refs/tags/${{ env.TAG }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Linux build dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev libgtk-3-dev
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
||||
with:
|
||||
toolchain: stable
|
||||
# The universal macOS bundle needs both Apple targets.
|
||||
targets: ${{ runner.os == 'macOS' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
workspaces: './src-tauri -> target'
|
||||
key: ${{ matrix.platform.runner }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Generate icons
|
||||
run: npm run tauri:icon
|
||||
|
||||
- name: Build and upload to the draft
|
||||
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # action-v1.0.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
releaseId: ${{ needs.create-release.outputs.release_id }}
|
||||
args: ${{ matrix.platform.args }}
|
||||
|
||||
# tauri-action builds desktop targets only; Android drives the Tauri CLI
|
||||
# directly and signs with the release keystore (see docs/TAURI-NOTES.md):
|
||||
# ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD,
|
||||
# ANDROID_KEY_PASSWORD (optional), ANDROID_KEY_ALIAS (optional, "upload").
|
||||
android:
|
||||
name: Build · Android (APK)
|
||||
needs: [verify, create-release]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: refs/tags/${{ env.TAG }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Java 17
|
||||
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
|
||||
|
||||
- name: Install SDK platform and NDK
|
||||
run: |
|
||||
sdkmanager "platforms;android-36" "ndk;27.2.12479018"
|
||||
echo "NDK_HOME=$ANDROID_HOME/ndk/27.2.12479018" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Setup Rust with Android targets
|
||||
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
workspaces: './src-tauri -> target'
|
||||
key: android
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Generate icons
|
||||
run: npm run tauri:icon
|
||||
|
||||
- name: Decode release keystore
|
||||
env:
|
||||
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
run: |
|
||||
if [ -z "$ANDROID_KEYSTORE_BASE64" ]; then
|
||||
echo "::error::ANDROID_KEYSTORE_BASE64 is not set; cannot sign the release APK."
|
||||
exit 1
|
||||
fi
|
||||
KEYSTORE_PATH="$RUNNER_TEMP/upload-keystore.jks"
|
||||
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > "$KEYSTORE_PATH"
|
||||
{
|
||||
echo "storePassword=$ANDROID_KEYSTORE_PASSWORD"
|
||||
echo "keyPassword=${ANDROID_KEY_PASSWORD:-$ANDROID_KEYSTORE_PASSWORD}"
|
||||
echo "keyAlias=${ANDROID_KEY_ALIAS:-upload}"
|
||||
echo "storeFile=$KEYSTORE_PATH"
|
||||
} > src-tauri/gen/android/keystore.properties
|
||||
|
||||
- name: Build signed universal APK
|
||||
run: npm run tauri -- android build --apk
|
||||
|
||||
- name: Upload the APK to the draft
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
env:
|
||||
RELEASE_ID: ${{ needs.create-release.outputs.release_id }}
|
||||
VERSION: ${{ needs.verify.outputs.version }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('node:fs');
|
||||
const { owner, repo } = context.repo;
|
||||
const releaseId = Number(process.env.RELEASE_ID);
|
||||
const dir = 'src-tauri/gen/android/app/build/outputs/apk/universal/release';
|
||||
const apks = fs.readdirSync(dir).filter((f) => f.endsWith('.apk'));
|
||||
if (apks.length !== 1) throw new Error(`Expected one APK in ${dir}, found: ${apks.join(', ') || 'none'}`);
|
||||
// Same naming scheme as the desktop bundles.
|
||||
const name = `JSONPrism_${process.env.VERSION}_android-universal.apk`;
|
||||
const assets = await github.paginate(github.rest.repos.listReleaseAssets, { owner, repo, release_id: releaseId });
|
||||
for (const old of assets.filter((a) => a.name === name)) {
|
||||
await github.rest.repos.deleteReleaseAsset({ owner, repo, asset_id: old.id });
|
||||
}
|
||||
await github.rest.repos.uploadReleaseAsset({
|
||||
owner,
|
||||
repo,
|
||||
release_id: releaseId,
|
||||
name,
|
||||
data: fs.readFileSync(`${dir}/${apks[0]}`),
|
||||
});
|
||||
core.info(`Uploaded ${name}`);
|
||||
|
||||
checksums:
|
||||
name: Checksums and provenance
|
||||
needs: [create-release, desktop, android]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
steps:
|
||||
- name: Download the draft's assets
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
RELEASE_ID: ${{ needs.create-release.outputs.release_id }}
|
||||
run: |
|
||||
mkdir assets
|
||||
gh api --paginate "repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets" \
|
||||
--jq '.[] | select(.name != "SHA256SUMS.txt") | [.id, .name] | @tsv' |
|
||||
while IFS=$'\t' read -r id name; do
|
||||
gh api -H 'Accept: application/octet-stream' "repos/$GITHUB_REPOSITORY/releases/assets/$id" > "assets/$name"
|
||||
done
|
||||
ls -l assets
|
||||
|
||||
- name: Write SHA256SUMS.txt
|
||||
working-directory: assets
|
||||
run: |
|
||||
sha256sum -- * > ../SHA256SUMS.txt
|
||||
cat ../SHA256SUMS.txt
|
||||
|
||||
- name: Attest build provenance
|
||||
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
||||
with:
|
||||
subject-path: assets/*
|
||||
|
||||
- name: Upload SHA256SUMS.txt to the draft
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
env:
|
||||
RELEASE_ID: ${{ needs.create-release.outputs.release_id }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('node:fs');
|
||||
const { owner, repo } = context.repo;
|
||||
const releaseId = Number(process.env.RELEASE_ID);
|
||||
const name = 'SHA256SUMS.txt';
|
||||
const assets = await github.paginate(github.rest.repos.listReleaseAssets, { owner, repo, release_id: releaseId });
|
||||
for (const old of assets.filter((a) => a.name === name)) {
|
||||
await github.rest.repos.deleteReleaseAsset({ owner, repo, asset_id: old.id });
|
||||
}
|
||||
await github.rest.repos.uploadReleaseAsset({
|
||||
owner,
|
||||
repo,
|
||||
release_id: releaseId,
|
||||
name,
|
||||
data: fs.readFileSync(name),
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
# zizmor (workflow security linter) configuration, run by
|
||||
# .gitea/workflows/security.yml (job `workflow-lint`, offline).
|
||||
rules:
|
||||
unpinned-uses:
|
||||
config:
|
||||
policies:
|
||||
# Every action and every call into the ops repo (poli0981/.github) is
|
||||
# pinned to a full commit SHA. Renovate bumps the actions; the ops pins
|
||||
# are bumped by hand when the ops repo is tagged (its runbook §3.2).
|
||||
"*": hash-pin
|
||||
dangerous-triggers:
|
||||
ignore:
|
||||
# Both run on `workflow_run` so a failure (or a release build) anywhere
|
||||
# can be reported to Discord. Neither checks out the triggering run's
|
||||
# code nor downloads its artifacts: the shared workflows only read run
|
||||
# metadata, and pass every untrusted field (branch, commit message,
|
||||
# actor) to the notifier script through `env:`, never by interpolation.
|
||||
- notify-ci-failure.yml
|
||||
- notify-release-pipeline.yml
|
||||
@@ -0,0 +1,56 @@
|
||||
<!--
|
||||
This is the GitLab mirror of git.poli0981.dev/poli0981/jsonPrism (sign-up there is
|
||||
closed). Issues opened here reach the maintainer.
|
||||
Start the title with "[A11Y] ". The maintainer adds the labels (accessibility, needs-triage).
|
||||
-->
|
||||
|
||||
<!--
|
||||
Thanks for reporting a barrier. You don't need to know the cause: describe
|
||||
what you tried and what happened. See ACCESSIBILITY.md for what JSONPrism
|
||||
supports today and its known limitations:
|
||||
https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/ACCESSIBILITY.md
|
||||
|
||||
Prefer not to post publicly? Email code@poli0981.dev with "Accessibility"
|
||||
in the subject. Security problems go through SECURITY.md instead.
|
||||
-->
|
||||
|
||||
## What were you trying to do?
|
||||
|
||||
For example: convert JSON to CSV, open a file, download the output, run a
|
||||
batch, change an option, get past the consent screen.
|
||||
|
||||
## What happened?
|
||||
|
||||
What you expected, and what you got instead (for example: nothing was
|
||||
announced, focus got stuck, text was unreadable at 200 % zoom).
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Go to '...'
|
||||
2. Press / say '...'
|
||||
3. See '...'
|
||||
|
||||
## Your setup
|
||||
|
||||
- Assistive technology and version: [e.g. NVDA 2026.3, VoiceOver, TalkBack, Narrator, Dragon, screen magnifier, none]
|
||||
- How you use the app: [keyboard only / screen reader / voice control / switch access / zoom or magnification / Windows contrast theme / other]
|
||||
- Platform: [Web / Windows / Linux / Android / macOS (2.2.1 or older)]
|
||||
- JSONPrism version: [e.g. 2.2.1 — see About → Build info]
|
||||
- Browser (web) or OS version (apps): [e.g. Firefox on Windows 11, Safari on macOS 15, Android 15]
|
||||
|
||||
## How much does it block you?
|
||||
|
||||
- [ ] **Critical** — I can't complete the task at all
|
||||
- [ ] **High** — I can, but only with a lot of effort or a workaround
|
||||
- [ ] **Medium** — confusing or inconsistent, but I can finish the task
|
||||
- [ ] **Low** — a minor annoyance
|
||||
|
||||
## Workaround
|
||||
|
||||
Did you find a way around it? It helps others while a fix is on the way.
|
||||
|
||||
## Diagnostics, recordings or screenshots
|
||||
|
||||
Optional. **About → Build info → Copy diagnostics** gives the version,
|
||||
platform and recent log lines (check it for anything private first). A
|
||||
short screen or screen-reader recording also helps.
|
||||
@@ -0,0 +1,66 @@
|
||||
<!--
|
||||
This is the GitLab mirror of git.poli0981.dev/poli0981/jsonPrism (sign-up there is
|
||||
closed). Issues opened here reach the maintainer.
|
||||
Start the title with "[BUG] ". The maintainer adds the labels (bug, needs-triage).
|
||||
-->
|
||||
|
||||
<!--
|
||||
Security vulnerabilities do NOT belong in a public issue. Report them
|
||||
privately by email to security@poli0981.dev (see SECURITY.md).
|
||||
|
||||
Something hard or impossible to use with a keyboard, screen reader, zoom or
|
||||
other assistive technology? Use the "Accessibility" template instead.
|
||||
-->
|
||||
|
||||
## Describe the bug
|
||||
|
||||
A clear description of what the bug is.
|
||||
|
||||
## To reproduce
|
||||
|
||||
1. Go to '...'
|
||||
2. Paste this input: '...'
|
||||
3. Pick format '...' and direction (JSON → format, or format → JSON where available)
|
||||
4. See error
|
||||
|
||||
## Sample JSON
|
||||
|
||||
Please provide a **minimal** JSON sample (or source-format input, for format → JSON) that triggers the bug, with anything private removed:
|
||||
|
||||
```json
|
||||
{ "your": "sample here" }
|
||||
```
|
||||
|
||||
## Expected behavior
|
||||
|
||||
What you expected to happen.
|
||||
|
||||
## Actual behavior
|
||||
|
||||
What actually happened. Include the error message and target format.
|
||||
|
||||
## Environment
|
||||
|
||||
- Platform: [Web / Windows / Linux / Android / macOS (2.2.1 or older)]
|
||||
- JSONPrism version: [e.g. 2.2.1 — see About → Build info]
|
||||
- Browser (web) or OS version (apps): [e.g. Firefox on Windows 11, Safari on macOS 15, Ubuntu 24.04, Android 15]
|
||||
- Where: [the website https://jsonprism.poli0981.dev / an installed release / a local dev build]
|
||||
- Assistive technology, if any: [e.g. NVDA 2026.3, VoiceOver, keyboard only, 200 % zoom]
|
||||
|
||||
## Diagnostics
|
||||
|
||||
Optional but helpful: open **About → Build info → Copy diagnostics** in the
|
||||
app and paste the result below. It contains the version, commit, platform
|
||||
and recent log lines; check it for anything private before posting.
|
||||
|
||||
```text
|
||||
Paste diagnostics here
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||
If applicable, attach screenshots.
|
||||
|
||||
## Additional context
|
||||
|
||||
Anything else relevant.
|
||||
@@ -0,0 +1,51 @@
|
||||
<!--
|
||||
This is the GitLab mirror of git.poli0981.dev/poli0981/jsonPrism (sign-up there is
|
||||
closed). Issues opened here reach the maintainer.
|
||||
Start the title with "[CONVERTER] ". The maintainer adds the labels (converter, needs-triage).
|
||||
-->
|
||||
|
||||
<!--
|
||||
JSONPrism is in maintenance mode (CONTRIBUTING.md → Maintenance mode): it
|
||||
takes no new features, but a format can still be added or removed when
|
||||
there is a real need. Other ideas are welcome on the Discord server
|
||||
(https://discord.gg/2aNR3aVt), with no commitment.
|
||||
-->
|
||||
|
||||
## Add or remove?
|
||||
|
||||
- [ ] Add a format
|
||||
- [ ] Remove a format
|
||||
|
||||
## Format
|
||||
|
||||
Name, file extension(s), and a link to its specification.
|
||||
|
||||
## Who needs it, and for what?
|
||||
|
||||
The real workflow this serves, or, for a removal, why the format should go.
|
||||
Requests without a concrete use case are closed.
|
||||
|
||||
## Direction
|
||||
|
||||
- [ ] JSON → format
|
||||
- [ ] Format → JSON
|
||||
- [ ] Input only (like JSONC → JSON)
|
||||
|
||||
## Sample
|
||||
|
||||
A small input and the output you expect:
|
||||
|
||||
```json
|
||||
{ "example": "input" }
|
||||
```
|
||||
|
||||
```
|
||||
expected output here
|
||||
```
|
||||
|
||||
## Scope check
|
||||
|
||||
- [ ] It fits the "one JSON → many formats" mission
|
||||
- [ ] It can run entirely on the user's device (no server)
|
||||
- [ ] No format JSONPrism already has covers it
|
||||
- [ ] I checked the latest build at https://jsonprism.poli0981.dev
|
||||
@@ -0,0 +1,38 @@
|
||||
<!--
|
||||
This is the GitLab mirror of git.poli0981.dev/poli0981/jsonPrism (sign-up there is
|
||||
closed). Issues opened here reach the maintainer.
|
||||
Start the title with "[I18N] ". The maintainer adds the labels (i18n, needs-triage).
|
||||
-->
|
||||
|
||||
<!--
|
||||
JSONPrism ships English, Tiếng Việt, 日本語 and 简体中文. The Japanese and
|
||||
Simplified Chinese strings, and parts of the Vietnamese ones, are
|
||||
AI-generated, so corrections from native speakers are very welcome.
|
||||
-->
|
||||
|
||||
## Language
|
||||
|
||||
- [ ] Tiếng Việt (`vi`)
|
||||
- [ ] 日本語 (`ja`)
|
||||
- [ ] 简体中文 (`zh-CN`)
|
||||
- [ ] English (`en`)
|
||||
|
||||
## Where
|
||||
|
||||
The page or screen, and what you were doing: for example the consent
|
||||
screen, the CSV options, an error message.
|
||||
|
||||
## Current text
|
||||
|
||||
Copy the text exactly as shown, or attach a screenshot.
|
||||
|
||||
## Suggested text
|
||||
|
||||
## Why
|
||||
|
||||
- [ ] It doesn't fit the culture, region or usual tone
|
||||
- [ ] A spelling or grammar mistake that could mislead
|
||||
- [ ] The meaning is wrong (mistranslation)
|
||||
- [ ] Other
|
||||
|
||||
Details:
|
||||
@@ -0,0 +1,85 @@
|
||||
<!--
|
||||
This is the GitLab mirror of git.poli0981.dev/poli0981/jsonPrism. GitLab CI does not
|
||||
run here: the maintainer runs CI on Gitea and applies accepted changes there; the
|
||||
mirror then marks this merge request merged (or it is closed with a link to the
|
||||
commit when it was squashed or rebased). Patches by e-mail to code@poli0981.dev
|
||||
work too.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Thanks for contributing to JSONPrism!
|
||||
|
||||
JSONPrism is in maintenance mode (CONTRIBUTING.md → "Maintenance mode"):
|
||||
new features are out of scope, and `feat:` merge requests from outside
|
||||
contributors are closed.
|
||||
|
||||
Please fill in the sections below. Changes missing required context (no summary,
|
||||
no test plan, off-topic preamble) may be closed without review.
|
||||
See CONTRIBUTING.md → "Auto-ignored contributions" for what gets dismissed.
|
||||
|
||||
Fixing an undisclosed security vulnerability? Report it privately first
|
||||
(SECURITY.md: security@poli0981.dev) instead of describing it in public.
|
||||
-->
|
||||
|
||||
## Summary
|
||||
|
||||
<!-- Required. 1–3 bullets describing WHAT changed and WHY. Link related issues. -->
|
||||
|
||||
-
|
||||
-
|
||||
|
||||
Closes #
|
||||
|
||||
## Scope
|
||||
|
||||
<!-- Required. Tick what this change is. Anything else is out of scope while JSONPrism is in maintenance mode. -->
|
||||
|
||||
- [ ] Bug fix, broken UI/UX or accessibility fix
|
||||
- [ ] Translation or wording fix
|
||||
- [ ] Add or remove a converter, agreed in issue #
|
||||
- [ ] Dependency update, security fix, or major language/runtime/framework upgrade
|
||||
- [ ] Cloudflare / Worker change, or a fix for a website incident
|
||||
- [ ] Docs or tests only
|
||||
|
||||
## Test plan
|
||||
|
||||
<!--
|
||||
Required. These are the checks CI runs; tick what you ran locally.
|
||||
CI (on Gitea) must pass before the change can be merged.
|
||||
-->
|
||||
|
||||
- [ ] `npm run format:check`
|
||||
- [ ] `npm run lint`
|
||||
- [ ] `npm run knip`
|
||||
- [ ] `npm run typecheck`
|
||||
- [ ] `npm test`
|
||||
- [ ] `npm run build`
|
||||
- [ ] `npm run cf:check`
|
||||
- [ ] Rust changed: `cargo fmt --check` and `cargo clippy --all-targets --locked -- -D warnings` in `src-tauri/`
|
||||
- [ ] Manual smoke (describe what you clicked / loaded, and on which platform: Web / Windows / Linux / Android)
|
||||
- [ ] UI changed: keyboard-only pass of what changed (visible focus, nothing stuck), accessible names in all four locales, `motion-safe:` animations, no colour-only meaning — see [ACCESSIBILITY.md](https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/ACCESSIBILITY.md#contributor-expectations). Screen reader used, if any:
|
||||
|
||||
## Screenshots / recordings (UI changes only)
|
||||
|
||||
<!-- Drop images or short clips here. Required for any visual change. -->
|
||||
|
||||
## AI-assistance disclosure
|
||||
|
||||
<!--
|
||||
JSONPrism's maintainer uses AI co-authoring openly. If an AI tool helped
|
||||
with this change (code, tests, docs or translations), say which tool and how
|
||||
you used it, so reviewers can calibrate. Either way, you are responsible
|
||||
for every line you submit.
|
||||
-->
|
||||
|
||||
- [ ] No AI assistance.
|
||||
- [ ] AI-assisted. Tool(s) and how they were used:
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] My changes follow the conventions in [CLAUDE.md](https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/CLAUDE.md) and [CONTRIBUTING.md](https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/CONTRIBUTING.md).
|
||||
- [ ] I added or updated tests where relevant.
|
||||
- [ ] New or changed UI strings are in all four locales (`en`, `vi`, `ja`, `zh-CN`) and the i18n parity test passes.
|
||||
- [ ] App code uses no ES2025 runtime APIs (Iterator helpers, `Set` methods, `Promise.try`, …).
|
||||
- [ ] I updated the docs and `CHANGELOG.md` (under `[Unreleased]`) for user-visible changes.
|
||||
- [ ] I did not include unrelated drive-by changes.
|
||||
@@ -0,0 +1,10 @@
|
||||
# gitleaks exceptions (security.yml → the ops repo's security.yml, `secrets`
|
||||
# job, full history). One fingerprint per line: <commit>:<path>:<rule>:<line>.
|
||||
# Describe each finding in words, never quote it (a quote is a new finding).
|
||||
# Editing a flagged line later makes a new finding, with its own entry.
|
||||
|
||||
# The Cloudflare Web Analytics beacon token: public by design, the site embeds
|
||||
# it in every page that loads the beacon (src/lib/analytics.ts, also named in
|
||||
# docs/DEPLOYMENT.md). It identifies the site to the analytics, it grants
|
||||
# nothing.
|
||||
532b5cfd820927fa5abf8c2da14bc034e0e9c711:src/lib/analytics.ts:generic-api-key:15
|
||||
@@ -0,0 +1,324 @@
|
||||
# Accessibility
|
||||
|
||||
**Last reviewed**: 2026-11-09 · **Applies to**: JSONPrism 2.2.x and 2.3.x (website, desktop and Android apps)
|
||||
|
||||
JSONPrism should work for everyone who needs to convert JSON, whatever
|
||||
input device, screen reader, display setting or language they use. This
|
||||
statement covers our goals, what works today, how it was tested, what is
|
||||
known not to work yet, and how to report a barrier.
|
||||
|
||||
JSONPrism is a one-person project (see [DISCLAIMER.md](DISCLAIMER.md)).
|
||||
This page describes honest best effort, not a certified result.
|
||||
|
||||
## Goals
|
||||
|
||||
- **Target: [WCAG 2.2](https://www.w3.org/TR/WCAG22/) level AA.** The
|
||||
website and the apps share one interface, so the target covers all of
|
||||
them. It is a goal, not a claim of conformance: there has been no formal
|
||||
audit.
|
||||
- **Priorities, in order:**
|
||||
1. Every task works with the keyboard alone: converting, opening and
|
||||
saving files, batch conversion, options and the consent screen.
|
||||
2. Every control has a name, role and state that screen readers
|
||||
announce, in the interface language.
|
||||
3. Content stays readable with high contrast, zoom, light or dark
|
||||
themes, reduced motion and Windows contrast themes.
|
||||
- **Accessibility regressions are bugs.** They are triaged and fixed like
|
||||
any other bug (see [Reporting accessibility
|
||||
issues](#reporting-accessibility-issues)).
|
||||
|
||||
## What works today
|
||||
|
||||
### Keyboard
|
||||
|
||||
- Every interactive element is a native button, link or form control, or
|
||||
a Radix UI component with built-in keyboard support. No element has a
|
||||
positive `tabindex`.
|
||||
- **Skip to content** is the first tab stop. After you move to another
|
||||
page, focus moves to that page's content.
|
||||
- Every focused control shows a visible focus indicator.
|
||||
- **Dialogs and sheets** (Options, Batch, format picker):
|
||||
- focus stays inside them while they are open;
|
||||
- Escape closes them;
|
||||
- focus then returns to the button that opened them.
|
||||
- **The consent screen** keeps focus inside and must be answered; after
|
||||
you accept, focus moves to the page content.
|
||||
- **The input editor:** Tab indents. To leave it, press **Escape, then
|
||||
Tab** (WCAG 2.1.2). The editor's screen-reader description and the
|
||||
status bar both say so.
|
||||
- The read-only output and the other scroll areas take focus and scroll
|
||||
with the arrow and Page keys.
|
||||
- **Drop zones have keyboard equivalents:** **Open** in the input panel,
|
||||
**click to browse** in Batch.
|
||||
|
||||
### Screen readers
|
||||
|
||||
- **Page structure:**
|
||||
- landmarks (banner, navigation, main, content info);
|
||||
- one `h1` per page;
|
||||
- a translated page title on every route.
|
||||
- `<html lang>` follows the interface language. Each language name in the
|
||||
switcher has its own `lang`.
|
||||
- **The editors:**
|
||||
- Both have names, such as "Input JSON" and "CSV output (read-only)".
|
||||
- The input editor reports whether its content parses (`aria-invalid`).
|
||||
- The input editor is described by the current error message
|
||||
(`aria-describedby`).
|
||||
- **Live regions announce:**
|
||||
- parse errors with line and column, and conversion failures (as alerts);
|
||||
- the conversion state, but not the byte counts or timing;
|
||||
- batch progress and the human check;
|
||||
- the offline notice and page loading;
|
||||
- notifications.
|
||||
- **States and shortcuts:**
|
||||
- Toggle buttons expose `aria-pressed`.
|
||||
- Theme choices are radio buttons, and on/off settings are switches.
|
||||
- The download and options shortcuts are exposed with `aria-keyshortcuts`.
|
||||
- Decorative icons are hidden from assistive technology, and icon-only
|
||||
buttons have names.
|
||||
- The editor's own announcements (search, replace, folding) and its
|
||||
search and error panels are translated into all four interface
|
||||
languages.
|
||||
|
||||
### Visual
|
||||
|
||||
- **Themes:** light, dark and system.
|
||||
- Text colours were checked against 4.5:1 on their backgrounds in both
|
||||
themes.
|
||||
- The focus indicator uses the theme's ring colour, at 3:1 or more.
|
||||
- **Reduced motion:** with `prefers-reduced-motion`, animations and
|
||||
transitions are switched off, and Back to top jumps instead of scrolling.
|
||||
- **Windows contrast themes** (`forced-colors`): focus, selected toggles and
|
||||
switches are drawn in system colours.
|
||||
- **No meaning from colour alone:**
|
||||
- the status dot comes with a text state;
|
||||
- batch rows have icons and text;
|
||||
- the new-output dot on the narrow layout's Output tab also says "(new)".
|
||||
- **Touch targets** meet WCAG 2.5.8: at least 24 × 24 CSS px, or spaced
|
||||
so that a 24 px circle around each one doesn't overlap its neighbours.
|
||||
|
||||
### Zoom and reflow
|
||||
|
||||
- **Website:** browser zoom and text resizing work, and pinch-zoom is
|
||||
never blocked.
|
||||
- **Desktop apps:** from 2.2.0, Ctrl/⌘ + = and Ctrl/⌘ + − zoom the window.
|
||||
On Windows, Ctrl + mouse wheel also works.
|
||||
- **Narrow screens:** the layout reflows to 320 CSS px wide without
|
||||
horizontal scrolling. It is designed for 360 × 640 and up
|
||||
([tested viewports](docs/tested-viewports.md)).
|
||||
|
||||
### Language
|
||||
|
||||
The interface, including all screen-reader text, is available in English,
|
||||
Tiếng Việt, 日本語 and 简体中文.
|
||||
|
||||
## Keyboard reference
|
||||
|
||||
| Keys | Where | Does |
|
||||
| --- | --- | --- |
|
||||
| Tab / Shift+Tab | Everywhere | Next / previous control |
|
||||
| Enter on **Skip to content** | First Tab on a page | Jump to the page content |
|
||||
| Ctrl+S (⌘S on macOS) | Converter | Download the output |
|
||||
| Ctrl+, (⌘, on macOS) | Converter | Open Options |
|
||||
| Escape | Dialog, sheet, Appearance menu | Close, and return focus to its button |
|
||||
| ↑ ↓ Home End | Appearance menu | Move between items |
|
||||
| ← → | Input / Output tabs (narrow screens) | Switch tab |
|
||||
| Escape, then Tab | Input editor | Leave the editor (Tab alone indents) |
|
||||
| Ctrl+M (Shift+Alt+M on macOS) | Input editor | Toggle "Tab moves focus" |
|
||||
| Ctrl+] / Ctrl+[ (⌘] / ⌘[) | Input editor | Indent / outdent |
|
||||
| Ctrl+F (⌘F), then F3 / Shift+F3 | Either editor | Search, next / previous match |
|
||||
| Ctrl+Alt+G (⌘⌥G) | Either editor | Go to line |
|
||||
| Ctrl+Shift+M (⌘⇧M), F8 | Input editor | Open the error list, next error |
|
||||
| Alt+T | Anywhere | Focus notifications (pauses them) |
|
||||
| Ctrl/⌘ + = and − | Desktop apps | Zoom in / out |
|
||||
|
||||
## How we test
|
||||
|
||||
### Tested with
|
||||
|
||||
| Date | Version | Platform | Method | Result |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 2026-11 | 2.1.1 | Windows 11: website in Edge, Brave and Firefox; Windows app (WebView2) | Narrator; keyboard only, no mouse (maintainer) | No blocking issues |
|
||||
| 2026-11-09 | 2.2.0 | Chromium (development build) | Keyboard walk-through of the 2.2.0 changes: skip link, focus after navigation and consent, focus indicators | Pass |
|
||||
| 2026-11-09 | 2.2.0 | iPhone 14 Pro (real device), iOS 26: production website in Brave and Chrome | Manual touch check (maintainer) | Works as expected |
|
||||
| Every change | — | jsdom in CI | [axe-core](https://github.com/dequelabs/axe-core) on every page, the consent screen and each sheet; role and name assertions with Testing Library | Must pass |
|
||||
| 2026-10-22 | 2.0.0 | Chromium device emulation, 360 × 740 to 1280 × 800, light and dark | Visual layout check | See [tested viewports](docs/tested-viewports.md) |
|
||||
|
||||
The automated scan runs without a real layout engine, so it can't
|
||||
measure colour contrast; contrast is checked by hand.
|
||||
|
||||
**Not tested yet** (reports are very welcome):
|
||||
|
||||
- **Screen readers:** NVDA and JAWS (Windows), VoiceOver (macOS, iOS),
|
||||
TalkBack (Android), Orca (Linux).
|
||||
- **Voice control:** Dragon, Voice Access.
|
||||
- **On real devices:** Windows contrast themes, and Android system font
|
||||
size.
|
||||
|
||||
### Manual check before a release
|
||||
|
||||
1. **Keyboard only.** Work through every main flow:
|
||||
- convert, open a file, download;
|
||||
- run a batch to a `.zip`;
|
||||
- change options, theme and language;
|
||||
- pass the consent screen.
|
||||
|
||||
Check that focus is always visible and never stuck.
|
||||
2. **Screen reader.** Use Narrator, NVDA or VoiceOver for the same flows.
|
||||
Listen for names, states, errors and the conversion state.
|
||||
3. **Zoom.** Check at 200 % and at 400 % in a 1280 px wide window, plus
|
||||
text-only zoom where the browser offers it.
|
||||
4. **Display settings.** Check with a Windows contrast theme, with reduced
|
||||
motion, and in light and dark themes.
|
||||
5. **Automated scan.** Run `npm test`, which includes the axe-core scan.
|
||||
|
||||
## Supported environments
|
||||
|
||||
| Surface | Engine | Assistive technology checked |
|
||||
| --- | --- | --- |
|
||||
| Website | Current Chrome, Edge, Brave, Firefox and Safari (engine floor: Chromium 111, WebKit of macOS 12) | Narrator with Edge, Brave and Firefox |
|
||||
| Windows app | Microsoft Edge WebView2 | Narrator |
|
||||
| macOS app (12+, builds up to 2.2.1) | WKWebView | — |
|
||||
| Linux app (Ubuntu 22.04+) | WebKitGTK | — |
|
||||
| Android app (12+) | Android System WebView, Chromium 111+ | — |
|
||||
|
||||
## Known limitations
|
||||
|
||||
These are the barriers we know about, with workarounds where one exists.
|
||||
They are tracked in [`docs/ROADMAP.md`](docs/ROADMAP.md).
|
||||
|
||||
1. **Long output in a screen reader's browse mode.** The editor keeps only
|
||||
the visible lines in the page, so a virtual cursor can't read a long
|
||||
result to the end. *Workaround:* **Copy** or **Download** the output and
|
||||
read it in another app.
|
||||
2. **Tab indents in the input editor.** *Workaround:* press Escape, then
|
||||
Tab; or press Ctrl+M (Shift+Alt+M on macOS) to make Tab move focus.
|
||||
3. **Small or short windows.**
|
||||
- Below about 600 CSS px of height, the editors get very short. This
|
||||
includes 400 % zoom in a 1280 px window.
|
||||
- On phones, only portrait orientation is fully supported.
|
||||
- Crossing 768 CSS px of width, for example by zooming, switches between
|
||||
the side-by-side and tabbed layouts. The editors are recreated: your
|
||||
text is kept, but focus and undo history are not.
|
||||
|
||||
*Workaround:* zoom to 200–300 % instead.
|
||||
4. **Human check (website only).** Cloudflare Turnstile runs in a
|
||||
Cloudflare frame, so its accessibility is Cloudflare's. If it fails or
|
||||
takes longer than 20 seconds, **Continue without the check** appears.
|
||||
5. **Notifications close after 4 seconds.** Screen readers announce them
|
||||
when they appear. *Workaround:* hover them, or press Alt+T to focus and
|
||||
pause them.
|
||||
6. **Low non-text contrast.** Text-field and switch outlines are below
|
||||
3:1 (WCAG 1.4.11). Every field is labelled, but the field boundary is
|
||||
faint.
|
||||
7. **Unavailable formats.** The reason a format is unavailable is in its
|
||||
tooltip. Screen readers get it as the button's description, but touch
|
||||
users can't see it.
|
||||
8. **New tabs aren't announced.** Links that open in a new tab, or in the
|
||||
system browser from the apps, don't say so.
|
||||
9. **Desktop apps.** The smallest window is 800 × 560. Page zoom arrived
|
||||
in 2.2.0.
|
||||
10. **Android app.** It uses the WebView's default handling of system font
|
||||
size and pinch-zoom, which hasn't been verified on a real device.
|
||||
11. **Translations.** The Japanese and Chinese texts, including the
|
||||
screen-reader texts, are AI-generated; native speakers' fixes are
|
||||
welcome.
|
||||
|
||||
## Contributor expectations
|
||||
|
||||
Contributors check these for every change to the interface (see also
|
||||
[CONTRIBUTING.md](CONTRIBUTING.md)):
|
||||
|
||||
- **Elements.** Use native elements or the components in
|
||||
`src/components/ui/`. Don't put click handlers on `div` or `span`, and
|
||||
don't use a positive `tabindex`.
|
||||
- **Names.** Every control has an accessible name from the locale files,
|
||||
in all four languages. Icon-only buttons get `aria-label`, and
|
||||
decorative icons get `aria-hidden`.
|
||||
- **Focus.**
|
||||
- Don't use `outline-none` without a `focus-visible:` replacement.
|
||||
- A scroll area that takes focus gets `role="region"` and a label.
|
||||
- The only exception is an element focused from code with
|
||||
`tabIndex={-1}`, such as `<main>`.
|
||||
- **Motion and colour.** Animations go behind `motion-safe:`. Don't show
|
||||
meaning with colour alone.
|
||||
- **Announcements.** Use the existing live regions, and keep
|
||||
announcements short. Don't announce text that changes on every
|
||||
keystroke.
|
||||
- **Testing.**
|
||||
- `npm test` must pass, including the axe-core scan in
|
||||
`src/app/__tests__/a11y.test.tsx`. Extend the scan for new pages and
|
||||
dialogs.
|
||||
- Do a keyboard-only pass of what you changed and say so in the pull
|
||||
request.
|
||||
- A screen-reader spot check is welcome too.
|
||||
- **This file.** Update it when behaviour or a known limitation changes.
|
||||
|
||||
## Reporting accessibility issues
|
||||
|
||||
Open an issue on the GitLab mirror with the
|
||||
**[Accessibility](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Accessibility)** template. Include:
|
||||
|
||||
- what you were trying to do and what happened instead;
|
||||
- your assistive technology and its version;
|
||||
- the browser or app version, and your operating system.
|
||||
|
||||
You don't need to know the cause.
|
||||
|
||||
If you can't or would rather not use GitLab, email
|
||||
**code@poli0981.dev** with "Accessibility" in the subject. Security
|
||||
problems go through [SECURITY.md](SECURITY.md) instead.
|
||||
|
||||
### Severity
|
||||
|
||||
| Severity | Meaning | Example |
|
||||
| --- | --- | --- |
|
||||
| Critical | Blocks a core task, with no workaround | You can't convert, open, save or get past the consent screen with your keyboard or screen reader |
|
||||
| High | Major difficulty, but a workaround exists | An error is never announced, but it shows in the output panel |
|
||||
| Medium | Inconsistent or confusing, but the task is possible | A wrong or missing label; focus lands in an odd place |
|
||||
| Low | Minor annoyance | Verbose announcements; an untranslated hint |
|
||||
|
||||
### How we respond
|
||||
|
||||
- We thank you and ask questions if something is unclear. We never ask
|
||||
you to justify why you need an accessibility feature.
|
||||
- We add the `accessibility` label, set a severity, and triage blockers
|
||||
before cosmetic issues.
|
||||
- We share a workaround as soon as we know one.
|
||||
- When a fix is ready, we ask you to confirm it, if you are willing. Fixes
|
||||
are listed in [CHANGELOG.md](CHANGELOG.md).
|
||||
|
||||
### Response times
|
||||
|
||||
This is best effort from a one-person project:
|
||||
|
||||
| Severity | First response | Fix released |
|
||||
| --- | --- | --- |
|
||||
| Critical | within 7 days | next patch release |
|
||||
| High | within 14 days | next release |
|
||||
| Medium / Low | within 30 days | when practical, usually the next minor release |
|
||||
|
||||
## Ownership and maintenance
|
||||
|
||||
Kokone ([poli0981](https://git.poli0981.dev/poli0981)), the sole maintainer
|
||||
(see [MAINTAINERS.md](MAINTAINERS.md)), owns accessibility. That covers:
|
||||
|
||||
- triaging reports;
|
||||
- tracking them with the `accessibility` label;
|
||||
- running the [manual check](#manual-check-before-a-release) before
|
||||
releases;
|
||||
- keeping this statement current, including its review date.
|
||||
|
||||
## Feedback
|
||||
|
||||
Suggestions for this statement are welcome as an issue or a merge request
|
||||
on the GitLab mirror.
|
||||
|
||||
A [Vietnamese translation](docs/i18n/vi/ACCESSIBILITY.md) is available. If
|
||||
the two differ, this English version prevails.
|
||||
|
||||
This statement follows the structure recommended by the Open Source Guides
|
||||
([Accessibility best practices for your
|
||||
project](https://opensource.guide/accessibility-best-practices-for-your-project/))
|
||||
and the [Open Source Accessibility
|
||||
toolkit](https://github.com/open-source-accessibility/accessibility-toolkit).
|
||||
+186
-1
@@ -6,7 +6,192 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
No unreleased changes at this time. Future work tracked in `docs/ROADMAP.md` under "Beyond".
|
||||
No unreleased changes. JSONPrism is in maintenance mode: [CONTRIBUTING.md → Maintenance mode](CONTRIBUTING.md#maintenance-mode) lists what still changes.
|
||||
|
||||
## [2.3.0] — 2026-11-27
|
||||
|
||||
JSONPrism moved off GitHub, whose account is gone, to its own forge. Conversions work exactly as before, the website collects nothing new, and you are not asked to accept the terms again. `bundle.android.versionCode` 20300.
|
||||
|
||||
### Where things are now
|
||||
|
||||
- **Source:** [git.poli0981.dev/poli0981/jsonPrism](https://git.poli0981.dev/poli0981/jsonPrism) (Gitea, canonical). Sign-up there is closed.
|
||||
- **Issues and merge requests:** the public mirror at [gitlab.com/poli0981/jsonPrism](https://gitlab.com/poli0981/jsonPrism), with Bug, Accessibility, Converter request and Translation templates. Patches by e-mail to code@poli0981.dev work too.
|
||||
- **Security reports:** by e-mail to security@poli0981.dev only (GitHub's private advisories are gone). `security.txt` lists only that address now.
|
||||
- **Downloads:** `https://releases.poli0981.dev/jsonprism/<version>/`, linked file by file from the [Gitea release notes](https://git.poli0981.dev/poli0981/jsonPrism/releases), with `SHA256SUMS.txt`. The newest APK is always at `releases.poli0981.dev/jsonprism/jsonprism-latest.apk`.
|
||||
- **Old links:** github.com/poli0981/jsonPrism, its releases and the `poli0981.github.io/jsonPrism` redirect no longer work. Installed apps keep working; they have no updater, so download 2.3.0 by hand.
|
||||
|
||||
### Changed
|
||||
|
||||
- **No macOS build any more.** There is no macOS build machine since the move; 2.2.1 was the last `.dmg`. The web app runs on a Mac in any browser, and `npm run tauri:build` still builds the app on a Mac.
|
||||
- **No build-provenance attestations.** They needed GitHub Actions; verify downloads against `SHA256SUMS.txt`.
|
||||
- **In the app:** the header's repository button is now "Source code" (a branch icon instead of GitHub's logo); About → "Report a bug" opens the GitLab mirror, "Releases & downloads" the Gitea releases page; legal documents open on Gitea at the build's commit; the footer links the maintainer's Gitea profile. The Discussions and GitHub Sponsors links are gone, with GitHub. Locale text names the new hosts (en, vi, ja, zh-CN).
|
||||
- **Docs:** README (+vi), CONTRIBUTING, SECURITY, MAINTAINERS, DISCLAIMER, ACCESSIBILITY (+vi), DEPLOYMENT, TAURI-NOTES and dev_env (+vi) describe the new hosts. TERMS (+vi) section 2 names GitLab's policies for the mirror instead of GitHub's, and PRIVACY (+vi) adds a row for downloads and the repository. Neither is a material change, so `CONSENT_VERSION` stays.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- **npm:** Tauri 2.12.5 (`@tauri-apps/api`) and 2.12.6 (CLI), i18next 27.2.6, react-i18next 18.0.3, react-router 8.5.2, lucide-react 1.78, react-dropzone 20.2.1, tailwind-merge 3.7.1; dev: vitest 5.1.1, wrangler 4.167, knip 6.48, axe-core 4.14.1, `@testing-library/user-event` 14.6.13, and `@testing-library/jest-dom` 8 (a new major, tests only).
|
||||
- **typescript-eslint 8.74.0** moves to minimatch 11, which closes GHSA-g3hv-75wg-m249 (moderate, dev-only), open since 2.1.1. `npm audit` reports no vulnerabilities.
|
||||
- **Rust:** tauri 2.12.7; `url` 2.5.9 (RUSTSEC-2026-0592) and `cookie` 0.18.3 (RUSTSEC-2026-0594); `cargo deny check` passes.
|
||||
- Every update is at least three days old (Renovate's release age); 202 packages have verified registry attestations. `THIRD-PARTY.md` matches both lockfiles.
|
||||
|
||||
### Project
|
||||
|
||||
- **CI on Gitea Actions** (`.gitea/workflows/`). The web app deploys from the CI `deploy` job (`wrangler deploy`) on every push to `main`, followed by the production smoke; Cloudflare Workers Builds, which pulled from GitHub, is no longer used.
|
||||
- **Release workflow** builds Windows (MSI, NSIS) on the maintainer's machine, Linux (AppImage, deb, rpm) and the signed universal APK (signature checked with `apksigner`), uploads them to Cloudflare R2 and opens a draft Gitea release with the links.
|
||||
- **Security workflow:** actionlint, shellcheck and zizmor on the workflows; gitleaks, Opengrep, osv-scanner and cargo-deny through the shared ops workflow, weekly as well. New `src-tauri/deny.toml` and `src-tauri/osv-scanner.toml` (six Tauri-stack advisories nobody fixes yet, each with a reason and an expiry date).
|
||||
- **Qodana** runs through the shared ops workflow (the Qodana CLI); the Rust analysis in Docker Desktop on the runner.
|
||||
- **Renovate replaces Dependabot** (`renovate.json`, extending the shared preset): majors wait on the Dependency Dashboard, Tauri's npm packages and crates move in one PR, the TypeScript aliases and runtimes are bumped by hand. Kotlin's CVE-2026-53914 fix (moderate, build cache only) waits for Tauri's Android template, as documented there.
|
||||
- **Removed with GitHub:** SonarQube Cloud, CodeQL, the maintenance triage auto-close workflow (out-of-scope items are closed by hand on the mirror), the Discussions announcement and the GitHub Pages redirect.
|
||||
|
||||
## [2.2.1] — 2026-11-16
|
||||
|
||||
A maintenance release, and the start of **maintenance mode**. JSONPrism is feature-complete. From now on it gets dependency and security updates, major runtime upgrades, bug, UI/UX, accessibility and translation fixes, converter additions or removals that people really need, and Cloudflare or website fixes, but no new features. Conversions work exactly as before, nothing new is collected, and you are not asked to accept the terms again. `bundle.android.versionCode` 20201.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- **npm (app):** i18next 27.1.3 and react-i18next 18.0.2 are new majors; their changed defaults don't apply here (`fallbackLng` is set, no translation is empty, no `Trans`, SSR or mocks). Also lucide-react 1.73, zustand 5.1, react-dropzone 20.2, papaparse 5.7.1, fast-xml-parser 5.12.1, `@codemirror/lint` 6.9.8 and `@tauri-apps/plugin-opener` 2.7.3.
|
||||
- **npm (dev):**
|
||||
- ESLint 10.15, typescript-eslint 8.72.2, eslint-plugin-react-refresh 0.5.8;
|
||||
- Vite 8.3.8, `@vitejs/plugin-react` 6.3, Tailwind CSS and `@tailwindcss/vite` 4.3.5;
|
||||
- Prettier 3.10.1, knip 6.45.1, wrangler 4.162;
|
||||
- jsdom 31.0.1 (a new major, tests only), `@testing-library/user-event` 14.6.12.
|
||||
- **Rust:** `cargo update` within semver: wry 0.57.2, tauri-plugin-opener 2.7.3 and 43 other crates.
|
||||
- **GitHub Actions:** SonarSource/sonarqube-scan-action 8.5.0, actions/setup-java 6.3.0.
|
||||
- `fast-xml-builder` 1.3.2 is now a direct dependency (see Fixed).
|
||||
- All 414 packages have verified registry signatures, and `THIRD-PARTY.md` matches both lockfiles again.
|
||||
- Supersedes Dependabot PRs #183–#191.
|
||||
|
||||
### Fixed
|
||||
|
||||
Findings from the first Qodana run. None of them is visible in the app.
|
||||
|
||||
- **XML builder:** the XML converter now uses `fast-xml-builder` directly. fast-xml-parser 5 deprecated its own `XMLBuilder` export, which only re-exported that package, so the output is identical.
|
||||
- **React types:** imported from `react` instead of read from the global `React` namespace.
|
||||
- **Tests:**
|
||||
- synchronous `act()` calls no longer return a promise nobody awaits;
|
||||
- the jsdom Range geometry stub is shared, and restored correctly after each file.
|
||||
- **Small cleanups:** two redundant regular-expression constructs and a redundant boolean comparison.
|
||||
|
||||
### Project
|
||||
|
||||
- **Maintenance mode:**
|
||||
- a status badge and section in both READMEs;
|
||||
- the policy in [CONTRIBUTING.md](CONTRIBUTING.md#maintenance-mode);
|
||||
- converter and translation issue templates instead of the feature request template;
|
||||
- a scope checklist in the pull request template.
|
||||
- **Auto-close:** `maintenance-triage.yml` closes out-of-scope feature requests with a bilingual comment.
|
||||
- **Qodana:** Qodana for JS (native mode) and Qodana for Rust (Early Access) run on every push and pull request and report to Qodana Cloud.
|
||||
- **Cleanup:** merged and stale branches and old worktrees were removed.
|
||||
|
||||
### Security
|
||||
|
||||
- No known vulnerability affects the app or the website.
|
||||
- i18next 27.1.3 includes the fix for GHSA-q76c-gcvw-89x9. That issue needs a backend connector, which JSONPrism doesn't use.
|
||||
- `npm audit` still lists minimatch < 11.0.1 (GHSA-g3hv-75wg-m249, moderate) through typescript-eslint, a development tool:
|
||||
- ESLint 10.15 itself has moved to minimatch 11;
|
||||
- `@typescript-eslint/typescript-estree` still requires minimatch 10, but only for typed-linting globs, which this project's ESLint config doesn't use.
|
||||
|
||||
## [2.2.0] — 2026-11-09
|
||||
|
||||
An accessibility release. JSONPrism now has an accessibility statement, [`ACCESSIBILITY.md`](ACCESSIBILITY.md), which targets WCAG 2.2 AA. The maintainer's keyboard-only and Narrator pass on 2.1.1 found no blocking issues; this release fixes the gaps an audit found beyond that pass. `bundle.android.versionCode` 20200.
|
||||
|
||||
### Added
|
||||
|
||||
- **Skip to content.** The first Tab stop on every page jumps past the header to the page content.
|
||||
- **Focus follows you.**
|
||||
- After you move to another page, focus moves to its content.
|
||||
- After you accept the consent screen, focus moves to the page instead of being lost.
|
||||
- **Back to top** returns focus to the page it scrolled.
|
||||
- **Zoom in the desktop apps.** Ctrl/⌘ + = and Ctrl/⌘ + − zoom the window; on Windows, Ctrl + mouse wheel works too. This adds the `core:webview:allow-set-webview-zoom` permission, which macOS and Linux need for zooming.
|
||||
- **How to leave the input editor.** Tab still indents. Screen readers now hear "press Escape, then Tab, to leave the editor", and the status bar shows the same hint on wide screens.
|
||||
- **Screen-reader states for the input editor:**
|
||||
- The input editor reports invalid input (`aria-invalid`).
|
||||
- It is described by the current error message.
|
||||
- **Download** and **Options** announce their keyboard shortcuts (`aria-keyshortcuts`).
|
||||
- **Accessibility statement.** [`ACCESSIBILITY.md`](ACCESSIBILITY.md) and its [Vietnamese translation](docs/i18n/vi/ACCESSIBILITY.md) cover:
|
||||
- goals;
|
||||
- what works;
|
||||
- a keyboard reference;
|
||||
- what has been tested;
|
||||
- known limitations with workarounds;
|
||||
- how to report a barrier, with severity levels and response times.
|
||||
|
||||
The About page links the statement, and there is a new **Accessibility issue** template.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Focus is always visible.**
|
||||
- Controls without their own ring now get a themed outline.
|
||||
- Scroll areas, the editors, the narrow-screen tab panels and the theme choices now show a ring.
|
||||
- Windows contrast themes keep focus, pressed and selected states, and switches visible.
|
||||
- **The status bar is quieter for screen readers.** Only the conversion state is announced, not the byte counts and timing that change on every keystroke.
|
||||
- **Accessible names match what you see** (WCAG 2.5.3):
|
||||
- The language buttons are named "EN English", "JA 日本語" and so on.
|
||||
- **Copy** is named **Copied** while it says so.
|
||||
- **The unread-output dot** on the narrow layout's Output tab is also announced, as "(new)".
|
||||
- **Navigation labels** in Vietnamese, Japanese and Chinese no longer repeat the word "navigation".
|
||||
- **Translations.** These now follow the interface language:
|
||||
- the Home page title;
|
||||
- the notification close button;
|
||||
- CodeMirror's screen-reader announcements for search, replace, folding and deleted selections.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The Appearance button** no longer claims to open a menu (`aria-haspopup`). It is a disclosure for a panel.
|
||||
- **The About page and the batch queue.** Their scroll areas are labelled regions, so the label is valid ARIA.
|
||||
- **The format picker sheet** on phones has a description, which also removes Radix's console warning.
|
||||
- **Page loading** is announced (`role="status"`), and the output panel's loading spinner is exposed as an image with a label.
|
||||
|
||||
### Tests
|
||||
|
||||
- **axe-core scan.** It covers every page, the input in an error state, the consent screen, and the Options, Batch and format-picker sheets. A guard test checks that the scan really reports violations.
|
||||
- **Focus tests.** They cover the skip link, focus after navigation and after consent, and Back to top.
|
||||
- **Unit tests** for the new attributes and labels.
|
||||
|
||||
### Docs
|
||||
|
||||
- **Accessibility guidance** for contributors:
|
||||
- CONTRIBUTING, CLAUDE.md and the PR template have accessibility checks.
|
||||
- The bug report template asks about assistive technology.
|
||||
- [`docs/tested-viewports.md`](docs/tested-viewports.md) links the accessibility checks to run before a release.
|
||||
- **The Vietnamese mirrors**, `docs/i18n/vi/PRIVACY.md` and `docs/i18n/vi/dev_env.md`, now describe the site-wide rate limits added in 2.0.2.
|
||||
- **Other fixes:**
|
||||
- The README credits match DISCLAIMER and THIRD-PARTY.
|
||||
- Outdated ROADMAP notes are corrected.
|
||||
- Version examples now use 2.2.0.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- `axe-core` 4.14.0 (MPL-2.0), test-only; nothing new ships to users.
|
||||
|
||||
## [2.1.1] — 2026-11-04
|
||||
|
||||
A maintenance release: every dependency at its latest version, no feature or behavior change. It supersedes Dependabot PRs #163–#169. `bundle.android.versionCode` 20101.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- **npm** (all minor/patch): react-router 8.5.1, i18next 26.7.1, react-i18next 17.1.12, i18next-browser-languagedetector 8.3.0, lucide-react 1.67.0, fast-xml-parser 5.12.0, cbor-x 1.6.9, `@tauri-apps/plugin-dialog` 2.8.4; dev: ESLint 10.14, typescript-eslint 8.72.1, globals 17.14, Vitest and `@vitest/coverage-v8` 5.1, `@vitejs/plugin-react` 6.2.1, Tailwind CSS and `@tailwindcss/vite` 4.3.4, knip 6.44.1, wrangler 4.157, `@types/node` 26.6.6. Transitive packages refreshed within their ranges; the lockfile is smaller because Vite and Tailwind now share one `lightningcss`. All 426 packages have verified registry signatures.
|
||||
- **Rust**: `cargo update` within semver — tauri-plugin-dialog 2.8.4 (rfd 0.17), tauri-plugin-single-instance 2.5.5, wry 0.57.1, tao 0.37.2 and 26 others.
|
||||
- **GitHub Actions**: SonarSource/sonarqube-scan-action 8.4.1 (scanner CLI 8.3.1). Every other action was already at its latest release.
|
||||
- knip 6.44 detects `@testing-library/user-event` on its own, so it left `ignoreDependencies`.
|
||||
- `THIRD-PARTY.md` lists the versions locked for 2.1.1 again; some rows had not been updated since 2.0.0.
|
||||
|
||||
### Security
|
||||
|
||||
- `npm audit` still lists minimatch < 11.0.1 (GHSA-g3hv-75wg-m249, moderate) through ESLint and typescript-eslint, which require minimatch 10 and have no release on 11 yet. It is a development-only dependency, and the amplification only runs at `optimizationLevel` 2 or higher; ESLint and typescript-eslint use the default level 1 with the glob patterns from this repository's own config. Forcing the new major with an override was rejected: minimatch 11 changes `partial` matching, which ESLint uses to decide which directories to walk.
|
||||
|
||||
## [2.1.0] — 2026-10-29
|
||||
|
||||
### Added
|
||||
|
||||
- **JSONC → JSON.** A new input-only format for JSON with comments, such as `tsconfig.json`, VS Code `settings.json`, `.code-workspace` and `deno.jsonc` files. Pick **JSONC** in the **→ JSON** direction, paste or drop `.jsonc` and `.json` files (batches included), and get standard JSON back: `//` and `/* */` comments and trailing commas are removed. Values are copied token by token rather than through JavaScript numbers, so integers beyond 2^53, `1.0`, `1e3`, duplicate keys and `__proto__` come out exactly as written. Output layout: 2 spaces (default), 4 spaces, tab or minified. The parser is hand-written and runs on your device; there is no new dependency.
|
||||
- **"This looks like JSONC" hint.** In the JSON → direction, when the input fails only because of comments or trailing commas, the input panel offers **Convert JSONC → JSON**, which switches the direction and format in one click.
|
||||
- The JSONC input editor highlights comments and marks errors in the gutter at the same line and column the converter reports.
|
||||
|
||||
### Changed
|
||||
|
||||
- Converting back to JSON can now report the line and column of an error. JSONC uses it, so its errors show `Ln …, Col …` like JSON input errors do.
|
||||
- The JSONC chip is disabled in the JSON → direction with an "Input only" note. Switching to JSON → while JSONC is selected moves to JSONL.
|
||||
|
||||
## [2.0.2] — 2026-10-27
|
||||
|
||||
|
||||
@@ -4,16 +4,29 @@ Guidance for Claude (and other AI assistants) working on this repository.
|
||||
|
||||
## Project context
|
||||
|
||||
**JSONPrism** converts one JSON input into 12 formats (JSONL, CSV, TSV, YAML, XML, TOML, .NET RESX, Markdown table, SQL INSERT, BSON, CBOR, MessagePack) and parses six of them (JSONL, CSV, TSV, YAML, TOML, RESX) back. Conversion always runs on the user's device. It ships as:
|
||||
**JSONPrism** converts one JSON input into 12 formats (JSONL, CSV, TSV, YAML, XML, TOML, .NET RESX, Markdown table, SQL INSERT, BSON, CBOR, MessagePack) and parses six of them (JSONL, CSV, TSV, YAML, TOML, RESX) back, plus the input-only JSONC → JSON. Conversion always runs on the user's device. It ships as:
|
||||
|
||||
- a web app at <https://jsonprism.poli0981.dev>, served by the Cloudflare Worker `jsonprism` (static assets behind a tiny Worker that rate limits requests and answers `/api/*`), deployed by Cloudflare Workers Builds on every push to `main`;
|
||||
- native apps built with Tauri 2: Windows, macOS, Linux and Android (sideload APK).
|
||||
- a web app at <https://jsonprism.poli0981.dev>, served by the Cloudflare Worker `jsonprism` (static assets behind a tiny Worker that rate limits requests and answers `/api/*`), deployed by the `deploy` job of the Gitea CI workflow (`wrangler deploy`) on every push to `main`;
|
||||
- native apps built with Tauri 2: Windows, Linux and Android (sideload APK), published to `https://releases.poli0981.dev/jsonprism/`. macOS builds stopped after 2.2.1 (no macOS runner); the code still builds there.
|
||||
|
||||
GitHub Pages (`poli0981.github.io/jsonPrism`) now only redirects to the new domain.
|
||||
The repository moved from GitHub (account gone, with its Pages redirect, Releases and Discussions) to Gitea in November 2026 — see **Forge & CI** below.
|
||||
|
||||
The maintainer is **Kokone** ([@poli0981](https://github.com/poli0981)). Audience: the developer community on the open-source Discord server plus YouTube viewers who watch indie/visual-novel gameplay and occasionally want a quick devtool.
|
||||
The maintainer is **Kokone** ([poli0981](https://git.poli0981.dev/poli0981)). Audience: the developer community on the open-source Discord server plus YouTube viewers who watch indie/visual-novel gameplay and occasionally want a quick devtool.
|
||||
|
||||
**Current release**: 2.0.2. See [`docs/ROADMAP.md`](docs/ROADMAP.md) for what is next.
|
||||
**Current release**: 2.3.0. See [`docs/ROADMAP.md`](docs/ROADMAP.md) for what is next.
|
||||
|
||||
**Status: maintenance mode** (since 2.2.1). Don't propose new features. Every change must fall under the policy in [`CONTRIBUTING.md` → Maintenance mode](CONTRIBUTING.md#maintenance-mode):
|
||||
|
||||
- dependency updates;
|
||||
- security fixes (a CVE rated high or critical, a serious runtime issue);
|
||||
- major language, runtime or framework upgrades;
|
||||
- bug, UI/UX and accessibility fixes;
|
||||
- adding or removing a converter when there is a real need;
|
||||
- translation fixes;
|
||||
- Cloudflare/Worker changes;
|
||||
- website incidents.
|
||||
|
||||
Out-of-scope issues and merge requests (on the GitLab mirror) are closed by hand with the label `out-of-scope`; the GitHub-era triage workflow is gone (Gitea takes no outside issues).
|
||||
|
||||
## Stack — exact versions matter
|
||||
|
||||
@@ -72,7 +85,7 @@ The same React UI runs in the browser and in Tauri (desktop + Android).
|
||||
|
||||
**Icons**: edit `src-tauri/icons/icon.svg` (1024×1024) and run `npm run tauri:icon`. Generated PNG/ICO/ICNS files are gitignored; CI regenerates them. Revert unintended changes it makes under `src-tauri/gen/android/`.
|
||||
|
||||
**Bundling**: `npm run tauri:build` builds for the current OS. Releases come from pushing a `vX.Y.Z` tag: `.github/workflows/release.yml` builds Windows, macOS universal, Linux and Android into one draft release with `SHA256SUMS.txt` and provenance attestations.
|
||||
**Bundling**: `npm run tauri:build` builds for the current OS. Releases come from pushing a signed `vX.Y.Z` tag to Gitea: `.gitea/workflows/release.yml` builds Windows (host runner on the maintainer's PC), Linux (`ubuntu-22.04`) and Android, uploads them with `SHA256SUMS.txt` to R2 (`releases.poli0981.dev/jsonprism/<version>/` + `jsonprism-latest.apk`) through the ops `publish-r2.yml`, and opens a draft Gitea release with links only. After publishing the draft, run `announce-release.yml` by hand with the tag (a draft made by the job token fires no workflow). No macOS job, no attestations.
|
||||
|
||||
**Velopack note**: PhantomMAC uses Velopack for `.exe` deltas; JSONPrism uses Tauri's native bundler (`.msi` + NSIS `.exe`). Don't mix the two.
|
||||
|
||||
@@ -87,6 +100,15 @@ The same React UI runs in the browser and in Tauri (desktop + Android).
|
||||
- **Tailwind class order**: rely on `prettier-plugin-tailwindcss`; never hand-sort.
|
||||
- **Don't fight the theme system**. Use the tokens (`--color-prism-*`, `--color-success`, `--color-warning`, `bg-background`, …), which have separate light and dark values. No hard-coded hex. Animations go behind `motion-safe:`.
|
||||
- **i18n everything user-facing** in all four locales: `en.json`, `vi.json`, `ja.json`, `zh-CN.json` (`src/i18n/__tests__/locales.test.ts` enforces key parity). Libraries return error *codes*; components translate them.
|
||||
- **Accessibility** (target WCAG 2.2 AA; see [`ACCESSIBILITY.md`](ACCESSIBILITY.md)). There is no `eslint-plugin-jsx-a11y` (it doesn't support ESLint 10); the axe-core scan in `src/app/__tests__/a11y.test.tsx` is the automated check, so extend it for new pages and dialogs.
|
||||
- **Elements:** native elements or the Radix-based `ui/` components only. No click handlers on `div`/`span`, no positive `tabIndex`.
|
||||
- **Names:** every control has an accessible name from i18n. Icon-only buttons get `aria-label` and decorative icons `aria-hidden`. The name starts with the visible label (WCAG 2.5.3).
|
||||
- **Focus:**
|
||||
- Never `outline-none` without a `focus-visible:ring-*` replacement; the one exception is an element focused only from code with `tabIndex={-1}`, like `<main>`.
|
||||
- A focusable scroll area needs `role="region"` and an `aria-label`.
|
||||
- Move focus with `focusMain()` (`src/lib/focus.ts`) when content is replaced.
|
||||
- **Announcements:** use the existing live regions (input error, output alert, status-bar state, batch chips, toasts). Never announce text that changes on every keystroke.
|
||||
- **Docs:** a behaviour change or new known limitation updates `ACCESSIBILITY.md` and its Vietnamese mirror.
|
||||
- **Logging**: use `createLogger(scope)` from `src/lib/logger.ts`, not `console.*` (ESLint warns). Logs stay in memory and feed About → Copy diagnostics; never log user content.
|
||||
- **Heavy work off the main thread**: conversions of large inputs and batch jobs go through `src/lib/convert-client.ts` (Web Worker); keep `convert-worker.ts` free of DOM access.
|
||||
|
||||
@@ -118,7 +140,7 @@ If you find yourself wanting another top-level folder, stop and reconsider.
|
||||
## Adding a new converter — checklist
|
||||
|
||||
1. Create `src/converters/myformat.ts` exporting `myFormatConverter`.
|
||||
2. Implement `Converter<MyFormatOptions>`, including `meta.extension` (plus `altExtensions` for aliases such as `yml`, and `binary` for byte formats). Return errors as values.
|
||||
2. Implement `Converter<MyFormatOptions>`, including `meta.extension` (plus `altExtensions` for aliases such as `yml`, `binary` for byte formats, and `inputOnly` for formats that only convert to JSON, like JSONC — their `convert()` returns an error). Return errors as values.
|
||||
3. Add the ID to the `FormatId` union in `src/converters/types.ts`.
|
||||
4. Register it in `src/converters/registry.ts` (`CONVERTERS` and `ALL_FORMATS`).
|
||||
5. Add `formats.myformat` (and any option labels) to all four locale files.
|
||||
@@ -148,7 +170,16 @@ npm run build # verify production output
|
||||
npm run preview:cf # the real Cloudflare setup on http://localhost:8787
|
||||
```
|
||||
|
||||
CI (`.github/workflows/ci.yml`) also runs `format:check`, `knip`, coverage, `cf:check`, SonarQube Cloud and `cargo fmt`/`clippy`. The maintainer typically uses **WebStorm** (JetBrains license), so Prettier and ESLint run on save.
|
||||
CI (`.gitea/workflows/ci.yml`) also runs `format:check`, `knip`, `npm audit` (advisory), `cf:check` and `cargo fmt`/`clippy`, then deploys `main` and runs the production smoke. `.gitea/workflows/security.yml` lints the workflows (actionlint, zizmor) and calls the ops scans (gitleaks, Opengrep, osv-scanner, cargo-deny). `.gitea/workflows/qodana.yml` runs Qodana for JS (native, `qodana.yaml`) and Qodana for Rust (Early Access, Docker Desktop on the host runner, `src-tauri/qodana.yaml`) through the ops `reusable-qodana.yml`, with the `QODANA_TOKEN_TS_JS` and `QODANA_TOKEN_RUST` secrets; both skip without their token. SonarQube Cloud, CodeQL and Dependabot are gone with GitHub. The maintainer typically uses **WebStorm** (JetBrains license), so Prettier and ESLint run on save.
|
||||
|
||||
## Forge & CI
|
||||
|
||||
- Canonical repo: <https://git.poli0981.dev/poli0981/jsonPrism> (Gitea, self-hosted; sign-up closed). `origin` is Gitea; the local `github` remote is the dead GitHub repo — never push to it. Public mirror for issues and merge requests: <https://gitlab.com/poli0981/jsonPrism> (push mirror from Gitea; never push there, GitLab CI is off). Links in code and docs: source → Gitea (`/src/branch/main/…`, `/src/commit/<sha>/…`), issues → GitLab, downloads → `releases.poli0981.dev/jsonprism/…`.
|
||||
- Workflows live in `.gitea/workflows/` (Gitea Actions). Bare `uses: owner/action@sha` resolves to github.com; Gitea-hosted actions need a full URL. Every action is pinned to a full SHA with a version comment; calls into the ops repo `poli0981/.github` pin the commit of an ops tag (and pass `ops_ref` to the notifiers) and are bumped by hand. Upstream `actions/upload-artifact`/`download-artifact` don't work on Gitea: use `christopherhx/gitea-*-artifact`.
|
||||
- The only runner is the maintainer's Windows PC: `windows-latest` = host mode (pwsh), `ubuntu-latest`/`ubuntu-24.04`/`ubuntu-22.04` = Docker (job containers run as root, no `sudo`). Jobs wait while the PC is off. Cron only 13:00–16:00 UTC on a slot from the ops cron registry (`security.yml`: Friday 13:19). No macOS runner, no OIDC, no code-scanning UI, no Dependabot.
|
||||
- Events caused by the job token start no workflow (a CI-made draft release published by hand doesn't announce; a CI-opened PR runs no checks).
|
||||
- Dependencies: self-hosted Renovate, `renovate.json` extends `local>poli0981/renovate-config` (3-day release age, OSV security PRs, majors via the Dependency Dashboard). Keep the repo rules there (TS aliases, Tauri JS+Rust group, generated Gradle project off).
|
||||
- The procedure and every shared decision are in the ops repo: `docs/GITEA-MIGRATION.md` and `docs/migration/jsonprism.md` in `poli0981/.github` (`E:\.github` on the maintainer's PC).
|
||||
|
||||
## Communication preferences
|
||||
|
||||
|
||||
+5
-4
@@ -10,14 +10,15 @@ In short:
|
||||
- Assume good intent, but don't tolerate bad behavior.
|
||||
- Keep discussion focused on the project.
|
||||
|
||||
The maintainer, Kokone ([@poli0981](https://github.com/poli0981)), is
|
||||
The maintainer, Kokone ([poli0981](https://git.poli0981.dev/poli0981)), is
|
||||
responsible for enforcement. Report misconduct by email to
|
||||
**[code@poli0981.dev](mailto:code@poli0981.dev)**, with links to the
|
||||
issues, comments or messages concerned if you can.
|
||||
|
||||
Content on GitHub that breaks GitHub's own rules, including anything
|
||||
posted by the maintainer, can also be reported to GitHub directly:
|
||||
see [Reporting abuse or spam](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam).
|
||||
Content on the GitLab mirror (issues, merge requests) that breaks
|
||||
GitLab's own rules, including anything posted by the maintainer, can also
|
||||
be reported to GitLab directly: see
|
||||
[Report abuse](https://docs.gitlab.com/user/report_abuse/).
|
||||
|
||||
Reports are handled confidentially. Following the Covenant's enforcement
|
||||
guidelines, possible outcomes are a private correction, a warning, a
|
||||
|
||||
+133
-30
@@ -2,6 +2,61 @@
|
||||
|
||||
Thanks for considering a contribution! JSONPrism is an open-source project under Apache License 2.0.
|
||||
|
||||
## Maintenance mode
|
||||
|
||||
Since 2.2.1 (November 2026) JSONPrism is in **maintenance mode**. It is
|
||||
feature-complete and stays maintained, but it doesn't grow new features.
|
||||
These changes are still accepted:
|
||||
|
||||
1. **Dependency updates** on a regular schedule (Renovate, self-hosted,
|
||||
grouped; majors wait for the Dependency Dashboard).
|
||||
2. **Security fixes**, as soon as possible: a dependency with a high or
|
||||
critical CVE, or a serious security issue in a runtime such as Node.js.
|
||||
3. **Major upgrades** of a language, runtime or framework, for example
|
||||
Node 24 → 26 or TypeScript 6 → 7.
|
||||
4. **Issues and merge requests** that:
|
||||
- add or remove a converter when people really need it (open a
|
||||
[converter request](#converter-requests) first);
|
||||
- fix a bug, a broken UI/UX or an accessibility barrier.
|
||||
5. **Language fixes**: wording that doesn't fit a culture or region, and
|
||||
spelling mistakes that could mislead (see [Translations](#translations)).
|
||||
6. **Cloudflare / Worker** changes when the platform changes significantly.
|
||||
7. **Website incidents** such as DDoS or bot spam.
|
||||
|
||||
Anything else is out of scope, new features in particular, unless the
|
||||
maintainer judges one genuinely necessary.
|
||||
|
||||
- The maintainer closes feature requests and `feat:` merge requests from
|
||||
outside contributors, and anything else out of scope, with the
|
||||
`out-of-scope` label.
|
||||
- Feature ideas are welcome on the
|
||||
[Discord server](https://discord.gg/2aNR3aVt), with no commitment.
|
||||
- If your issue or merge request was closed by mistake, reply to it and the
|
||||
maintainer will take another look.
|
||||
|
||||
Releases ship only when one of these changes needs one, for example a
|
||||
security fix for the desktop and Android apps. The website keeps deploying
|
||||
from `main`.
|
||||
|
||||
## Where to contribute
|
||||
|
||||
The canonical repository is on Gitea,
|
||||
[git.poli0981.dev/poli0981/jsonPrism](https://git.poli0981.dev/poli0981/jsonPrism).
|
||||
Sign-up there is closed, so outsiders can read and clone it but not open
|
||||
issues or pull requests. Instead:
|
||||
|
||||
- **Issues and merge requests** go to the public mirror,
|
||||
[gitlab.com/poli0981/jsonPrism](https://gitlab.com/poli0981/jsonPrism).
|
||||
The mirror is a copy that Gitea pushes to; GitLab CI does not run there.
|
||||
- **Patches by e-mail** work too: `git format-patch` (or `git send-email`)
|
||||
to [code@poli0981.dev](mailto:code@poli0981.dev).
|
||||
- **Security reports** go by e-mail only, never as a public issue: see
|
||||
[SECURITY.md](SECURITY.md).
|
||||
|
||||
The maintainer runs CI on Gitea and applies accepted changes there; the
|
||||
mirror then updates GitLab, and the merge request shows as merged (or is
|
||||
closed with a link to the commit when it was squashed or rebased).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
| Tool | Version | Notes |
|
||||
@@ -16,7 +71,7 @@ and "Android app" in [README.md](README.md).
|
||||
## Quick start
|
||||
|
||||
```bash
|
||||
git clone https://github.com/poli0981/jsonPrism.git
|
||||
git clone https://git.poli0981.dev/poli0981/jsonPrism.git
|
||||
cd jsonPrism
|
||||
npm ci
|
||||
npm run dev
|
||||
@@ -35,16 +90,16 @@ npm run tauri:dev # desktop window around the dev server
|
||||
npm run tauri:android:dev # Android emulator or device
|
||||
```
|
||||
|
||||
## Before opening a PR
|
||||
## Before opening a merge request
|
||||
|
||||
1. **Run the same checks as CI**. If any fails, your PR can't be merged:
|
||||
1. **Run the same checks as CI**. If any fails, your change can't be merged:
|
||||
|
||||
```bash
|
||||
npm run format:check # Prettier (fix with: npm run format)
|
||||
npm run lint # ESLint (many issues fix with: npm run lint:fix)
|
||||
npm run knip # unused files, exports and dependencies
|
||||
npm run typecheck # TypeScript 7: app, tests, config files, Worker
|
||||
npm test # Vitest (CI runs npm run test:coverage)
|
||||
npm test # Vitest
|
||||
npm run build # production web build into dist/
|
||||
npm run cf:check # Worker deploy dry run; needs dist/ from the build
|
||||
```
|
||||
@@ -54,14 +109,28 @@ npm run tauri:android:dev # Android emulator or device
|
||||
Run `npm run tauri:icon` and `npm run build` first: the Rust build
|
||||
embeds the generated icons and `dist/`.
|
||||
|
||||
On Gitea, the **Security** workflow also lints the workflows
|
||||
(actionlint, zizmor) and runs gitleaks, Opengrep, osv-scanner and
|
||||
cargo-deny, and the **Qodana** workflow (Qodana for JS and Qodana for
|
||||
Rust) reports to Qodana Cloud. The maintainer reviews their findings
|
||||
before merging.
|
||||
|
||||
2. **Match the project style.** Read [`CLAUDE.md`](CLAUDE.md) for the
|
||||
non-negotiable code conventions (converter shape, error handling, i18n
|
||||
requirements). For tool versions, `package.json` and this file are
|
||||
authoritative.
|
||||
|
||||
3. **Keep PRs focused.** One feature or one fix per PR. Refactors as separate PRs.
|
||||
3. **Keep the UI accessible.** For any UI change:
|
||||
- Do a keyboard-only pass of what you changed: focus is visible and never stuck.
|
||||
- Give every control an accessible name in all four locales.
|
||||
- Put animations behind `motion-safe:`.
|
||||
- Extend the axe-core scan in `src/app/__tests__/a11y.test.tsx` when you add a page or dialog.
|
||||
|
||||
4. **Fill in the [PR template](.github/PULL_REQUEST_TEMPLATE.md)**: what
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md#contributor-expectations) has the full list.
|
||||
|
||||
4. **Keep merge requests focused.** One fix per merge request. Refactors as separate ones.
|
||||
|
||||
5. **Fill in the [merge request template](.gitlab/merge_request_templates/Default.md)**: what
|
||||
changed, why, how you tested it, screenshots if UI, and whether AI
|
||||
tools helped.
|
||||
|
||||
@@ -78,8 +147,8 @@ compiler. Two TypeScript packages are installed side by side on purpose:
|
||||
| `typescript` | `@typescript/typescript6` | The TypeScript 6 API (binary `tsc6`) that typescript-eslint and editors load |
|
||||
|
||||
Why: TypeScript 7.0 ships no JavaScript API yet, and typescript-eslint 8
|
||||
only supports `typescript` below 6.1. Leave the alias as it is (Dependabot
|
||||
ignores it from 6.1 on). It goes away once TypeScript 7.1 ships an API
|
||||
only supports `typescript` below 6.1. Leave the alias as it is (Renovate
|
||||
keeps it below 6.1). It goes away once TypeScript 7.1 ships an API
|
||||
that typescript-eslint supports.
|
||||
|
||||
- **`npm run typecheck` is the source of truth.** CI also checks that
|
||||
@@ -110,7 +179,7 @@ Cloudflare's runtime and is not bound by this rule.
|
||||
- `npm test` runs Vitest once, in two projects: `app` (jsdom) for
|
||||
`src/**/*.test.{ts,tsx}` and `worker` (Node) for `worker/**/*.test.ts`.
|
||||
- `npm run test:watch` re-runs on change. `npm run test:coverage` adds V8
|
||||
coverage in `coverage/` (CI feeds `lcov.info` to SonarQube Cloud).
|
||||
coverage in `coverage/`.
|
||||
- Tests live in `__tests__/` folders next to the code they cover. Add a
|
||||
regression test with a bug fix where you can.
|
||||
|
||||
@@ -152,17 +221,18 @@ dry run, so `preview:cf` always serves a fresh build.
|
||||
- The Turnstile human check is off in `npm run dev` unless you set
|
||||
`VITE_TURNSTILE_DEV=1`. On localhost the app uses Cloudflare's test
|
||||
sitekey.
|
||||
- Nobody deploys by hand: Cloudflare Workers Builds deploys every push to
|
||||
`main`. `npm run cf:check` is the deploy dry run CI uses. Hosting, secrets,
|
||||
- Nobody deploys by hand: the `deploy` job of the Gitea CI workflow runs
|
||||
`wrangler deploy` for every push to `main`, then checks production.
|
||||
`npm run cf:check` is the deploy dry run CI uses. Hosting, secrets,
|
||||
rollback and releases are described in [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md).
|
||||
|
||||
## Ways to contribute
|
||||
|
||||
### Bug reports
|
||||
|
||||
Use the [Bug Report](https://github.com/poli0981/jsonPrism/issues/new?template=bug_report.md) template. Include:
|
||||
Open an issue on the GitLab mirror with the [Bug](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Bug) template. Include:
|
||||
|
||||
- Platform (Web / Windows / macOS / Linux / Android) and browser or OS version
|
||||
- Platform (Web / Windows / Linux / Android, or macOS up to 2.2.1) and browser or OS version
|
||||
- JSONPrism version (*About → Build info*), or the output of *Copy diagnostics* on the same page
|
||||
- Steps to reproduce
|
||||
- Sample JSON that triggers the bug (minimal, please, and nothing private)
|
||||
@@ -170,45 +240,73 @@ Use the [Bug Report](https://github.com/poli0981/jsonPrism/issues/new?template=b
|
||||
|
||||
Security vulnerabilities never go in a public issue. See [SECURITY.md](SECURITY.md).
|
||||
|
||||
### Feature requests
|
||||
### Accessibility issues
|
||||
|
||||
Use the [Feature Request](https://github.com/poli0981/jsonPrism/issues/new?template=feature_request.md) template. We prioritize features that:
|
||||
Something hard or impossible to use with a keyboard, screen reader, zoom or other assistive technology? Use the [Accessibility](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Accessibility) template on the GitLab mirror. You don't need to know the cause. [ACCESSIBILITY.md](ACCESSIBILITY.md) covers:
|
||||
|
||||
- what is supported and tested;
|
||||
- the known limitations;
|
||||
- how reports are triaged.
|
||||
|
||||
Fixes for those limitations are welcome.
|
||||
|
||||
### Converter requests
|
||||
|
||||
A format can still be added or removed when people really need it. Open a
|
||||
[Converter request](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Converter%20request)
|
||||
first and describe the workflow it serves. A merge request that adds a
|
||||
converter without an agreed request may be closed. A new converter must:
|
||||
|
||||
- Fit the "one JSON → many formats" core mission
|
||||
- Run entirely on the user's device (conversion never touches a server)
|
||||
- Have a clear use case from a real workflow
|
||||
|
||||
### Feature ideas
|
||||
|
||||
New features are out of scope while JSONPrism is in
|
||||
[maintenance mode](#maintenance-mode). Share ideas on the
|
||||
[Discord server](https://discord.gg/2aNR3aVt): they are read, but nothing
|
||||
is scheduled.
|
||||
|
||||
### Translations
|
||||
|
||||
Currently bundled: **English** (`en`), **Tiếng Việt** (`vi`), **日本語**
|
||||
(`ja`), **简体中文** (`zh-CN`). The Japanese and Simplified Chinese
|
||||
locales, and parts of the Vietnamese one, are AI-generated and not
|
||||
professionally reviewed; see [DISCLAIMER.md](DISCLAIMER.md).
|
||||
Native-speaker corrections are very welcome.
|
||||
Native-speaker corrections are very welcome. Wording that reads wrong for
|
||||
a culture or region, or a spelling mistake that could mislead, counts as a
|
||||
bug: report it with the
|
||||
[Translation](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Translation)
|
||||
template, or fix it in a merge request.
|
||||
|
||||
Every user-facing string goes through i18next, so a new or changed string
|
||||
means editing **all four** files in `src/i18n/locales/`. The parity test
|
||||
(`src/i18n/__tests__/locales.test.ts`, part of `npm test` and CI) fails
|
||||
when a locale is missing a key or has an extra one, changes a
|
||||
`{{variable}}`, or leaves a value empty. If you aren't confident in a
|
||||
translation, say so in the PR.
|
||||
translation, say so in the merge request.
|
||||
|
||||
To add a new language:
|
||||
A new language counts as a new feature, so while JSONPrism is in
|
||||
[maintenance mode](#maintenance-mode), ask first (an issue on the GitLab
|
||||
mirror, or [code@poli0981.dev](mailto:code@poli0981.dev)) before you start. The steps stay here for reference. To add a new language:
|
||||
|
||||
1. Copy `src/i18n/locales/en.json` to `src/i18n/locales/<locale>.json` and translate every value (keep `{{variables}}` unchanged)
|
||||
2. Import it in `src/i18n/index.ts` and add it to `resources` and `SUPPORTED_LANGUAGES`
|
||||
3. Add it to `LANGUAGES` in `src/components/common/LanguageSwitcher.tsx`
|
||||
4. Add it to the `describe.each` list in `src/i18n/__tests__/locales.test.ts`
|
||||
5. If Cloudflare Turnstile supports the language, map it in `turnstileLanguage()` in `src/lib/turnstile.ts`
|
||||
6. Open a PR
|
||||
6. Open a merge request
|
||||
|
||||
### Adding a new converter
|
||||
|
||||
See the **"Adding a new converter — checklist"** section in [`CLAUDE.md`](CLAUDE.md).
|
||||
Start with a [converter request](#converter-requests). Once it is agreed,
|
||||
follow the **"Adding a new converter — checklist"** section in
|
||||
[`CLAUDE.md`](CLAUDE.md).
|
||||
|
||||
Briefly:
|
||||
|
||||
1. New file `src/converters/myformat.ts` implementing `Converter<TOptions>` (pure, errors as values)
|
||||
1. New file `src/converters/myformat.ts` implementing `Converter<TOptions>` (pure, errors as values; an input-only format such as JSONC sets `meta.inputOnly`)
|
||||
2. Add the ID to `FormatId` in `types.ts` and register the converter in `registry.ts`
|
||||
3. Add `formats.myformat` labels to all four locales
|
||||
4. Add tests in `src/converters/__tests__/` (`contract.test.ts` already runs every registered converter against the errors-as-values contract)
|
||||
@@ -229,7 +327,7 @@ ci: pin actions to full commit SHAs
|
||||
```
|
||||
|
||||
Prefixes: `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`
|
||||
(dependencies, bundling, toolchain), `ci` (GitHub Actions workflows),
|
||||
(dependencies, bundling, toolchain), `ci` (Gitea Actions workflows),
|
||||
`chore`, `style`.
|
||||
|
||||
## Auto-ignored contributions
|
||||
@@ -237,21 +335,26 @@ Prefixes: `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`
|
||||
To keep the maintainer's review queue manageable, the following are
|
||||
closed without review:
|
||||
|
||||
- **PRs with suspicious code.** If a diff looks like obfuscated/minified
|
||||
- **New features outside the [maintenance scope](#maintenance-mode).**
|
||||
Feature requests and `feat:` merge requests from outside contributors,
|
||||
and other out-of-scope items, are closed with the `out-of-scope` label.
|
||||
- **Merge requests with suspicious code.** If a diff looks like obfuscated/minified
|
||||
code, hidden network calls, or subtly tampered third-party files, it
|
||||
will be flagged. If CodeQL or Dependabot also flag it, the contributor
|
||||
will be flagged. If the security scans (Opengrep, gitleaks, osv-scanner)
|
||||
also flag it, the contributor
|
||||
will be **banned** without exception. The maintainer may also verify
|
||||
suspect sections by hand.
|
||||
- **PRs / issues posting unknown / random links** (especially shortened
|
||||
- **Merge requests / issues posting unknown / random links** (especially shortened
|
||||
URLs to "demos", "fixes", etc. with no clear source).
|
||||
- **Behavior / language violating GitHub's policy** — harassment, hate
|
||||
speech, doxxing, NSFW content, etc.
|
||||
- **Behavior / language violating GitLab's policies** (where issues and
|
||||
merge requests are posted) — harassment, hate speech, doxxing, NSFW
|
||||
content, etc.
|
||||
- **Off-topic preamble**, e.g. "Chào buổi sáng, hôm nay là 1 ngày trời
|
||||
đẹp…" ("Good morning, what a lovely day…") or any greeting/filler that
|
||||
doesn't immediately address the issue. Get to the point: what's wrong,
|
||||
what's the expected behavior, what reproduces it.
|
||||
- **PRs without a meaningful description** or test plan. The Summary and
|
||||
Test plan sections of the PR template are required.
|
||||
- **Merge requests without a meaningful description** or test plan. The
|
||||
Summary and Test plan sections of the template are required.
|
||||
|
||||
These rules exist because this is a one-person + AI-assisted project
|
||||
(see [DISCLAIMER.md](DISCLAIMER.md)); time spent triaging low-effort
|
||||
@@ -265,7 +368,7 @@ fine; personal attacks and harassment are not.
|
||||
|
||||
Report conduct concerns to the maintainer at **code@poli0981.dev**.
|
||||
Security vulnerabilities are not conduct reports: follow
|
||||
[SECURITY.md](SECURITY.md) (private advisory or security@poli0981.dev).
|
||||
[SECURITY.md](SECURITY.md) (security@poli0981.dev).
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+14
-11
@@ -1,13 +1,14 @@
|
||||
# Disclaimer
|
||||
|
||||
**Last updated**: 2026-10-22
|
||||
**Last updated**: 2026-11-27
|
||||
|
||||
## Project status
|
||||
|
||||
JSONPrism is a **one-person open-source project** maintained by poli0981
|
||||
(Kokone, [@poli0981](https://github.com/poli0981)), written with
|
||||
(Kokone, [poli0981](https://git.poli0981.dev/poli0981)), written with
|
||||
substantial AI assistance. It is published under the Apache 2.0 License
|
||||
and the source is available on GitHub.
|
||||
and the source is available on [git.poli0981.dev](https://git.poli0981.dev/poli0981/jsonPrism), mirrored on
|
||||
[GitLab](https://gitlab.com/poli0981/jsonPrism).
|
||||
|
||||
It is **not** a commercial product. There is no SLA, no support contract
|
||||
and no warranty. See the `LICENSE` file for the exact legal text — the
|
||||
@@ -28,12 +29,12 @@ Apache 2.0 disclaimer-of-warranty clause applies in full.
|
||||
This project openly uses AI tools during development:
|
||||
|
||||
- **Claude Chat** and **Claude Code** — Claude Opus 4.7 and 4.8 for the 1.x
|
||||
releases, Claude Opus 5.5 for 2.0 — used for drafting code,
|
||||
releases, Claude Opus 5.5 for 2.x — used for drafting code,
|
||||
refactoring, writing tests and documentation, generating translations
|
||||
and reviewing changes.
|
||||
- All AI-generated code is reviewed by the maintainer before it is merged.
|
||||
Errors that slip through are bugs — please report them via
|
||||
[GitHub Issues](https://github.com/poli0981/jsonPrism/issues).
|
||||
Errors that slip through are bugs — please report them via the
|
||||
[issues on the GitLab mirror](https://gitlab.com/poli0981/jsonPrism/-/issues).
|
||||
|
||||
### Translations
|
||||
|
||||
@@ -41,8 +42,9 @@ Non-English locales (Vietnamese, Japanese, Simplified Chinese) are
|
||||
produced primarily by AI translation. They are **not professionally
|
||||
reviewed**, so wording, technical terms or idioms may be inaccurate.
|
||||
|
||||
If you are a native speaker and spot a translation issue, a pull request
|
||||
or a Discussion post is very welcome.
|
||||
If you are a native speaker and spot a translation issue, an issue with
|
||||
the [Translation](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Translation) template or a merge request on the
|
||||
GitLab mirror is very welcome.
|
||||
|
||||
## Third-party services
|
||||
|
||||
@@ -59,13 +61,14 @@ do not depend on these services.
|
||||
without checking it.
|
||||
- Do not assume that a round trip JSON → format → JSON is byte-perfect for
|
||||
lossy formats. Only JSONL, CSV, TSV, YAML, TOML and RESX convert back
|
||||
to JSON at all.
|
||||
to JSON at all. JSONC → JSON removes comments and trailing commas, so
|
||||
they are not kept.
|
||||
- Pin a specific JSONPrism version if you depend on its behaviour; future
|
||||
releases may change defaults.
|
||||
|
||||
## Reporting concerns
|
||||
|
||||
- Bugs: [GitHub Issues](https://github.com/poli0981/jsonPrism/issues)
|
||||
- Bugs: [issues on the GitLab mirror](https://gitlab.com/poli0981/jsonPrism/-/issues)
|
||||
- Security: [SECURITY.md](SECURITY.md)
|
||||
- Translation accuracy: [GitHub Discussions](https://github.com/poli0981/jsonPrism/discussions)
|
||||
- Translation accuracy: the [Translation](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Translation) issue template
|
||||
- Legal: legal@poli0981.dev
|
||||
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2026 poli0981 (https://github.com/poli0981)
|
||||
Copyright 2026 poli0981 (https://git.poli0981.dev/poli0981)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+29
-18
@@ -1,45 +1,56 @@
|
||||
# Maintainers
|
||||
|
||||
| Name | GitHub | Contact | Scope |
|
||||
| Name | Forge | Contact | Scope |
|
||||
|---|---|---|---|
|
||||
| Kokone | [@poli0981](https://github.com/poli0981) | [code@poli0981.dev](mailto:code@poli0981.dev) | Solo maintainer — code review, releases, translations review, community |
|
||||
| Kokone | [poli0981](https://git.poli0981.dev/poli0981) | [code@poli0981.dev](mailto:code@poli0981.dev) | Solo maintainer — code review, releases, translations review, community |
|
||||
|
||||
JSONPrism is co-authored with AI tooling — see [DISCLAIMER.md](DISCLAIMER.md)
|
||||
for details. The maintainer is the single point of human review for every
|
||||
merged PR.
|
||||
merged change.
|
||||
|
||||
Since 2.2.1 the project is in **maintenance mode**: no new features, only
|
||||
the changes listed in
|
||||
[CONTRIBUTING.md → Maintenance mode](CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
## Responsibilities
|
||||
|
||||
- **Code review** — reviews and merges every PR, including AI-assisted
|
||||
changes and the weekly grouped Dependabot updates, and doesn't merge on
|
||||
red CI.
|
||||
- **Releases** — tags `v*` releases; `release.yml` builds the Windows,
|
||||
macOS, Linux and Android packages into a draft GitHub Release with
|
||||
`SHA256SUMS.txt` and build-provenance attestations, which the maintainer
|
||||
reviews and publishes. The website deploys itself from `main` through
|
||||
Cloudflare Workers Builds.
|
||||
- **Code review** — reviews and merges every change, including
|
||||
AI-assisted changes, merge requests from the GitLab mirror and the grouped
|
||||
Renovate updates, and doesn't merge on red CI.
|
||||
- **Releases** — tags `v*` releases (signed); `release.yml` on Gitea
|
||||
Actions builds the Windows, Linux and Android packages, uploads them with
|
||||
`SHA256SUMS.txt` to `releases.poli0981.dev/jsonprism/`, and opens a draft
|
||||
Gitea release, which the maintainer reviews and publishes. The website
|
||||
deploys from `main` through the CI `deploy` job (`wrangler deploy`).
|
||||
- **Translations review** — the AI-generated Japanese and Simplified
|
||||
Chinese strings and the partly AI-generated Vietnamese ones.
|
||||
- **Community** — issues, Discussions and the Discord server, and
|
||||
- **Accessibility** — triages reports labelled `accessibility`, runs the
|
||||
manual checks before a release and keeps
|
||||
[ACCESSIBILITY.md](ACCESSIBILITY.md) current.
|
||||
- **Community** — issues and merge requests on the GitLab mirror, the
|
||||
Discord server, and
|
||||
enforcement of the [Code of Conduct](CODE_OF_CONDUCT.md). Vulnerability
|
||||
reports are triaged as described in [SECURITY.md](SECURITY.md).
|
||||
- **Triage** — keeps issues and merge requests within the maintenance
|
||||
scope, closing the rest by hand with the `out-of-scope` label.
|
||||
|
||||
## Contact
|
||||
|
||||
- Bug reports & feature requests: [GitHub Issues](https://github.com/poli0981/jsonPrism/issues)
|
||||
- Discussion / Q&A: [GitHub Discussions](https://github.com/poli0981/jsonPrism/discussions)
|
||||
- Community chat: [Discord](https://discord.gg/2aNR3aVt)
|
||||
- Source: [git.poli0981.dev/poli0981/jsonPrism](https://git.poli0981.dev/poli0981/jsonPrism) (canonical, read-only for outsiders)
|
||||
- Bug reports, translation fixes and converter requests: [issues on the GitLab mirror](https://gitlab.com/poli0981/jsonPrism/-/issues)
|
||||
- Accessibility barriers: the [Accessibility](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Accessibility) template, or [code@poli0981.dev](mailto:code@poli0981.dev) — see [ACCESSIBILITY.md](ACCESSIBILITY.md)
|
||||
- Feature ideas (no commitment while in maintenance mode), questions and community chat: [Discord](https://discord.gg/2aNR3aVt)
|
||||
- Project, maintainer & Code of Conduct: [code@poli0981.dev](mailto:code@poli0981.dev)
|
||||
- Security: [Private Security Advisory](https://github.com/poli0981/jsonPrism/security/advisories/new) or [security@poli0981.dev](mailto:security@poli0981.dev) — never a public issue
|
||||
- Security: [security@poli0981.dev](mailto:security@poli0981.dev) — never a public issue
|
||||
|
||||
## Becoming a maintainer
|
||||
|
||||
JSONPrism is small-by-design. Additional maintainers may be added when a
|
||||
contributor has demonstrated:
|
||||
|
||||
- Multiple high-quality merged PRs.
|
||||
- Multiple high-quality merged changes.
|
||||
- Familiarity with the conventions in [CLAUDE.md](CLAUDE.md) and
|
||||
[CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
- Willingness to review others' PRs and respond to issues.
|
||||
- Willingness to review others' merge requests and respond to issues.
|
||||
|
||||
Until then, the project runs as a single-maintainer indie project.
|
||||
+4
-1
@@ -1,6 +1,8 @@
|
||||
# Privacy Policy
|
||||
|
||||
**Version**: 2.0 · **Effective**: 2026-10-22 · Replaces the policy of 2026-05-13.
|
||||
Edited 2026-11-27: the downloads and the source moved off GitHub (the
|
||||
"Downloads and the repository" row; not a material change).
|
||||
|
||||
## Short version
|
||||
|
||||
@@ -29,6 +31,7 @@ Privacy questions and requests: **privacy@poli0981.dev**.
|
||||
| Website | Cloudflare Workers (static files plus a small API for the human check) | Standard HTTP request data needed to deliver the site; the Turnstile check; anonymous page-view metrics if analytics is on. Never the data you convert. |
|
||||
| Windows, macOS, Linux app | Tauri 2, runs locally | Nothing from app code. Links you click open in your browser. |
|
||||
| Android app | Tauri 2 in the system WebView | Nothing from app code. Links you tap open in your browser. |
|
||||
| Downloads and the repository | Cloudflare R2 (`releases.poli0981.dev`) serves the app files; the maintainer's Gitea server (`git.poli0981.dev`) the source and release notes; GitLab.com the public mirror for issues | Standard HTTP request data needed to deliver a file or a page. Nothing is logged by JSONPrism itself; an account you use on GitLab follows GitLab's privacy statement. |
|
||||
|
||||
### Hosting (website)
|
||||
|
||||
@@ -176,4 +179,4 @@ accept it again before you continue.
|
||||
|
||||
- Privacy: privacy@poli0981.dev
|
||||
- Security vulnerabilities: see [SECURITY.md](SECURITY.md)
|
||||
- Everything else: [GitHub Issues](https://github.com/poli0981/jsonPrism/issues)
|
||||
- Everything else: [issues on the GitLab mirror](https://gitlab.com/poli0981/jsonPrism/-/issues)
|
||||
@@ -6,11 +6,13 @@
|
||||
|
||||
One JSON input. Multi-target formats. Fully on your device.
|
||||
|
||||
[](https://github.com/poli0981/jsonPrism/actions/workflows/ci.yml)
|
||||
[](https://sonarcloud.io/summary/new_code?id=poli0981_jsonPrism)
|
||||
[](#project-status)
|
||||
[](https://git.poli0981.dev/poli0981/jsonPrism/actions?workflow=ci.yml)
|
||||
[](https://git.poli0981.dev/poli0981/jsonPrism/actions?workflow=security.yml)
|
||||
[](https://git.poli0981.dev/poli0981/jsonPrism/actions?workflow=qodana.yml)
|
||||
[](LICENSE)
|
||||
|
||||
[Web app](https://jsonprism.poli0981.dev) · [Downloads](https://github.com/poli0981/jsonPrism/releases/latest) · [Tiếng Việt](README.vi.md) · [Roadmap](docs/ROADMAP.md)
|
||||
[Web app](https://jsonprism.poli0981.dev) · [Downloads](https://git.poli0981.dev/poli0981/jsonPrism/releases) · [Tiếng Việt](README.vi.md) · [Roadmap](docs/ROADMAP.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -18,24 +20,41 @@ One JSON input. Multi-target formats. Fully on your device.
|
||||
|
||||
JSONPrism is a refracting tool for developers. It takes a single JSON input and disperses it into many target formats — like white light through a prism. **Conversion runs entirely on your device** — in the browser, the desktop app or the Android app — so your data never leaves it.
|
||||
|
||||
## Project status
|
||||
|
||||
**Maintenance mode** since 2.2.1 (November 2026). JSONPrism is feature-complete, and it stays maintained:
|
||||
|
||||
- dependency updates on a regular schedule, and fast fixes for high or critical CVEs and serious runtime security issues;
|
||||
- major language, runtime and framework upgrades (for example Node 24 → 26, TypeScript 6 → 7);
|
||||
- bug, UI/UX and accessibility fixes, and adding or removing a converter when people really need it;
|
||||
- translation fixes: wording that doesn't fit a culture or region, and spelling mistakes that could mislead;
|
||||
- changes the Cloudflare or Worker platform forces, and website incidents such as DDoS or bot spam.
|
||||
|
||||
New features are not planned, except the rare one that is genuinely necessary. Feature requests and merge requests outside this list are closed. The full policy is in [CONTRIBUTING.md](CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
## Where things live
|
||||
|
||||
Source: [git.poli0981.dev/poli0981/jsonPrism](https://git.poli0981.dev/poli0981/jsonPrism) (canonical). Mirror for issues and merge requests: [gitlab.com/poli0981/jsonPrism](https://gitlab.com/poli0981/jsonPrism). Patches and questions: [code@poli0981.dev](mailto:code@poli0981.dev). Security: [security@poli0981.dev](mailto:security@poli0981.dev) (see [`SECURITY.md`](SECURITY.md)). Downloads: `releases.poli0981.dev/jsonprism/`, linked file by file from the [release notes](https://git.poli0981.dev/poli0981/jsonPrism/releases). The GitHub repository is gone with its account (November 2026); old GitHub links don't work any more.
|
||||
|
||||
## Target formats
|
||||
|
||||
| Format | Extension | Status | Reverse (→ JSON) |
|
||||
| ----------------- | ----------- | ------------- | ---------------- |
|
||||
| JSONL | `.jsonl` | ✅ Phase 1 | ✅ |
|
||||
| CSV | `.csv` | ✅ Phase 1 | ✅ |
|
||||
| TSV | `.tsv` | ✅ Phase 1 | ✅ |
|
||||
| YAML | `.yaml` | ✅ Phase 1 | ✅ |
|
||||
| XML | `.xml` | ✅ Phase 2 | — |
|
||||
| TOML | `.toml` | ✅ Phase 2 | ✅ |
|
||||
| Markdown table | `.md` | ✅ Phase 2 | — |
|
||||
| SQL `INSERT` | `.sql` | ✅ Phase 2 | — |
|
||||
| RESX (.NET) | `.resx` | ✅ Phase 3 | ✅ |
|
||||
| BSON | `.bson` | ✅ Phase 4 | — |
|
||||
| CBOR | `.cbor` | ✅ Phase 4 | — |
|
||||
| MessagePack | `.msgpack` | ✅ Phase 4 | — |
|
||||
| Format | Extension | Status | Reverse (→ JSON) |
|
||||
| ------------------ | ----------------- | --------- | ---------------- |
|
||||
| JSONL | `.jsonl` | ✅ Phase 1 | ✅ |
|
||||
| JSONC (input only) | `.jsonc`, `.json` | ✅ 2.1.0 | ✅ (only) |
|
||||
| CSV | `.csv` | ✅ Phase 1 | ✅ |
|
||||
| TSV | `.tsv` | ✅ Phase 1 | ✅ |
|
||||
| YAML | `.yaml` | ✅ Phase 1 | ✅ |
|
||||
| XML | `.xml` | ✅ Phase 2 | — |
|
||||
| TOML | `.toml` | ✅ Phase 2 | ✅ |
|
||||
| Markdown table | `.md` | ✅ Phase 2 | — |
|
||||
| SQL `INSERT` | `.sql` | ✅ Phase 2 | — |
|
||||
| RESX (.NET) | `.resx` | ✅ Phase 3 | ✅ |
|
||||
| BSON | `.bson` | ✅ Phase 4 | — |
|
||||
| CBOR | `.cbor` | ✅ Phase 4 | — |
|
||||
| MessagePack | `.msgpack` | ✅ Phase 4 | — |
|
||||
|
||||
Twelve formats. Six of them — JSONL, CSV, TSV, YAML, TOML and RESX — also convert back to JSON; in that direction `.ndjson`, `.tab` and `.yml` files are accepted too. SQL `INSERT` speaks standard SQL, PostgreSQL, MySQL, SQLite and MSSQL. BSON, CBOR and MessagePack are binary: the output panel shows them as base64 or hex text, and downloads are real binary files.
|
||||
Twelve target formats. Six of them — JSONL, CSV, TSV, YAML, TOML and RESX — also convert back to JSON; in that direction `.ndjson`, `.tab` and `.yml` files are accepted too. **JSONC** (JSON with comments: `tsconfig.json`, VS Code settings) is input only: it turns `.jsonc` and `.json` files into plain JSON, dropping comments and trailing commas while keeping every value, number and key exactly as written. Paste JSONC in the JSON → direction and the app offers to switch. SQL `INSERT` speaks standard SQL, PostgreSQL, MySQL, SQLite and MSSQL. BSON, CBOR and MessagePack are binary: the output panel shows them as base64 or hex text, and downloads are real binary files.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -48,7 +67,7 @@ Twelve formats. Six of them — JSONL, CSV, TSV, YAML, TOML and RESX — also co
|
||||
- **Light, dark or system theme** — Prism Spectrum palette with violet / cyan / amber / rose accents on a technical, blueprint-grid look. The Appearance menu can also hide scrollbars.
|
||||
- **Responsive — designed for viewports ≥ 360 × 640.** Smaller screens still work but may feel cramped; on mobile, Input and Output use a Tabs UI to give each panel full height. See [`docs/tested-viewports.md`](docs/tested-viewports.md) for the full device test matrix.
|
||||
- **4 UI languages** — English, Tiếng Việt, 日本語 and 简体中文. The Japanese and Chinese translations are AI-generated; fixes from native speakers are welcome.
|
||||
- **Desktop and Android apps** — Tauri 2 builds for Windows, macOS, Linux and Android with native file dialogs and drag-and-drop. They work fully offline.
|
||||
- **Desktop and Android apps** — Tauri 2 builds for Windows, Linux and Android with native file dialogs and drag-and-drop (macOS builds stopped after 2.2.1). They work fully offline.
|
||||
|
||||
## Privacy
|
||||
|
||||
@@ -61,6 +80,19 @@ Twelve formats. Six of them — JSONL, CSV, TSV, YAML, TOML and RESX — also co
|
||||
|
||||
Details: [`PRIVACY.md`](PRIVACY.md).
|
||||
|
||||
## Accessibility
|
||||
|
||||
JSONPrism aims for **WCAG 2.2 AA** on the website and in the apps:
|
||||
|
||||
- **Keyboard:** everything works with the keyboard alone, with a skip link and a visible focus indicator.
|
||||
- **Screen readers:** controls have names, and errors and state changes are announced, in all four languages.
|
||||
- **Display:** light, dark or system theme with text at 4.5:1 or better, plus support for reduced motion and Windows contrast themes.
|
||||
- **Zoom:** works on the website, and in the desktop apps with Ctrl/⌘ + = and −.
|
||||
|
||||
The maintainer tests it with Narrator and the keyboard alone, and every pull request runs an axe-core scan.
|
||||
|
||||
Known limitations and how to report a barrier: [`ACCESSIBILITY.md`](ACCESSIBILITY.md).
|
||||
|
||||
## Tech stack
|
||||
|
||||
- **Vite 8** + **React 19.3** + **TypeScript 7** (native compiler; the `typescript` dependency is a TS 6 alias kept only for typescript-eslint)
|
||||
@@ -71,14 +103,14 @@ Details: [`PRIVACY.md`](PRIVACY.md).
|
||||
- **Vitest** + Testing Library for tests
|
||||
- **Node.js 26** for the toolchain
|
||||
- **Cloudflare Workers** hosts the web app (static assets behind a small Worker that rate limits requests and serves `/api/*`)
|
||||
- **Tauri 2.12** for the desktop (Windows, macOS, Linux) and Android apps
|
||||
- **Tauri 2.12** for the desktop (Windows, Linux) and Android apps
|
||||
|
||||
## Quick start
|
||||
|
||||
**Requirements**: Node.js **26** (pinned in `.nvmrc`).
|
||||
|
||||
```bash
|
||||
git clone https://github.com/poli0981/jsonPrism.git
|
||||
git clone https://git.poli0981.dev/poli0981/jsonPrism.git
|
||||
cd jsonPrism
|
||||
nvm use # picks Node 26 from .nvmrc
|
||||
npm install
|
||||
@@ -105,9 +137,9 @@ npm run preview:cf # build + wrangler dev on http://localhost:8787
|
||||
| `npm run knip` | Find unused files, exports and dependencies |
|
||||
| `npm run format` | Format with Prettier |
|
||||
| `npm run format:check` | Check formatting (CI uses this) |
|
||||
| `npm test` | Run the Vitest suite once |
|
||||
| `npm test` | Run the Vitest suite once (CI uses this) |
|
||||
| `npm run test:watch` | Run Vitest in watch mode |
|
||||
| `npm run test:coverage` | Run the tests with a coverage report (CI uses this) |
|
||||
| `npm run test:coverage` | Run the tests with a coverage report |
|
||||
| `npm run cf:types` | Regenerate the Worker's binding types |
|
||||
| `npm run cf:check` | Dry-run the Cloudflare deploy (`wrangler deploy --dry-run`; CI runs it too) |
|
||||
| `npm run preview:cf` | Serve a fresh build and the Worker with `wrangler dev` on http://localhost:8787 |
|
||||
@@ -132,21 +164,23 @@ JSONPrism also ships as a native desktop app via Tauri 2. The app uses the same
|
||||
|
||||
### Download (users)
|
||||
|
||||
Get the bundle for your OS from the [latest release](https://github.com/poli0981/jsonPrism/releases/latest):
|
||||
Get the bundle for your OS from the [latest release](https://git.poli0981.dev/poli0981/jsonPrism/releases): its notes link every file, hosted at `https://releases.poli0981.dev/jsonprism/<version>/`.
|
||||
|
||||
| OS | Files | Requirement |
|
||||
| --- | --- | --- |
|
||||
| **Windows** | `.msi` or NSIS `-setup.exe` | WebView2 runtime (preinstalled on Windows 11) |
|
||||
| **macOS** | universal `.dmg` (Apple Silicon + Intel) | macOS **12** or newer |
|
||||
| **Linux** | `.deb`, `.rpm` or `.AppImage` | Built on Ubuntu 22.04 — needs Ubuntu 22.04 or a similarly recent distro |
|
||||
|
||||
The desktop bundles aren't code-signed yet, so Windows SmartScreen or macOS Gatekeeper may warn the first time you open them. Releases from v2.0.0 on also carry `SHA256SUMS.txt` and GitHub build-provenance attestations, so you can check a download before running it:
|
||||
**No macOS build since 2.2.1.** Since the move from GitHub there is no macOS build machine. A Mac keeps the version it has (the 2.2.1 `.dmg` was the last one), and the [web app](https://jsonprism.poli0981.dev) runs in any browser, offline included once loaded.
|
||||
|
||||
The desktop bundles aren't code-signed yet, so Windows SmartScreen may warn the first time you open them. Every release carries `SHA256SUMS.txt` next to the files, so you can check a download before running it:
|
||||
|
||||
```bash
|
||||
sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
gh attestation verify <file> --repo poli0981/jsonPrism
|
||||
```
|
||||
|
||||
The apps have no auto-updater: download a new version by hand. Releases up to 2.2.1 were on GitHub, which is gone; an installed copy keeps working.
|
||||
|
||||
### Build (developers)
|
||||
|
||||
**Additional requirements**:
|
||||
@@ -181,7 +215,7 @@ Output:
|
||||
- macOS → `src-tauri/target/release/bundle/dmg/*.dmg` + `macos/*.app`
|
||||
- Linux → `src-tauri/target/release/bundle/appimage/*.AppImage` + `deb/*.deb` + `rpm/*.rpm`
|
||||
|
||||
**Automated releases**: pushing a `v*` tag runs `.github/workflows/release.yml`. It checks that the tag matches the version in `package.json` and `src-tauri/Cargo.toml`, runs the tests, builds the Windows, macOS (universal) and Linux bundles plus the Android APK into **one** draft GitHub release, then adds `SHA256SUMS.txt` and build-provenance attestations. The maintainer publishes the draft.
|
||||
**Automated releases**: pushing a `v*` tag runs `.gitea/workflows/release.yml` on Gitea Actions. It checks that the tag matches the version in `package.json` and `src-tauri/Cargo.toml`, runs the tests, builds the Windows bundles (on the maintainer's PC), the Linux bundles and the Android APK, uploads them with `SHA256SUMS.txt` to `releases.poli0981.dev/jsonprism/<version>/`, then opens a draft Gitea release that links them. The maintainer publishes the draft. Official builds cover Windows, Linux and Android; macOS bundles can still be built locally on a Mac.
|
||||
|
||||
## Android app (Tauri 2)
|
||||
|
||||
@@ -200,8 +234,8 @@ JSONPrism also ships as an Android app you sideload from a `.apk`. Same React UI
|
||||
|
||||
### Install (users)
|
||||
|
||||
1. Download `JSONPrism_<version>_android-universal.apk` from the [latest release](https://github.com/poli0981/jsonPrism/releases/latest).
|
||||
2. Optionally check it against `SHA256SUMS.txt` or with `gh attestation verify` (see [Download (users)](#download-users)).
|
||||
1. Download `JSONPrism_<version>_android-universal.apk` from the [latest release](https://git.poli0981.dev/poli0981/jsonPrism/releases), or the newest one from the stable link [`releases.poli0981.dev/jsonprism/jsonprism-latest.apk`](https://releases.poli0981.dev/jsonprism/jsonprism-latest.apk).
|
||||
2. Optionally check it against `SHA256SUMS.txt` (see [Download (users)](#download-users)).
|
||||
3. Open it; Android will ask you to allow "install unknown apps" for your browser/file manager — enable it, then install.
|
||||
4. Needs Android 12+. The app runs fully offline.
|
||||
|
||||
@@ -230,7 +264,7 @@ npm run tauri:android:build
|
||||
|
||||
Output: `src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk`. Release signing is read from `src-tauri/gen/android/keystore.properties` (gitignored); without it the APK builds unsigned. See [`docs/TAURI-NOTES.md`](docs/TAURI-NOTES.md) for keystore setup and the CI signing secrets.
|
||||
|
||||
**Automated releases**: the same `v*` tag also runs the `android` job in `release.yml`, which signs the APK with the keystore from repository secrets and attaches it to the draft release as `JSONPrism_<version>_android-universal.apk`.
|
||||
**Automated releases**: the same `v*` tag also runs the `android` job in `release.yml`, which signs the APK with the keystore from repository secrets, checks the signature, and publishes it with the desktop bundles as `JSONPrism_<version>_android-universal.apk` (plus the `jsonprism-latest.apk` alias).
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -295,28 +329,30 @@ export const myFormatConverter: Converter<MyFormatOptions> = {
|
||||
};
|
||||
```
|
||||
|
||||
An input-only format (like JSONC) sets `meta.inputOnly: true`, implements `reverse()`, and has `convert()` return an error; the UI then disables it in the JSON → direction.
|
||||
|
||||
Then add the id to the `FormatId` union in `src/converters/types.ts`, register the converter in `src/converters/registry.ts` (`CONVERTERS` and `ALL_FORMATS`), and add its label keys to all four files in `src/i18n/locales/` — a parity test fails when a locale is missing a key.
|
||||
|
||||
See [`docs/ROADMAP.md`](docs/ROADMAP.md) for the full phase plan.
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests welcome — please read [`CONTRIBUTING.md`](CONTRIBUTING.md) first. PRs that match the **auto-ignored** patterns described there (suspicious code, off-topic preamble, no description, etc.) get closed without review.
|
||||
Contributions welcome within the maintenance policy — please read [`CONTRIBUTING.md`](CONTRIBUTING.md) first. The canonical repository on Gitea is read-only for outsiders: open a merge request on the [GitLab mirror](https://gitlab.com/poli0981/jsonPrism), or mail a patch (`git format-patch`) to [code@poli0981.dev](mailto:code@poli0981.dev). Merge requests that match the **auto-ignored** patterns described there (suspicious code, off-topic preamble, no description, etc.) get closed without review.
|
||||
|
||||
For bug reports and feature requests, use [GitHub Issues](https://github.com/poli0981/jsonPrism/issues). For security vulnerabilities, use the [private Security Advisory flow](https://github.com/poli0981/jsonPrism/security/advisories/new).
|
||||
For bug reports, use the [issues on the GitLab mirror](https://gitlab.com/poli0981/jsonPrism/-/issues). For security vulnerabilities, e-mail [security@poli0981.dev](mailto:security@poli0981.dev) — never a public issue.
|
||||
|
||||
## Contact
|
||||
|
||||
| Address | For |
|
||||
| --- | --- |
|
||||
| [security@poli0981.dev](mailto:security@poli0981.dev) | Vulnerability reports (the [private Security Advisory flow](https://github.com/poli0981/jsonPrism/security/advisories/new) is preferred) |
|
||||
| [security@poli0981.dev](mailto:security@poli0981.dev) | Vulnerability reports (see [`SECURITY.md`](SECURITY.md)) |
|
||||
| [privacy@poli0981.dev](mailto:privacy@poli0981.dev) | Privacy requests |
|
||||
| [legal@poli0981.dev](mailto:legal@poli0981.dev) | Terms, licensing and other legal questions |
|
||||
| [copyright@poli0981.dev](mailto:copyright@poli0981.dev) | Copyright and takedown notices |
|
||||
| [code@poli0981.dev](mailto:code@poli0981.dev) | The project and its maintainer; Code of Conduct reports |
|
||||
| [sponsor@poli0981.dev](mailto:sponsor@poli0981.dev) | Sponsorship |
|
||||
|
||||
Bug reports and feature requests belong in [GitHub Issues](https://github.com/poli0981/jsonPrism/issues), not email.
|
||||
Bug reports belong in the [issues on the GitLab mirror](https://gitlab.com/poli0981/jsonPrism/-/issues), not email.
|
||||
|
||||
## Project docs
|
||||
|
||||
@@ -325,6 +361,7 @@ Bug reports and feature requests belong in [GitHub Issues](https://github.com/po
|
||||
| [`PRIVACY.md`](PRIVACY.md) | What stays on your device, and the web-only Cloudflare services (hosting, Turnstile, Web Analytics). |
|
||||
| [`TERMS.md`](TERMS.md) | ToS / EULA — acceptable use, license inheritance, user data ownership. |
|
||||
| [`SECURITY.md`](SECURITY.md) | How to report vulnerabilities; response SLAs. |
|
||||
| [`ACCESSIBILITY.md`](ACCESSIBILITY.md) | Accessibility goals (WCAG 2.2 AA), what's tested, known limitations, how to report a barrier. |
|
||||
| [`DISCLAIMER.md`](DISCLAIMER.md) | One-person + AI-assisted project; no warranty. |
|
||||
| [`THIRD-PARTY.md`](THIRD-PARTY.md) | Every dependency: version, license, link. |
|
||||
| [`MAINTAINERS.md`](MAINTAINERS.md) | Who's responsible for what. |
|
||||
@@ -350,8 +387,8 @@ Hang out, ask questions, or follow updates:
|
||||
|
||||
Substantial parts of JSONPrism's code, tests, translations, and docs
|
||||
were drafted with AI assistance: **Claude Chat** and **Claude Code
|
||||
(Opus 4.7, 1M context)** for v1.x, and **Claude Code (Opus 5.5)** for
|
||||
v2.0.0. See [DISCLAIMER.md](DISCLAIMER.md) for the full AI-assist
|
||||
(Opus 4.7 and 4.8)** for v1.x, and **Claude Code (Opus 5.5)** for
|
||||
v2.x. See [DISCLAIMER.md](DISCLAIMER.md) for the full AI-assist
|
||||
disclosure. The Japanese and Simplified Chinese translations, and parts
|
||||
of the Vietnamese one, are AI-generated and best-effort; contributions
|
||||
from native speakers are welcomed.
|
||||
@@ -359,11 +396,13 @@ from native speakers are welcomed.
|
||||
## Sponsorship
|
||||
|
||||
If JSONPrism is useful to you, consider sponsoring the maintainer,
|
||||
poli0981 (Kokone), via any of the channels in
|
||||
[`.github/FUNDING.yml`](.github/FUNDING.yml): GitHub Sponsors, Ko-fi,
|
||||
Buy Me a Coffee, Patreon, or PayPal. For sponsorship enquiries, email
|
||||
poli0981 (Kokone), via [Ko-fi](https://ko-fi.com/skullmute),
|
||||
[Buy Me a Coffee](https://www.buymeacoffee.com/skullmute),
|
||||
[Patreon](https://patreon.com/skullmute) or
|
||||
[PayPal](https://paypal.me/DungDang212) (the same list as the app's About
|
||||
page). For sponsorship enquiries, email
|
||||
[sponsor@poli0981.dev](mailto:sponsor@poli0981.dev).
|
||||
|
||||
## License
|
||||
|
||||
[Apache License 2.0](LICENSE) — © 2026 [poli0981](https://github.com/poli0981) (Kokone).
|
||||
[Apache License 2.0](LICENSE) — © 2026 [poli0981](https://git.poli0981.dev/poli0981) (Kokone).
|
||||
+79
-40
@@ -6,11 +6,13 @@
|
||||
|
||||
Một JSON đầu vào. Đa định dạng đích. Chạy hoàn toàn trên thiết bị của bạn.
|
||||
|
||||
[](https://github.com/poli0981/jsonPrism/actions/workflows/ci.yml)
|
||||
[](https://sonarcloud.io/summary/new_code?id=poli0981_jsonPrism)
|
||||
[](#trạng-thái-dự-án)
|
||||
[](https://git.poli0981.dev/poli0981/jsonPrism/actions?workflow=ci.yml)
|
||||
[](https://git.poli0981.dev/poli0981/jsonPrism/actions?workflow=security.yml)
|
||||
[](https://git.poli0981.dev/poli0981/jsonPrism/actions?workflow=qodana.yml)
|
||||
[](LICENSE)
|
||||
|
||||
[Ứng dụng web](https://jsonprism.poli0981.dev) · [Tải về](https://github.com/poli0981/jsonPrism/releases/latest) · [English](README.md) · [Lộ trình](docs/ROADMAP.md)
|
||||
[Ứng dụng web](https://jsonprism.poli0981.dev) · [Tải về](https://git.poli0981.dev/poli0981/jsonPrism/releases) · [English](README.md) · [Lộ trình](docs/ROADMAP.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -18,24 +20,41 @@ Một JSON đầu vào. Đa định dạng đích. Chạy hoàn toàn trên thi
|
||||
|
||||
JSONPrism là công cụ "tán sắc" cho developer. Nhận một JSON đầu vào và phân tách ra nhiều định dạng đích — như ánh sáng trắng đi qua lăng kính. **Việc chuyển đổi diễn ra hoàn toàn trên thiết bị của bạn** — trong trình duyệt, app desktop hay app Android — nên dữ liệu không bao giờ rời khỏi máy.
|
||||
|
||||
## Trạng thái dự án
|
||||
|
||||
**Đang ở giai đoạn bảo trì** từ bản 2.2.1 (tháng 11/2026). JSONPrism đã đủ tính năng và vẫn được duy trì:
|
||||
|
||||
- cập nhật thư viện định kỳ; vá nhanh các CVE mức high trở lên và lỗ hổng bảo mật nghiêm trọng của runtime;
|
||||
- nâng cấp lớn ngôn ngữ, runtime, framework (ví dụ Node 24 → 26, TypeScript 6 → 7);
|
||||
- sửa lỗi, lỗi UI/UX và trợ năng (accessibility); thêm hoặc bỏ converter khi thật sự có người cần;
|
||||
- sửa bản dịch: câu chữ không hợp văn hoá hay giọng địa phương, lỗi chính tả dễ gây hiểu nhầm;
|
||||
- thay đổi do Cloudflare hoặc nền tảng Worker bắt buộc, và sự cố website như DDoS hay bot spam.
|
||||
|
||||
Không thêm tính năng mới, trừ trường hợp hiếm thật sự cần thiết. Đề xuất tính năng và merge request ngoài danh sách trên sẽ bị đóng. Chính sách đầy đủ ở [CONTRIBUTING.md](CONTRIBUTING.md#maintenance-mode) (tiếng Anh).
|
||||
|
||||
## Mọi thứ nằm ở đâu
|
||||
|
||||
Mã nguồn: [git.poli0981.dev/poli0981/jsonPrism](https://git.poli0981.dev/poli0981/jsonPrism) (bản gốc). Mirror để mở issue và merge request: [gitlab.com/poli0981/jsonPrism](https://gitlab.com/poli0981/jsonPrism). Patch và câu hỏi: [code@poli0981.dev](mailto:code@poli0981.dev). Bảo mật: [security@poli0981.dev](mailto:security@poli0981.dev) (xem [`SECURITY.md`](SECURITY.md)). Tải về: `releases.poli0981.dev/jsonprism/`, từng file được liệt kê trong [ghi chú phát hành](https://git.poli0981.dev/poli0981/jsonPrism/releases). Repo GitHub đã mất cùng tài khoản (tháng 11/2026); link GitHub cũ không còn dùng được.
|
||||
|
||||
## Định dạng hỗ trợ
|
||||
|
||||
| Định dạng | Phần mở rộng | Trạng thái | Đảo (→ JSON) |
|
||||
| ----------------- | ------------ | -------------- | ------------ |
|
||||
| JSONL | `.jsonl` | ✅ Phase 1 | ✅ |
|
||||
| CSV | `.csv` | ✅ Phase 1 | ✅ |
|
||||
| TSV | `.tsv` | ✅ Phase 1 | ✅ |
|
||||
| YAML | `.yaml` | ✅ Phase 1 | ✅ |
|
||||
| XML | `.xml` | ✅ Phase 2 | — |
|
||||
| TOML | `.toml` | ✅ Phase 2 | ✅ |
|
||||
| Bảng Markdown | `.md` | ✅ Phase 2 | — |
|
||||
| SQL `INSERT` | `.sql` | ✅ Phase 2 | — |
|
||||
| RESX (.NET) | `.resx` | ✅ Phase 3 | ✅ |
|
||||
| BSON | `.bson` | ✅ Phase 4 | — |
|
||||
| CBOR | `.cbor` | ✅ Phase 4 | — |
|
||||
| MessagePack | `.msgpack` | ✅ Phase 4 | — |
|
||||
| Định dạng | Phần mở rộng | Trạng thái | Đảo (→ JSON) |
|
||||
| ------------------- | ----------------- | ---------- | ----------------- |
|
||||
| JSONL | `.jsonl` | ✅ Phase 1 | ✅ |
|
||||
| JSONC (chỉ đầu vào) | `.jsonc`, `.json` | ✅ 2.1.0 | ✅ (chỉ chiều này) |
|
||||
| CSV | `.csv` | ✅ Phase 1 | ✅ |
|
||||
| TSV | `.tsv` | ✅ Phase 1 | ✅ |
|
||||
| YAML | `.yaml` | ✅ Phase 1 | ✅ |
|
||||
| XML | `.xml` | ✅ Phase 2 | — |
|
||||
| TOML | `.toml` | ✅ Phase 2 | ✅ |
|
||||
| Bảng Markdown | `.md` | ✅ Phase 2 | — |
|
||||
| SQL `INSERT` | `.sql` | ✅ Phase 2 | — |
|
||||
| RESX (.NET) | `.resx` | ✅ Phase 3 | ✅ |
|
||||
| BSON | `.bson` | ✅ Phase 4 | — |
|
||||
| CBOR | `.cbor` | ✅ Phase 4 | — |
|
||||
| MessagePack | `.msgpack` | ✅ Phase 4 | — |
|
||||
|
||||
Tổng cộng 12 định dạng. Sáu trong số đó — JSONL, CSV, TSV, YAML, TOML và RESX — còn chuyển ngược được về JSON; ở chiều này app cũng nhận file `.ndjson`, `.tab` và `.yml`. SQL `INSERT` hỗ trợ SQL chuẩn, PostgreSQL, MySQL, SQLite và MSSQL. BSON, CBOR và MessagePack là định dạng nhị phân: panel output hiển thị chúng dưới dạng text base64 hoặc hex, còn file tải về là binary thật.
|
||||
Tổng cộng 12 định dạng đích. Sáu trong số đó — JSONL, CSV, TSV, YAML, TOML và RESX — còn chuyển ngược được về JSON; ở chiều này app cũng nhận file `.ndjson`, `.tab` và `.yml`. **JSONC** (JSON có comment: `tsconfig.json`, settings của VS Code) là định dạng chỉ-đầu-vào: biến file `.jsonc` và `.json` thành JSON thuần, bỏ comment và dấu phẩy thừa nhưng giữ nguyên mọi giá trị, con số và key như bạn viết. Dán JSONC ở chiều JSON → thì app sẽ gợi ý chuyển sang. SQL `INSERT` hỗ trợ SQL chuẩn, PostgreSQL, MySQL, SQLite và MSSQL. BSON, CBOR và MessagePack là định dạng nhị phân: panel output hiển thị chúng dưới dạng text base64 hoặc hex, còn file tải về là binary thật.
|
||||
|
||||
## Tính năng
|
||||
|
||||
@@ -48,7 +67,7 @@ Tổng cộng 12 định dạng. Sáu trong số đó — JSONL, CSV, TSV, YAML,
|
||||
- **Theme sáng, tối hoặc theo hệ thống** — bảng màu Prism Spectrum với violet / cyan / amber / rose trên phong cách "kỹ thuật" với nền lưới kiểu bản vẽ (blueprint). Menu Giao diện còn có tuỳ chọn ẩn thanh cuộn.
|
||||
- **Responsive — tối ưu cho viewport ≥ 360 × 640.** Màn hình nhỏ hơn vẫn dùng được nhưng có thể chật; trên mobile, Input và Output dùng Tabs UI để mỗi panel có toàn bộ chiều cao. Xem [`docs/tested-viewports.md`](docs/tested-viewports.md) cho ma trận thiết bị đã kiểm thử.
|
||||
- **4 ngôn ngữ giao diện** — English, Tiếng Việt, 日本語 và 简体中文. Bản tiếng Nhật và tiếng Trung do AI dịch; rất hoan nghênh người bản ngữ góp ý chỉnh sửa.
|
||||
- **App desktop và Android** — bản Tauri 2 cho Windows, macOS, Linux và Android, có dialog chọn file native và drag-and-drop. Chạy hoàn toàn offline.
|
||||
- **App desktop và Android** — bản Tauri 2 cho Windows, Linux và Android, có dialog chọn file native và drag-and-drop (bản macOS dừng sau 2.2.1). Chạy hoàn toàn offline.
|
||||
|
||||
## Quyền riêng tư
|
||||
|
||||
@@ -61,6 +80,19 @@ Tổng cộng 12 định dạng. Sáu trong số đó — JSONL, CSV, TSV, YAML,
|
||||
|
||||
Chi tiết: [`PRIVACY.md`](PRIVACY.md).
|
||||
|
||||
## Trợ năng (Accessibility)
|
||||
|
||||
JSONPrism hướng tới **WCAG 2.2 AA** trên website lẫn các app:
|
||||
|
||||
- **Bàn phím:** mọi thao tác dùng được chỉ bằng bàn phím, có skip link và chỉ báo focus rõ ràng.
|
||||
- **Trình đọc màn hình:** control có tên, lỗi và thay đổi trạng thái được đọc lên, đủ bốn ngôn ngữ.
|
||||
- **Hiển thị:** theme sáng, tối hoặc theo hệ thống với chữ tương phản từ 4.5:1, hỗ trợ giảm chuyển động và contrast theme của Windows.
|
||||
- **Phóng to:** dùng được trên website, và trong app desktop bằng Ctrl/⌘ + = và −.
|
||||
|
||||
Maintainer kiểm thử bằng Narrator và chỉ dùng bàn phím, mỗi pull request đều chạy bài quét axe-core.
|
||||
|
||||
Hạn chế đã biết và cách báo rào cản: [`ACCESSIBILITY.md`](ACCESSIBILITY.md) ([bản tiếng Việt](docs/i18n/vi/ACCESSIBILITY.md)).
|
||||
|
||||
## Tech stack
|
||||
|
||||
- **Vite 8** + **React 19.3** + **TypeScript 7** (compiler native; dependency `typescript` là alias TS 6, chỉ giữ lại cho typescript-eslint)
|
||||
@@ -71,14 +103,14 @@ Chi tiết: [`PRIVACY.md`](PRIVACY.md).
|
||||
- **Vitest** + Testing Library cho test
|
||||
- **Node.js 26** cho toolchain
|
||||
- **Cloudflare Workers** host bản web (static assets phía sau một Worker nhỏ giới hạn tần suất request và phục vụ `/api/*`)
|
||||
- **Tauri 2.12** cho app desktop (Windows, macOS, Linux) và Android
|
||||
- **Tauri 2.12** cho app desktop (Windows, Linux) và Android
|
||||
|
||||
## Bắt đầu nhanh
|
||||
|
||||
**Yêu cầu**: Node.js **26** (ghim trong `.nvmrc`).
|
||||
|
||||
```bash
|
||||
git clone https://github.com/poli0981/jsonPrism.git
|
||||
git clone https://git.poli0981.dev/poli0981/jsonPrism.git
|
||||
cd jsonPrism
|
||||
nvm use # chọn Node 26 theo .nvmrc
|
||||
npm install
|
||||
@@ -107,7 +139,7 @@ npm run preview:cf # build + wrangler dev tại http://localhost:8
|
||||
| `npm run format:check` | Kiểm tra format (CI dùng cái này) |
|
||||
| `npm test` | Chạy bộ test Vitest một lần |
|
||||
| `npm run test:watch` | Chạy Vitest ở chế độ watch |
|
||||
| `npm run test:coverage` | Chạy test kèm báo cáo coverage (CI dùng cái này) |
|
||||
| `npm run test:coverage` | Chạy test kèm báo cáo coverage |
|
||||
| `npm run cf:types` | Tạo lại type cho các binding của Worker |
|
||||
| `npm run cf:check` | Chạy thử deploy lên Cloudflare (`wrangler deploy --dry-run`; CI cũng chạy) |
|
||||
| `npm run preview:cf` | Build mới rồi chạy site + Worker bằng `wrangler dev` tại http://localhost:8787 |
|
||||
@@ -132,21 +164,23 @@ JSONPrism cũng có bản desktop native qua Tauri 2. App dùng cùng React UI,
|
||||
|
||||
### Tải về (người dùng)
|
||||
|
||||
Tải bundle cho hệ điều hành của bạn từ [bản release mới nhất](https://github.com/poli0981/jsonPrism/releases/latest):
|
||||
Tải bundle cho hệ điều hành của bạn từ [bản release mới nhất](https://git.poli0981.dev/poli0981/jsonPrism/releases): ghi chú phát hành có link tới từng file, lưu tại `https://releases.poli0981.dev/jsonprism/<version>/`.
|
||||
|
||||
| Hệ điều hành | File | Yêu cầu |
|
||||
| --- | --- | --- |
|
||||
| **Windows** | `.msi` hoặc NSIS `-setup.exe` | WebView2 runtime (cài sẵn trên Windows 11) |
|
||||
| **macOS** | `.dmg` universal (Apple Silicon + Intel) | macOS **12** trở lên |
|
||||
| **Linux** | `.deb`, `.rpm` hoặc `.AppImage` | Build trên Ubuntu 22.04 — cần Ubuntu 22.04 hoặc distro mới tương đương |
|
||||
|
||||
Bản desktop chưa được ký số (code signing), nên Windows SmartScreen hoặc macOS Gatekeeper có thể cảnh báo ở lần mở đầu tiên. Từ v2.0.0, mỗi bản release đều kèm `SHA256SUMS.txt` và build-provenance attestation của GitHub để bạn kiểm tra file trước khi chạy:
|
||||
**Không còn bản macOS từ sau 2.2.1.** Từ khi rời GitHub không còn máy build macOS. Máy Mac giữ nguyên bản đang có (`.dmg` của 2.2.1 là bản cuối), và [bản web](https://jsonprism.poli0981.dev) chạy được trên mọi trình duyệt, kể cả offline sau khi đã tải.
|
||||
|
||||
Bản desktop chưa được ký số (code signing), nên Windows SmartScreen có thể cảnh báo ở lần mở đầu tiên. Mỗi bản release đều kèm `SHA256SUMS.txt` cạnh các file để bạn kiểm tra trước khi chạy:
|
||||
|
||||
```bash
|
||||
sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
gh attestation verify <file> --repo poli0981/jsonPrism
|
||||
```
|
||||
|
||||
App không tự cập nhật: tải bản mới bằng tay. Các bản đến 2.2.1 nằm trên GitHub, nay đã mất; bản đã cài vẫn chạy bình thường.
|
||||
|
||||
### Build (lập trình viên)
|
||||
|
||||
**Yêu cầu thêm**:
|
||||
@@ -181,7 +215,7 @@ Output:
|
||||
- macOS → `src-tauri/target/release/bundle/dmg/*.dmg` + `macos/*.app`
|
||||
- Linux → `src-tauri/target/release/bundle/appimage/*.AppImage` + `deb/*.deb` + `rpm/*.rpm`
|
||||
|
||||
**Release tự động**: push tag `v*` sẽ chạy `.github/workflows/release.yml`: kiểm tra tag khớp với version trong `package.json` và `src-tauri/Cargo.toml`, chạy test, build bundle Windows, macOS (universal), Linux cùng APK Android vào **một** draft GitHub release, rồi thêm `SHA256SUMS.txt` và build-provenance attestation. Maintainer sẽ publish draft đó.
|
||||
**Release tự động**: push tag `v*` sẽ chạy `.gitea/workflows/release.yml` trên Gitea Actions: kiểm tra tag khớp với version trong `package.json` và `src-tauri/Cargo.toml`, chạy test, build bundle Windows (trên máy của maintainer), bundle Linux và APK Android, tải chúng cùng `SHA256SUMS.txt` lên `releases.poli0981.dev/jsonprism/<version>/`, rồi mở một draft release trên Gitea có link tới từng file. Maintainer sẽ publish draft đó. Bản build chính thức gồm Windows, Linux và Android; bundle macOS vẫn build được trên máy Mac.
|
||||
|
||||
## Bản Android (Tauri 2)
|
||||
|
||||
@@ -200,8 +234,8 @@ JSONPrism còn có bản Android để bạn sideload từ file `.apk`. Cùng Re
|
||||
|
||||
### Cài đặt (người dùng)
|
||||
|
||||
1. Tải `JSONPrism_<version>_android-universal.apk` từ [bản release mới nhất](https://github.com/poli0981/jsonPrism/releases/latest).
|
||||
2. Nếu muốn, đối chiếu file với `SHA256SUMS.txt` hoặc kiểm tra bằng `gh attestation verify` (xem [Tải về (người dùng)](#tải-về-người-dùng)).
|
||||
1. Tải `JSONPrism_<version>_android-universal.apk` từ [bản release mới nhất](https://git.poli0981.dev/poli0981/jsonPrism/releases), hoặc bản mới nhất qua link cố định [`releases.poli0981.dev/jsonprism/jsonprism-latest.apk`](https://releases.poli0981.dev/jsonprism/jsonprism-latest.apk).
|
||||
2. Nếu muốn, đối chiếu file với `SHA256SUMS.txt` (xem [Tải về (người dùng)](#tải-về-người-dùng)).
|
||||
3. Mở file; Android sẽ hỏi cho phép "cài app không rõ nguồn" cho trình duyệt/trình quản lý file — bật lên rồi cài.
|
||||
4. Cần Android 12+. App chạy hoàn toàn offline.
|
||||
|
||||
@@ -230,7 +264,7 @@ npm run tauri:android:build
|
||||
|
||||
Output: `src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk`. Thông tin ký lấy từ `src-tauri/gen/android/keystore.properties` (gitignored); thiếu file này thì APK build ra chưa ký. Xem [`docs/TAURI-NOTES.md`](docs/TAURI-NOTES.md) để biết cách tạo keystore và các secret ký trong CI.
|
||||
|
||||
**Release tự động**: cùng tag `v*` cũng chạy job `android` trong `release.yml`, ký APK bằng keystore từ repository secrets và đính vào draft release với tên `JSONPrism_<version>_android-universal.apk`.
|
||||
**Release tự động**: cùng tag `v*` cũng chạy job `android` trong `release.yml`, ký APK bằng keystore từ repository secrets, kiểm tra chữ ký, rồi phát hành cùng bundle desktop với tên `JSONPrism_<version>_android-universal.apk` (kèm alias `jsonprism-latest.apk`).
|
||||
|
||||
## Kiến trúc
|
||||
|
||||
@@ -295,28 +329,30 @@ export const myFormatConverter: Converter<MyFormatOptions> = {
|
||||
};
|
||||
```
|
||||
|
||||
Định dạng chỉ-đầu-vào (như JSONC) đặt `meta.inputOnly: true`, cài `reverse()`, còn `convert()` trả lỗi; UI sẽ disable nó ở chiều JSON →.
|
||||
|
||||
Sau đó thêm id vào union `FormatId` trong `src/converters/types.ts`, đăng ký converter trong `src/converters/registry.ts` (`CONVERTERS` và `ALL_FORMATS`), và thêm label key vào cả bốn file trong `src/i18n/locales/` — test parity sẽ fail nếu một ngôn ngữ thiếu key.
|
||||
|
||||
Xem [`docs/ROADMAP.md`](docs/ROADMAP.md) để biết kế hoạch phase đầy đủ.
|
||||
|
||||
## Đóng góp
|
||||
|
||||
Rất hoan nghênh pull request — vui lòng đọc [`CONTRIBUTING.md`](CONTRIBUTING.md) trước. PR thuộc nhóm **auto-ignored** (code đáng ngờ, lan man không vào vấn đề, không mô tả…) sẽ bị đóng không review.
|
||||
Hoan nghênh đóng góp trong phạm vi chính sách bảo trì — vui lòng đọc [`CONTRIBUTING.md`](CONTRIBUTING.md) trước. Repo gốc trên Gitea chỉ đọc với người ngoài: hãy mở merge request trên [mirror GitLab](https://gitlab.com/poli0981/jsonPrism), hoặc gửi patch (`git format-patch`) tới [code@poli0981.dev](mailto:code@poli0981.dev). Merge request thuộc nhóm **auto-ignored** (code đáng ngờ, lan man không vào vấn đề, không mô tả…) sẽ bị đóng không review.
|
||||
|
||||
Báo bug hoặc đề xuất tính năng tại [GitHub Issues](https://github.com/poli0981/jsonPrism/issues). Vấn đề bảo mật vui lòng dùng [Security Advisory riêng tư](https://github.com/poli0981/jsonPrism/security/advisories/new).
|
||||
Báo bug qua [issue trên mirror GitLab](https://gitlab.com/poli0981/jsonPrism/-/issues). Vấn đề bảo mật vui lòng gửi email tới [security@poli0981.dev](mailto:security@poli0981.dev), không mở issue công khai.
|
||||
|
||||
## Liên hệ
|
||||
|
||||
| Địa chỉ | Dùng cho |
|
||||
| --- | --- |
|
||||
| [security@poli0981.dev](mailto:security@poli0981.dev) | Báo lỗ hổng bảo mật (ưu tiên dùng [Security Advisory riêng tư](https://github.com/poli0981/jsonPrism/security/advisories/new)) |
|
||||
| [security@poli0981.dev](mailto:security@poli0981.dev) | Báo lỗ hổng bảo mật (xem [`SECURITY.md`](SECURITY.md)) |
|
||||
| [privacy@poli0981.dev](mailto:privacy@poli0981.dev) | Yêu cầu liên quan đến quyền riêng tư |
|
||||
| [legal@poli0981.dev](mailto:legal@poli0981.dev) | Điều khoản, giấy phép và các vấn đề pháp lý khác |
|
||||
| [copyright@poli0981.dev](mailto:copyright@poli0981.dev) | Thông báo bản quyền và yêu cầu gỡ bỏ (takedown) |
|
||||
| [code@poli0981.dev](mailto:code@poli0981.dev) | Về project và maintainer; báo cáo vi phạm Quy tắc ứng xử |
|
||||
| [sponsor@poli0981.dev](mailto:sponsor@poli0981.dev) | Tài trợ |
|
||||
|
||||
Báo bug và đề xuất tính năng vui lòng gửi qua [GitHub Issues](https://github.com/poli0981/jsonPrism/issues), không gửi qua email.
|
||||
Báo bug vui lòng gửi qua [issue trên mirror GitLab](https://gitlab.com/poli0981/jsonPrism/-/issues), không gửi qua email.
|
||||
|
||||
## Tài liệu project
|
||||
|
||||
@@ -325,6 +361,7 @@ Báo bug và đề xuất tính năng vui lòng gửi qua [GitHub Issues](https:
|
||||
| [`PRIVACY.md`](PRIVACY.md) | Những gì ở lại trên thiết bị, và các dịch vụ Cloudflare chỉ dùng cho website (hosting, Turnstile, Web Analytics). |
|
||||
| [`TERMS.md`](TERMS.md) | ToS / EULA — acceptable use, kế thừa giấy phép, quyền sở hữu dữ liệu. |
|
||||
| [`SECURITY.md`](SECURITY.md) | Cách report vulnerability, SLA. |
|
||||
| [`ACCESSIBILITY.md`](ACCESSIBILITY.md) · [`docs/i18n/vi/ACCESSIBILITY.md`](docs/i18n/vi/ACCESSIBILITY.md) | Mục tiêu trợ năng (WCAG 2.2 AA), những gì đã kiểm thử, hạn chế đã biết, cách báo rào cản. |
|
||||
| [`DISCLAIMER.md`](DISCLAIMER.md) | Project 1 người + AI-assisted, không bảo hành. |
|
||||
| [`THIRD-PARTY.md`](THIRD-PARTY.md) | Mỗi dependency: version, giấy phép, link. |
|
||||
| [`MAINTAINERS.md`](MAINTAINERS.md) | Ai chịu trách nhiệm gì. |
|
||||
@@ -349,8 +386,8 @@ Trò chuyện, hỏi đáp, hoặc theo dõi cập nhật:
|
||||
## Ghi nhận
|
||||
|
||||
Phần lớn code, test, bản dịch và tài liệu của JSONPrism được draft với
|
||||
sự hỗ trợ của AI: **Claude Chat** và **Claude Code (Opus 4.7, 1M
|
||||
context)** cho v1.x, **Claude Code (Opus 5.5)** cho v2.0.0. Xem
|
||||
sự hỗ trợ của AI: **Claude Chat** và **Claude Code (Opus 4.7 và
|
||||
4.8)** cho v1.x, **Claude Code (Opus 5.5)** cho v2.x. Xem
|
||||
[DISCLAIMER.md](DISCLAIMER.md) để biết chi tiết về AI-assist. Bản dịch
|
||||
tiếng Nhật, tiếng Trung giản thể và một phần bản tiếng Việt do AI tạo,
|
||||
chất lượng ở mức best-effort — rất hoan nghênh đóng góp từ người bản ngữ.
|
||||
@@ -358,11 +395,13 @@ chất lượng ở mức best-effort — rất hoan nghênh đóng góp từ ng
|
||||
## Tài trợ
|
||||
|
||||
Nếu JSONPrism hữu ích cho bạn, hãy cân nhắc tài trợ maintainer
|
||||
poli0981 (Kokone) qua một trong các kênh trong
|
||||
[`.github/FUNDING.yml`](.github/FUNDING.yml): GitHub Sponsors, Ko-fi,
|
||||
Buy Me a Coffee, Patreon hoặc PayPal. Liên hệ về tài trợ qua email
|
||||
poli0981 (Kokone) qua [Ko-fi](https://ko-fi.com/skullmute),
|
||||
[Buy Me a Coffee](https://www.buymeacoffee.com/skullmute),
|
||||
[Patreon](https://patreon.com/skullmute) hoặc
|
||||
[PayPal](https://paypal.me/DungDang212) (cùng danh sách với trang About
|
||||
trong app). Liên hệ về tài trợ qua email
|
||||
[sponsor@poli0981.dev](mailto:sponsor@poli0981.dev).
|
||||
|
||||
## Giấy phép
|
||||
|
||||
[Apache License 2.0](LICENSE) — © 2026 [poli0981](https://github.com/poli0981) (Kokone).
|
||||
[Apache License 2.0](LICENSE) — © 2026 [poli0981](https://git.poli0981.dev/poli0981) (Kokone).
|
||||
+30
-21
@@ -11,22 +11,26 @@ website always runs the latest code on `main`.
|
||||
| 2.x | ✅ |
|
||||
| < 2.0 | ❌ |
|
||||
|
||||
JSONPrism has been in
|
||||
[maintenance mode](CONTRIBUTING.md#maintenance-mode) since 2.2.1. That
|
||||
doesn't change this policy: security fixes keep shipping, and a dependency
|
||||
with a high or critical CVE is fixed as soon as possible.
|
||||
|
||||
## Reporting a vulnerability
|
||||
|
||||
**Please do not open a public GitHub Issue for security reports.**
|
||||
|
||||
Use GitHub's private vulnerability reporting:
|
||||
|
||||
→ <https://github.com/poli0981/jsonPrism/security/advisories/new>
|
||||
|
||||
This reaches the maintainer through a private channel. Include a
|
||||
proof of concept, a suggested fix if you have one, and your preferred
|
||||
disclosure timeline.
|
||||
|
||||
If you cannot use GitHub, email **security@poli0981.dev**. The same
|
||||
contacts are published in
|
||||
Email **security@poli0981.dev**. Include a proof of concept, a suggested
|
||||
fix if you have one, and your preferred disclosure timeline. The same
|
||||
contact is published in
|
||||
[`/.well-known/security.txt`](https://jsonprism.poli0981.dev/.well-known/security.txt).
|
||||
|
||||
**Do not open a public issue for security reports**, on the GitLab mirror
|
||||
(where public issues go) or anywhere else. A report that arrives as a
|
||||
public issue is made confidential and continued by e-mail.
|
||||
|
||||
The repository moved from GitHub to
|
||||
[git.poli0981.dev](https://git.poli0981.dev/poli0981/jsonPrism) in
|
||||
November 2026; GitHub's private vulnerability reporting went with it.
|
||||
|
||||
## Response expectations
|
||||
|
||||
JSONPrism is a one-person open-source project (see
|
||||
@@ -57,12 +61,12 @@ In scope:
|
||||
headers), `public/_redirects`, `wrangler.jsonc`.
|
||||
- `src-tauri/` — the Rust shell, capabilities, file-system scope and CSP.
|
||||
- Build and release tooling whose output ships to users: the website
|
||||
build, Tauri release artifacts and `.github/workflows/`.
|
||||
build, Tauri release artifacts and `.gitea/workflows/`.
|
||||
|
||||
Out of scope:
|
||||
|
||||
- Cloudflare, GitHub Pages or GitHub Actions platform issues — report them
|
||||
to Cloudflare or GitHub.
|
||||
- Cloudflare (Workers, R2), Gitea or GitLab platform issues — report them
|
||||
to their vendors.
|
||||
- WebView2 / WebKitGTK / WKWebView / Android System WebView bugs — report
|
||||
them to their vendors. JSONPrism uses whatever is installed on the
|
||||
user's system.
|
||||
@@ -73,19 +77,24 @@ Out of scope:
|
||||
|
||||
## Verifying releases
|
||||
|
||||
Every GitHub release includes `SHA256SUMS.txt` and build-provenance
|
||||
attestations generated in GitHub Actions:
|
||||
Releases are built by Gitea Actions and published to
|
||||
`https://releases.poli0981.dev/jsonprism/<version>/`, with a
|
||||
`SHA256SUMS.txt` next to the files; the
|
||||
[Gitea release notes](https://git.poli0981.dev/poli0981/jsonPrism/releases)
|
||||
list the same checksums:
|
||||
|
||||
```bash
|
||||
sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
gh attestation verify JSONPrism_2.0.0_x64-setup.exe --repo poli0981/jsonPrism
|
||||
```
|
||||
|
||||
The desktop installers are not yet code-signed, so Windows SmartScreen
|
||||
and macOS Gatekeeper may warn on first launch.
|
||||
Releases up to 2.2.1 also carried GitHub build-provenance attestations;
|
||||
those went with the GitHub account, and the new pipeline has none (there
|
||||
is no OIDC identity on Gitea). The desktop installers are not yet
|
||||
code-signed, so Windows SmartScreen may warn on first launch. The Android
|
||||
APK is signed with the project's release key.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Reporters are credited in the published advisory unless they ask
|
||||
Reporters are credited in the release notes unless they ask
|
||||
otherwise. Contributors of accepted fixes are credited in the release
|
||||
notes.
|
||||
@@ -1,9 +1,11 @@
|
||||
# Terms of Service / EULA
|
||||
|
||||
**Version**: 2.0 · **Effective**: 2026-10-22 · Replaces the terms of 2026-05-13.
|
||||
Edited 2026-11-27: section 2 and section 9 name where the project is now
|
||||
hosted (not a material change).
|
||||
|
||||
JSONPrism is a one-person, AI-assisted open-source project published by
|
||||
poli0981 (Kokone, [@poli0981](https://github.com/poli0981)) under the
|
||||
poli0981 (Kokone, [poli0981](https://git.poli0981.dev/poli0981)) under the
|
||||
[Apache License 2.0](LICENSE). These terms cover the website, the desktop
|
||||
and Android applications, the source repository and associated assets
|
||||
(together, "JSONPrism").
|
||||
@@ -25,16 +27,23 @@ does so on its license page) and again whenever these terms or the
|
||||
You must be at least 13 years old, or the age of digital consent where
|
||||
you live, to use JSONPrism.
|
||||
|
||||
## 2. GitHub Terms of Service
|
||||
## 2. Where the project is hosted
|
||||
|
||||
The repository, issues, discussions, releases and pull requests are
|
||||
hosted on GitHub. Using them means complying with:
|
||||
The source repository and the release notes are hosted on the
|
||||
maintainer's own Gitea server, <https://git.poli0981.dev/poli0981/jsonPrism>,
|
||||
where sign-up is closed. Issues and merge requests from anyone go to the
|
||||
public mirror on GitLab.com, <https://gitlab.com/poli0981/jsonPrism>.
|
||||
Using the mirror means complying with:
|
||||
|
||||
- [GitHub Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service)
|
||||
- [GitHub Acceptable Use Policies](https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies)
|
||||
- [GitHub Privacy Statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement)
|
||||
- [GitLab Website Terms of Use](https://handbook.gitlab.com/handbook/legal/policies/website-terms-of-use/)
|
||||
- [GitLab Acceptable Use Policy](https://handbook.gitlab.com/handbook/legal/acceptable-use-policy/)
|
||||
- [GitLab Privacy Statement](https://about.gitlab.com/privacy/)
|
||||
|
||||
Behaviour that violates GitHub's rules also violates these terms.
|
||||
Behaviour that violates GitLab's rules also violates these terms. The
|
||||
desktop and Android downloads are served by Cloudflare R2 at
|
||||
`releases.poli0981.dev` (see the [Privacy Policy](PRIVACY.md)). Until
|
||||
November 2026 the project lived on GitHub; that account and its
|
||||
releases are gone.
|
||||
|
||||
## 3. License
|
||||
|
||||
@@ -113,9 +122,9 @@ written permission.
|
||||
The website hosts no user content. If you believe material in the
|
||||
repository or the apps infringes your copyright, write to
|
||||
**copyright@poli0981.dev** with the material concerned, the work you
|
||||
claim it infringes and your contact details. Content on GitHub
|
||||
(issues, discussions, pull requests) is also subject to
|
||||
[GitHub's DMCA process](https://docs.github.com/en/site-policy/content-removal-policies/dmca-takedown-policy).
|
||||
claim it infringes and your contact details. Content on the GitLab
|
||||
mirror (issues, merge requests) is also subject to
|
||||
[GitLab's DMCA policy](https://handbook.gitlab.com/handbook/legal/dmca/).
|
||||
|
||||
## 10. Changes
|
||||
|
||||
|
||||
+42
-40
@@ -3,7 +3,7 @@
|
||||
JSONPrism is built on top of open-source libraries. This page lists each
|
||||
direct dependency declared in [`package.json`](package.json) and
|
||||
[`src-tauri/Cargo.toml`](src-tauri/Cargo.toml), the exact version used by
|
||||
**JSONPrism 2.0.0**, the upstream license, and a link to the project. It
|
||||
**JSONPrism 2.3.0**, the upstream license, and a link to the project. It
|
||||
also lists the third-party services the website uses.
|
||||
|
||||
Versions are the ones locked in [`package-lock.json`](package-lock.json)
|
||||
@@ -24,19 +24,19 @@ copyright and license notices. This file is a starting point.
|
||||
|---|---|---|---|
|
||||
| `react` | 19.3.1 | MIT | [react.dev](https://react.dev/) |
|
||||
| `react-dom` | 19.3.1 | MIT | [react.dev](https://react.dev/) |
|
||||
| `react-router` | 8.5.0 | MIT | [reactrouter.com](https://reactrouter.com/) |
|
||||
| `tailwindcss` (devDep) | 4.3.3 | MIT | [tailwindcss.com](https://tailwindcss.com/) |
|
||||
| `react-router` | 8.5.2 | MIT | [reactrouter.com](https://reactrouter.com/) |
|
||||
| `tailwindcss` (devDep) | 4.3.5 | MIT | [tailwindcss.com](https://tailwindcss.com/) |
|
||||
| `tw-animate-css` (devDep) | 1.4.0 | MIT | [github.com/Wombosvideo/tw-animate-css](https://github.com/Wombosvideo/tw-animate-css) |
|
||||
| `tailwind-merge` | 3.7.0 | MIT | [github.com/dcastil/tailwind-merge](https://github.com/dcastil/tailwind-merge) |
|
||||
| `tailwind-merge` | 3.7.1 | MIT | [github.com/dcastil/tailwind-merge](https://github.com/dcastil/tailwind-merge) |
|
||||
| `class-variance-authority` | 0.7.1 | Apache-2.0 | [cva.style](https://cva.style/) |
|
||||
| `clsx` | 2.1.1 | MIT | [github.com/lukeed/clsx](https://github.com/lukeed/clsx) |
|
||||
| `@radix-ui/react-dialog` | 1.3.1 | MIT | [radix-ui.com](https://www.radix-ui.com/) |
|
||||
| `@radix-ui/react-slot` | 1.5.0 | MIT | [radix-ui.com](https://www.radix-ui.com/) |
|
||||
| `@radix-ui/react-switch` | 1.4.1 | MIT | [radix-ui.com](https://www.radix-ui.com/) |
|
||||
| `@radix-ui/react-tabs` | 1.2.1 | MIT | [radix-ui.com](https://www.radix-ui.com/) |
|
||||
| `lucide-react` | 1.61.0 | ISC | [lucide.dev](https://lucide.dev/) |
|
||||
| `lucide-react` | 1.78.0 | ISC | [lucide.dev](https://lucide.dev/) |
|
||||
| `sonner` | 2.0.8 | MIT | [sonner.emilkowal.ski](https://sonner.emilkowal.ski/) |
|
||||
| `react-dropzone` | 20.1.4 | MIT | [react-dropzone.js.org](https://react-dropzone.js.org/) |
|
||||
| `react-dropzone` | 20.2.1 | MIT | [react-dropzone.js.org](https://react-dropzone.js.org/) |
|
||||
|
||||
The component patterns under `src/components/ui/` are generated from
|
||||
**[shadcn/ui](https://ui.shadcn.com/)** (MIT) — copied into the repo, not
|
||||
@@ -57,19 +57,20 @@ build-time packages whose generated CSS ships in the bundle.
|
||||
| `@codemirror/lang-markdown` | 6.5.2 | MIT | [codemirror.net](https://codemirror.net/) |
|
||||
| `@codemirror/lang-sql` | 6.10.0 | MIT | [codemirror.net](https://codemirror.net/) |
|
||||
| `@codemirror/legacy-modes` | 6.5.5 | MIT | [codemirror.net](https://codemirror.net/) |
|
||||
| `@codemirror/lint` | 6.9.7 | MIT | [codemirror.net](https://codemirror.net/) |
|
||||
| `@codemirror/lint` | 6.9.8 | MIT | [codemirror.net](https://codemirror.net/) |
|
||||
| `@lezer/highlight` | 1.2.5 | MIT | [lezer.codemirror.net](https://lezer.codemirror.net/) |
|
||||
|
||||
## Parsers / serialization
|
||||
|
||||
| Package | Version | License | Link |
|
||||
|---|---|---|---|
|
||||
| `papaparse` | 5.7.0 | MIT | [papaparse.com](https://www.papaparse.com/) |
|
||||
| `papaparse` | 5.7.1 | MIT | [papaparse.com](https://www.papaparse.com/) |
|
||||
| `js-yaml` | 5.5.0 | MIT | [github.com/nodeca/js-yaml](https://github.com/nodeca/js-yaml) |
|
||||
| `smol-toml` | 1.9.1 | BSD-3-Clause | [github.com/squirrelchat/smol-toml](https://github.com/squirrelchat/smol-toml) |
|
||||
| `fast-xml-parser` | 5.11.2 | MIT | [github.com/NaturalIntelligence/fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) |
|
||||
| `bson` | 7.3.3 | Apache-2.0 | [github.com/mongodb/js-bson](https://github.com/mongodb/js-bson) |
|
||||
| `cbor-x` | 1.6.8 | MIT | [github.com/kriszyp/cbor-x](https://github.com/kriszyp/cbor-x) |
|
||||
| `fast-xml-parser` | 5.12.1 | MIT | [github.com/NaturalIntelligence/fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) |
|
||||
| `fast-xml-builder` | 1.3.2 | MIT | [github.com/NaturalIntelligence/fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder) |
|
||||
| `bson` | 7.3.4 | Apache-2.0 | [github.com/mongodb/js-bson](https://github.com/mongodb/js-bson) |
|
||||
| `cbor-x` | 1.6.9 | MIT | [github.com/kriszyp/cbor-x](https://github.com/kriszyp/cbor-x) |
|
||||
| `@msgpack/msgpack` | 3.1.3 | ISC | [msgpack.org](https://msgpack.org/) |
|
||||
| `fflate` | 0.8.3 | MIT | [github.com/101arrowz/fflate](https://github.com/101arrowz/fflate) |
|
||||
|
||||
@@ -77,17 +78,17 @@ build-time packages whose generated CSS ships in the bundle.
|
||||
|
||||
| Package | Version | License | Link |
|
||||
|---|---|---|---|
|
||||
| `zustand` | 5.0.16 | MIT | [github.com/pmndrs/zustand](https://github.com/pmndrs/zustand) |
|
||||
| `i18next` | 26.5.5 | MIT | [i18next.com](https://www.i18next.com/) |
|
||||
| `react-i18next` | 17.1.1 | MIT | [react.i18next.com](https://react.i18next.com/) |
|
||||
| `i18next-browser-languagedetector` | 8.2.1 | MIT | [github.com/i18next/i18next-browser-languageDetector](https://github.com/i18next/i18next-browser-languageDetector) |
|
||||
| `zustand` | 5.1.0 | MIT | [github.com/pmndrs/zustand](https://github.com/pmndrs/zustand) |
|
||||
| `i18next` | 27.2.6 | MIT | [i18next.com](https://www.i18next.com/) |
|
||||
| `react-i18next` | 18.0.3 | MIT | [react.i18next.com](https://react.i18next.com/) |
|
||||
| `i18next-browser-languagedetector` | 8.3.1 | MIT | [github.com/i18next/i18next-browser-languageDetector](https://github.com/i18next/i18next-browser-languageDetector) |
|
||||
|
||||
## Cloudflare (web build)
|
||||
|
||||
| Package | Version | License | Link |
|
||||
|---|---|---|---|
|
||||
| `@marsidev/react-turnstile` | 1.6.3 | MIT | [github.com/marsidev/react-turnstile](https://github.com/marsidev/react-turnstile) |
|
||||
| `wrangler` (devDep) | 4.151.3 | MIT OR Apache-2.0 | [github.com/cloudflare/workers-sdk](https://github.com/cloudflare/workers-sdk) |
|
||||
| `wrangler` (devDep) | 4.167.0 | MIT OR Apache-2.0 | [github.com/cloudflare/workers-sdk](https://github.com/cloudflare/workers-sdk) |
|
||||
|
||||
`@marsidev/react-turnstile` renders the Turnstile widget on the website
|
||||
only. `wrangler` runs, type-checks and deploys the Worker in `worker/`.
|
||||
@@ -98,22 +99,22 @@ The services themselves are covered under
|
||||
|
||||
| Package | Version | License | Link |
|
||||
|---|---|---|---|
|
||||
| `@tauri-apps/api` | 2.12.4 | Apache-2.0 OR MIT | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/plugin-dialog` | 2.8.3 | MIT OR Apache-2.0 | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/api` | 2.12.5 | Apache-2.0 OR MIT | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/plugin-dialog` | 2.8.4 | MIT OR Apache-2.0 | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/plugin-fs` | 2.7.1 | MIT OR Apache-2.0 | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/plugin-opener` | 2.7.2 | MIT OR Apache-2.0 | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/cli` (devDep) | 2.12.4 | Apache-2.0 OR MIT | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/plugin-opener` | 2.7.3 | MIT OR Apache-2.0 | [tauri.app](https://tauri.app/) |
|
||||
| `@tauri-apps/cli` (devDep) | 2.12.6 | Apache-2.0 OR MIT | [tauri.app](https://tauri.app/) |
|
||||
|
||||
### Rust crates (`src-tauri/Cargo.lock`)
|
||||
|
||||
| Crate | Version | License | Link |
|
||||
|---|---|---|---|
|
||||
| `tauri` | 2.12.5 | Apache-2.0 OR MIT | [crates.io/crates/tauri](https://crates.io/crates/tauri) |
|
||||
| `tauri` | 2.12.7 | Apache-2.0 OR MIT | [crates.io/crates/tauri](https://crates.io/crates/tauri) |
|
||||
| `tauri-build` (build dependency) | 2.7.4 | Apache-2.0 OR MIT | [crates.io/crates/tauri-build](https://crates.io/crates/tauri-build) |
|
||||
| `tauri-plugin-dialog` | 2.8.3 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-dialog](https://crates.io/crates/tauri-plugin-dialog) |
|
||||
| `tauri-plugin-dialog` | 2.8.4 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-dialog](https://crates.io/crates/tauri-plugin-dialog) |
|
||||
| `tauri-plugin-fs` | 2.7.1 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-fs](https://crates.io/crates/tauri-plugin-fs) |
|
||||
| `tauri-plugin-opener` | 2.7.2 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-opener](https://crates.io/crates/tauri-plugin-opener) |
|
||||
| `tauri-plugin-single-instance` (desktop only) | 2.5.4 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-single-instance](https://crates.io/crates/tauri-plugin-single-instance) |
|
||||
| `tauri-plugin-opener` | 2.7.3 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-opener](https://crates.io/crates/tauri-plugin-opener) |
|
||||
| `tauri-plugin-single-instance` (desktop only) | 2.5.5 | Apache-2.0 OR MIT | [crates.io/crates/tauri-plugin-single-instance](https://crates.io/crates/tauri-plugin-single-instance) |
|
||||
| `serde` | 1.0.229 | MIT OR Apache-2.0 | [serde.rs](https://serde.rs/) |
|
||||
| `serde_json` | 1.0.154 | MIT OR Apache-2.0 | [github.com/serde-rs/json](https://github.com/serde-rs/json) |
|
||||
|
||||
@@ -124,28 +125,29 @@ shipped in the app.
|
||||
|
||||
| Package | Version | License | Link |
|
||||
|---|---|---|---|
|
||||
| `vite` | 8.3.5 | MIT | [vite.dev](https://vite.dev/) |
|
||||
| `@vitejs/plugin-react` | 6.1.2 | MIT | [github.com/vitejs/vite-plugin-react](https://github.com/vitejs/vite-plugin-react) |
|
||||
| `@tailwindcss/vite` | 4.3.3 | MIT | [tailwindcss.com](https://tailwindcss.com/) |
|
||||
| `vite` | 8.3.8 | MIT | [vite.dev](https://vite.dev/) |
|
||||
| `@vitejs/plugin-react` | 6.3.0 | MIT | [github.com/vitejs/vite-plugin-react](https://github.com/vitejs/vite-plugin-react) |
|
||||
| `@tailwindcss/vite` | 4.3.5 | MIT | [tailwindcss.com](https://tailwindcss.com/) |
|
||||
| `@typescript/native` (alias of `typescript@^7`) | 7.0.2 | Apache-2.0 | [typescriptlang.org](https://www.typescriptlang.org/) |
|
||||
| `typescript` (alias of `@typescript/typescript6`, wraps TypeScript 6.0.3) | 6.0.2 | Apache-2.0 | [typescriptlang.org](https://www.typescriptlang.org/) |
|
||||
| `eslint` | 10.13.0 | MIT | [eslint.org](https://eslint.org/) |
|
||||
| `eslint` | 10.15.0 | MIT | [eslint.org](https://eslint.org/) |
|
||||
| `@eslint/js` | 10.0.1 | MIT | [eslint.org](https://eslint.org/) |
|
||||
| `typescript-eslint` | 8.72.0 | MIT | [typescript-eslint.io](https://typescript-eslint.io/) |
|
||||
| `typescript-eslint` | 8.74.0 | MIT | [typescript-eslint.io](https://typescript-eslint.io/) |
|
||||
| `eslint-plugin-react-hooks` | 7.1.1 | MIT | [github.com/facebook/react](https://github.com/facebook/react) |
|
||||
| `eslint-plugin-react-refresh` | 0.5.7 | MIT | [github.com/ArnaudBarre/eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) |
|
||||
| `globals` | 17.13.0 | MIT | [github.com/sindresorhus/globals](https://github.com/sindresorhus/globals) |
|
||||
| `prettier` | 3.9.10 | MIT | [prettier.io](https://prettier.io/) |
|
||||
| `eslint-plugin-react-refresh` | 0.5.8 | MIT | [github.com/ArnaudBarre/eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) |
|
||||
| `globals` | 17.14.0 | MIT | [github.com/sindresorhus/globals](https://github.com/sindresorhus/globals) |
|
||||
| `prettier` | 3.10.1 | MIT | [prettier.io](https://prettier.io/) |
|
||||
| `prettier-plugin-tailwindcss` | 0.8.1 | MIT | [github.com/tailwindlabs/prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) |
|
||||
| `knip` | 6.42.1 | ISC | [knip.dev](https://knip.dev/) |
|
||||
| `vitest` | 5.0.5 | MIT | [vitest.dev](https://vitest.dev/) |
|
||||
| `@vitest/coverage-v8` | 5.0.5 | MIT | [vitest.dev](https://vitest.dev/) |
|
||||
| `jsdom` | 30.1.3 | MIT | [github.com/jsdom/jsdom](https://github.com/jsdom/jsdom) |
|
||||
| `knip` | 6.48.0 | ISC | [knip.dev](https://knip.dev/) |
|
||||
| `vitest` | 5.1.1 | MIT | [vitest.dev](https://vitest.dev/) |
|
||||
| `@vitest/coverage-v8` | 5.1.1 | MIT | [vitest.dev](https://vitest.dev/) |
|
||||
| `jsdom` | 31.0.1 | MIT | [github.com/jsdom/jsdom](https://github.com/jsdom/jsdom) |
|
||||
| `@testing-library/react` | 16.3.3 | MIT | [testing-library.com](https://testing-library.com/) |
|
||||
| `@testing-library/dom` | 10.4.2 | MIT | [testing-library.com](https://testing-library.com/) |
|
||||
| `@testing-library/jest-dom` | 7.0.1 | MIT | [testing-library.com](https://testing-library.com/) |
|
||||
| `@testing-library/user-event` | 14.6.8 | MIT | [testing-library.com](https://testing-library.com/) |
|
||||
| `@types/node` | 26.6.5 | MIT | [github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) |
|
||||
| `@testing-library/jest-dom` | 8.0.0 | MIT | [testing-library.com](https://testing-library.com/) |
|
||||
| `@testing-library/user-event` | 14.6.13 | MIT | [testing-library.com](https://testing-library.com/) |
|
||||
| `axe-core` | 4.14.1 | MPL-2.0 | [github.com/dequelabs/axe-core](https://github.com/dequelabs/axe-core) |
|
||||
| `@types/node` | 26.6.6 | MIT | [github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) |
|
||||
| `@types/papaparse` | 5.5.2 | MIT | [github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) |
|
||||
| `@types/react` | 19.3.0 | MIT | [github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) |
|
||||
| `@types/react-dom` | 19.3.0 | MIT | [github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) |
|
||||
@@ -192,7 +194,7 @@ of the project.
|
||||
Substantial portions of JSONPrism's code, tests, translations, and docs
|
||||
were drafted with AI assistance from Anthropic: **Claude Chat** +
|
||||
**Claude Code** with Claude Opus 4.7 and 4.8 for the 1.x releases, and
|
||||
**Claude Code** with Claude Opus 5.5 for 2.0.0. The Japanese and Simplified
|
||||
**Claude Code** with Claude Opus 5.5 for 2.x. The Japanese and Simplified
|
||||
Chinese translations, and parts of the Vietnamese one, are AI-generated.
|
||||
The maintainer reviews every change before it is merged. See
|
||||
[DISCLAIMER.md](DISCLAIMER.md).
|
||||
|
||||
+161
-109
@@ -8,12 +8,12 @@ in [dev_env.md](dev_env.md), Tauri details in [TAURI-NOTES.md](TAURI-NOTES.md).
|
||||
|
||||
| Task | How |
|
||||
| --- | --- |
|
||||
| Deploy the web app | Merge or push to `main`. Cloudflare Workers Builds deploys it. |
|
||||
| Check a deploy | GitHub Actions → **Production smoke** (runs on every push to `main`). |
|
||||
| Deploy the web app | Merge or push to `main`. The CI workflow's `deploy` job runs `wrangler deploy`. |
|
||||
| Check a deploy | The CI run's `smoke` job (Gitea → Actions → **CI**), or run **Production smoke** by hand. |
|
||||
| Roll back the web app | Dashboard → `jsonprism` Worker → **Deployments**, or `npx wrangler rollback`. |
|
||||
| Preview locally | `npm run preview:cf` → http://localhost:8787 |
|
||||
| Rotate the Turnstile secret | Rotate it on the widget, then update `TURNSTILE_SECRET` on the Worker. |
|
||||
| Ship desktop + Android builds | Bump the versions, push a `vX.Y.Z` tag, publish the draft release. |
|
||||
| Ship desktop + Android builds | Bump the versions, push a signed `vX.Y.Z` tag, publish the draft Gitea release, run **Announce Release to Discord**. |
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -55,57 +55,61 @@ browser ──► jsonprism.poli0981.dev (Cloudflare Worker "jsonprism")
|
||||
- `compatibility_date` is pinned in `wrangler.jsonc`; move it deliberately and
|
||||
test with `npm run preview:cf`.
|
||||
|
||||
## Workers Builds (automatic deploys)
|
||||
## Forge and CI
|
||||
|
||||
Configured in the Cloudflare dashboard (the `jsonprism` Worker →
|
||||
**Settings → Build**), not in the repo:
|
||||
- The repository lives on Gitea, <https://git.poli0981.dev/poli0981/jsonPrism>
|
||||
(canonical), with a push mirror at <https://gitlab.com/poli0981/jsonPrism>
|
||||
for outside issues and merge requests. GitHub (the account, its Actions,
|
||||
Pages and Releases) is gone since November 2026.
|
||||
- CI is **Gitea Actions** (`.gitea/workflows/`). The runner is the
|
||||
maintainer's Windows PC: `windows-latest` jobs run there in host mode,
|
||||
`ubuntu-*` jobs in Docker (`docker.gitea.com/runner-images`). Jobs wait
|
||||
while the PC is off; scheduled workflows run only 13:00–16:00 UTC. The
|
||||
shared rules (runner labels, the ops repo's reusable workflows, cron
|
||||
slots) are in the ops runbook, `docs/GITEA-MIGRATION.md` in
|
||||
`poli0981/.github`.
|
||||
- Dependency updates come from the self-hosted Renovate (`renovate.json`
|
||||
extends `local>poli0981/renovate-config`), daily; majors wait on the
|
||||
Dependency Dashboard issue.
|
||||
|
||||
| Setting | Value |
|
||||
| --- | --- |
|
||||
| Repository | `poli0981/jsonPrism` |
|
||||
| Production branch | `main` |
|
||||
| Build command | `npm run build` (may also be empty) |
|
||||
| Deploy command | `npx wrangler deploy` |
|
||||
| Non-production branch deploy command | `npx wrangler preview` |
|
||||
| Root directory | repository root |
|
||||
| Node.js | 26, from `.nvmrc` or the `NODE_VERSION` build variable |
|
||||
## Deploys (Gitea CI)
|
||||
|
||||
- `wrangler.jsonc` → `build.command` runs `npm run build` before every
|
||||
`wrangler deploy`, `preview` and `dev`, so a deploy works even with no build
|
||||
command in the dashboard (setting one only builds twice).
|
||||
- Workers Builds installs dependencies with `npm clean-install` using its own
|
||||
npm (10.9.2 at the time of writing). The lockfile must stay installable with
|
||||
that npm: a peer-dependency conflict fails the build at the install step
|
||||
(this kept `main` undeployable before 2.0.0).
|
||||
`ci.yml` runs on every push and pull request to `main`. On a push to `main`,
|
||||
after the `web` job passes:
|
||||
|
||||
### Previews (pull requests and other branches)
|
||||
1. **`deploy`** installs from a clean `npm ci` and runs
|
||||
`npx wrangler deploy --message "main <sha>"`; `wrangler.jsonc` →
|
||||
`build.command` runs `npm run build` first. It authenticates with the
|
||||
user-level Actions secrets `CLOUDFLARE_API_TOKEN` (Workers edit) and
|
||||
`CLOUDFLARE_ACCOUNT_ID`, shared by the web repos.
|
||||
2. **`smoke`** calls `production-smoke.yml` with the commit — see
|
||||
[Production smoke](#production-smoke).
|
||||
|
||||
Non-production branches run `npx wrangler preview`, which publishes a
|
||||
[Worker Preview](https://developers.cloudflare.com/workers/previews/) named
|
||||
after the branch (`<branch>-jsonprism.<subdomain>.workers.dev` when workers.dev
|
||||
is enabled) and reports it on the pull request.
|
||||
- The build stamps the short commit (`GITHUB_SHA`, which Gitea Actions sets)
|
||||
into `<meta name="jsonprism-commit">` and the About page; the smoke check
|
||||
uses it to recognise the new deploy.
|
||||
- A failed deploy leaves the previous version live, and the CI run is red
|
||||
(Discord via `notify-ci-failure.yml`).
|
||||
- Changes to `wrangler.jsonc` (route, vars, bindings) apply on the next
|
||||
deploy. `npm run cf:check` (`wrangler deploy --dry-run`) in the `web` job
|
||||
catches config and bundling errors before merge.
|
||||
- **Workers Builds is no longer used**: it pulled from GitHub. Its GitHub
|
||||
connection on the `jsonprism` Worker should stay disconnected in the
|
||||
dashboard (the Worker → **Settings → Build**), so nothing else deploys.
|
||||
It installed with its own npm 10.9.2, which is why the lockfile had to stay
|
||||
installable with that npm; the CI job now uses the npm of `.nvmrc`'s Node.
|
||||
|
||||
- Previews inherit no production vars or bindings. `wrangler.jsonc` → `previews`
|
||||
declares them again: separate rate-limit counters (`namespace_id` 4202, 4204,
|
||||
4206) and an empty `ALLOWED_HOSTNAMES`. Any binding added at the top level needs a
|
||||
preview-safe twin there, or `wrangler preview` fails with "missing a
|
||||
`previews` block".
|
||||
- Previews get no `TURNSTILE_SECRET` (set one with
|
||||
`npx wrangler preview base-config secret put` only if you need the check on
|
||||
previews), and the production sitekey doesn't run on preview hostnames, so
|
||||
the human check reports "unavailable" and testers continue past it. Web
|
||||
Analytics never loads there.
|
||||
### Previews
|
||||
|
||||
- Every push to `main` builds and deploys. No GitHub Action deploys the web
|
||||
app, and GitHub holds no Cloudflare credentials.
|
||||
- The build stamps the short commit (`WORKERS_CI_COMMIT_SHA`) into
|
||||
`<meta name="jsonprism-commit">` and the header's version chip; the smoke
|
||||
workflow uses it to recognise the new deploy.
|
||||
- A failed build leaves the previous version live. Build logs exist only in the
|
||||
dashboard (the Worker's build history).
|
||||
- Changes to `wrangler.jsonc` (route, vars, bindings) apply on the next deploy.
|
||||
CI's `npm run cf:check` (`wrangler deploy --dry-run`) catches config and
|
||||
bundling errors before merge.
|
||||
Workers Builds published a
|
||||
[Worker Preview](https://developers.cloudflare.com/workers/previews/) for each
|
||||
pull request; Gitea CI does not. `npx wrangler preview` still works by hand.
|
||||
Previews inherit no production vars or bindings, so `wrangler.jsonc` →
|
||||
`previews` declares them again: separate rate-limit counters (`namespace_id`
|
||||
4202, 4204, 4206) and an empty `ALLOWED_HOSTNAMES`. Any binding added at the
|
||||
top level needs a preview-safe twin there, or `wrangler preview` fails with
|
||||
"missing a `previews` block". Previews get no `TURNSTILE_SECRET`, so the human
|
||||
check reports "unavailable" there.
|
||||
|
||||
## Custom domain
|
||||
|
||||
@@ -116,7 +120,7 @@ is enabled) and reports it on the pull request.
|
||||
- Changing the hostname touches more than the route. Search the repo for
|
||||
`jsonprism.poli0981.dev` (`wrangler.jsonc` route and `ALLOWED_HOSTNAMES`,
|
||||
`src/lib/analytics.ts`, `src/lib/links.ts`, `index.html`, `public/`,
|
||||
`.github/pages-redirect/`, the workflows, the legal docs), then update the
|
||||
the workflows, the legal docs), then update the
|
||||
Turnstile widget's hostnames and the Web Analytics site in the dashboard.
|
||||
|
||||
## Secrets and variables
|
||||
@@ -216,7 +220,8 @@ Vite copies `public/` into `dist/`; Workers Static Assets applies `_headers` and
|
||||
the console in `npm run preview:cf` afterwards. The desktop CSP is separate
|
||||
(`tauri.conf.json`) and stays free of third-party hosts.
|
||||
- `public/_redirects`: `/jsonPrism` and `/jsonPrism/*` → 301 to the same path
|
||||
without the old GitHub Pages prefix.
|
||||
without the old GitHub Pages prefix (links that were rewritten to the new
|
||||
host keep working; `poli0981.github.io` itself went with the account).
|
||||
- Also in `public/`: `robots.txt`, `sitemap.xml` (update `lastmod` when pages
|
||||
change), `.well-known/security.txt` (**expires 2027-10-01 — renew it before
|
||||
then**), `og-image.png`, and `theme-init.js` (applies the theme before first
|
||||
@@ -243,10 +248,16 @@ Three [Rate Limiting bindings](https://developers.cloudflare.com/workers/runtime
|
||||
gets a JSON 429 `{"ok":false,"error":"rate_limited"}`; both carry
|
||||
`Retry-After: 60` and `Cache-Control: no-store`. The app treats a 429 from
|
||||
the verify endpoint as "check unavailable" and lets the user continue.
|
||||
- Counters live per Cloudflare data centre and update asynchronously, so a
|
||||
burst can overshoot slightly before the 429s start. If the limiter itself
|
||||
fails the request goes through (`ratelimit.error` in the logs): a broken
|
||||
counter must not take the site down.
|
||||
- The limits are approximate. Counts are kept per Cloudflare data centre, and
|
||||
each edge machine checks a locally cached count that syncs in the
|
||||
background. Measured on production (2026-10-27): on one keep-alive
|
||||
connection they hold almost exactly (120 pages, then 429s), but 300
|
||||
requests on fresh parallel connections in 13 s all passed, because they
|
||||
spread over many machines before the counts caught up. They throttle
|
||||
browsers, crawlers and simple scripts; a strict cap would need a Durable
|
||||
Object or a WAF rule (below).
|
||||
- If the limiter itself fails the request goes through (`ratelimit.error` in
|
||||
the logs): a broken counter must not take the site down.
|
||||
- Every request that reaches the Worker is billed as a Worker request,
|
||||
refused ones included. The limits keep floods off the API and slow scrapers;
|
||||
volumetric attacks are Cloudflare's DDoS protection's job, in front of the
|
||||
@@ -258,7 +269,10 @@ Three [Rate Limiting bindings](https://developers.cloudflare.com/workers/runtime
|
||||
`namespace_id` unique within the Cloudflare account.
|
||||
- To see it work locally, run `npm run preview:cf` and then
|
||||
`for i in $(seq 70); do curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8787/api/health; done | sort | uniq -c`
|
||||
— 60 × 200, then 429s for the rest of the minute.
|
||||
— 60 × 200, then 429s for the rest of the minute. Against production, send
|
||||
the burst over one connection so it reaches one machine, e.g.
|
||||
`curl -s -w '%{http_code}\n' $(printf -- '-o /dev/null https://jsonprism.poli0981.dev/api/health %.0s' $(seq 100)) | sort | uniq -c`
|
||||
(this throttles your own address for a minute).
|
||||
|
||||
## Workers Logs
|
||||
|
||||
@@ -292,20 +306,21 @@ npm run preview:cf # wrangler dev (builds first) → http://localh
|
||||
|
||||
## Production smoke
|
||||
|
||||
`.github/workflows/production-smoke.yml` runs on every push to `main` and on
|
||||
demand:
|
||||
`.gitea/workflows/production-smoke.yml` runs after every deploy (called by
|
||||
`ci.yml`'s `smoke` job with the commit) and by hand:
|
||||
|
||||
1. Waits up to 15 minutes for https://jsonprism.poli0981.dev/ to serve
|
||||
`<meta name="jsonprism-commit">` with the pushed commit (skipped on manual
|
||||
runs).
|
||||
`<meta name="jsonprism-commit">` with that commit, three times in a row
|
||||
(skipped on manual runs).
|
||||
2. Checks the CSP, HSTS, `nosniff` and `X-Frame-Options` headers; `/about` → 200
|
||||
(SPA fallback); `/jsonPrism/about` → 301 to `/about`; `/api/health`; the
|
||||
`security.txt` contact; and that `/api/turnstile/verify` answers 403 to a
|
||||
foreign `Origin`.
|
||||
|
||||
Failures reach Discord through `notify-ci-failure.yml`. When the wait step times
|
||||
out, check the build in the Cloudflare dashboard first. Run the workflow by hand
|
||||
after a rollback or a dashboard change.
|
||||
Failures reach Discord through `notify-ci-failure.yml` (as a CI failure, or
|
||||
"Production smoke" for a manual run). When the wait step times out, check the
|
||||
`deploy` job and the Worker's deployments in the Cloudflare dashboard. Run the
|
||||
workflow by hand after a rollback or a dashboard change.
|
||||
|
||||
## Rollback
|
||||
|
||||
@@ -316,34 +331,54 @@ after a rollback or a dashboard change.
|
||||
to the previous version). Needs `npx wrangler login` with access to the
|
||||
account.
|
||||
- A rollback doesn't touch `main`: revert the bad commit too, or the next push
|
||||
deploys it again. Then run **Production smoke** by hand.
|
||||
deploys it again. Then run **Production smoke** by hand (Gitea → Actions).
|
||||
|
||||
## GitHub Pages redirect
|
||||
## Security scans
|
||||
|
||||
- https://poli0981.github.io/jsonPrism/ serves only
|
||||
`.github/pages-redirect/index.html` and `404.html` (identical): a script that
|
||||
drops the `/jsonPrism` prefix and keeps the rest of the path, the query and
|
||||
the hash; a 3-second meta refresh to the home page when JavaScript is off;
|
||||
`noindex`.
|
||||
- Deploy it by hand — Actions → **Pages redirect** → Run workflow — and only
|
||||
after changing `.github/pages-redirect/`. Repository Settings → Pages →
|
||||
Source must stay **GitHub Actions**.
|
||||
- Keep it online: old links in YouTube descriptions, Discord and READMEs point
|
||||
there.
|
||||
`security.yml` ("Security") runs on every push and pull request to `main`,
|
||||
weekly on Friday 13:19 UTC, and by hand:
|
||||
|
||||
## SonarQube Cloud
|
||||
- **workflow-lint**: actionlint + shellcheck (pinned binaries, SHA-256
|
||||
checked; `.github/actionlint.yaml`) and zizmor offline
|
||||
(`.github/zizmor.yml`, hash-locked in `.github/requirements-ci.txt`) on
|
||||
`.gitea/workflows/*.yml`.
|
||||
- **scan**: the ops repo's `security.yml` — gitleaks over the full history
|
||||
(exceptions in `.gitleaksignore`: the public Web Analytics beacon token), Opengrep (SARIF as an artifact),
|
||||
osv-scanner over `package-lock.json` and `src-tauri/Cargo.lock` (dated
|
||||
exceptions in `src-tauri/osv-scanner.toml`) and cargo-deny
|
||||
(`src-tauri/deny.toml`: advisories, licences, crates.io only).
|
||||
|
||||
- Organization `poli0981`, project key `poli0981_jsonPrism`, settings in
|
||||
`sonar-project.properties`.
|
||||
- CI-based analysis: job `sonar` in `ci.yml` runs after `web` with the
|
||||
`SONAR_TOKEN` repository secret and the coverage artifact
|
||||
(`coverage/lcov.info`).
|
||||
- **Automatic Analysis must stay OFF** (SonarQube Cloud → project →
|
||||
Administration → Analysis Method); with it on, the CI scan fails.
|
||||
- Without `SONAR_TOKEN` (Dependabot and fork PRs) the job skips instead of
|
||||
failing. The quality gate is reported, not enforced
|
||||
(`sonar.qualitygate.wait=false`).
|
||||
- CodeQL runs through GitHub's default setup (no workflow file).
|
||||
SonarQube Cloud, CodeQL and Dependabot were GitHub-era tools and are gone;
|
||||
`npm audit` still runs in CI as an advisory step.
|
||||
|
||||
## Qodana
|
||||
|
||||
- Workflow `qodana.yml` ("Qodana") runs on every push to `main`, every pull
|
||||
request to `main`, and by hand, through the ops repo's
|
||||
`reusable-qodana.yml` (the Qodana CLI). Results go to Qodana Cloud (Ultimate
|
||||
licence) and the `qodana-report-typescript` / `qodana-report-rust`
|
||||
artifacts (SARIF and logs); there is no code-scanning UI on Gitea.
|
||||
- **Job `typescript`**: Qodana for JS in native mode on `ubuntu-latest`.
|
||||
- Installs with npm (scripts off); `npm run cf:types` runs first so the
|
||||
Worker's types resolve.
|
||||
- Config `qodana.yaml`, Cloud project `jsonprism-js-ts`, secret
|
||||
`QODANA_TOKEN_TS_JS`.
|
||||
- **Job `rust`**: Qodana for Rust, Early Access, Docker only — it runs on the
|
||||
maintainer's PC (`windows-latest`) in Docker Desktop, as root.
|
||||
- `src-tauri/` is the project directory and the repository root is
|
||||
mounted. The job generates the icons and a stand-in `dist/index.html`
|
||||
first, because `tauri::generate_context!()` needs them.
|
||||
- Config `src-tauri/qodana.yaml` (the dhi.io apt pin for the bootstrap, a
|
||||
25-minute project timeout, the linter's own type/borrow checks off —
|
||||
rustc and clippy are the checkers of record), Cloud project
|
||||
`jsonprism-rust`, secret `QODANA_TOKEN_RUST`.
|
||||
- A job without its token skips (a `tokens` job checks first); runs started by
|
||||
Renovate skip too. Findings are reported, not enforced.
|
||||
- The Qodana Cloud projects' VCS URL should point at
|
||||
`https://git.poli0981.dev/poli0981/jsonPrism.git`.
|
||||
- If the licence lapses, the jobs fail at the licence check, but only in
|
||||
this workflow. Renew the licence, or delete the two secrets so the jobs
|
||||
skip.
|
||||
|
||||
## Releases (desktop + Android)
|
||||
|
||||
@@ -359,37 +394,54 @@ Android builds.
|
||||
- `bundle.android.versionCode` in `src-tauri/tauri.conf.json`:
|
||||
`MAJOR*10000 + MINOR*100 + PATCH` (2.0.0 → 20000).
|
||||
- `CHANGELOG.md`.
|
||||
2. **Tag** the merged commit (signed, like earlier tags) and push the tag:
|
||||
2. **Tag** the merged commit (signed, like earlier tags) and push the tag to
|
||||
Gitea:
|
||||
|
||||
```bash
|
||||
git tag -s vX.Y.Z -m "JSONPrism vX.Y.Z"
|
||||
git push origin vX.Y.Z
|
||||
```
|
||||
|
||||
3. **`release.yml`** checks tag = `package.json` = `Cargo.toml`, runs the
|
||||
tests, creates one draft release, builds Windows (`.msi`, NSIS `.exe`),
|
||||
macOS universal (`.dmg`, `.app.tar.gz`), Linux (`.deb`, `.rpm`, `.AppImage`)
|
||||
and the signed Android APK (`JSONPrism_<version>_android-universal.apk`),
|
||||
then adds `SHA256SUMS.txt` and build-provenance attestations. Details in
|
||||
[TAURI-NOTES.md](TAURI-NOTES.md#release-workflow).
|
||||
4. **Review the draft** (every asset present, notes taken from the changelog),
|
||||
then **Publish**. Publishing triggers `announce-release.yml` (Discord) and
|
||||
`announce-discussion.yml` (Discussions → Announcements).
|
||||
5. **Rebuild a tag**: Actions → **Release Tauri bundles** → Run workflow with
|
||||
the tag. It reuses the draft and refuses once the release is published.
|
||||
3. **`release.yml`** ("Release Tauri bundles") checks tag = `package.json` =
|
||||
`Cargo.toml`, runs the tests, builds Windows (`.msi`, NSIS `.exe`) on the
|
||||
maintainer's PC, Linux (`.deb`, `.rpm`, `.AppImage`) and the signed Android
|
||||
APK, uploads them with `SHA256SUMS.txt` to
|
||||
`https://releases.poli0981.dev/jsonprism/<version>/` (and the
|
||||
`jsonprism-latest.apk` alias), then opens a **draft** Gitea release whose
|
||||
notes link every file. No macOS builds since 2.2.1 (no macOS runner).
|
||||
Details in [TAURI-NOTES.md](TAURI-NOTES.md#release-workflow).
|
||||
4. **Review the draft**: every link answers (`curl -I`), add the highlights
|
||||
from the changelog, then **Publish** in the Gitea UI.
|
||||
5. **Announce**: Actions → **Announce Release to Discord** → Run workflow with
|
||||
the tag. Publishing a draft the job token created starts no workflow on
|
||||
Gitea, so this step is manual. (GitHub Discussions announcements ended
|
||||
with GitHub.)
|
||||
6. **A failed job**: "Re-run failed jobs" on the run (Gitea's artifact service
|
||||
sometimes times out). Files already on R2 are never overwritten
|
||||
(`rclone --immutable`): to ship different files, bump the version.
|
||||
A dry run without a tag: Actions → **Release Tauri bundles** → Run
|
||||
workflow on a branch; it builds everything and uploads nothing.
|
||||
|
||||
The bundles are not code-signed yet, so Windows SmartScreen and macOS
|
||||
Gatekeeper warn on first launch.
|
||||
The bundles are not code-signed yet, so Windows SmartScreen warns on first
|
||||
launch.
|
||||
|
||||
### Repository secrets
|
||||
### Actions secrets (Gitea)
|
||||
|
||||
| Secret | Used by |
|
||||
| --- | --- |
|
||||
| `SONAR_TOKEN` | `ci.yml` (job `sonar`) |
|
||||
| `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_PASSWORD`, `ANDROID_KEY_ALIAS` | `release.yml` (job `android`) — see [TAURI-NOTES.md](TAURI-NOTES.md#ci-signing-secrets) |
|
||||
| `DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_PING_ROLE_ID` | `announce-release.yml` |
|
||||
| `DISCORD_CI_WEBHOOK` | `notify-ci-failure.yml` (CI and Production smoke failures) |
|
||||
| `DISCORD_RELEASE_PIPELINE_WEBHOOK` | `notify-release-pipeline.yml` |
|
||||
| Secret | Level | Used by |
|
||||
| --- | --- | --- |
|
||||
| `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` | user (shared) | `ci.yml` (job `deploy`) |
|
||||
| `R2_RELEASES_ACCESS_KEY_ID`, `R2_RELEASES_SECRET_ACCESS_KEY` + variable `R2_ACCOUNT_ID` | user (shared) | `release.yml` (job `publish`, the ops `publish-r2.yml`) |
|
||||
| `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_PASSWORD`, `ANDROID_KEY_ALIAS` | repository | `release.yml` (job `android`) — see [TAURI-NOTES.md](TAURI-NOTES.md#ci-signing-secrets) |
|
||||
| `QODANA_TOKEN_TS_JS`, `QODANA_TOKEN_RUST` | repository | `qodana.yml` |
|
||||
| `DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_PING_ROLE_ID` | repository / user | `announce-release.yml` |
|
||||
| `DISCORD_CI_WEBHOOK` | repository / user | `notify-ci-failure.yml` (CI, Production smoke, Security and Qodana failures on `main`) |
|
||||
| `DISCORD_RELEASE_PIPELINE_WEBHOOK` | repository / user | `notify-release-pipeline.yml` |
|
||||
|
||||
The Discord workflows call reusable workflows from `poli0981/.github`, pinned
|
||||
to a commit, and receive only these secrets (no `secrets: inherit`).
|
||||
Release credentials are only used by jobs a tag push or a manual dispatch
|
||||
starts, never by pull requests or schedules.
|
||||
|
||||
The Discord, Qodana, security and R2 workflows call reusable workflows from
|
||||
`poli0981/.github` on Gitea, pinned to the commit of an ops tag (`ops_ref`
|
||||
for the notifiers' script), and receive only the secrets they name (no
|
||||
`secrets: inherit`). Renovate does not bump those pins: update them by hand
|
||||
when the ops repo is tagged.
|
||||
+117
-6
@@ -4,7 +4,9 @@ This document is the **single source of truth** for what's done, what's next, an
|
||||
|
||||
Update it as work lands — keep the project status honest.
|
||||
|
||||
**Current release: v2.0.2 (2026-10-27).** The web app runs at https://jsonprism.poli0981.dev (Cloudflare Workers); desktop and Android builds are on [GitHub Releases](https://github.com/poli0981/jsonPrism/releases).
|
||||
**Status: maintenance mode since v2.2.1 (2026-11-16).** No new features; see [Phase 11](#phase-11--maintenance-mode-) for what is still done.
|
||||
|
||||
**Current release: v2.3.0 (2026-11-27).** The web app runs at https://jsonprism.poli0981.dev (Cloudflare Workers); desktop and Android builds are on `releases.poli0981.dev/jsonprism/`, linked from the [Gitea releases](https://git.poli0981.dev/poli0981/jsonPrism/releases).
|
||||
|
||||
---
|
||||
|
||||
@@ -83,8 +85,8 @@ Goal: make the four working converters production-quality and the UX delightful
|
||||
- [x] Keyboard shortcuts: ⌘/Ctrl+K (clear), ⌘/Ctrl+S (download) — *⌘/Ctrl+K removed in 2.0.0: it clashed with the browser's search shortcut*
|
||||
- [x] Status bar showing: input bytes, output bytes, parse time, shortcut hints
|
||||
- [x] Shape detection hint (scalar / object / array / flat-object / array-of-objects)
|
||||
- [x] Disabled-format chips show "P2"/"P3" badge with tooltip
|
||||
- [x] Cmd/Ctrl+, to open settings — *deferred at the time; added in a later 1.x release*
|
||||
- [x] Disabled-format chips show "P2"/"P3" badge with tooltip — *badges retired once every format shipped; a disabled chip now explains why in its tooltip*
|
||||
- [x] Cmd/Ctrl+, to open settings — *deferred at the time; added in 2.0.0*
|
||||
|
||||
### Deliverable
|
||||
|
||||
@@ -178,7 +180,7 @@ Split into three sub-phases for digestibility.
|
||||
|
||||
8/9 formats production-ready. Batch up to 500 files. Desktop builds for Windows / macOS / Linux. JSONPrism becomes a "real" tool, not just a website.
|
||||
|
||||
**Currently at Phase 2A — only RESX (Phase 3) remains as a stub.**
|
||||
*Written during Phase 2A, when only RESX (Phase 3) was still a stub; Phase 3 has since shipped.*
|
||||
|
||||
---
|
||||
|
||||
@@ -243,7 +245,7 @@ Codebase hygiene plus a small UX addition — no converter behavior changed.
|
||||
|
||||
- [x] Decomposed three oversized components (`BatchPanel`, `ConverterWorkspace`, `InputPanel`) into focused pure utilities, leaf components, and hooks — behavior-preserving, all 193 tests still green.
|
||||
- [x] Integrated `knip` for dead-code analysis: `knip.json` config, `npm run knip` script, and a CI step. Initial sweep removed orphaned code and a phantom dependency.
|
||||
- [x] Scroll-to-top button on the long, scrollbar-hidden About page (respects `prefers-reduced-motion`).
|
||||
- [x] Scroll-to-top button on the long, scrollbar-hidden About page (respects `prefers-reduced-motion`). — *since 2.0.0 the scrollbar shows unless **Appearance → Hide scrollbars** is on; since 2.2.0 the button hands focus back to the page*
|
||||
|
||||
---
|
||||
|
||||
@@ -263,7 +265,7 @@ Compliance + reliability + first-paint performance. No converter behavior change
|
||||
|
||||
## Phase 7 — Android (sideload APK) 🔜
|
||||
|
||||
**Status**: in progress — the APK has shipped with every release since v1.7.0 (2026-06-16); only the real-device checks below remain.
|
||||
**Status**: in progress — the APK has shipped with every release since v1.7.0 (2026-06-16); only the real-device checks below remain, handled as maintenance since 2.2.1.
|
||||
|
||||
Goal: ship JSONPrism as an Android app users sideload from a `.apk`. Same React UI, no behavior change to the converters. **Minimum Android 12 (API 31)** — older devices are blocked by the OS.
|
||||
|
||||
@@ -353,8 +355,116 @@ JSONPrism 2.0.0 on its own domain, with the human check and analytics confined t
|
||||
|
||||
---
|
||||
|
||||
## Phase 9 — 2.1.0: JSONC → JSON ✅
|
||||
|
||||
**Status**: complete (shipped in v2.1.0, 2026-10-29)
|
||||
|
||||
The most common "this isn't valid JSON" paste — config files with comments — now converts in one step.
|
||||
|
||||
- [x] `src/converters/jsonc.ts`: hand-written, no dependency. Comments and trailing commas become spaces at the same offsets (error line/column match the input), `JSON.parse` validates, then a token-level printer lays the result out without building JS values — big integers, number spelling, duplicate and `__proto__` keys survive. Iterative, with an output-size guard for pathological nesting.
|
||||
- [x] Input-only formats: `ConverterMeta.inputOnly`; the chip is disabled in the JSON → direction, switching to JSON → falls back to JSONL, and a stored input-only format opens in → JSON.
|
||||
- [x] Reverse errors carry an optional line/column (`ConversionFailure`), shown like JSON input errors.
|
||||
- [x] JSONC input editor: legacy JSON mode for comment highlighting plus a linter that shares the converter's parser.
|
||||
- [x] JSON → input that is valid JSONC gets a one-click "Convert JSONC → JSON" hint.
|
||||
- [x] Accepts `.jsonc` and `.json` (plus `.txt`) in the single-file and batch flows; strings in all four locales.
|
||||
- [x] 2.1.1 (2026-11-04): every npm, Cargo and GitHub Actions dependency at its latest release within the current majors; `THIRD-PARTY.md` re-synced with the lockfiles
|
||||
|
||||
### Deliverable
|
||||
|
||||
13 chips — 12 target formats plus JSONC as an input. **932 tests in 94 files.**
|
||||
|
||||
---
|
||||
|
||||
## Phase 10 — 2.2.0: Accessibility ✅
|
||||
|
||||
**Status**: complete (shipped in v2.2.0, 2026-11-09)
|
||||
|
||||
The release adds an accessibility statement and fixes the gaps that an audit against WCAG 2.2 AA found. The maintainer's keyboard-only and Narrator pass on 2.1.1 found no blockers; these fixes cover what that pass didn't reach.
|
||||
|
||||
- [x] **Docs and process:**
|
||||
- [`ACCESSIBILITY.md`](../ACCESSIBILITY.md) and its [Vietnamese mirror](i18n/vi/ACCESSIBILITY.md): goals, what works, keyboard reference, tested-with table, supported environments, known limitations, contributor expectations, and reporting with severity levels and response times.
|
||||
- An accessibility issue template and a PR checklist item.
|
||||
- Rules in CONTRIBUTING and CLAUDE.md.
|
||||
- [x] **Focus:**
|
||||
- A skip link.
|
||||
- Focus moves to `<main>` after a navigation and after the consent gate.
|
||||
- Visible focus everywhere: a global `:focus-visible` outline, and inset rings on scroll areas and the editors.
|
||||
- In Windows contrast themes (`forced-colors`), focus, the pressed or selected state, and switches stay visible.
|
||||
- [x] **Input editor:** an "Escape, then Tab" hint (screen-reader description and status bar), and `aria-invalid` with `aria-describedby` pointing at the current error.
|
||||
- [x] **Screen readers:**
|
||||
- Only the status bar's state is a live region.
|
||||
- The language buttons and Copy have names that start with their visible labels.
|
||||
- Download and Options expose `aria-keyshortcuts`.
|
||||
- The unread-output dot has text.
|
||||
- The format-picker sheet has a description.
|
||||
- Loading has `role="status"`.
|
||||
- Back to top hands focus back to the content.
|
||||
- [x] **Translated screen-reader strings:**
|
||||
- the toast close button;
|
||||
- CodeMirror's search, replace, fold and delete announcements;
|
||||
- the Home page title.
|
||||
|
||||
Navigation labels no longer repeat "navigation".
|
||||
- [x] **Desktop apps:** page zoom with Ctrl/⌘ + = and − (`zoomHotkeysEnabled`, with the `core:webview:allow-set-webview-zoom` permission).
|
||||
- [x] **Automated check:** an axe-core scan of every page, the consent gate and each sheet runs in `npm test`. The About page links the statement.
|
||||
|
||||
### Deliverable
|
||||
|
||||
An accessibility statement backed by tests. **949 tests in 95 files.**
|
||||
|
||||
---
|
||||
|
||||
## Phase 11 — Maintenance mode 📋
|
||||
|
||||
**Status**: ongoing since v2.2.1 (2026-11-16)
|
||||
|
||||
JSONPrism is feature-complete. From 2.2.1 on it is maintained, not extended: no new features unless one is judged genuinely necessary. The accepted changes, and how out-of-scope issues and pull requests are closed, are in [CONTRIBUTING.md → Maintenance mode](../CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
What 2.2.1 set up for it:
|
||||
|
||||
- [x] **Policy:**
|
||||
- a status section and badge in both READMEs;
|
||||
- the policy in CONTRIBUTING;
|
||||
- converter and translation issue templates (the feature-request template is gone);
|
||||
- a scope checklist in the pull request template.
|
||||
- [x] **Auto-close:** `maintenance-triage.yml` closes, with a bilingual comment:
|
||||
- feature issues and `feat:` pull requests from outside contributors;
|
||||
- anything the maintainer labels `out-of-scope`.
|
||||
|
||||
*Removed in 2.3.0: Gitea takes no outside issues, and the maintainer closes out-of-scope items on the GitLab mirror by hand.*
|
||||
- [x] **Qodana:** Qodana for JS (native mode) and Qodana for Rust (Early Access) on every push and pull request, reported to Qodana Cloud.
|
||||
- [x] **Dependencies:** every dependency at its latest release, including i18next 27, react-i18next 18 and jsdom 31.
|
||||
|
||||
What 2.3.0 changed: the move from GitHub to Gitea (November 2026, after the GitHub account was lost):
|
||||
|
||||
- [x] **Forge:** the source on [git.poli0981.dev](https://git.poli0981.dev/poli0981/jsonPrism), issues and merge requests on the [GitLab mirror](https://gitlab.com/poli0981/jsonPrism); every link in the app and the docs moved.
|
||||
- [x] **CI and deploys:** Gitea Actions. The web app deploys from the CI `deploy` job (`wrangler deploy`), then the production smoke runs; Workers Builds is no longer used.
|
||||
- [x] **Releases:** Windows, Linux and Android files with `SHA256SUMS.txt` on `releases.poli0981.dev/jsonprism/`, a draft Gitea release with the links. No macOS builds (no macOS runner) and no build-provenance attestations any more.
|
||||
- [x] **Checks:** a Security workflow (actionlint, zizmor, gitleaks, Opengrep, osv-scanner, cargo-deny), Qodana through the ops reusable workflow, Renovate instead of Dependabot. SonarQube Cloud, CodeQL and the auto-close workflow are gone.
|
||||
- [x] **Dependencies:** refreshed within the current majors plus jest-dom 8; the minimatch, `url` and `cookie` advisories are closed.
|
||||
|
||||
Earlier work still open, now handled as maintenance:
|
||||
|
||||
- the Android real-device checks (Phase 7);
|
||||
- the accessibility follow-ups below.
|
||||
|
||||
---
|
||||
|
||||
## Beyond — Ideas (no commitment)
|
||||
|
||||
**Frozen while JSONPrism is in maintenance mode.** An item moves only if it falls under the [maintenance policy](../CONTRIBUTING.md#maintenance-mode), for example a security need or a converter people really need.
|
||||
|
||||
### Accessibility follow-ups
|
||||
|
||||
These are tracked as known limitations in [`ACCESSIBILITY.md`](../ACCESSIBILITY.md#known-limitations).
|
||||
|
||||
- **Non-text contrast:** text-field and switch outlines at 3:1 (WCAG 1.4.11).
|
||||
- **Android:** follow the system font size and allow pinch-zoom in the WebView; a TalkBack pass on a real device.
|
||||
- **More screen readers:** NVDA, VoiceOver and Orca passes, and Windows contrast themes checked on real hardware.
|
||||
- **Layout switch:** keep editor focus and undo history when the layout changes at 768 px.
|
||||
- **New tabs:** announce links that open a new tab or the system browser.
|
||||
- **Long output:** a way to read it in a screen reader's browse mode, such as a plain-text view.
|
||||
|
||||
### Deferred from 2.0.0
|
||||
|
||||
- **Lazy-load non-English locales** — about 20 KB gzip off the first load
|
||||
@@ -365,6 +475,7 @@ JSONPrism 2.0.0 on its own domain, with the human check and analytics confined t
|
||||
- **End-to-end tests** — Playwright (web), tauri-driver (desktop)
|
||||
- **JSON tools** — JSON Schema, JSONPath and diff features
|
||||
- **More formats** — INI, `.env`, Java `.properties`, Excel `.xlsx`
|
||||
- **JSONC as input for every target** — accept comments in the JSON → direction (e.g. `tsconfig.json` straight to YAML) instead of converting to JSON first; changes the strict `parseJsonInput` contract, so it needs its own design
|
||||
- **Streaming NDJSON** for very large files
|
||||
- **Community translation workflow** (ja and zh-CN are AI-translated today)
|
||||
- **Drop the TypeScript 6 alias** once TypeScript 7 ships an API that typescript-eslint supports
|
||||
|
||||
+53
-26
@@ -4,11 +4,12 @@ Operational notes for the desktop and Android builds. Aimed at maintainers, not
|
||||
|
||||
## Versions
|
||||
|
||||
Tauri 2.12: `tauri` 2.12.5, `tauri-plugin-dialog` 2.8, `tauri-plugin-fs` 2.7,
|
||||
Tauri 2.12: `tauri` 2.12.7, `tauri-plugin-dialog` 2.8, `tauri-plugin-fs` 2.7,
|
||||
`tauri-plugin-opener` 2.7 and, on desktop only, `tauri-plugin-single-instance`
|
||||
2.5 (`src-tauri/Cargo.toml` / `Cargo.lock`), with `@tauri-apps/cli` 2.12 and the
|
||||
matching `@tauri-apps/*` npm packages. Dependabot groups each side (npm `tauri`,
|
||||
cargo `tauri`) so the plugin versions move together.
|
||||
matching `@tauri-apps/*` npm packages. Renovate keeps both sides in one pull
|
||||
request ("Tauri (JS + Rust)" in `renovate.json`), so the CLI never sees a
|
||||
major.minor mismatch.
|
||||
|
||||
There is **no os plugin and no shell plugin**. The os plugin was removed in
|
||||
2.0.0; the About page's "Copy diagnostics" gets OS and architecture from the
|
||||
@@ -60,6 +61,7 @@ intentionally narrow (trimmed in 2.0.0):
|
||||
| Permission | Why |
|
||||
| --- | --- |
|
||||
| `core:default` | Tauri's core set (app, event, path, window, webview, …), including the `tauri://drag-drop` events. |
|
||||
| `core:webview:allow-set-webview-zoom` | Page zoom (2.2.0). On macOS and Linux, `zoomHotkeysEnabled` injects a script that zooms with Ctrl/⌘ + = and − through this command. On Windows, WebView2's own zoom controls are used. |
|
||||
| `opener:default` | Opens `https://` and `mailto:` links in the system browser / mail app via `openUrl`. Works on Android, where the shell plugin's `open()` has no URL handler. |
|
||||
| `dialog:allow-open`, `dialog:allow-save` | Native open / save dialogs only — no message, ask or confirm dialogs. |
|
||||
| `fs:default` | The fs plugin's baseline: the app's own data directories; denies the webview data folder. |
|
||||
@@ -100,6 +102,18 @@ default-src 'self'; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'
|
||||
external blocking script rather than an inline one, so neither CSP needs
|
||||
`'unsafe-inline'` for scripts (the reason is spelled out in `index.html`).
|
||||
|
||||
## Page zoom
|
||||
|
||||
`app.windows[0].zoomHotkeysEnabled` is `true` since 2.2.0. It is off by default in Tauri, and before 2.2.0 the desktop apps could only scale with the OS display setting (WCAG 1.4.4 Resize Text).
|
||||
|
||||
| Platform | Behaviour |
|
||||
| --- | --- |
|
||||
| Windows | Sets WebView2's `IsZoomControlEnabled`: Ctrl + = / − and Ctrl + mouse wheel both work. |
|
||||
| macOS, Linux | Tauri injects a script for Ctrl/⌘ + = / −, in 20 % steps from 20 % to 1000 %. It calls `set_webview_zoom`, so it needs the permission above. |
|
||||
| Android | Not supported by Tauri. Pinch-zoom and text size follow the system WebView defaults; see the known limitations in [`ACCESSIBILITY.md`](../ACCESSIBILITY.md#known-limitations). |
|
||||
|
||||
The zoom level isn't saved between launches.
|
||||
|
||||
## Consent gate
|
||||
|
||||
The first-launch Consent Gate (License, Terms, Privacy Policy, Disclaimer)
|
||||
@@ -123,42 +137,55 @@ Turnstile check inside the gate exists only on the web.
|
||||
|
||||
- Windows: MSI (via WiX) + NSIS `.exe`. Tested on Windows 10 22H2 and
|
||||
Windows 11.
|
||||
- macOS: universal (Apple Silicon + Intel) DMG + `.app` (published as
|
||||
`.app.tar.gz`), min version 12.0 (Monterey).
|
||||
- macOS: universal (Apple Silicon + Intel) DMG + `.app`, min version 12.0
|
||||
(Monterey). **Official builds stopped after 2.2.1**: Gitea Actions has no
|
||||
macOS runner (ops migration decision D9). `npm run tauri:build` on a Mac
|
||||
still produces them.
|
||||
- Linux: AppImage, `.deb` and `.rpm`, built on Ubuntu 22.04 to keep the glibc
|
||||
floor low.
|
||||
- Android: one universal APK — see [Android](#android-sideload-apk).
|
||||
|
||||
Bundles are not code-signed yet (`certificateThumbprint` and
|
||||
`signingIdentity` are `null`), so expect Windows SmartScreen and macOS
|
||||
Gatekeeper warnings on first launch. Signing is on the roadmap.
|
||||
`signingIdentity` are `null`), so expect Windows SmartScreen warnings on
|
||||
first launch. Signing is on the roadmap.
|
||||
|
||||
## Release workflow
|
||||
|
||||
`.github/workflows/release.yml` runs on a `v*` tag push, or by hand
|
||||
(`workflow_dispatch`) with an existing tag to rebuild it:
|
||||
`.gitea/workflows/release.yml` (Gitea Actions) runs on a `v*` tag push. Run
|
||||
by hand on a branch ("Run workflow"), it builds everything and keeps the
|
||||
files as the `r2-release` artifact for 7 days, but uploads and releases
|
||||
nothing: a dry run.
|
||||
|
||||
1. **verify** — the tag must look like `vX.Y.Z` and match the `package.json`
|
||||
and `Cargo.toml` versions; then `npm test`.
|
||||
2. **create-release** — creates **one** draft release, or reuses the existing
|
||||
draft; it refuses when the release is already published. (Parallel
|
||||
"find or create" calls used to race and split assets across drafts.)
|
||||
3. **desktop** — matrix: Windows (`windows-latest`), macOS universal
|
||||
(`macos-14`, `--target universal-apple-darwin`), Linux (`ubuntu-22.04`).
|
||||
Each builds with `tauri-apps/tauri-action` v1 and uploads into the draft.
|
||||
4. **android** — Java 17 (Temurin), SDK platform 36 + NDK `27.2.12479018`,
|
||||
Rust Android targets; signs with the release keystore from secrets and
|
||||
uploads `JSONPrism_<version>_android-universal.apk` (1.7.x used
|
||||
`JSONPrism-v<version>-android-universal.apk`).
|
||||
5. **checksums** — downloads every asset, uploads `SHA256SUMS.txt` and creates
|
||||
GitHub build-provenance attestations for each file.
|
||||
1. **verify** — `package.json` and `Cargo.toml` versions agree; on a tag, the
|
||||
tag looks like `vX.Y.Z` and matches them; then `npm test`.
|
||||
2. **windows** — on the maintainer's PC (`windows-latest` is the runner's host
|
||||
mode): `npm run tauri -- build` → MSI + NSIS.
|
||||
3. **linux** — in the runner's `ubuntu-22.04` Docker image (the WebKitGTK
|
||||
packages are installed in the job; `APPIMAGE_EXTRACT_AND_RUN=1` because a
|
||||
container has no FUSE): AppImage, `.deb`, `.rpm`.
|
||||
4. **android** — Java 17 (Temurin), the SDK installed in the job
|
||||
(`setup-android` + `sdkmanager`: platform 36, build-tools 36.1.0, NDK
|
||||
`27.2.12479018`), Rust Android targets; signs with the release keystore
|
||||
from secrets, checks the signature with `apksigner`, and stages
|
||||
`JSONPrism_<version>_android-universal.apk`.
|
||||
5. **assemble** — collects the six files under fixed names, writes
|
||||
`SHA256SUMS.txt`, copies the APK to the `jsonprism-latest.apk` alias and
|
||||
writes the release notes with a link to every file.
|
||||
6. **publish** — the ops repo's `publish-r2.yml` uploads the files to
|
||||
`releases.poli0981.dev/jsonprism/<version>/` (never overwritten), then the
|
||||
alias last.
|
||||
7. **release** — opens a **draft** Gitea release with those notes (no binaries
|
||||
on the forge).
|
||||
|
||||
The maintainer reviews and publishes the draft; publishing triggers the
|
||||
Discord and GitHub Discussions announcements. Anyone can check a download:
|
||||
The maintainer checks the links and publishes the draft, then runs
|
||||
`announce-release.yml` by hand with the tag: publishing a draft that the job
|
||||
token created starts no workflow on Gitea. Releases up to 2.2.1 were built by
|
||||
GitHub Actions (`tauri-action`, a macOS universal job, build-provenance
|
||||
attestations) and published on GitHub, which is gone. Anyone can check a
|
||||
download:
|
||||
|
||||
```bash
|
||||
sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
gh attestation verify <file> --repo poli0981/jsonPrism
|
||||
```
|
||||
|
||||
Every action is pinned to a full commit SHA, checkouts use
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ Two TypeScript packages are installed side by side:
|
||||
The IDE's TS 6 service can disagree with TS 7 on edge cases; trust
|
||||
`npm run typecheck`.
|
||||
- Don't "fix" the alias. It goes once TypeScript 7.1 ships an API that
|
||||
typescript-eslint supports; until then Dependabot ignores `typescript` ≥ 6.1.
|
||||
typescript-eslint supports; until then Renovate keeps `typescript` below 6.1.
|
||||
- TS 7 rules: no `baseUrl` (use `paths`), `types` defaults to `[]` (every
|
||||
tsconfig lists its own), enums and parameter properties are not erasable
|
||||
(`erasableSyntaxOnly`).
|
||||
@@ -106,7 +106,7 @@ selection, signing and the CI secrets are in
|
||||
sorting.
|
||||
- `npm test` — Vitest 5 with two projects: `app` (jsdom) and `worker` (node).
|
||||
- `npm run test:coverage` — the same run with V8 coverage; reports land in
|
||||
`coverage/` (text, HTML and `lcov.info`, which CI passes to SonarQube Cloud).
|
||||
`coverage/` (text, HTML and `lcov.info`).
|
||||
|
||||
## Other tooling on the maintainer's machine
|
||||
|
||||
@@ -127,7 +127,7 @@ the broader dev environment knows what's around:
|
||||
|
||||
```bash
|
||||
# One-time
|
||||
git clone https://github.com/poli0981/jsonPrism.git
|
||||
git clone https://git.poli0981.dev/poli0981/jsonPrism.git
|
||||
cd jsonPrism
|
||||
npm ci
|
||||
cp .dev.vars.example .dev.vars
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
> **Lưu ý:** Đây là bản dịch tiếng Việt chỉ mang tính tham khảo. Nếu có
|
||||
> bất kỳ khác biệt nào giữa bản dịch này và
|
||||
> [bản gốc tiếng Anh](../../../ACCESSIBILITY.md), bản tiếng Anh được ưu
|
||||
> tiên áp dụng.
|
||||
|
||||
# Trợ năng (Accessibility)
|
||||
|
||||
**Rà soát lần cuối**: 2026-11-09 · **Áp dụng cho**: JSONPrism 2.2.x và 2.3.x (website, ứng dụng desktop và Android)
|
||||
|
||||
JSONPrism muốn ai cần chuyển đổi JSON cũng dùng được, bất kể họ dùng
|
||||
thiết bị nhập nào, trình đọc màn hình nào, thiết lập hiển thị hay ngôn
|
||||
ngữ nào. Tài liệu này nêu mục tiêu, những gì đang hoạt động, cách đã kiểm
|
||||
thử, những gì còn chưa ổn và cách báo một rào cản.
|
||||
|
||||
JSONPrism do một người duy trì (xem [DISCLAIMER.md](../../../DISCLAIMER.md)).
|
||||
Đây là nỗ lực thành thật hết mức có thể, không phải kết quả được chứng nhận.
|
||||
|
||||
## Mục tiêu
|
||||
|
||||
- **Đích: [WCAG 2.2](https://www.w3.org/TR/WCAG22/) mức AA.** Website và
|
||||
các ứng dụng dùng chung một giao diện, nên mục tiêu áp dụng cho tất cả.
|
||||
Đây là mục tiêu, không phải tuyên bố đã đạt chuẩn: chưa có đợt audit
|
||||
chính thức nào.
|
||||
- **Ưu tiên, theo thứ tự:**
|
||||
1. Mọi việc đều làm được chỉ bằng bàn phím: chuyển đổi, mở và lưu tệp,
|
||||
chuyển đổi hàng loạt (batch), tuỳ chọn và màn hình đồng ý điều khoản.
|
||||
2. Mọi control đều có tên, vai trò và trạng thái để trình đọc màn hình
|
||||
đọc được, bằng ngôn ngữ của giao diện.
|
||||
3. Nội dung luôn dễ đọc khi tăng độ tương phản, phóng to, dùng theme
|
||||
sáng hoặc tối, giảm chuyển động hoặc bật contrast theme của Windows.
|
||||
- **Lỗi hồi quy về trợ năng là bug.** Chúng được phân loại và sửa như mọi
|
||||
bug khác (xem [Báo lỗi trợ năng](#báo-lỗi-trợ-năng)).
|
||||
|
||||
## Những gì đang hoạt động
|
||||
|
||||
### Bàn phím
|
||||
|
||||
- Mọi phần tử tương tác đều là nút, liên kết hay control form gốc của
|
||||
HTML, hoặc component Radix UI có sẵn hỗ trợ bàn phím. Không phần tử nào
|
||||
có `tabindex` dương.
|
||||
- **Bỏ qua, tới nội dung chính** (skip link) là điểm dừng Tab đầu tiên.
|
||||
Khi bạn chuyển sang trang khác, focus chuyển vào nội dung của trang đó.
|
||||
- Control nào đang có focus cũng hiện chỉ báo focus.
|
||||
- **Hộp thoại và sheet** (Tuỳ chọn, Batch, chọn định dạng):
|
||||
- focus nằm gọn bên trong khi chúng đang mở;
|
||||
- Escape đóng chúng;
|
||||
- sau đó focus quay về nút đã mở chúng.
|
||||
- **Màn hình đồng ý** giữ focus bên trong và phải được trả lời; sau khi
|
||||
bạn đồng ý, focus chuyển vào nội dung trang.
|
||||
- **Ô nhập (editor):** Tab dùng để thụt lề. Để rời khỏi editor, nhấn
|
||||
**Esc rồi Tab** (WCAG 2.1.2). Mô tả cho trình đọc màn hình và thanh
|
||||
trạng thái đều ghi điều này.
|
||||
- Ô kết quả chỉ đọc và các vùng cuộn khác nhận được focus và cuộn bằng
|
||||
phím mũi tên, Page Up/Down.
|
||||
- **Vùng kéo thả có cách tương đương bằng bàn phím:** **Mở** ở ô nhập,
|
||||
**click để duyệt…** trong Batch.
|
||||
|
||||
### Trình đọc màn hình
|
||||
|
||||
- **Cấu trúc trang:**
|
||||
- landmark (banner, điều hướng, nội dung chính, chân trang);
|
||||
- mỗi trang một `h1`;
|
||||
- tiêu đề trang đã dịch cho mọi route.
|
||||
- `<html lang>` theo ngôn ngữ giao diện. Mỗi tên ngôn ngữ trong bộ chuyển
|
||||
ngôn ngữ có `lang` riêng.
|
||||
- **Các editor:**
|
||||
- Cả hai đều có tên, ví dụ "JSON đầu vào" và "Kết quả CSV (chỉ đọc)".
|
||||
- Ô nhập báo nội dung có hợp lệ hay không (`aria-invalid`).
|
||||
- Ô nhập được mô tả bằng thông báo lỗi hiện tại (`aria-describedby`).
|
||||
- **Live region đọc lên:**
|
||||
- lỗi phân tích kèm dòng và cột, và lỗi chuyển đổi (dạng cảnh báo);
|
||||
- trạng thái chuyển đổi, nhưng không đọc số byte hay thời gian;
|
||||
- tiến độ batch và bước xác minh con người;
|
||||
- thông báo mất mạng và trạng thái đang tải trang;
|
||||
- các thông báo (notification).
|
||||
- **Trạng thái và phím tắt:**
|
||||
- Nút bật/tắt có `aria-pressed`.
|
||||
- Lựa chọn theme là radio, các thiết lập bật/tắt là switch.
|
||||
- Phím tắt tải về và mở tuỳ chọn được khai báo bằng `aria-keyshortcuts`.
|
||||
- Icon trang trí được ẩn khỏi công nghệ hỗ trợ, nút chỉ có icon đều có tên.
|
||||
- Các thông báo riêng của editor (tìm kiếm, thay thế, thu gọn) cùng bảng
|
||||
tìm kiếm và bảng lỗi đã được dịch sang cả bốn ngôn ngữ giao diện.
|
||||
|
||||
### Hiển thị
|
||||
|
||||
- **Theme:** sáng, tối và theo hệ thống.
|
||||
- Màu chữ đã được kiểm tra đạt 4.5:1 so với nền ở cả hai theme.
|
||||
- Chỉ báo focus dùng màu ring của theme, tương phản từ 3:1 trở lên.
|
||||
- **Giảm chuyển động:** khi bật `prefers-reduced-motion`, hiệu ứng động và
|
||||
chuyển cảnh bị tắt, nút Về đầu trang nhảy thẳng thay vì cuộn mượt.
|
||||
- **Contrast theme của Windows** (`forced-colors`): focus, nút đang được
|
||||
chọn và switch được vẽ bằng màu hệ thống.
|
||||
- **Không truyền tải ý nghĩa chỉ bằng màu:**
|
||||
- chấm trạng thái luôn đi kèm chữ;
|
||||
- các dòng trong batch có icon và chữ;
|
||||
- chấm báo có kết quả mới trên tab Kết quả (bố cục hẹp) còn kèm chữ "(mới)".
|
||||
- **Vùng chạm** đạt WCAG 2.5.8: tối thiểu 24 × 24 CSS px, hoặc cách nhau
|
||||
đủ để vòng tròn 24 px quanh mỗi vùng không chồng lên vùng bên cạnh.
|
||||
|
||||
### Phóng to và dàn lại bố cục
|
||||
|
||||
- **Website:** phóng to của trình duyệt và tăng cỡ chữ đều dùng được,
|
||||
không bao giờ chặn pinch-zoom.
|
||||
- **Ứng dụng desktop:** từ 2.2.0, Ctrl/⌘ + = và Ctrl/⌘ + − phóng to, thu
|
||||
nhỏ cửa sổ. Trên Windows dùng được cả Ctrl + con lăn chuột.
|
||||
- **Màn hình hẹp:** bố cục dàn lại tới bề rộng 320 CSS px mà không cần
|
||||
cuộn ngang. Bố cục được thiết kế cho 360 × 640 trở lên
|
||||
([các viewport đã kiểm thử](../../tested-viewports.md)).
|
||||
|
||||
### Ngôn ngữ
|
||||
|
||||
Giao diện, kể cả mọi đoạn chữ dành cho trình đọc màn hình, có tiếng Anh,
|
||||
tiếng Việt, tiếng Nhật và tiếng Trung giản thể.
|
||||
|
||||
## Bảng phím tắt
|
||||
|
||||
| Phím | Ở đâu | Tác dụng |
|
||||
| --- | --- | --- |
|
||||
| Tab / Shift+Tab | Mọi nơi | Control tiếp theo / trước đó |
|
||||
| Enter trên **Bỏ qua, tới nội dung chính** | Lần Tab đầu tiên của trang | Nhảy tới nội dung trang |
|
||||
| Ctrl+S (⌘S trên macOS) | Trang chuyển đổi | Tải kết quả về |
|
||||
| Ctrl+, (⌘, trên macOS) | Trang chuyển đổi | Mở Tuỳ chọn |
|
||||
| Esc | Hộp thoại, sheet, menu Giao diện | Đóng, focus quay về nút đã mở |
|
||||
| ↑ ↓ Home End | Menu Giao diện | Di chuyển giữa các mục |
|
||||
| ← → | Tab Đầu vào / Kết quả (màn hình hẹp) | Chuyển tab |
|
||||
| Esc rồi Tab | Ô nhập | Rời editor (chỉ Tab thì thụt lề) |
|
||||
| Ctrl+M (Shift+Alt+M trên macOS) | Ô nhập | Bật/tắt chế độ "Tab chuyển focus" |
|
||||
| Ctrl+] / Ctrl+[ (⌘] / ⌘[) | Ô nhập | Thụt lề / bỏ thụt lề |
|
||||
| Ctrl+F (⌘F), rồi F3 / Shift+F3 | Cả hai editor | Tìm, kết quả tiếp / trước |
|
||||
| Ctrl+Alt+G (⌘⌥G) | Cả hai editor | Đến dòng |
|
||||
| Ctrl+Shift+M (⌘⇧M), F8 | Ô nhập | Mở danh sách lỗi, lỗi tiếp theo |
|
||||
| Alt+T | Mọi nơi | Focus vào thông báo (tạm dừng chúng) |
|
||||
| Ctrl/⌘ + = và − | Ứng dụng desktop | Phóng to / thu nhỏ |
|
||||
|
||||
## Cách kiểm thử
|
||||
|
||||
### Đã kiểm thử với
|
||||
|
||||
| Ngày | Phiên bản | Nền tảng | Cách kiểm | Kết quả |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 2026-11 | 2.1.1 | Windows 11: website trên Edge, Brave và Firefox; ứng dụng Windows (WebView2) | Narrator; chỉ bàn phím, không dùng chuột (maintainer) | Không có lỗi chặn |
|
||||
| 2026-11-09 | 2.2.0 | Chromium (bản development) | Đi bằng bàn phím qua các thay đổi của 2.2.0: skip link, focus sau khi chuyển trang và sau màn hình đồng ý, chỉ báo focus | Đạt |
|
||||
| 2026-11-09 | 2.2.0 | iPhone 14 Pro (máy thật), iOS 26: website production trên Brave và Chrome | Kiểm tra thủ công bằng cảm ứng (maintainer) | Hoạt động đúng |
|
||||
| Mỗi thay đổi | — | jsdom trong CI | [axe-core](https://github.com/dequelabs/axe-core) trên mọi trang, màn hình đồng ý và từng sheet; kiểm tra vai trò và tên bằng Testing Library | Bắt buộc đạt |
|
||||
| 2026-10-22 | 2.0.0 | Giả lập thiết bị trên Chromium, từ 360 × 740 tới 1280 × 800, sáng và tối | Kiểm tra bố cục bằng mắt | Xem [các viewport đã kiểm thử](../../tested-viewports.md) |
|
||||
|
||||
Bài quét tự động chạy không có engine layout thật nên không đo được độ
|
||||
tương phản màu; độ tương phản được kiểm tra thủ công.
|
||||
|
||||
**Chưa kiểm thử** (rất mong nhận báo cáo):
|
||||
|
||||
- **Trình đọc màn hình:** NVDA và JAWS (Windows), VoiceOver (macOS, iOS),
|
||||
TalkBack (Android), Orca (Linux).
|
||||
- **Điều khiển bằng giọng nói:** Dragon, Voice Access.
|
||||
- **Trên thiết bị thật:** contrast theme của Windows, cỡ chữ hệ thống trên
|
||||
Android.
|
||||
|
||||
### Kiểm tra thủ công trước khi phát hành
|
||||
|
||||
1. **Chỉ bàn phím.** Đi qua mọi luồng chính:
|
||||
- chuyển đổi, mở tệp, tải về;
|
||||
- chạy một batch ra tệp `.zip`;
|
||||
- đổi tuỳ chọn, theme và ngôn ngữ;
|
||||
- qua màn hình đồng ý.
|
||||
|
||||
Kiểm tra focus luôn nhìn thấy và không bao giờ bị kẹt.
|
||||
2. **Trình đọc màn hình.** Dùng Narrator, NVDA hoặc VoiceOver cho các
|
||||
luồng trên. Nghe tên, trạng thái, lỗi và trạng thái chuyển đổi.
|
||||
3. **Phóng to.** Kiểm tra ở 200 % và 400 % trong cửa sổ rộng 1280 px, cùng
|
||||
chế độ chỉ phóng to chữ nếu trình duyệt có.
|
||||
4. **Thiết lập hiển thị.** Kiểm tra với contrast theme của Windows, với
|
||||
giảm chuyển động, và ở theme sáng lẫn tối.
|
||||
5. **Quét tự động.** Chạy `npm test`, lệnh này bao gồm bài quét axe-core.
|
||||
|
||||
## Môi trường hỗ trợ
|
||||
|
||||
| Bề mặt | Engine | Công nghệ hỗ trợ đã kiểm |
|
||||
| --- | --- | --- |
|
||||
| Website | Chrome, Edge, Brave, Firefox và Safari bản hiện hành (engine tối thiểu: Chromium 111, WebKit của macOS 12) | Narrator với Edge, Brave và Firefox |
|
||||
| Ứng dụng Windows | Microsoft Edge WebView2 | Narrator |
|
||||
| Ứng dụng macOS (12+, các bản đến 2.2.1) | WKWebView | — |
|
||||
| Ứng dụng Linux (Ubuntu 22.04+) | WebKitGTK | — |
|
||||
| Ứng dụng Android (12+) | Android System WebView, Chromium 111+ | — |
|
||||
|
||||
## Hạn chế đã biết
|
||||
|
||||
Đây là các rào cản đã biết, kèm cách khắc phục tạm nếu có. Chúng được
|
||||
theo dõi trong [`docs/ROADMAP.md`](../../ROADMAP.md).
|
||||
|
||||
1. **Kết quả dài khi trình đọc màn hình ở chế độ duyệt (browse mode).**
|
||||
Editor chỉ giữ trong trang các dòng đang hiển thị, nên con trỏ ảo không
|
||||
đọc được hết một kết quả dài. *Cách khắc phục:* **Sao chép** hoặc **Tải
|
||||
về** kết quả rồi đọc bằng ứng dụng khác.
|
||||
2. **Tab thụt lề trong ô nhập.** *Cách khắc phục:* nhấn Esc rồi Tab; hoặc
|
||||
nhấn Ctrl+M (Shift+Alt+M trên macOS) để Tab chuyển focus.
|
||||
3. **Cửa sổ nhỏ hoặc thấp.**
|
||||
- Khi chiều cao dưới khoảng 600 CSS px, các editor trở nên rất thấp,
|
||||
kể cả khi phóng to 400 % trong cửa sổ rộng 1280 px.
|
||||
- Trên điện thoại, chỉ chiều dọc được hỗ trợ đầy đủ.
|
||||
- Khi bề rộng vượt qua mốc 768 CSS px, ví dụ do phóng to, bố cục chuyển
|
||||
giữa dạng hai cột và dạng tab. Các editor được tạo lại: chữ của bạn
|
||||
vẫn còn, nhưng focus và lịch sử hoàn tác (undo) thì không.
|
||||
|
||||
*Cách khắc phục:* phóng to ở mức 200–300 %.
|
||||
4. **Xác minh con người (chỉ trên website).** Cloudflare Turnstile chạy
|
||||
trong một khung của Cloudflare, nên khả năng truy cập của nó thuộc về
|
||||
Cloudflare. Nếu bước này lỗi hoặc quá 20 giây, nút **Tiếp tục không xác
|
||||
minh** sẽ hiện ra.
|
||||
5. **Thông báo tự đóng sau 4 giây.** Trình đọc màn hình đọc chúng ngay khi
|
||||
xuất hiện. *Cách khắc phục:* rê chuột lên, hoặc nhấn Alt+T để focus và
|
||||
tạm dừng chúng.
|
||||
6. **Tương phản phi văn bản thấp.** Viền ô nhập và switch dưới 3:1
|
||||
(WCAG 1.4.11). Ô nào cũng có nhãn, nhưng đường viền mờ.
|
||||
7. **Định dạng không dùng được.** Lý do một định dạng không dùng được nằm
|
||||
trong tooltip. Trình đọc màn hình nhận được nó dưới dạng mô tả của nút,
|
||||
nhưng người dùng màn hình cảm ứng không xem được.
|
||||
8. **Không báo khi mở tab mới.** Các liên kết mở tab mới, hoặc mở trình
|
||||
duyệt hệ thống từ ứng dụng, không nói điều đó.
|
||||
9. **Ứng dụng desktop.** Cửa sổ nhỏ nhất là 800 × 560. Phóng to trang mới
|
||||
có từ 2.2.0.
|
||||
10. **Ứng dụng Android.** Ứng dụng dùng cách xử lý mặc định của WebView
|
||||
với cỡ chữ hệ thống và pinch-zoom, chưa được kiểm chứng trên thiết bị
|
||||
thật.
|
||||
11. **Bản dịch.** Chữ tiếng Nhật và tiếng Trung, kể cả chữ dành cho trình
|
||||
đọc màn hình, do AI tạo; rất hoan nghênh người bản ngữ sửa.
|
||||
|
||||
## Yêu cầu với người đóng góp
|
||||
|
||||
Người đóng góp kiểm tra các điểm sau với mọi thay đổi giao diện (xem thêm
|
||||
[CONTRIBUTING.md](../../../CONTRIBUTING.md)):
|
||||
|
||||
- **Phần tử.** Dùng phần tử HTML gốc hoặc các component trong
|
||||
`src/components/ui/`. Không gắn click handler cho `div` hay `span`, không
|
||||
dùng `tabindex` dương.
|
||||
- **Tên.** Mọi control đều có tên accessible lấy từ các file locale, đủ cả
|
||||
bốn ngôn ngữ. Nút chỉ có icon có `aria-label`, icon trang trí có
|
||||
`aria-hidden`.
|
||||
- **Focus.**
|
||||
- Không dùng `outline-none` nếu không có thứ thay thế dạng `focus-visible:`.
|
||||
- Vùng cuộn nhận focus phải có `role="region"` và nhãn.
|
||||
- Ngoại lệ duy nhất là phần tử được focus từ code với `tabIndex={-1}`,
|
||||
như `<main>`.
|
||||
- **Chuyển động và màu.** Hiệu ứng động đặt sau `motion-safe:`. Không
|
||||
truyền tải ý nghĩa chỉ bằng màu.
|
||||
- **Thông báo.** Dùng các live region có sẵn, giữ thông báo ngắn gọn.
|
||||
Không đọc lên đoạn chữ thay đổi sau mỗi lần gõ phím.
|
||||
- **Kiểm thử.**
|
||||
- `npm test` phải đạt, kể cả bài quét axe-core trong
|
||||
`src/app/__tests__/a11y.test.tsx`. Mở rộng bài quét khi thêm trang hay
|
||||
hộp thoại mới.
|
||||
- Tự đi bằng bàn phím qua phần mình thay đổi và ghi lại trong merge request.
|
||||
- Kiểm tra nhanh bằng trình đọc màn hình thì càng tốt.
|
||||
- **Tài liệu này.** Cập nhật khi hành vi hoặc một hạn chế đã biết thay đổi.
|
||||
|
||||
## Báo lỗi trợ năng
|
||||
|
||||
Mở issue trên bản mirror GitLab bằng template
|
||||
**[Accessibility](https://gitlab.com/poli0981/jsonPrism/-/issues/new?issuable_template=Accessibility)**, kèm theo:
|
||||
|
||||
- bạn định làm gì và chuyện gì đã xảy ra;
|
||||
- công nghệ hỗ trợ bạn dùng và phiên bản;
|
||||
- phiên bản trình duyệt hoặc ứng dụng, và hệ điều hành.
|
||||
|
||||
Bạn không cần biết nguyên nhân.
|
||||
|
||||
Nếu không thể hoặc không muốn dùng GitLab, hãy email
|
||||
**code@poli0981.dev**, tiêu đề có chữ "Accessibility". Vấn đề bảo mật đi
|
||||
theo [SECURITY.md](../../../SECURITY.md).
|
||||
|
||||
### Mức độ
|
||||
|
||||
| Mức độ | Ý nghĩa | Ví dụ |
|
||||
| --- | --- | --- |
|
||||
| Critical | Chặn một việc chính, không có cách khắc phục | Không thể chuyển đổi, mở, lưu tệp hoặc qua màn hình đồng ý bằng bàn phím hay trình đọc màn hình |
|
||||
| High | Rất khó khăn nhưng có cách khắc phục | Lỗi không bao giờ được đọc lên, nhưng có hiện trong ô kết quả |
|
||||
| Medium | Không nhất quán hoặc gây khó hiểu, nhưng vẫn làm được | Nhãn sai hoặc thiếu; focus rơi vào chỗ lạ |
|
||||
| Low | Phiền nhỏ | Đọc lên quá dài dòng; một gợi ý chưa được dịch |
|
||||
|
||||
### Cách chúng tôi phản hồi
|
||||
|
||||
- Cảm ơn bạn và hỏi lại nếu có gì chưa rõ. Không bao giờ yêu cầu bạn giải
|
||||
thích vì sao bạn cần một tính năng trợ năng.
|
||||
- Gắn nhãn `accessibility`, đặt mức độ, ưu tiên lỗi chặn trước lỗi về
|
||||
hình thức.
|
||||
- Chia sẻ cách khắc phục tạm ngay khi biết.
|
||||
- Khi có bản sửa, nhờ bạn xác nhận nếu bạn sẵn lòng. Các bản sửa được ghi
|
||||
trong [CHANGELOG.md](../../../CHANGELOG.md).
|
||||
|
||||
### Thời gian phản hồi
|
||||
|
||||
Đây là nỗ lực hết mức có thể của một dự án một người:
|
||||
|
||||
| Mức độ | Phản hồi đầu tiên | Phát hành bản sửa |
|
||||
| --- | --- | --- |
|
||||
| Critical | trong vòng 7 ngày | bản patch kế tiếp |
|
||||
| High | trong vòng 14 ngày | bản phát hành kế tiếp |
|
||||
| Medium / Low | trong vòng 30 ngày | khi có thể, thường là bản minor kế tiếp |
|
||||
|
||||
## Trách nhiệm và duy trì
|
||||
|
||||
Kokone ([poli0981](https://git.poli0981.dev/poli0981)), maintainer duy nhất
|
||||
(xem [MAINTAINERS.md](../../../MAINTAINERS.md)), chịu trách nhiệm về trợ
|
||||
năng, gồm:
|
||||
|
||||
- phân loại báo cáo;
|
||||
- theo dõi chúng bằng nhãn `accessibility`;
|
||||
- chạy [bước kiểm tra thủ công](#kiểm-tra-thủ-công-trước-khi-phát-hành)
|
||||
trước khi phát hành;
|
||||
- giữ tài liệu này luôn cập nhật, kể cả ngày rà soát.
|
||||
|
||||
## Góp ý
|
||||
|
||||
Mọi góp ý cho tài liệu này đều được hoan nghênh qua issue hoặc merge request
|
||||
trên bản mirror GitLab.
|
||||
|
||||
Cấu trúc tài liệu theo khuyến nghị của Open Source Guides
|
||||
([Accessibility best practices for your
|
||||
project](https://opensource.guide/accessibility-best-practices-for-your-project/))
|
||||
và [Open Source Accessibility
|
||||
toolkit](https://github.com/open-source-accessibility/accessibility-toolkit).
|
||||
|
||||
[English](../../../ACCESSIBILITY.md)
|
||||
+13
-8
@@ -6,6 +6,8 @@
|
||||
# Chính sách quyền riêng tư
|
||||
|
||||
**Phiên bản**: 2.0 · **Ngày hiệu lực**: 2026-10-22 · Thay thế chính sách ngày 2026-05-13.
|
||||
Sửa ngày 2026-11-27: bản tải về và mã nguồn đã rời GitHub (dòng "Bản tải
|
||||
về và kho mã nguồn"; không phải thay đổi đáng kể).
|
||||
|
||||
## Tóm tắt
|
||||
|
||||
@@ -39,6 +41,7 @@ tư: **privacy@poli0981.dev**.
|
||||
| Trang web | Cloudflare Workers (tệp tĩnh cùng một API nhỏ cho bước xác minh con người) | Dữ liệu yêu cầu HTTP tiêu chuẩn cần thiết để cung cấp trang web; bước xác minh Turnstile; số liệu lượt xem trang ẩn danh nếu tính năng thống kê đang bật. Không bao giờ bao gồm dữ liệu bạn chuyển đổi. |
|
||||
| Ứng dụng Windows, macOS, Linux | Tauri 2, chạy cục bộ | Không có gì được gửi đi từ mã của ứng dụng. Các liên kết bạn nhấp vào sẽ mở trong trình duyệt của bạn. |
|
||||
| Ứng dụng Android | Tauri 2 trong WebView của hệ thống | Không có gì được gửi đi từ mã của ứng dụng. Các liên kết bạn chạm vào sẽ mở trong trình duyệt của bạn. |
|
||||
| Bản tải về và kho mã nguồn | Cloudflare R2 (`releases.poli0981.dev`) phục vụ các tệp ứng dụng; máy chủ Gitea của maintainer (`git.poli0981.dev`) phục vụ mã nguồn và ghi chú phát hành; GitLab.com là bản mirror công khai để mở issue | Dữ liệu yêu cầu HTTP tiêu chuẩn cần thiết để cung cấp tệp hoặc trang. Bản thân JSONPrism không ghi log gì; tài khoản bạn dùng trên GitLab tuân theo tuyên bố quyền riêng tư của GitLab. |
|
||||
|
||||
### Dịch vụ lưu trữ (trang web)
|
||||
|
||||
@@ -47,13 +50,15 @@ Cloudflare, Inc. phục vụ trang web và xử lý dữ liệu mà mọi yêu c
|
||||
tin TLS) để cung cấp các trang và bảo vệ dịch vụ trước hành vi lạm dụng.
|
||||
Phần mã phía máy chủ của riêng JSONPrism chỉ xử lý API xác minh con người
|
||||
(`/api/turnstile/verify`) và một điểm kiểm tra tình trạng hoạt động
|
||||
(health check). Với API đó, phần mã này ghi lại các sự kiện có cấu trúc —
|
||||
kết quả, trạng thái HTTP, mã trung tâm dữ liệu của Cloudflare, thời lượng
|
||||
và mã lỗi Turnstile — vào Cloudflare Workers Logs, được lưu giữ trong 7
|
||||
ngày. Các sự kiện này không bao giờ chứa địa chỉ IP, token Turnstile hay
|
||||
bất cứ nội dung nào bạn chuyển đổi. API này được Cloudflare giới hạn tần
|
||||
suất truy cập (rate limit) theo từng máy khách; JSONPrism không lưu trữ
|
||||
khoá máy khách (client key).
|
||||
(health check), đồng thời tính các yêu cầu tới trang và API vào giới hạn
|
||||
tần suất truy cập (rate limit) theo từng máy khách trước khi phục vụ.
|
||||
Phần mã này ghi lại các sự kiện có cấu trúc — kết quả, trạng thái HTTP,
|
||||
mã trung tâm dữ liệu của Cloudflare, thời lượng, mã lỗi Turnstile và các
|
||||
yêu cầu bị từ chối vì vượt giới hạn — vào Cloudflare Workers Logs, được
|
||||
lưu giữ trong 7 ngày. Các sự kiện này không bao giờ chứa địa chỉ IP, token
|
||||
Turnstile hay bất cứ nội dung nào bạn chuyển đổi. Bộ đếm giới hạn tần
|
||||
suất do Cloudflare lưu giữ, theo khoá là địa chỉ IP của bạn (với IPv6 là
|
||||
mạng /64 của địa chỉ đó); JSONPrism không lưu trữ khoá này.
|
||||
|
||||
### Xác minh con người (trang web)
|
||||
|
||||
@@ -199,4 +204,4 @@ và ứng dụng sẽ yêu cầu bạn chấp nhận lại trước khi bạn ti
|
||||
|
||||
- Quyền riêng tư: privacy@poli0981.dev
|
||||
- Lỗ hổng bảo mật: xem [SECURITY.md](../../../SECURITY.md)
|
||||
- Mọi vấn đề khác: [GitHub Issues](https://github.com/poli0981/jsonPrism/issues)
|
||||
- Mọi vấn đề khác: [issue trên mirror GitLab](https://gitlab.com/poli0981/jsonPrism/-/issues)
|
||||
+20
-10
@@ -6,9 +6,11 @@
|
||||
# Điều khoản dịch vụ / EULA
|
||||
|
||||
**Phiên bản**: 2.0 · **Ngày hiệu lực**: 2026-10-22 · Thay thế các điều khoản ngày 2026-05-13.
|
||||
Sửa ngày 2026-11-27: mục 2 và mục 9 ghi nơi dự án hiện được lưu trữ
|
||||
(không phải thay đổi đáng kể).
|
||||
|
||||
JSONPrism là một dự án mã nguồn mở do một người thực hiện với sự hỗ trợ
|
||||
của AI, được poli0981 (Kokone, [@poli0981](https://github.com/poli0981))
|
||||
của AI, được poli0981 (Kokone, [poli0981](https://git.poli0981.dev/poli0981))
|
||||
phát hành theo [Apache License 2.0](../../../LICENSE). Các điều khoản này
|
||||
áp dụng cho trang web, các ứng dụng desktop và Android, kho mã nguồn và
|
||||
các tài nguyên liên quan (gọi chung là "JSONPrism").
|
||||
@@ -31,16 +33,24 @@ này trong lần khởi chạy đầu tiên (trình cài đặt Windows thực h
|
||||
Bạn phải từ đủ 13 tuổi trở lên, hoặc đã đạt độ tuổi đồng ý kỹ thuật số
|
||||
(age of digital consent) tại nơi bạn sinh sống, để sử dụng JSONPrism.
|
||||
|
||||
## 2. Điều khoản dịch vụ của GitHub
|
||||
## 2. Nơi lưu trữ dự án
|
||||
|
||||
Kho mã nguồn, issue, discussion, bản phát hành (release) và pull request
|
||||
được lưu trữ trên GitHub. Việc sử dụng chúng đồng nghĩa với việc tuân thủ:
|
||||
Kho mã nguồn và ghi chú phát hành (release notes) được lưu trữ trên máy
|
||||
chủ Gitea riêng của maintainer, <https://git.poli0981.dev/poli0981/jsonPrism>,
|
||||
nơi không mở đăng ký tài khoản. Issue và merge request của mọi người được
|
||||
gửi lên bản mirror công khai trên GitLab.com,
|
||||
<https://gitlab.com/poli0981/jsonPrism>. Việc sử dụng bản mirror đồng nghĩa
|
||||
với việc tuân thủ:
|
||||
|
||||
- [Điều khoản dịch vụ của GitHub](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) (GitHub Terms of Service)
|
||||
- [Chính sách sử dụng được chấp nhận của GitHub](https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies) (GitHub Acceptable Use Policies)
|
||||
- [Tuyên bố quyền riêng tư của GitHub](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement) (GitHub Privacy Statement)
|
||||
- [Điều khoản sử dụng website của GitLab](https://handbook.gitlab.com/handbook/legal/policies/website-terms-of-use/) (GitLab Website Terms of Use)
|
||||
- [Chính sách sử dụng được chấp nhận của GitLab](https://handbook.gitlab.com/handbook/legal/acceptable-use-policy/) (GitLab Acceptable Use Policy)
|
||||
- [Tuyên bố quyền riêng tư của GitLab](https://about.gitlab.com/privacy/) (GitLab Privacy Statement)
|
||||
|
||||
Hành vi vi phạm các quy định của GitHub cũng là vi phạm các điều khoản này.
|
||||
Hành vi vi phạm các quy định của GitLab cũng là vi phạm các điều khoản này.
|
||||
Các bản tải về cho desktop và Android được phục vụ bởi Cloudflare R2 tại
|
||||
`releases.poli0981.dev` (xem [Chính sách quyền riêng tư](PRIVACY.md)). Trước
|
||||
tháng 11/2026 dự án nằm trên GitHub; tài khoản đó cùng các bản phát hành
|
||||
trên đó không còn nữa.
|
||||
|
||||
## 3. Giấy phép
|
||||
|
||||
@@ -133,9 +143,9 @@ Trang web không lưu trữ nội dung của người dùng. Nếu bạn cho r
|
||||
trong kho mã nguồn hoặc trong các ứng dụng xâm phạm bản quyền (quyền tác
|
||||
giả) của bạn, hãy gửi email tới **copyright@poli0981.dev**, nêu rõ nội dung
|
||||
liên quan, tác phẩm mà bạn cho rằng bị xâm phạm và thông tin liên hệ của
|
||||
bạn. Nội dung trên GitHub (issue, discussion, pull request) cũng chịu sự
|
||||
bạn. Nội dung trên bản mirror GitLab (issue, merge request) cũng chịu sự
|
||||
điều chỉnh của
|
||||
[quy trình DMCA của GitHub](https://docs.github.com/en/site-policy/content-removal-policies/dmca-takedown-policy).
|
||||
[chính sách DMCA của GitLab](https://handbook.gitlab.com/handbook/legal/dmca/).
|
||||
|
||||
## 10. Thay đổi
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Hai package TypeScript được cài song song:
|
||||
Language service TS 6 trong IDE có thể lệch với TS 7 ở vài trường hợp hiếm;
|
||||
khi đó hãy tin `npm run typecheck`.
|
||||
- Đừng "sửa" alias này. Nó sẽ được gỡ khi TypeScript 7.1 có API mà
|
||||
typescript-eslint hỗ trợ; tới lúc đó Dependabot bỏ qua `typescript` ≥ 6.1.
|
||||
typescript-eslint hỗ trợ; tới lúc đó Renovate giữ `typescript` dưới 6.1.
|
||||
- Quy tắc của TS 7: không còn `baseUrl` (dùng `paths`), `types` mặc định là
|
||||
`[]` (mỗi tsconfig tự khai báo), enum và parameter property không "erasable"
|
||||
(`erasableSyntaxOnly`).
|
||||
@@ -58,7 +58,7 @@ npm run preview:cf # wrangler dev tại http://localhost:8787 (t
|
||||
- `.dev.vars` chứa secret `TURNSTILE_SECRET` của Worker khi chạy local. File
|
||||
này đã được gitignore; tuyệt đối không đưa secret production vào đây.
|
||||
- `npm run preview:cf` phục vụ `dist/` giống hệt production (`_headers`,
|
||||
`_redirects`, SPA fallback) cùng với Worker `/api/*`. Trên localhost app
|
||||
`_redirects`, SPA fallback) phía sau Worker (rate limit, `/api/*`). Trên localhost app
|
||||
dùng sitekey test của Cloudflare, nên bước kiểm tra Turnstile trong Consent
|
||||
Gate tự pass.
|
||||
- `npm run cf:types` — tạo lại `worker-configuration.d.ts` (đã gitignore) sau
|
||||
@@ -108,8 +108,7 @@ Cách chọn NDK, ký APK và các secret của CI nằm trong
|
||||
Tailwind.
|
||||
- `npm test` — Vitest 5 với hai project: `app` (jsdom) và `worker` (node).
|
||||
- `npm run test:coverage` — chạy như `npm test` nhưng đo coverage bằng V8; báo
|
||||
cáo nằm trong `coverage/` (text, HTML và `lcov.info` — file CI gửi lên
|
||||
SonarQube Cloud).
|
||||
cáo nằm trong `coverage/` (text, HTML và `lcov.info`).
|
||||
|
||||
## Tool khác có trên máy maintainer
|
||||
|
||||
@@ -130,7 +129,7 @@ trường tương đương:
|
||||
|
||||
```bash
|
||||
# Một lần
|
||||
git clone https://github.com/poli0981/jsonPrism.git
|
||||
git clone https://git.poli0981.dev/poli0981/jsonPrism.git
|
||||
cd jsonPrism
|
||||
npm ci
|
||||
cp .dev.vars.example .dev.vars
|
||||
|
||||
@@ -10,6 +10,16 @@ Status legend:
|
||||
|
||||
Recommended minimum viewport: **360 × 640**. Phones in landscape orientation are best-effort — see [recommendation](#recommendation).
|
||||
|
||||
## v2.2.0 check (2026-11-09)
|
||||
|
||||
The maintainer checked the production website (https://jsonprism.poli0981.dev) on a real phone.
|
||||
|
||||
| Device | Viewport | Browsers | Status | Notes |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| iPhone 14 Pro (iOS 26) | 393 × 852 | Brave, Chrome | ✅ | Real device; everything works as expected |
|
||||
|
||||
The accessibility checks for this release are recorded in [`ACCESSIBILITY.md` → Tested with](../ACCESSIBILITY.md#tested-with).
|
||||
|
||||
## v2.0.0 check (2026-10-22)
|
||||
|
||||
Chromium device emulation against the production build served by `wrangler dev` (`npm run preview:cf`), in the light and the dark theme at each size.
|
||||
@@ -68,5 +78,11 @@ Also checked in this round:
|
||||
3. Pick a device from the dropdown or set a custom viewport.
|
||||
4. Verify on the Home page: Header navigation visible, Input/Output Tabs accessible, FormatPicker trigger fits, no horizontal scroll on `<body>`.
|
||||
5. Repeat in light and dark (Appearance menu), pass the Consent Gate (the Turnstile test key passes on its own), and check the console for CSP violations.
|
||||
6. Run the accessibility checks in [`ACCESSIBILITY.md` → Manual check before a release](../ACCESSIBILITY.md#manual-check-before-a-release):
|
||||
- keyboard only;
|
||||
- a screen reader;
|
||||
- 200 % and 400 % zoom;
|
||||
- a Windows contrast theme;
|
||||
- reduced motion.
|
||||
|
||||
Test results contributed by the maintainer. PRs welcome to expand the matrix.
|
||||
+3
-3
@@ -18,11 +18,11 @@
|
||||
<title>JSONPrism · Disperse JSON into 12 formats</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="JSONPrism converts JSON to JSONL, CSV, TSV, YAML, XML, TOML, RESX, Markdown, SQL, BSON, CBOR and MessagePack, and six of them back to JSON. Conversion runs on your device; batch up to 500 files."
|
||||
content="JSONPrism converts JSON to JSONL, CSV, TSV, YAML, XML, TOML, RESX, Markdown, SQL, BSON, CBOR and MessagePack, reads six of them back, and turns JSONC (JSON with comments) into plain JSON. Conversion runs on your device; batch up to 500 files."
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content="JSON converter, JSONL, NDJSON, CSV, YAML, XML, TOML, RESX, Markdown table, SQL INSERT, BSON, CBOR, MessagePack, batch, offline"
|
||||
content="JSON converter, JSONC to JSON, JSONL, NDJSON, CSV, YAML, XML, TOML, RESX, Markdown table, SQL INSERT, BSON, CBOR, MessagePack, batch, offline"
|
||||
/>
|
||||
<!-- Updated per route by Layout (useCanonicalUrl). -->
|
||||
<link rel="canonical" href="https://jsonprism.poli0981.dev/" />
|
||||
@@ -33,7 +33,7 @@
|
||||
<meta property="og:title" content="JSONPrism — Disperse JSON into 12 formats" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="A refracting tool for developers: one JSON input, twelve target formats, six of them reversible. Runs on your device."
|
||||
content="A refracting tool for developers: one JSON input, twelve target formats, six of them reversible, plus JSONC to JSON. Runs on your device."
|
||||
/>
|
||||
<meta property="og:url" content="https://jsonprism.poli0981.dev/" />
|
||||
<meta property="og:image" content="https://jsonprism.poli0981.dev/og-image.png" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"entry": ["src/lib/convert-worker.ts"],
|
||||
"project": ["src/**/*.{ts,tsx,css}", "worker/**/*.ts"],
|
||||
"ignore": ["src/components/ui/**"],
|
||||
"ignoreDependencies": ["@radix-ui/react-slot", "@testing-library/user-event"],
|
||||
"ignoreDependencies": ["@radix-ui/react-slot"],
|
||||
"rules": {
|
||||
"types": "off"
|
||||
}
|
||||
|
||||
Generated
+1719
-1346
File diff suppressed because it is too large.
Load diff
+41
-39
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"name": "jsonprism",
|
||||
"private": true,
|
||||
"version": "2.0.2",
|
||||
"version": "2.3.0",
|
||||
"type": "module",
|
||||
"description": "Disperse JSON into 12 formats (six convert back) — JSONL, CSV, TSV, YAML, XML, TOML, RESX, Markdown, SQL, BSON, CBOR, MessagePack. Conversion runs locally in your browser or desktop app.",
|
||||
"author": "poli0981 <code@poli0981.dev> (https://github.com/poli0981)",
|
||||
"description": "Disperse JSON into 12 formats (six convert back, plus JSONC → JSON) — JSONL, CSV, TSV, YAML, XML, TOML, RESX, Markdown, SQL, BSON, CBOR, MessagePack. Conversion runs locally in your browser or desktop app.",
|
||||
"author": "poli0981 <code@poli0981.dev> (https://git.poli0981.dev/poli0981)",
|
||||
"license": "Apache-2.0",
|
||||
"homepage": "https://jsonprism.poli0981.dev",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/poli0981/jsonPrism.git"
|
||||
"url": "https://git.poli0981.dev/poli0981/jsonPrism.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/poli0981/jsonPrism/issues"
|
||||
"url": "https://gitlab.com/poli0981/jsonPrism/-/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=26.0.0"
|
||||
@@ -50,7 +50,7 @@
|
||||
"@codemirror/lang-yaml": "^6.1.3",
|
||||
"@codemirror/language": "^6.13.1",
|
||||
"@codemirror/legacy-modes": "^6.5.5",
|
||||
"@codemirror/lint": "^6.9.7",
|
||||
"@codemirror/lint": "^6.9.8",
|
||||
"@codemirror/state": "^6.7.6",
|
||||
"@codemirror/view": "^6.43.15",
|
||||
"@fontsource-variable/geist": "^5.3.0",
|
||||
@@ -62,61 +62,63 @@
|
||||
"@radix-ui/react-slot": "^1.5.0",
|
||||
"@radix-ui/react-switch": "^1.4.1",
|
||||
"@radix-ui/react-tabs": "^1.2.1",
|
||||
"@tauri-apps/api": "^2.12.4",
|
||||
"@tauri-apps/plugin-dialog": "^2.8.3",
|
||||
"@tauri-apps/api": "^2.12.5",
|
||||
"@tauri-apps/plugin-dialog": "^2.8.4",
|
||||
"@tauri-apps/plugin-fs": "^2.7.1",
|
||||
"@tauri-apps/plugin-opener": "^2.7.2",
|
||||
"@tauri-apps/plugin-opener": "^2.7.3",
|
||||
"@uiw/react-codemirror": "^4.25.12",
|
||||
"bson": "^7.3.3",
|
||||
"cbor-x": "^1.6.8",
|
||||
"bson": "^7.3.4",
|
||||
"cbor-x": "^1.6.9",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"fast-xml-parser": "^5.11.2",
|
||||
"fast-xml-builder": "^1.3.2",
|
||||
"fast-xml-parser": "^5.12.1",
|
||||
"fflate": "^0.8.3",
|
||||
"i18next": "^26.5.6",
|
||||
"i18next-browser-languagedetector": "^8.2.1",
|
||||
"i18next": "^27.2.6",
|
||||
"i18next-browser-languagedetector": "^8.3.1",
|
||||
"js-yaml": "^5.5.0",
|
||||
"lucide-react": "^1.61.0",
|
||||
"papaparse": "^5.7.0",
|
||||
"lucide-react": "^1.78.0",
|
||||
"papaparse": "^5.7.1",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1",
|
||||
"react-dropzone": "^20.1.4",
|
||||
"react-i18next": "^17.1.3",
|
||||
"react-router": "^8.5.0",
|
||||
"react-dropzone": "^20.2.1",
|
||||
"react-i18next": "^18.0.3",
|
||||
"react-router": "^8.5.2",
|
||||
"smol-toml": "^1.9.1",
|
||||
"sonner": "^2.0.8",
|
||||
"tailwind-merge": "^3.7.0",
|
||||
"zustand": "^5.0.16"
|
||||
"tailwind-merge": "^3.7.1",
|
||||
"zustand": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"@tauri-apps/cli": "^2.12.4",
|
||||
"@tailwindcss/vite": "^4.3.5",
|
||||
"@tauri-apps/cli": "^2.12.6",
|
||||
"@testing-library/dom": "^10.4.2",
|
||||
"@testing-library/jest-dom": "^7.0.1",
|
||||
"@testing-library/jest-dom": "^8.0.0",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@testing-library/user-event": "^14.6.8",
|
||||
"@types/node": "^26.6.5",
|
||||
"@testing-library/user-event": "^14.6.13",
|
||||
"@types/node": "^26.6.6",
|
||||
"@types/papaparse": "^5.5.2",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"@typescript/native": "npm:typescript@^7.0.2",
|
||||
"@vitejs/plugin-react": "^6.1.2",
|
||||
"@vitest/coverage-v8": "^5.0.5",
|
||||
"eslint": "^10.13.0",
|
||||
"@vitejs/plugin-react": "^6.3.0",
|
||||
"@vitest/coverage-v8": "^5.1.1",
|
||||
"axe-core": "^4.14.1",
|
||||
"eslint": "^10.15.0",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.7",
|
||||
"globals": "^17.13.0",
|
||||
"jsdom": "^30.1.3",
|
||||
"knip": "^6.42.1",
|
||||
"prettier": "^3.9.10",
|
||||
"eslint-plugin-react-refresh": "^0.5.8",
|
||||
"globals": "^17.14.0",
|
||||
"jsdom": "^31.0.1",
|
||||
"knip": "^6.48.0",
|
||||
"prettier": "^3.10.1",
|
||||
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"tailwindcss": "^4.3.5",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
||||
"typescript-eslint": "^8.72.0",
|
||||
"vite": "^8.3.5",
|
||||
"vitest": "^5.0.5",
|
||||
"wrangler": "^4.152.0"
|
||||
"typescript-eslint": "^8.74.0",
|
||||
"vite": "^8.3.8",
|
||||
"vitest": "^5.1.1",
|
||||
"wrangler": "^4.167.0"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
# Security contact for JSONPrism (RFC 9116). Policy: SECURITY.md.
|
||||
Contact: https://github.com/poli0981/jsonPrism/security/advisories/new
|
||||
# Report by e-mail only, never as a public issue on the GitLab mirror.
|
||||
Contact: mailto:security@poli0981.dev
|
||||
Expires: 2027-10-01T00:00:00.000Z
|
||||
Preferred-Languages: en, vi
|
||||
Canonical: https://jsonprism.poli0981.dev/.well-known/security.txt
|
||||
Policy: https://github.com/poli0981/jsonPrism/blob/main/SECURITY.md
|
||||
Policy: https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/SECURITY.md
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
# Qodana for JS/TS: Qodana Cloud project "jsonprism-js-ts".
|
||||
# Run by .gitea/workflows/qodana.yml (job `typescript`: the ops repo's
|
||||
# reusable-qodana.yml, native mode).
|
||||
# The Tauri shell has its own configuration in src-tauri/qodana.yaml.
|
||||
version: '1.0'
|
||||
linter: qodana-js
|
||||
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
|
||||
exclude:
|
||||
- name: All
|
||||
paths:
|
||||
# Build output, caches and generated files
|
||||
- .wrangler
|
||||
- coverage
|
||||
- dist
|
||||
- node_modules
|
||||
- package-lock.json
|
||||
- worker-configuration.d.ts
|
||||
# Generated by the shadcn CLI; not edited by hand (see CLAUDE.md)
|
||||
- src/components/ui
|
||||
# Analysed by Qodana for Rust (src-tauri/qodana.yaml)
|
||||
- src-tauri
|
||||
# The webhook there is a ${{ secrets.… }} reference, not a hard-coded secret.
|
||||
- name: HardcodedPasswords
|
||||
paths:
|
||||
- .gitea/workflows/notify-release-pipeline.yml
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["local>poli0981/renovate-config"],
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "Maintenance mode: a major lands only when it is ticked on the Dependency Dashboard, with its migration in the same change. Minor and patch updates come in the preset's grouped pull request.",
|
||||
"matchUpdateTypes": ["major"],
|
||||
"dependencyDashboardApproval": true
|
||||
},
|
||||
{
|
||||
"description": "A family's majors land together: a lone eslint major once left `npm ci` broken on main for four months (eslint-plugin-react-hooks did not accept it yet).",
|
||||
"matchManagers": ["npm"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"matchPackageNames": ["eslint", "@eslint/**", "typescript-eslint", "eslint-plugin-*", "globals"],
|
||||
"groupName": "ESLint (major)",
|
||||
"groupSlug": "eslint-major"
|
||||
},
|
||||
{
|
||||
"description": "Majors of the other families that move together: i18next with react-i18next, CodeMirror with its React wrapper, Radix, Cloudflare tooling, and fast-xml-parser with fast-xml-builder (which it re-exports).",
|
||||
"matchManagers": ["npm"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"matchPackageNames": ["i18next", "react-i18next", "i18next-*"],
|
||||
"groupName": "i18next (major)",
|
||||
"groupSlug": "i18n-major"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["npm"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"matchPackageNames": ["@codemirror/**", "@uiw/**", "@lezer/**"],
|
||||
"groupName": "CodeMirror (major)",
|
||||
"groupSlug": "codemirror-major"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["npm"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"matchPackageNames": ["@radix-ui/**"],
|
||||
"groupName": "Radix (major)",
|
||||
"groupSlug": "radix-major"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["npm"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"matchPackageNames": ["wrangler", "@cloudflare/**", "@marsidev/react-turnstile"],
|
||||
"groupName": "Cloudflare (major)",
|
||||
"groupSlug": "cloudflare-major"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["npm"],
|
||||
"matchPackageNames": ["fast-xml-parser", "fast-xml-builder"],
|
||||
"groupName": "fast-xml",
|
||||
"groupSlug": "fast-xml"
|
||||
},
|
||||
{
|
||||
"description": "Tauri, its JS packages and its Rust crates in ONE pull request: the tauri CLI refuses to build when the @tauri-apps/* npm packages and the tauri crates differ in major.minor. Outside the preset's all-non-major group, so it never waits behind an unrelated bump.",
|
||||
"matchManagers": ["npm", "cargo"],
|
||||
"matchPackageNames": ["@tauri-apps/**", "tauri", "tauri-build", "tauri-plugin-*"],
|
||||
"groupName": "Tauri (JS + Rust)",
|
||||
"groupSlug": "tauri"
|
||||
},
|
||||
{
|
||||
"description": "@vitest/coverage-v8 needs vitest's exact version.",
|
||||
"matchManagers": ["npm"],
|
||||
"matchPackageNames": ["vitest", "@vitest/**"],
|
||||
"groupName": "Vitest",
|
||||
"groupSlug": "vitest"
|
||||
},
|
||||
{
|
||||
"description": "`typescript` is an alias for the TypeScript 6 API package (@typescript/typescript6) that typescript-eslint loads, and typescript-eslint 8 only accepts typescript < 6.1. The compiler itself is `@typescript/native` (TypeScript 7). CLAUDE.md: don't 'fix' the alias.",
|
||||
"matchManagers": ["npm"],
|
||||
"matchDepNames": ["typescript"],
|
||||
"allowedVersions": "<6.1.0"
|
||||
},
|
||||
{
|
||||
"description": "The TypeScript aliases' majors are taken by hand, never by a bot; @types/node follows the Node major in .nvmrc, not the newest Node.",
|
||||
"matchManagers": ["npm"],
|
||||
"matchDepNames": ["typescript", "@typescript/native", "@types/node"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"description": "Runtimes are bumped by hand, every copy at once: Node is .nvmrc (+ engines and @types/node); the Android job's JDK (setup-java in release.yml) moves with Tauri's Gradle template, and only a release build would show a break.",
|
||||
"matchDepNames": ["node", "java-jdk"],
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"description": "`runs-on` names the labels of the Gitea runner on the maintainer's PC (ubuntu-latest, ubuntu-24.04, ubuntu-22.04, windows-latest), not GitHub's images: a newer Ubuntu label does not exist there. release.yml keeps ubuntu-22.04 on purpose (the glibc floor of the Linux packages).",
|
||||
"matchDatasources": ["github-runners"],
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"description": "glib 0.18 comes with Tauri's gtk-rs 0.18 Linux stack; its fix (0.20) is a major the tree cannot take until Tauri moves (src-tauri/deny.toml, src-tauri/osv-scanner.toml).",
|
||||
"matchManagers": ["cargo"],
|
||||
"matchPackageNames": ["glib"],
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"description": "src-tauri/gen/android is Tauri's generated Gradle project: the Android Gradle Plugin, Kotlin and the wrapper move with Tauri's template, not on their own (Kotlin 2.2+ refuses the template's `kotlinOptions {}` block, and only a release build would show it). This also holds back OSV's kotlin-gradle-plugin 2.4.20 fix for CVE-2026-53914 (GHSA-r937-wjx7-w2jp, moderate): unsafe deserialization of the Kotlin build cache, which the release job never shares or restores (a fresh container, no caches). Revisit with Tauri's next Android template.",
|
||||
"matchManagers": ["gradle", "gradle-wrapper"],
|
||||
"enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
# SonarQube Cloud, CI-based analysis (.github/workflows/ci.yml, job "sonar").
|
||||
# Automatic Analysis must stay off in the project settings, or the CI scan fails.
|
||||
sonar.organization=poli0981
|
||||
sonar.projectKey=poli0981_jsonPrism
|
||||
sonar.projectName=JSONPrism
|
||||
sonar.sourceEncoding=UTF-8
|
||||
|
||||
# The Android project under src-tauri/gen is Tauri scaffolding; only the files
|
||||
# we maintain (manifest, Kotlin entry point) are analysed, not its Gradle setup.
|
||||
sonar.sources=src,worker,src-tauri/src,src-tauri/gen/android/app/src/main,.github/workflows,vite.config.ts,vitest.config.ts
|
||||
sonar.tests=src,worker
|
||||
sonar.test.inclusions=**/__tests__/**,**/*.test.ts,**/*.test.tsx,src/test/**
|
||||
sonar.exclusions=**/__tests__/**,**/*.test.ts,**/*.test.tsx,src/test/**,src/components/ui/**,**/*.d.ts,src-tauri/gen/android/app/src/main/res/**
|
||||
|
||||
# Coverage comes from Vitest (npm run test:coverage). Rust, Android and
|
||||
# workflow files have no JS coverage to report.
|
||||
sonar.javascript.lcov.reportPaths=coverage/lcov.info
|
||||
sonar.coverage.exclusions=src/main.tsx,src/i18n/locales/**,src-tauri/**,.github/**,vite.config.ts,vitest.config.ts
|
||||
sonar.cpd.exclusions=src/i18n/locales/**
|
||||
|
||||
# Report the Quality Gate without blocking CI until coverage settles.
|
||||
sonar.qualitygate.wait=false
|
||||
Generated
+482
-333
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "jsonprism"
|
||||
version = "2.0.2"
|
||||
version = "2.3.0"
|
||||
description = "Disperse JSON into many formats."
|
||||
authors = ["poli0981 <code@poli0981.dev>"]
|
||||
license = "Apache-2.0"
|
||||
repository = "https://github.com/poli0981/jsonPrism"
|
||||
repository = "https://git.poli0981.dev/poli0981/jsonPrism"
|
||||
homepage = "https://jsonprism.poli0981.dev"
|
||||
edition = "2021"
|
||||
rust-version = "1.90"
|
||||
@@ -23,6 +23,8 @@ tauri-plugin-dialog = "2"
|
||||
tauri-plugin-fs = "2"
|
||||
tauri-plugin-opener = "2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
# Not referenced in src/, but the code tauri::generate_context!() expands to
|
||||
# uses ::serde_json, so it has to stay a direct dependency.
|
||||
serde_json = "1"
|
||||
|
||||
# Desktop-only: prevent multiple JSONPrism windows / processes when the user
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
"identifier": "default",
|
||||
"description": "JSONPrism main window: native open/save dialogs, reading files the user picks or drops, writing where they choose to save, and opening links in the system browser. Picked and dropped paths are added to the fs scope at runtime; the static scope only covers common folders.",
|
||||
"description": "JSONPrism main window: native open/save dialogs, reading files the user picks or drops, writing where they choose to save, opening links in the system browser, and page zoom (Ctrl/Cmd + and -). Picked and dropped paths are added to the fs scope at runtime; the static scope only covers common folders.",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"core:webview:allow-set-webview-zoom",
|
||||
"opener:default",
|
||||
"dialog:allow-open",
|
||||
"dialog:allow-save",
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# cargo-deny configuration for the Tauri shell. Run by
|
||||
# .gitea/workflows/security.yml through the ops repo's security.yml (job
|
||||
# `rust`: `cargo deny --all-features check`), on every push and pull request
|
||||
# and weekly for new RustSec advisories.
|
||||
|
||||
[graph]
|
||||
all-features = false
|
||||
|
||||
[advisories]
|
||||
# Unmaintained crates only fail the check when this crate depends on them
|
||||
# directly. The transitive ones today (e.g. proc-macro-error, RUSTSEC-2024-0370,
|
||||
# via tauri's gtk-rs 0.18 Linux stack) have no safe upgrade until tauri moves
|
||||
# on, and would otherwise keep this job permanently red. Vulnerabilities
|
||||
# always fail, whatever the depth.
|
||||
unmaintained = "workspace"
|
||||
# Transitive unsound / unmaintained advisories with no fix yet (glib 0.18, the
|
||||
# zbus crates, chrono, all under Tauri's Linux stack) stay out of this check
|
||||
# by the scope above; osv-scanner, which reports them, lists each with its
|
||||
# reason and an expiry date in src-tauri/osv-scanner.toml.
|
||||
|
||||
[licenses]
|
||||
confidence-threshold = 0.9
|
||||
# Permissive licenses, plus MPL-2.0 (file-level copyleft; used unmodified).
|
||||
allow = [
|
||||
"MIT",
|
||||
"Apache-2.0",
|
||||
"Apache-2.0 WITH LLVM-exception",
|
||||
"BSD-3-Clause",
|
||||
"Zlib",
|
||||
"Unicode-3.0",
|
||||
"MPL-2.0",
|
||||
]
|
||||
|
||||
[sources]
|
||||
unknown-registry = "deny"
|
||||
unknown-git = "deny"
|
||||
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
|
||||
@@ -6,12 +6,12 @@
|
||||
By installing and using JSONPrism, you agree to the terms below.\par
|
||||
\par
|
||||
JSONPrism is free, open-source software licensed under the Apache License 2.0:\par
|
||||
https://github.com/poli0981/jsonPrism/blob/v2.0.2/LICENSE\par
|
||||
https://git.poli0981.dev/poli0981/jsonPrism/src/tag/v2.3.0/LICENSE\par
|
||||
\par
|
||||
Your use is also governed by the following documents (version 2.0, effective 2026-10-22):\par
|
||||
\bullet\tab Terms of Service (EULA): https://github.com/poli0981/jsonPrism/blob/v2.0.2/TERMS.md\par
|
||||
\bullet\tab Privacy Policy: https://github.com/poli0981/jsonPrism/blob/v2.0.2/PRIVACY.md\par
|
||||
\bullet\tab Disclaimer: https://github.com/poli0981/jsonPrism/blob/v2.0.2/DISCLAIMER.md\par
|
||||
\bullet\tab Terms of Service (EULA): https://git.poli0981.dev/poli0981/jsonPrism/src/tag/v2.3.0/TERMS.md\par
|
||||
\bullet\tab Privacy Policy: https://git.poli0981.dev/poli0981/jsonPrism/src/tag/v2.3.0/PRIVACY.md\par
|
||||
\bullet\tab Disclaimer: https://git.poli0981.dev/poli0981/jsonPrism/src/tag/v2.3.0/DISCLAIMER.md\par
|
||||
\par
|
||||
JSONPrism is provided \ldblquote as is\rdblquote , without warranty of any kind. The desktop app converts everything on your device and makes no network requests of its own.\par
|
||||
\par
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# OSV-Scanner exceptions for Cargo.lock (security.yml → the ops repo's
|
||||
# security.yml, `deps` job): the scanner reads this file because it sits next
|
||||
# to the lockfile.
|
||||
#
|
||||
# Only advisories that NO release of our dependency chain fixes yet: a fixed
|
||||
# one is taken (Cargo.lock), not listed here. Every entry expires, so the
|
||||
# weekly scan turns red again and someone looks. cargo-deny doesn't need them
|
||||
# (deny.toml scopes unmaintained advisories to direct dependencies). Reviewed
|
||||
# 2026-11-27 with Tauri 2.12 (the same Linux stack as youtube-generator and the
|
||||
# two catalog apps).
|
||||
|
||||
[[IgnoredVulns]]
|
||||
id = "GHSA-wrw7-89jp-8q8g"
|
||||
effectiveUntil = 2027-03-01
|
||||
reason = "glib 0.18 VariantStrIter unsoundness. Linux only, via gtk 0.18 under tao/wry/webkit2gtk; the shell never iterates GVariant strings. Fixed in glib 0.20, which Tauri 2's Linux stack does not use yet."
|
||||
|
||||
[[IgnoredVulns]]
|
||||
id = "RUSTSEC-2024-0370"
|
||||
effectiveUntil = 2027-03-01
|
||||
reason = "proc-macro-error is unmaintained. Build-time only (a proc-macro of the gtk 0.18 macros); nothing of it ships."
|
||||
|
||||
[[IgnoredVulns]]
|
||||
id = "RUSTSEC-2026-0370"
|
||||
effectiveUntil = 2027-03-01
|
||||
reason = "zvariant (zbus, Linux D-Bus via Tauri's plugins) is unmaintained: no release of the dependants moves off it yet."
|
||||
|
||||
[[IgnoredVulns]]
|
||||
id = "RUSTSEC-2026-0371"
|
||||
effectiveUntil = 2027-03-01
|
||||
reason = "zbus_names: as zvariant."
|
||||
|
||||
[[IgnoredVulns]]
|
||||
id = "RUSTSEC-2026-0372"
|
||||
effectiveUntil = 2027-03-01
|
||||
reason = "zvariant_derive: as zvariant; a derive macro, build-time."
|
||||
|
||||
[[IgnoredVulns]]
|
||||
id = "RUSTSEC-2026-0543"
|
||||
effectiveUntil = 2027-03-01
|
||||
reason = "chrono is unmaintained (informational, no fixed release). Pulled in by Tauri's dependencies; no unsound API reported."
|
||||
@@ -0,0 +1,55 @@
|
||||
# Qodana for Rust (Early Access): Qodana Cloud project "jsonprism-rust".
|
||||
# Run by .gitea/workflows/qodana.yml (job `rust`: the ops repo's
|
||||
# reusable-qodana.yml, Docker Desktop on the maintainer's PC), with this
|
||||
# folder as the project directory and the repository root mounted, so
|
||||
# tauri::generate_context!() can read ../dist.
|
||||
version: '1.0'
|
||||
linter: qodana-rust
|
||||
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
|
||||
# The linter evaluates build scripts and expands macros with `cargo check`,
|
||||
# and its image has neither a C toolchain nor the GTK/WebKit headers Tauri
|
||||
# links against ("linker `cc` not found"), so install what the CI `rust` job
|
||||
# installs. Needs root in the container: the workflow passes `-u root`.
|
||||
#
|
||||
# The image is a Docker Hardened Image: its libraries are installed as
|
||||
# `<v>+dhi0`, which sorts above the `<v>+deb13u0+dhi0` its own repository
|
||||
# (dhi.io) ships, so every -dev package reads as a downgrade and apt stops
|
||||
# ("held broken packages"). Pinning dhi.io and allowing downgrades lets the
|
||||
# install through (found on free-steam-games-list, ops migration notes).
|
||||
bootstrap: |
|
||||
printf 'Package: *\nPin: origin dhi.io\nPin-Priority: 1001\n' > /etc/apt/preferences.d/dhi
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --allow-downgrades --no-install-recommends build-essential pkg-config libssl-dev libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
|
||||
|
||||
# Opening the project (crates, build scripts, macro expansion) takes longer
|
||||
# than the linter's default 10 minutes in Docker Desktop on the runner PC on a
|
||||
# cold cache ("failed to configure the project: timeout reached").
|
||||
properties:
|
||||
qd.rust.configuration.timeout.minutes: '25'
|
||||
|
||||
exclude:
|
||||
- name: All
|
||||
paths:
|
||||
# Generated by `tauri android init` and the Android build
|
||||
- gen
|
||||
# Generated by `npm run tauri:icon`
|
||||
- icons
|
||||
- target
|
||||
# serde_json looks unused from src/, but the code tauri::generate_context!()
|
||||
# expands to uses ::serde_json, and removing it breaks the build (see the
|
||||
# comment in Cargo.toml).
|
||||
- name: CargoUnusedDependency
|
||||
paths:
|
||||
- Cargo.toml
|
||||
# The linter's own type and borrow checker, which re-implement rustc's.
|
||||
# rustc is the checker of record: ci.yml builds the crate and runs clippy
|
||||
# with -D warnings. The 2026.3 Early Access linter reports errors rustc does
|
||||
# not have (youtube-generator's first run on Gitea found 9, all false), plus
|
||||
# the unresolved paths of what tauri::generate_context!() and the
|
||||
# #[tauri::command] macros expand to.
|
||||
- name: RsTypeCheck
|
||||
- name: RsBorrowChecker
|
||||
- name: RsUnresolvedPath
|
||||
@@ -22,6 +22,7 @@
|
||||
"fullscreen": false,
|
||||
"transparent": false,
|
||||
"dragDropEnabled": true,
|
||||
"zoomHotkeysEnabled": true,
|
||||
"theme": null
|
||||
}
|
||||
],
|
||||
@@ -42,7 +43,7 @@
|
||||
],
|
||||
"category": "DeveloperTool",
|
||||
"shortDescription": "Disperse JSON into many formats",
|
||||
"longDescription": "JSONPrism is a refracting tool for developers. It takes a single JSON input and disperses it into twelve formats — JSONL, CSV, TSV, YAML, XML, TOML, .NET RESX, Markdown table, SQL INSERT, BSON, CBOR and MessagePack — and parses six of them back, entirely on your machine.",
|
||||
"longDescription": "JSONPrism is a refracting tool for developers. It takes a single JSON input and disperses it into twelve formats — JSONL, CSV, TSV, YAML, XML, TOML, .NET RESX, Markdown table, SQL INSERT, BSON, CBOR and MessagePack — and parses six of them back (plus JSONC into plain JSON), entirely on your machine.",
|
||||
"copyright": "Copyright (c) 2026 poli0981",
|
||||
"publisher": "poli0981",
|
||||
"homepage": "https://jsonprism.poli0981.dev",
|
||||
@@ -78,7 +79,7 @@
|
||||
},
|
||||
"android": {
|
||||
"minSdkVersion": 31,
|
||||
"versionCode": 20002
|
||||
"versionCode": 20300
|
||||
}
|
||||
},
|
||||
"plugins": {
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { render, screen, waitFor, within } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { MemoryRouter } from 'react-router';
|
||||
import '@/i18n';
|
||||
import { App } from '../App';
|
||||
import { axeViolations } from '@/test/axe';
|
||||
import { stubRangeGeometry } from '@/test/range-geometry';
|
||||
import { useConsentStore } from '@/stores/consentStore';
|
||||
import { useWorkspaceStore } from '@/stores/workspaceStore';
|
||||
|
||||
vi.mock('@/lib/analytics', () => ({ loadWebAnalytics: vi.fn(() => false) }));
|
||||
|
||||
stubRangeGeometry();
|
||||
|
||||
beforeEach(() => {
|
||||
// axe probes <canvas> for icon fonts; jsdom only logs "not implemented".
|
||||
vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockReturnValue(null);
|
||||
});
|
||||
|
||||
function renderApp(path = '/') {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter initialEntries={[path]}>
|
||||
<App />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for the real CodeMirror editor, which loads as its own chunk. Until
|
||||
* then a plain <textarea> with the same name stands in, so match on the
|
||||
* editor's content element, not just the role and name.
|
||||
*/
|
||||
async function findInputEditor() {
|
||||
return waitFor(
|
||||
() => {
|
||||
const editor = screen.getByRole('textbox', { name: 'Input JSON' });
|
||||
expect(editor).toHaveClass('cm-content');
|
||||
return editor;
|
||||
},
|
||||
{ timeout: 10_000 },
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
useConsentStore.setState({ accepted: true, humanVerified: true });
|
||||
useWorkspaceStore.setState({
|
||||
input: '[{"id":1,"name":"Ada"}]',
|
||||
format: 'csv',
|
||||
direction: 'forward',
|
||||
optionsByFormat: {},
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
document.documentElement.classList.remove('dark');
|
||||
});
|
||||
|
||||
describe('axe-core scan', () => {
|
||||
it('reports real violations (guards against a scan that checks nothing)', async () => {
|
||||
render(
|
||||
<main>
|
||||
<button type="button">
|
||||
<svg aria-hidden="true" />
|
||||
</button>
|
||||
</main>,
|
||||
);
|
||||
// This bare render also lacks a <title>; the app pages always have one.
|
||||
expect(await axeViolations()).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.stringMatching(/^button-name \(critical\)/),
|
||||
expect.stringMatching(/^document-title/),
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
it('finds no violations on the converter page', async () => {
|
||||
renderApp('/');
|
||||
const editor = await findInputEditor();
|
||||
expect(editor).toHaveAccessibleDescription(/To leave the editor, press Escape, then Tab/);
|
||||
expect(await axeViolations()).toEqual([]);
|
||||
});
|
||||
|
||||
it('finds no violations while the input does not parse', async () => {
|
||||
useWorkspaceStore.setState({ input: '{"broken": ' });
|
||||
renderApp('/');
|
||||
const editor = await findInputEditor();
|
||||
await waitFor(() => expect(editor).toHaveAttribute('aria-invalid', 'true'));
|
||||
expect(await axeViolations()).toEqual([]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
['/about', 'About JSONPrism'],
|
||||
['/no/such/page', 'Page not found'],
|
||||
['/error/403', 'Forbidden'],
|
||||
])('finds no violations on %s', async (path, heading) => {
|
||||
renderApp(path);
|
||||
await screen.findByRole('heading', { level: 1, name: heading });
|
||||
expect(await axeViolations()).toEqual([]);
|
||||
});
|
||||
|
||||
it('finds no violations with the consent gate open', async () => {
|
||||
useConsentStore.setState({ accepted: false });
|
||||
renderApp('/');
|
||||
await screen.findByRole('dialog', { name: 'Before you start' });
|
||||
expect(await axeViolations()).toEqual([]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
['Options', /options/i],
|
||||
['Batch', /batch/i],
|
||||
[/Target format/, /Target format/],
|
||||
])('finds no violations with the %s sheet open', async (trigger, dialogName) => {
|
||||
const user = renderApp('/');
|
||||
await findInputEditor();
|
||||
await user.click(screen.getByRole('button', { name: trigger }));
|
||||
const dialog = await screen.findByRole('dialog', { name: dialogName });
|
||||
expect(dialog).toHaveAccessibleDescription();
|
||||
expect(await axeViolations()).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('focus management', () => {
|
||||
it('starts with a skip link that moves focus to the main content', async () => {
|
||||
const user = renderApp('/about');
|
||||
await screen.findByRole('heading', { level: 1, name: 'About JSONPrism' });
|
||||
|
||||
await user.tab();
|
||||
const skip = screen.getByRole('link', { name: 'Skip to content' });
|
||||
expect(skip).toHaveFocus();
|
||||
await user.keyboard('{Enter}');
|
||||
expect(screen.getByRole('main')).toHaveFocus();
|
||||
|
||||
// The next Tab continues inside the page, not back in the header.
|
||||
await user.tab();
|
||||
expect(
|
||||
within(screen.getByRole('main')).getByRole('region', { name: 'About JSONPrism' }),
|
||||
).toHaveFocus();
|
||||
});
|
||||
|
||||
it('moves focus to the main content after navigating', async () => {
|
||||
const user = renderApp('/about');
|
||||
await screen.findByRole('heading', { level: 1, name: 'About JSONPrism' });
|
||||
await user.click(screen.getByRole('link', { name: 'Convert' }));
|
||||
await findInputEditor();
|
||||
expect(screen.getByRole('main')).toHaveFocus();
|
||||
});
|
||||
|
||||
it('continues in the main content once the consent gate closes', async () => {
|
||||
useConsentStore.setState({ accepted: false });
|
||||
const user = renderApp('/about');
|
||||
await screen.findByRole('dialog', { name: 'Before you start' });
|
||||
|
||||
await user.click(screen.getByRole('checkbox', { name: /I have read and agree/ }));
|
||||
await user.click(screen.getByRole('button', { name: 'Continue' }));
|
||||
await waitFor(() => expect(screen.getByRole('main')).toHaveFocus());
|
||||
});
|
||||
});
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { HumanCheck } from '@/components/common/HumanCheck';
|
||||
import { focusMain } from '@/lib/focus';
|
||||
import { legalDocUrl } from '@/lib/links';
|
||||
import { isTurnstileEnabled } from '@/lib/turnstile';
|
||||
import { useConsentStore } from '@/stores/consentStore';
|
||||
@@ -47,6 +48,11 @@ export function ConsentGate({ children }: { children: ReactNode }) {
|
||||
onEscapeKeyDown={(e) => e.preventDefault()}
|
||||
onPointerDownOutside={(e) => e.preventDefault()}
|
||||
onInteractOutside={(e) => e.preventDefault()}
|
||||
// The gate has no trigger to return to, so Radix would leave focus
|
||||
// on <body>; continue in the page content instead.
|
||||
onCloseAutoFocus={(e) => {
|
||||
if (focusMain()) e.preventDefault();
|
||||
}}
|
||||
className="max-w-md"
|
||||
>
|
||||
{/* Tauri builds never run the human check, so the bundler drops it there. */}
|
||||
|
||||
@@ -27,7 +27,8 @@ export function LanguageSwitcher() {
|
||||
type="button"
|
||||
lang={lang.code}
|
||||
aria-pressed={current === lang.code}
|
||||
aria-label={lang.name}
|
||||
// Starts with the visible code so voice control ("click JA") works (WCAG 2.5.3).
|
||||
aria-label={`${lang.label} ${lang.name}`}
|
||||
title={lang.name}
|
||||
onClick={() => change(lang.code)}
|
||||
className={cn(
|
||||
|
||||
@@ -5,8 +5,11 @@ import { LoaderCircle } from 'lucide-react';
|
||||
export function RouteFallback() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="text-muted-foreground flex min-h-0 flex-1 items-center justify-center gap-2 p-8">
|
||||
<LoaderCircle className="h-4 w-4 animate-spin" />
|
||||
<div
|
||||
role="status"
|
||||
className="text-muted-foreground flex min-h-0 flex-1 items-center justify-center gap-2 p-8"
|
||||
>
|
||||
<LoaderCircle className="h-4 w-4 animate-spin" aria-hidden />
|
||||
<span className="text-sm">{t('common.loading')}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useState, type RefObject } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ArrowUp } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface ScrollToTopProps {
|
||||
/** The scroll container to watch and scroll back to top. */
|
||||
scrollRef: React.RefObject<HTMLDivElement | null>;
|
||||
scrollRef: RefObject<HTMLDivElement | null>;
|
||||
/** Reveal the button once the container is scrolled past this many pixels. */
|
||||
threshold?: number;
|
||||
}
|
||||
@@ -28,6 +28,9 @@ export function ScrollToTop({ scrollRef, threshold = 320 }: ScrollToTopProps) {
|
||||
if (!el) return;
|
||||
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
el.scrollTo({ top: 0, behavior: reduceMotion ? 'auto' : 'smooth' });
|
||||
// The button hides at the top; hand focus to the content it scrolled
|
||||
// (a focusable region) rather than leaving it on a hidden control.
|
||||
if (el.tabIndex >= 0) el.focus({ preventScroll: true });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -52,11 +52,3 @@ export function YoutubeIcon({ className }: IconProps) {
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
export function GithubIcon({ className }: IconProps) {
|
||||
return (
|
||||
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
|
||||
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface ToolbarButtonProps {
|
||||
onClick: () => void;
|
||||
label: string;
|
||||
icon: React.ReactNode;
|
||||
icon: ReactNode;
|
||||
disabled?: boolean;
|
||||
/** Shown instead of `label` (visually) without changing the accessible name. */
|
||||
visibleLabel?: string;
|
||||
/** `aria-keyshortcuts` value, e.g. "Control+S". */
|
||||
keyShortcuts?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -21,6 +24,7 @@ export function ToolbarButton({
|
||||
icon,
|
||||
disabled,
|
||||
visibleLabel,
|
||||
keyShortcuts,
|
||||
className,
|
||||
}: ToolbarButtonProps) {
|
||||
return (
|
||||
@@ -29,6 +33,7 @@ export function ToolbarButton({
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
aria-label={label}
|
||||
aria-keyshortcuts={keyShortcuts}
|
||||
title={label}
|
||||
className={cn(
|
||||
'group text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:ring-ring inline-flex min-h-8 items-center gap-1.5 rounded-md px-2 text-xs transition outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-40',
|
||||
|
||||
@@ -108,7 +108,7 @@ describe('ConsentGate', () => {
|
||||
// Test builds have no commit hash, so links fall back to `main`.
|
||||
expect(link).toHaveAttribute(
|
||||
'href',
|
||||
`https://github.com/poli0981/jsonPrism/blob/main/${file}`,
|
||||
`https://git.poli0981.dev/poli0981/jsonPrism/src/branch/main/${file}`,
|
||||
);
|
||||
expect(link).toHaveAttribute('target', '_blank');
|
||||
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
|
||||
|
||||
@@ -17,11 +17,12 @@ describe('LanguageSwitcher', () => {
|
||||
const group = screen.getByRole('group', { name: 'Language' });
|
||||
const buttons = within(group).getAllByRole('button');
|
||||
expect(buttons.map((b) => b.textContent)).toEqual(['EN', 'VI', 'JA', 'ZH']);
|
||||
expect(within(group).getByRole('button', { name: 'English' })).toHaveAttribute(
|
||||
expect(within(group).getByRole('button', { name: 'EN English' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'true',
|
||||
);
|
||||
expect(within(group).getByRole('button', { name: '日本語' })).toHaveAttribute('lang', 'ja');
|
||||
// Names start with the visible code (WCAG 2.5.3) and add the native name.
|
||||
expect(within(group).getByRole('button', { name: 'JA 日本語' })).toHaveAttribute('lang', 'ja');
|
||||
expect(screen.getByRole('combobox', { name: 'Language' })).toHaveValue('en');
|
||||
});
|
||||
|
||||
@@ -29,14 +30,14 @@ describe('LanguageSwitcher', () => {
|
||||
const user = userEvent.setup();
|
||||
render(<LanguageSwitcher />);
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Tiếng Việt' }));
|
||||
await user.click(screen.getByRole('button', { name: 'VI Tiếng Việt' }));
|
||||
expect(i18n.resolvedLanguage).toBe('vi');
|
||||
expect(document.documentElement.lang).toBe('vi');
|
||||
expect(screen.getByRole('button', { name: 'Tiếng Việt' })).toHaveAttribute(
|
||||
expect(screen.getByRole('button', { name: 'VI Tiếng Việt' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'true',
|
||||
);
|
||||
expect(screen.getByRole('button', { name: 'English' })).toHaveAttribute(
|
||||
expect(screen.getByRole('button', { name: 'EN English' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'false',
|
||||
);
|
||||
@@ -51,7 +52,7 @@ describe('LanguageSwitcher', () => {
|
||||
expect(i18n.resolvedLanguage).toBe('zh-CN');
|
||||
expect(document.documentElement.lang).toBe('zh-CN');
|
||||
expect(screen.getByRole('combobox')).toHaveValue('zh-CN');
|
||||
expect(screen.getByRole('button', { name: '简体中文' })).toHaveAttribute(
|
||||
expect(screen.getByRole('button', { name: 'ZH 简体中文' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'true',
|
||||
);
|
||||
@@ -68,6 +69,9 @@ describe('LanguageSwitcher', () => {
|
||||
</I18nextProvider>,
|
||||
);
|
||||
expect(screen.getByRole('combobox')).toHaveValue('en');
|
||||
expect(screen.getByRole('button', { name: 'English' })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.getByRole('button', { name: 'EN English' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'true',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -6,7 +6,8 @@ import { RouteFallback } from '../RouteFallback';
|
||||
describe('RouteFallback', () => {
|
||||
it('shows a translated loading indicator while a route chunk streams in', () => {
|
||||
const { container } = render(<RouteFallback />);
|
||||
expect(screen.getByText('Loading…')).toBeInTheDocument();
|
||||
expect(screen.getByRole('status')).toHaveTextContent('Loading…');
|
||||
expect(container.querySelector('svg')).toHaveClass('animate-spin');
|
||||
expect(container.querySelector('svg')).toHaveAttribute('aria-hidden', 'true');
|
||||
});
|
||||
});
|
||||
@@ -99,6 +99,18 @@ describe('ScrollToTop', () => {
|
||||
expect(scroll).toHaveBeenCalledWith({ top: 0, behavior });
|
||||
});
|
||||
|
||||
it('hands focus to a focusable container instead of the button it hides', async () => {
|
||||
const user = userEvent.setup();
|
||||
stubReducedMotion(true);
|
||||
render(<ScrollArea initialScroll={1000} />);
|
||||
const scroller = screen.getByTestId('scroller');
|
||||
scroller.tabIndex = 0;
|
||||
Object.defineProperty(scroller, 'scrollTo', { configurable: true, value: vi.fn() });
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Back to top' }));
|
||||
expect(scroller).toHaveFocus();
|
||||
});
|
||||
|
||||
it('does nothing without a scroll container', async () => {
|
||||
const user = userEvent.setup();
|
||||
const matchMedia = stubReducedMotion(false);
|
||||
|
||||
@@ -3,7 +3,6 @@ import { render } from '@testing-library/react';
|
||||
import {
|
||||
BlueskyIcon,
|
||||
DiscordIcon,
|
||||
GithubIcon,
|
||||
MastodonIcon,
|
||||
TelegramIcon,
|
||||
XIcon,
|
||||
@@ -13,7 +12,6 @@ import {
|
||||
const ICONS = {
|
||||
BlueskyIcon,
|
||||
DiscordIcon,
|
||||
GithubIcon,
|
||||
MastodonIcon,
|
||||
TelegramIcon,
|
||||
XIcon,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
import { useCallback, useEffect, useRef, type ChangeEvent } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDropzone, type FileRejection } from 'react-dropzone';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
@@ -144,7 +144,7 @@ export function BatchPanel({ format, direction, options, open, onOpenChange }: B
|
||||
}
|
||||
};
|
||||
|
||||
const onFileInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const onFileInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
const files = Array.from(e.target.files ?? []);
|
||||
e.target.value = '';
|
||||
if (files.length > 0) handleAddFiles(files);
|
||||
@@ -250,8 +250,9 @@ export function BatchPanel({ format, direction, options, open, onOpenChange }: B
|
||||
|
||||
{/* Queue list */}
|
||||
<div
|
||||
className="flex-1 [scrollbar-gutter:stable] overflow-y-auto px-6 pb-3"
|
||||
className="focus-visible:ring-ring flex-1 [scrollbar-gutter:stable] overflow-y-auto px-6 pb-3 outline-none focus-visible:ring-2 focus-visible:ring-inset"
|
||||
tabIndex={0} // NOSONAR(S6845): scrollable region; keyboard users need focus to scroll it
|
||||
role="region"
|
||||
aria-label={t('batch.queue_label')}
|
||||
>
|
||||
{totalCount === 0 ? (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useId, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CodeMirror, {
|
||||
EditorState,
|
||||
@@ -12,15 +12,18 @@ import { xml } from '@codemirror/lang-xml';
|
||||
import { markdown } from '@codemirror/lang-markdown';
|
||||
import { sql } from '@codemirror/lang-sql';
|
||||
import { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';
|
||||
import { json as jsonStream } from '@codemirror/legacy-modes/mode/javascript';
|
||||
import { toml } from '@codemirror/legacy-modes/mode/toml';
|
||||
import { lintGutter, linter, type Diagnostic } from '@codemirror/lint';
|
||||
import { tags as t } from '@lezer/highlight';
|
||||
import { parseJsonInput } from '@/lib/detect';
|
||||
import { parseJsonc } from '@/converters/jsonc';
|
||||
import type { ConversionFailure } from '@/converters/types';
|
||||
import { parseJsonInput, type ParseFailure } from '@/lib/detect';
|
||||
import { useTheme } from '@/lib/theme';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
export type EditorLanguage =
|
||||
'json' | 'jsonl' | 'plain' | 'yaml' | 'xml' | 'markdown' | 'sql' | 'toml';
|
||||
'json' | 'jsonl' | 'jsonc' | 'plain' | 'yaml' | 'xml' | 'markdown' | 'sql' | 'toml';
|
||||
|
||||
export interface CodeEditorProps {
|
||||
value: string;
|
||||
@@ -31,6 +34,10 @@ export interface CodeEditorProps {
|
||||
placeholder?: string;
|
||||
/** Accessible name for the editable region (screen readers). */
|
||||
ariaLabel?: string;
|
||||
/** Space-separated ids of elements that describe the editor (hints, errors). */
|
||||
ariaDescribedBy?: string;
|
||||
/** Marks the content invalid, e.g. while the input doesn't parse. */
|
||||
ariaInvalid?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,15 +83,23 @@ const yieldFileDrops = EditorView.domEventHandlers({
|
||||
const LINT_LIMIT_CHARS = 2_000_000;
|
||||
const MAX_JSONL_DIAGNOSTICS = 100;
|
||||
|
||||
type Check = (text: string) => { ok: true } | ParseFailure | ConversionFailure;
|
||||
|
||||
/**
|
||||
* Lints `text` (starting at document offset `start`) with the converter's own
|
||||
* parser, so the editor and the conversion agree — a leading byte-order mark
|
||||
* is fine, and error positions match on every engine. Blank text is a
|
||||
* prompt, not an error.
|
||||
*/
|
||||
function parseDiagnostic(view: EditorView, text: string, start: number): Diagnostic | null {
|
||||
const result = parseJsonInput(text);
|
||||
if (result.ok || result.error === 'empty') return null;
|
||||
function parseDiagnostic(
|
||||
view: EditorView,
|
||||
text: string,
|
||||
start: number,
|
||||
check: Check = parseJsonInput,
|
||||
): Diagnostic | null {
|
||||
if (!text.trim()) return null;
|
||||
const result = check(text);
|
||||
if (result.ok) return null;
|
||||
const { doc } = view.state;
|
||||
let from = start;
|
||||
if (result.line !== undefined && result.column !== undefined) {
|
||||
@@ -100,6 +115,17 @@ const jsonLint = linter((view) => {
|
||||
return diagnostic ? [diagnostic] : [];
|
||||
});
|
||||
|
||||
// @lezer/json has no comment tokens, so JSONC uses the legacy JSON mode, which
|
||||
// highlights them. It calls true/false/null "atom"; colour them like JSON's.
|
||||
const jsoncLanguage = StreamLanguage.define({ ...jsonStream, tokenTable: { atom: t.bool } });
|
||||
|
||||
// JSONC: comments and trailing commas are fine; the rest must be JSON.
|
||||
const jsoncLint = linter((view) => {
|
||||
if (view.state.doc.length > LINT_LIMIT_CHARS) return [];
|
||||
const diagnostic = parseDiagnostic(view, view.state.doc.toString(), 0, parseJsonc);
|
||||
return diagnostic ? [diagnostic] : [];
|
||||
});
|
||||
|
||||
// JSONL: every non-blank line is its own JSON document.
|
||||
const jsonlLint = linter((view) => {
|
||||
const { doc } = view.state;
|
||||
@@ -134,6 +160,8 @@ function languageExtensions(language: EditorLanguage, readOnly: boolean) {
|
||||
return readOnly ? [json()] : [json(), lintGutter(), jsonLint];
|
||||
case 'jsonl':
|
||||
return readOnly ? [json()] : [json(), lintGutter(), jsonlLint];
|
||||
case 'jsonc':
|
||||
return readOnly ? [jsoncLanguage] : [jsoncLanguage, lintGutter(), jsoncLint];
|
||||
case 'yaml':
|
||||
return [yaml()];
|
||||
case 'xml':
|
||||
@@ -149,7 +177,9 @@ function languageExtensions(language: EditorLanguage, readOnly: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
// English phrases used by CodeMirror's search panel, folding and lint UI.
|
||||
// English phrases used by CodeMirror's search panel, folding and lint UI, and
|
||||
// in what it announces to screen readers (search, replace, folding, deletion).
|
||||
// `$` is CodeMirror's placeholder for a number; translations keep it.
|
||||
const PHRASE_KEYS: Record<string, string> = {
|
||||
Find: 'find',
|
||||
Replace: 'replace',
|
||||
@@ -170,6 +200,15 @@ const PHRASE_KEYS: Record<string, string> = {
|
||||
unfold: 'unfold',
|
||||
Diagnostics: 'diagnostics',
|
||||
'No diagnostics': 'no_diagnostics',
|
||||
'Folded lines': 'folded_lines',
|
||||
'Unfolded lines': 'unfolded_lines',
|
||||
to: 'to',
|
||||
'current match': 'current_match',
|
||||
'on line': 'on_line',
|
||||
'replaced match on line $': 'replaced_match_on_line',
|
||||
'replaced $ matches': 'replaced_matches',
|
||||
'Selection deleted': 'selection_deleted',
|
||||
'Control character': 'control_character',
|
||||
};
|
||||
|
||||
export function CodeEditor({
|
||||
@@ -180,10 +219,15 @@ export function CodeEditor({
|
||||
className,
|
||||
placeholder,
|
||||
ariaLabel,
|
||||
ariaDescribedBy,
|
||||
ariaInvalid = false,
|
||||
}: CodeEditorProps) {
|
||||
const { resolvedTheme } = useTheme();
|
||||
const { t: translate, i18n } = useTranslation();
|
||||
const wrap = value.length < WRAP_LIMIT_CHARS;
|
||||
// Tab indents in the editable editor (WCAG 2.1.2: say how to leave it).
|
||||
const tabHintId = useId();
|
||||
const describedBy = [readOnly ? undefined : tabHintId, ariaDescribedBy].filter(Boolean).join(' ');
|
||||
|
||||
const phrases = useMemo(() => {
|
||||
const entries = Object.entries(PHRASE_KEYS).map(([phrase, key]) => [
|
||||
@@ -241,8 +285,15 @@ export function CodeEditor({
|
||||
'.cm-placeholder': {
|
||||
color: 'var(--muted-foreground)',
|
||||
},
|
||||
// Focus ring drawn inside the editor: the wrapper clips overflow.
|
||||
'&.cm-focused': {
|
||||
outline: 'none',
|
||||
outline: '2px solid var(--color-ring)',
|
||||
outlineOffset: '-2px',
|
||||
},
|
||||
// The read-only output focuses its scroller, not the content.
|
||||
'.cm-scroller:focus-visible': {
|
||||
outline: '2px solid var(--color-ring)',
|
||||
outlineOffset: '-2px',
|
||||
},
|
||||
},
|
||||
{ dark: isDark },
|
||||
@@ -255,15 +306,22 @@ export function CodeEditor({
|
||||
phrases,
|
||||
EditorView.contentAttributes.of({
|
||||
...(ariaLabel ? { 'aria-label': ariaLabel } : {}),
|
||||
...(describedBy ? { 'aria-describedby': describedBy } : {}),
|
||||
...(ariaInvalid ? { 'aria-invalid': 'true' } : {}),
|
||||
...(readOnly ? { 'aria-readonly': 'true' } : {}),
|
||||
}),
|
||||
...(readOnly ? [focusableScroller(ariaLabel)] : []),
|
||||
theme,
|
||||
];
|
||||
}, [ariaLabel, language, phrases, readOnly, resolvedTheme, wrap]);
|
||||
}, [ariaInvalid, ariaLabel, describedBy, language, phrases, readOnly, resolvedTheme, wrap]);
|
||||
|
||||
return (
|
||||
<div className={cn('h-full overflow-hidden', className)}>
|
||||
{!readOnly && (
|
||||
<span id={tabHintId} className="sr-only">
|
||||
{translate('editor.tab_hint')}
|
||||
</span>
|
||||
)}
|
||||
<CodeMirror
|
||||
// The wrapper div this component renders must fill the panel too, or
|
||||
// `height="100%"` has nothing to resolve against: the editor grows to
|
||||
|
||||
@@ -20,6 +20,8 @@ function EditorFallback({
|
||||
readOnly = false,
|
||||
className,
|
||||
ariaLabel,
|
||||
ariaDescribedBy,
|
||||
ariaInvalid = false,
|
||||
}: CodeEditorProps) {
|
||||
return (
|
||||
<div className={cn('h-full overflow-hidden', className)}>
|
||||
@@ -29,8 +31,10 @@ function EditorFallback({
|
||||
spellCheck={false}
|
||||
placeholder={placeholder}
|
||||
aria-label={ariaLabel}
|
||||
aria-describedby={ariaDescribedBy}
|
||||
aria-invalid={ariaInvalid || undefined}
|
||||
onChange={onChange ? (e) => onChange(e.target.value) : undefined}
|
||||
className="text-foreground placeholder:text-muted-foreground h-full w-full resize-none bg-transparent px-4 py-3 font-mono text-[13px] leading-[1.6] outline-none"
|
||||
className="text-foreground placeholder:text-muted-foreground focus-visible:ring-ring h-full w-full resize-none bg-transparent px-4 py-3 font-mono text-[13px] leading-[1.6] outline-none focus-visible:ring-2 focus-visible:ring-inset"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -23,6 +23,8 @@ import { StatusBar, type ConversionState } from './StatusBar';
|
||||
import { BatchPanel } from './BatchPanel';
|
||||
|
||||
const REVERSIBLE_FALLBACKS: FormatId[] = ['jsonl', 'csv', 'yaml', 'toml', 'resx'];
|
||||
/** Where the JSON → direction lands when the current format is input-only. */
|
||||
const FORWARD_FALLBACK: FormatId = 'jsonl';
|
||||
|
||||
export function ConverterWorkspace() {
|
||||
const { t } = useTranslation();
|
||||
@@ -74,16 +76,24 @@ export function ConverterWorkspace() {
|
||||
(next: Direction) => {
|
||||
setDirection(next);
|
||||
// If the current format doesn't support the new direction, switch to one that does.
|
||||
if (next === 'reverse' && typeof getConverter(format).reverse !== 'function') {
|
||||
const converter = getConverter(format);
|
||||
if (next === 'reverse' && typeof converter.reverse !== 'function') {
|
||||
const fallback = REVERSIBLE_FALLBACKS.find(
|
||||
(id) => typeof getConverter(id).reverse === 'function',
|
||||
);
|
||||
if (fallback) setFormat(fallback);
|
||||
}
|
||||
if (next === 'forward' && converter.meta.inputOnly) setFormat(FORWARD_FALLBACK);
|
||||
},
|
||||
[format, setDirection, setFormat],
|
||||
);
|
||||
|
||||
// Offered by the input panel when JSON → fails on text that is valid JSONC.
|
||||
const readAsJsonc = useCallback(() => {
|
||||
setDirection('reverse');
|
||||
setFormat('jsonc');
|
||||
}, [setDirection, setFormat]);
|
||||
|
||||
const currentOptions = useMemo(
|
||||
() => storedOptions ?? { ...getConverter(format).defaultOptions },
|
||||
[format, storedOptions],
|
||||
@@ -130,6 +140,7 @@ export function ConverterWorkspace() {
|
||||
format={format}
|
||||
direction={direction}
|
||||
onMultiFileDrop={handleMultiFileDrop}
|
||||
onReadAsJsonc={readAsJsonc}
|
||||
/>
|
||||
);
|
||||
const outputPanel = (
|
||||
@@ -193,10 +204,14 @@ export function ConverterWorkspace() {
|
||||
<TabsTrigger value="output" className="relative">
|
||||
{t('home.tab_output')}
|
||||
{hasUnreadOutput && (
|
||||
<span
|
||||
aria-hidden
|
||||
className="bg-primary absolute top-1 right-1 h-1.5 w-1.5 rounded-full"
|
||||
/>
|
||||
<>
|
||||
<span
|
||||
aria-hidden
|
||||
className="bg-primary absolute top-1 right-1 h-1.5 w-1.5 rounded-full"
|
||||
/>
|
||||
{/* The dot alone is visual; say it in the tab's name too. */}{' '}
|
||||
<span className="sr-only">{t('home.output_unread')}</span>
|
||||
</>
|
||||
)}
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
@@ -204,14 +219,14 @@ export function ConverterWorkspace() {
|
||||
<TabsContent
|
||||
value="input"
|
||||
forceMount
|
||||
className="min-h-0 flex-1 data-[state=inactive]:hidden"
|
||||
className="focus-visible:ring-ring min-h-0 flex-1 focus-visible:ring-2 focus-visible:ring-inset data-[state=inactive]:hidden"
|
||||
>
|
||||
{inputPanel}
|
||||
</TabsContent>
|
||||
<TabsContent
|
||||
value="output"
|
||||
forceMount
|
||||
className="min-h-0 flex-1 data-[state=inactive]:hidden"
|
||||
className="focus-visible:ring-ring min-h-0 flex-1 focus-visible:ring-2 focus-visible:ring-inset data-[state=inactive]:hidden"
|
||||
>
|
||||
{outputPanel}
|
||||
</TabsContent>
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ChevronDown } from 'lucide-react';
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet';
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
SheetDescription,
|
||||
SheetHeader,
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from '@/components/ui/sheet';
|
||||
import { ALL_FORMATS, getConverter } from '@/converters/registry';
|
||||
import type { Direction, FormatId } from '@/converters/types';
|
||||
import type { JsonShape } from '@/lib/detect';
|
||||
@@ -13,7 +20,10 @@ interface FormatPickerProps {
|
||||
onChange: (id: FormatId) => void;
|
||||
/** Drives the subtle highlight ring on suggested chips. */
|
||||
shape?: JsonShape | null;
|
||||
/** When reverse, formats without a reverse() implementation are disabled. */
|
||||
/**
|
||||
* When reverse, formats without a reverse() implementation are disabled;
|
||||
* when forward, input-only formats (JSONC) are.
|
||||
*/
|
||||
direction?: Direction;
|
||||
}
|
||||
|
||||
@@ -30,7 +40,7 @@ export function FormatPicker({ value, onChange, shape, direction = 'forward' }:
|
||||
return (
|
||||
<>
|
||||
{/* Mobile: compact Sheet trigger — saves ~50-80px of toolbar height when
|
||||
the 12 chip grid would otherwise wrap to 2-3 rows on narrow viewports. */}
|
||||
the chip grid would otherwise wrap to 2-3 rows on narrow viewports. */}
|
||||
<Sheet open={sheetOpen} onOpenChange={setSheetOpen}>
|
||||
<SheetTrigger asChild>
|
||||
<button
|
||||
@@ -49,6 +59,9 @@ export function FormatPicker({ value, onChange, shape, direction = 'forward' }:
|
||||
>
|
||||
<SheetHeader>
|
||||
<SheetTitle>{t('home.format_picker_label')}</SheetTitle>
|
||||
<SheetDescription className="sr-only">
|
||||
{t('home.format_picker_description')}
|
||||
</SheetDescription>
|
||||
</SheetHeader>
|
||||
<div
|
||||
className="grid grid-cols-2 gap-1.5 p-4 pt-2 sm:grid-cols-3"
|
||||
@@ -70,7 +83,7 @@ export function FormatPicker({ value, onChange, shape, direction = 'forward' }:
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
|
||||
{/* Desktop: 12 chips inline. */}
|
||||
{/* Desktop: every chip inline. */}
|
||||
<div
|
||||
className="hidden flex-wrap gap-1 md:flex"
|
||||
role="group"
|
||||
@@ -101,8 +114,9 @@ interface FormatChipProps {
|
||||
expanded?: boolean;
|
||||
}
|
||||
|
||||
function chipStatus(noReverse: boolean, suggested: boolean, dimmed: boolean) {
|
||||
function chipStatus(noReverse: boolean, inputOnly: boolean, suggested: boolean, dimmed: boolean) {
|
||||
if (noReverse) return 'no_reverse';
|
||||
if (inputOnly) return 'input_only';
|
||||
if (suggested) return 'suggested';
|
||||
return dimmed ? 'not_suggested' : 'ready';
|
||||
}
|
||||
@@ -113,9 +127,10 @@ function FormatChip({ id, value, onChange, shape, direction, expanded }: FormatC
|
||||
const active = value === id;
|
||||
const suggested = direction === 'forward' && shape ? isFormatSuggested(id, shape) : false;
|
||||
const noReverse = direction === 'reverse' && typeof c.reverse !== 'function';
|
||||
const enabled = c.meta.ready && !noReverse;
|
||||
const dimmed = direction === 'forward' && !!shape && !suggested && c.meta.ready;
|
||||
const status = chipStatus(noReverse, suggested, dimmed);
|
||||
const inputOnly = direction === 'forward' && c.meta.inputOnly === true;
|
||||
const enabled = c.meta.ready && !noReverse && !inputOnly;
|
||||
const dimmed = direction === 'forward' && !!shape && !suggested && enabled;
|
||||
const status = chipStatus(noReverse, inputOnly, suggested, dimmed);
|
||||
|
||||
return (
|
||||
<button
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import { useCallback, useId, useMemo, useRef, useState, type ChangeEvent } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDropzone, type FileRejection } from 'react-dropzone';
|
||||
import { Eraser, FileText, FolderOpen } from 'lucide-react';
|
||||
import { Eraser, FileText, FolderOpen, MessageSquareCode } from 'lucide-react';
|
||||
import { ToolbarButton } from '@/components/common/ToolbarButton';
|
||||
import { toast } from '@/components/ui/sonner';
|
||||
import { parseJsonc } from '@/converters/jsonc';
|
||||
import { extensionsFor } from '@/converters/registry';
|
||||
import type { Direction, FormatId } from '@/converters/types';
|
||||
import { useFileAccept } from '@/hooks/useFileAccept';
|
||||
import { WORKER_THRESHOLD_CHARS } from '@/lib/convert-client';
|
||||
import { editorLanguageFor } from '@/lib/editor-language';
|
||||
import { errorMessage } from '@/lib/errors';
|
||||
import { extOf } from '@/lib/file-filter';
|
||||
@@ -28,6 +30,8 @@ interface InputPanelProps {
|
||||
direction: Direction;
|
||||
/** Called when 2+ files are dropped — workspace routes them into batch. */
|
||||
onMultiFileDrop?: (files: File[]) => void;
|
||||
/** Switches to JSONC → JSON; offered when JSON → fails on valid JSONC. */
|
||||
onReadAsJsonc?: () => void;
|
||||
}
|
||||
|
||||
export function InputPanel({
|
||||
@@ -39,10 +43,12 @@ export function InputPanel({
|
||||
format,
|
||||
direction,
|
||||
onMultiFileDrop,
|
||||
onReadAsJsonc,
|
||||
}: InputPanelProps) {
|
||||
const { t } = useTranslation();
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const [dragActive, setDragActive] = useState(false);
|
||||
const errorId = useId();
|
||||
|
||||
const { converter, isReverse, accept, fileInputAccept, allowedExtensions } = useFileAccept(
|
||||
format,
|
||||
@@ -150,12 +156,19 @@ export function InputPanel({
|
||||
}
|
||||
};
|
||||
|
||||
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const handleFileChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
e.target.value = '';
|
||||
if (file) loadFile(file);
|
||||
};
|
||||
|
||||
// Comments or trailing commas make JSON → fail; if that is all that is wrong,
|
||||
// offer JSONC. Inputs this big convert in the worker, so skip the extra parse.
|
||||
const looksLikeJsonc = useMemo(
|
||||
() => !isReverse && !!error && value.length < WORKER_THRESHOLD_CHARS && parseJsonc(value).ok,
|
||||
[error, isReverse, value],
|
||||
);
|
||||
|
||||
const showOverlay = isDragActive || dragActive;
|
||||
const position =
|
||||
errorLine != null
|
||||
@@ -204,6 +217,7 @@ export function InputPanel({
|
||||
</div>
|
||||
|
||||
<div
|
||||
id={errorId}
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
className={cn(
|
||||
@@ -219,12 +233,31 @@ export function InputPanel({
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{looksLikeJsonc && onReadAsJsonc && (
|
||||
<div className="border-border/70 flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b px-3 py-1 text-xs">
|
||||
<span className="text-muted-foreground">{t('home.jsonc_hint')}</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onReadAsJsonc}
|
||||
className="group border-primary/40 text-foreground hover:bg-primary/10 focus-visible:ring-ring inline-flex min-h-6 items-center gap-1.5 rounded-md border px-2 font-mono font-medium transition outline-none focus-visible:ring-2"
|
||||
>
|
||||
<MessageSquareCode
|
||||
className="h-3.5 w-3.5 transition-transform motion-safe:group-hover:-rotate-6"
|
||||
aria-hidden
|
||||
/>
|
||||
{t('home.jsonc_switch')}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="relative min-h-0 flex-1">
|
||||
<CodeEditorLazy
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
language={editorLanguageFor(format, direction)}
|
||||
ariaLabel={inputLabel}
|
||||
ariaDescribedBy={errorId}
|
||||
ariaInvalid={!!error}
|
||||
placeholder={
|
||||
isReverse
|
||||
? t('home.input_placeholder_format', {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { toast } from '@/components/ui/sonner';
|
||||
import { ToolbarButton } from '@/components/common/ToolbarButton';
|
||||
import { getConverter } from '@/converters/registry';
|
||||
import type { Direction, FormatId } from '@/converters/types';
|
||||
import { ariaModShortcut } from '@/hooks/useKeyboardShortcuts';
|
||||
import { decodeBytes, type Encoding } from '@/lib/bytes';
|
||||
import { downloadBlob } from '@/lib/download';
|
||||
import { outputLanguageFor } from '@/lib/editor-language';
|
||||
@@ -115,6 +116,7 @@ export function OutputPanel({
|
||||
{pending && (
|
||||
<LoaderCircle
|
||||
className="text-primary h-3.5 w-3.5 motion-safe:animate-spin"
|
||||
role="img"
|
||||
aria-label={t('common.loading')}
|
||||
/>
|
||||
)}
|
||||
@@ -122,8 +124,8 @@ export function OutputPanel({
|
||||
<div className="flex items-center gap-0.5">
|
||||
<ToolbarButton
|
||||
onClick={() => void handleCopy()}
|
||||
label={t('home.copy')}
|
||||
visibleLabel={copied ? t('home.copied') : t('home.copy')}
|
||||
// The name follows the visible label (WCAG 2.5.3).
|
||||
label={copied ? t('home.copied') : t('home.copy')}
|
||||
icon={
|
||||
copied ? (
|
||||
<Check className="text-success motion-safe:animate-pop h-3.5 w-3.5" />
|
||||
@@ -136,6 +138,7 @@ export function OutputPanel({
|
||||
<ToolbarButton
|
||||
onClick={() => void handleDownload()}
|
||||
label={t('home.download')}
|
||||
keyShortcuts={ariaModShortcut('S')}
|
||||
icon={<Download className="motion-safe:group-hover:animate-bob h-3.5 w-3.5" />}
|
||||
disabled={disabled}
|
||||
/>
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { getConverter } from '@/converters/registry';
|
||||
import type { FormatId, OptionSchemaField } from '@/converters/types';
|
||||
import { ariaModShortcut } from '@/hooks/useKeyboardShortcuts';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface SettingsPanelProps {
|
||||
@@ -48,6 +49,7 @@ export function SettingsPanel({
|
||||
<SheetTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
aria-keyshortcuts={ariaModShortcut(',')}
|
||||
className="group text-muted-foreground hover:bg-muted hover:text-foreground border-border bg-card/60 inline-flex min-h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs transition"
|
||||
>
|
||||
<Settings2
|
||||
|
||||
@@ -27,10 +27,14 @@ export function StatusBar({ state, inputBytes, outputBytes, ms, precisionLoss }:
|
||||
|
||||
return (
|
||||
<div className="border-border/70 text-muted-foreground flex items-center justify-between gap-3 border-t px-3 py-1 font-mono text-[11px]">
|
||||
<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5" aria-live="polite">
|
||||
<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5">
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<span aria-hidden className={cn('h-1.5 w-1.5 rounded-full', DOT_TONE[state])} />
|
||||
<span className="text-foreground">{t(`status.state.${state}`)}</span>
|
||||
{/* Only the state is announced; sizes and timing change on every
|
||||
keystroke and would flood screen readers. */}
|
||||
<span className="text-foreground" aria-live="polite">
|
||||
{t(`status.state.${state}`)}
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
{t('status.in')} <span className="text-foreground">{formatBytes(inputBytes)}</span>
|
||||
@@ -54,14 +58,19 @@ export function StatusBar({ state, inputBytes, outputBytes, ms, precisionLoss }:
|
||||
<span>UTF-8</span>
|
||||
<Shortcut keys={`${modKey()}+S`} label={t('shortcut.download')} />
|
||||
<Shortcut keys={`${modKey()}+,`} label={t('shortcut.settings')} />
|
||||
<Shortcut
|
||||
keys="Esc, Tab"
|
||||
label={t('shortcut.leave_editor')}
|
||||
className="hidden lg:inline-flex"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Shortcut({ keys, label }: { keys: string; label: string }) {
|
||||
function Shortcut({ keys, label, className }: { keys: string; label: string; className?: string }) {
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1">
|
||||
<span className={cn('inline-flex items-center gap-1', className)}>
|
||||
<kbd className="kbd">{keys}</kbd>
|
||||
<span>{label}</span>
|
||||
</span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { act, createEvent, fireEvent, render } from '@testing-library/react';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { diagnosticCount, forceLinting } from '@codemirror/lint';
|
||||
@@ -7,28 +7,10 @@ import '@/i18n';
|
||||
import { parseJsonInput } from '@/lib/detect';
|
||||
import { editorLanguageFor } from '@/lib/editor-language';
|
||||
import { ThemeProvider, type Theme } from '@/lib/theme';
|
||||
import { stubRangeGeometry } from '@/test/range-geometry';
|
||||
import { CodeEditor, type CodeEditorProps, type EditorLanguage } from '../CodeEditor';
|
||||
|
||||
// jsdom has no layout engine; CodeMirror measures text ranges to draw the
|
||||
// cursor and selection layers. Empty geometry is enough for these tests.
|
||||
const emptyRect = { x: 0, y: 0, width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0 };
|
||||
const rangeGeometry = ['getClientRects', 'getBoundingClientRect'] as const;
|
||||
const originalGeometry = rangeGeometry.map((key) =>
|
||||
Object.getOwnPropertyDescriptor(Range.prototype, key),
|
||||
);
|
||||
|
||||
beforeAll(() => {
|
||||
Range.prototype.getClientRects = () => [] as unknown as DOMRectList;
|
||||
Range.prototype.getBoundingClientRect = () => ({ ...emptyRect, toJSON: () => emptyRect });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
rangeGeometry.forEach((key, i) => {
|
||||
const original = originalGeometry[i];
|
||||
if (original) Object.defineProperty(Range.prototype, key, original);
|
||||
else Reflect.deleteProperty(Range.prototype, key);
|
||||
});
|
||||
});
|
||||
stubRangeGeometry();
|
||||
|
||||
afterEach(async () => {
|
||||
await i18n.changeLanguage('en');
|
||||
@@ -111,6 +93,24 @@ describe('CodeEditor — editable', () => {
|
||||
typeInto(view, '{}');
|
||||
expect(view.state.doc.toString()).toBe('{}');
|
||||
});
|
||||
|
||||
it('says how to leave the editor and links the error description (WCAG 2.1.2)', () => {
|
||||
const { content, rerender } = renderEditor({
|
||||
value: '{',
|
||||
ariaLabel: 'Input JSON',
|
||||
ariaDescribedBy: 'input-error',
|
||||
ariaInvalid: true,
|
||||
});
|
||||
const [hintId, errorId] = content.getAttribute('aria-describedby')!.split(' ');
|
||||
expect(document.getElementById(hintId!)).toHaveTextContent(
|
||||
'Tab indents. To leave the editor, press Escape, then Tab.',
|
||||
);
|
||||
expect(errorId).toBe('input-error');
|
||||
expect(content).toHaveAttribute('aria-invalid', 'true');
|
||||
|
||||
rerender({ value: '{}', ariaLabel: 'Input JSON', ariaDescribedBy: 'input-error' });
|
||||
expect(content).not.toHaveAttribute('aria-invalid');
|
||||
});
|
||||
});
|
||||
|
||||
describe('CodeEditor — sizing', () => {
|
||||
@@ -141,6 +141,8 @@ describe('CodeEditor — read-only', () => {
|
||||
expect(scroller).toHaveAttribute('role', 'region');
|
||||
expect(scroller).toHaveAttribute('aria-label', 'YAML output (read-only)');
|
||||
expect(content).toHaveAttribute('aria-label', 'YAML output (read-only)');
|
||||
// Nothing to indent, so no "leave the editor" hint.
|
||||
expect(content).not.toHaveAttribute('aria-describedby');
|
||||
expect(container.querySelector('.cm-lineNumbers')).not.toBeNull();
|
||||
expect(container.querySelector('.cm-activeLine')).toBeNull();
|
||||
expect(container.querySelector('.cm-gutter-lint')).toBeNull();
|
||||
@@ -156,6 +158,7 @@ describe('CodeEditor — languages', () => {
|
||||
it.each<[EditorLanguage, string | null]>([
|
||||
['json', 'json'],
|
||||
['jsonl', 'json'],
|
||||
['jsonc', 'json'],
|
||||
['yaml', 'yaml'],
|
||||
['xml', 'xml'],
|
||||
['markdown', 'markdown'],
|
||||
@@ -218,6 +221,26 @@ describe('CodeEditor — JSON linting', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('CodeEditor — JSONC linting', () => {
|
||||
const language = editorLanguageFor('jsonc', 'reverse');
|
||||
|
||||
it('accepts comments and trailing commas', async () => {
|
||||
const { view } = renderEditor({
|
||||
value: '{\n // note\n "a": [1, 2,], /* more */\n}',
|
||||
language,
|
||||
});
|
||||
expect(await lintNow(view)).toBe(0);
|
||||
});
|
||||
|
||||
it('flags JSONC errors where the converter does', async () => {
|
||||
const { view } = renderEditor({ value: '{\n "a": 1 /* open\n}', language });
|
||||
expect(await lintNow(view)).toBe(1);
|
||||
|
||||
typeInto(view, '');
|
||||
expect(await lintNow(view)).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('CodeEditor — behaviour', () => {
|
||||
it('leaves file drops to the surrounding dropzone', async () => {
|
||||
const { content, view } = renderEditor({ value: 'keep' });
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
import '@/i18n';
|
||||
import type { CodeEditorProps } from '@/components/converter/CodeEditor';
|
||||
import type * as CodeEditorModule from '@/components/converter/CodeEditor';
|
||||
import { ThemeProvider } from '@/lib/theme';
|
||||
import { stubRangeGeometry } from '@/test/range-geometry';
|
||||
import { CodeEditorLazy } from '../CodeEditorLazy';
|
||||
|
||||
// The real editor module, behind a switch that simulates a failed chunk load.
|
||||
@@ -24,22 +25,7 @@ vi.mock('@/components/converter/CodeEditor', async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
|
||||
const emptyRect = { x: 0, y: 0, width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0 };
|
||||
const originalGetClientRects = Object.getOwnPropertyDescriptor(Range.prototype, 'getClientRects');
|
||||
beforeAll(() => {
|
||||
// jsdom has no layout; CodeMirror measures ranges for the cursor layer.
|
||||
Range.prototype.getClientRects = () => [] as unknown as DOMRectList;
|
||||
Range.prototype.getBoundingClientRect = () => ({ ...emptyRect, toJSON: () => emptyRect });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
if (originalGetClientRects) {
|
||||
Object.defineProperty(Range.prototype, 'getClientRects', originalGetClientRects);
|
||||
} else {
|
||||
Reflect.deleteProperty(Range.prototype, 'getClientRects');
|
||||
}
|
||||
Reflect.deleteProperty(Range.prototype, 'getBoundingClientRect');
|
||||
});
|
||||
stubRangeGeometry();
|
||||
|
||||
afterEach(() => {
|
||||
chunk.broken = false;
|
||||
|
||||
@@ -195,6 +195,39 @@ describe('ConverterWorkspace — direction', () => {
|
||||
expect(useWorkspaceStore.getState()).toMatchObject({ direction: 'forward', format: 'csv' });
|
||||
expect(inputBox()).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('converts JSONC back to JSON and places errors in the original text', () => {
|
||||
useWorkspaceStore.setState({ format: 'jsonc', direction: 'reverse' });
|
||||
render(<ConverterWorkspace />);
|
||||
|
||||
type('{\n // comment\n "a": [1, 2,],\n}', 'Input JSONC');
|
||||
expect(outputBox('JSON output (read-only)')).toHaveValue('{\n "a": [\n 1,\n 2\n ]\n}');
|
||||
|
||||
type('{\n /* comment */\n "a": 1\n "b": 2\n}', 'Input JSONC');
|
||||
expect(screen.getByRole('status')).toHaveTextContent(/^Ln 4, Col 3/);
|
||||
expect(screen.getByText('error')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('leaves an input-only format when switching to JSON →', async () => {
|
||||
const user = userEvent.setup();
|
||||
useWorkspaceStore.setState({ format: 'jsonc', direction: 'reverse' });
|
||||
render(<ConverterWorkspace />);
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'JSON →' }));
|
||||
expect(useWorkspaceStore.getState()).toMatchObject({ direction: 'forward', format: 'jsonl' });
|
||||
expect(within(chips()).getByRole('button', { name: 'JSONC' })).toBeDisabled();
|
||||
});
|
||||
|
||||
it('offers to read JSON with comments as JSONC', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<ConverterWorkspace />);
|
||||
type('[1, /* two */ 2]');
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Convert JSONC → JSON' }));
|
||||
expect(useWorkspaceStore.getState()).toMatchObject({ direction: 'reverse', format: 'jsonc' });
|
||||
expect(inputBox('Input JSONC')).toHaveValue('[1, /* two */ 2]');
|
||||
expect(outputBox('JSON output (read-only)')).toHaveValue('[\n 1,\n 2\n]');
|
||||
});
|
||||
});
|
||||
|
||||
describe('ConverterWorkspace — options', () => {
|
||||
@@ -346,6 +379,8 @@ describe('ConverterWorkspace — mobile layout', () => {
|
||||
|
||||
type('[{"a":1}]');
|
||||
expect(badgeOn(outputTab)).toBe(true);
|
||||
// The dot is visual only; the tab's name says it too.
|
||||
expect(outputTab).toHaveAccessibleName('Output (new)');
|
||||
|
||||
await user.click(outputTab);
|
||||
expect(outputTab).toHaveAttribute('aria-selected', 'true');
|
||||
|
||||
@@ -7,6 +7,7 @@ import { FormatPicker } from '../FormatPicker';
|
||||
|
||||
const LABELS: Record<FormatId, string> = {
|
||||
jsonl: 'JSONL',
|
||||
jsonc: 'JSONC',
|
||||
csv: 'CSV',
|
||||
tsv: 'TSV',
|
||||
yaml: 'YAML',
|
||||
@@ -34,7 +35,7 @@ describe('FormatPicker — inline chips', () => {
|
||||
render(<FormatPicker value="yaml" onChange={() => {}} />);
|
||||
const buttons = within(inlineGroup()).getAllByRole('button');
|
||||
expect(buttons.map((b) => b.textContent)).toEqual(Object.values(LABELS));
|
||||
for (const button of buttons) {
|
||||
for (const button of buttons.filter((b) => b.textContent !== 'JSONC')) {
|
||||
expect(button).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
button.textContent === 'YAML' ? 'true' : 'false',
|
||||
@@ -44,6 +45,23 @@ describe('FormatPicker — inline chips', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('disables input-only formats going forward', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onChange = vi.fn();
|
||||
render(<FormatPicker value="jsonl" onChange={onChange} shape="object" />);
|
||||
|
||||
expect(chip('jsonc')).toBeDisabled();
|
||||
expect(chip('jsonc')).toHaveAttribute(
|
||||
'title',
|
||||
'Input only: converts to JSON in the → JSON direction',
|
||||
);
|
||||
// Disabled, not "not suggested": no dashed border.
|
||||
expect(chip('jsonc')).not.toHaveClass('border-dashed');
|
||||
|
||||
await user.click(chip('jsonc'));
|
||||
expect(onChange).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('reports the picked format', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onChange = vi.fn();
|
||||
@@ -84,8 +102,9 @@ describe('FormatPicker — inline chips', () => {
|
||||
expect(chip(format)).toBeDisabled();
|
||||
expect(chip(format)).toHaveAttribute('title', 'Reverse parse not supported for this format');
|
||||
}
|
||||
for (const format of ['jsonl', 'csv', 'tsv', 'yaml', 'toml', 'resx'] as const) {
|
||||
for (const format of ['jsonl', 'jsonc', 'csv', 'tsv', 'yaml', 'toml', 'resx'] as const) {
|
||||
expect(chip(format)).toBeEnabled();
|
||||
expect(chip(format)).toHaveAttribute('title', 'Ready');
|
||||
}
|
||||
|
||||
await user.click(chip('xml'));
|
||||
@@ -107,7 +126,7 @@ describe('FormatPicker — compact sheet (mobile)', () => {
|
||||
await user.click(screen.getByRole('button', { name: /Target format\s*JSONL/ }));
|
||||
const dialog = await screen.findByRole('dialog', { name: 'Target format' });
|
||||
const sheetGroup = within(dialog).getByRole('group', { name: 'Target format' });
|
||||
expect(within(sheetGroup).getAllByRole('button')).toHaveLength(12);
|
||||
expect(within(sheetGroup).getAllByRole('button')).toHaveLength(13);
|
||||
expect(chip('jsonl', sheetGroup)).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(chip('yaml', sheetGroup)).toHaveAttribute('title', 'Suggested for the detected shape');
|
||||
|
||||
|
||||
Loaded 100 of 148 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user