Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/project-liminal-drift-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- "pnpm-workspace.yaml"
- "patches/**"
- "scripts/auditDependencies*.mjs"
- "scripts/checkBracesSecurity.cjs"
push:
branches:
- main
Expand All @@ -23,7 +22,6 @@ on:
- "pnpm-workspace.yaml"
- "patches/**"
- "scripts/auditDependencies*.mjs"
- "scripts/checkBracesSecurity.cjs"

permissions:
contents: read
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/project-youtube-auto-resume-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- "pnpm-workspace.yaml"
- "patches/**"
- "scripts/auditDependencies*.mjs"
- "scripts/checkBracesSecurity.cjs"
- ".github/workflows/project-youtube-auto-resume-ci.yml"
push:
branches:
Expand All @@ -22,7 +21,6 @@ on:
- "pnpm-workspace.yaml"
- "patches/**"
- "scripts/auditDependencies*.mjs"
- "scripts/checkBracesSecurity.cjs"
- ".github/workflows/project-youtube-auto-resume-ci.yml"

permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- "pnpm-workspace.yaml"
- "patches/**"
- "scripts/auditDependencies*.mjs"
- "scripts/checkBracesSecurity.cjs"
- ".github/workflows/project-youtube-auto-resume-extension-ci.yml"
push:
branches:
Expand All @@ -22,7 +21,6 @@ on:
- "pnpm-workspace.yaml"
- "patches/**"
- "scripts/auditDependencies*.mjs"
- "scripts/checkBracesSecurity.cjs"
- ".github/workflows/project-youtube-auto-resume-extension-ci.yml"

permissions:
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ Personal monorepo for apps, packages, local Python projects, and assorted experi

Archived tools include [Refrain Trainer](./others/game-tools/refrain-trainer/README.md), a one-off Chinese Windows trainer for Labyrinth of Refrain. See the [Others index](./others/README.md) for the full inventory.

## Related repositories

- [InFalsusTouch](https://github.com/Cedarflake/InFalsusTouch): an unofficial Android USB touch controller for the PC rhythm game In Falsus, with streamed gameplay, six touch keys, Field control, and multi-device co-op. [Download the preview](https://github.com/Cedarflake/InFalsusTouch/releases/tag/v0.5.0-preview.1).

InFalsusTouch is maintained in its own repository and does not currently declare a reuse license.

## Commands

```bash
Expand All @@ -46,8 +40,6 @@ pnpm render:email

Use `pnpm --filter <package-name> <script>` for project-specific frontend/package commands.

`pnpm audit:dependencies` audits the full pnpm workspace, including development dependencies, against the npm registry at the high severity threshold. The registry still reports `GHSA-vfj7-8cjw-p6xm` for the locally patched `braces@3.0.3`. This command recognizes that one mitigation only after checking the reviewed patch hash, all locked braces instances, and the installed package's security regression. Other high/critical advisories, missing patches, and audit errors fail the check. It does not add registry-wide ignore settings. Run `pnpm test:dependency-audit` to verify this gate. Replace the local mitigation when an upstream fix is published and reviewed.

Python workbench checks:

```powershell
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/config/projects/building.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const buildingProjectEntries = [
{
title: "Personal Email",
path: "apps/personal-email",
updatedAt: "2026-10-24T17:14:25Z",
updatedAt: "2026-11-08T16:31:59Z",
summary:
"React Email templates and local scripts for rendering, selecting, and delivering personal mail.",
label: "Local tool",
Expand Down
10 changes: 10 additions & 0 deletions apps/personal-email/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ EMAIL_TEMPLATE=reset_password TO_NAME=李四 MAIL_TO=foo@example.com pnpm run se
- 模板字符串支持占位符 `{{name}}` 等,脚本会在渲染前替换它们。
- `brandDefaults` 用于统一公司名称、logo、主色和页脚文本,修改此处可改变全局样式。

验证命令(从仓库根目录运行):

```bash
pnpm --filter personal_email check
pnpm --filter personal_email render:all
```

`check` 包含 lint、类型检查以及 HTML 转义、纯文本和两种渲染入口的回归测试。

扩展提示

- 若需要更复杂的内容(如表格、多行项目),在 `TemplateRenderer.tsx` 中扩展渲染逻辑或创建新的模板组件,仍然使用 `EmailLayout` 以保持一致样式。

5 changes: 3 additions & 2 deletions apps/personal-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"type": "module",
"scripts": {
"build": "pnpm run build:ts",
"check": "pnpm lint && pnpm typecheck",
"check": "pnpm lint && pnpm typecheck && pnpm test:render",
"test:render": "node --test scripts/renderSecurity.test.mjs",
"render:email": "pnpm run build:ts && node dist/scripts/renderEmail.js",
"render:all": "pnpm run build:ts && node dist/scripts/renderAll.js",
"email": "pnpm run build:ts && node dist/scripts/cli.js",
Expand All @@ -20,7 +21,7 @@
},
"dependencies": {
"@react-email/components": "1.0.10",
"@react-email/render": "^2.0.0",
"@react-email/render": "^2.2.0",
"dotenv": "^16.0.0",
"nodemailer": "^10.1.4",
"prompts": "^2.4.2",
Expand Down
37 changes: 37 additions & 0 deletions apps/personal-email/scripts/renderSecurity.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import assert from 'node:assert/strict';
import test from 'node:test';

import { render as renderComponents, toPlainText as componentsToPlainText } from '@react-email/components';
import { render, toPlainText } from '@react-email/render';
import { createElement } from 'react';

test('direct and component renderers preserve HTML escaping and plain text', async () => {
const name = '示例用户 <script>alert(1)</script> & test';
const email = createElement('p', null, name);
const html = await render(email);

assert.equal(await renderComponents(email), html);
assert.ok(!html.includes('<script>'));
assert.ok(html.includes('&lt;script&gt;'));
assert.equal(toPlainText(html), name);
assert.equal(componentsToPlainText(html), name);
assert.equal(await render(email, { plainText: true }), name);
assert.equal(await renderComponents(email, { plainText: true }), name);
});

test('plain-text conversion keeps default selectors alongside custom selectors', () => {
const html = '<p>Keep</p><p data-skip-in-text="true">Hidden</p><img src="https://example.com/image.png" alt="Hidden image"><span class="omit">Omit</span>';
const options = { selectors: [{ selector: '.omit', format: 'skip' }] };

assert.equal(toPlainText(html, options), 'Keep');
assert.equal(componentsToPlainText(html, options), 'Keep');
assert.deepEqual(options, { selectors: [{ selector: '.omit', format: 'skip' }] });
});

test('plain-text links and Unicode remain readable', () => {
const html = '<p>你好 &amp; welcome</p><p><a href="https://example.com">Visit</a></p><p><a href="https://example.com">https://example.com</a></p>';
const expected = '你好 & welcome\n\nVisit https://example.com\n\nhttps://example.com';

assert.equal(toPlainText(html), expected);
assert.equal(componentsToPlainText(html), expected);
});
2 changes: 1 addition & 1 deletion apps/shika/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"db:check": "drizzle-kit check --config=drizzle.config.ts",
"db:migrate:local": "tsx ./scripts/migrate-local.ts",
"db:migrate": "drizzle-kit migrate --config=drizzle.remote.config.ts",
"check": "pnpm --workspace-root check:dependency-security && pnpm lint && pnpm typecheck && pnpm test && pnpm db:check"
"check": "pnpm lint && pnpm typecheck && pnpm test && pnpm db:check"
},
"dependencies": {
"@better-auth/drizzle-adapter": "1.7.7",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"check:focus-orb-package": "pnpm --filter @cedarflake/focus-orb pack:check && pnpm --filter @cedarflake/focus-orb-demo exec tsc -p package-consumer/tsconfig.json --noEmit",
"test:repository-contract": "tsx --test scripts/repository-contract/*.test.ts",
"typecheck:repository-contract": "tsc -p tsconfig.repository-contract.json --noEmit",
"check:dependency-security": "node scripts/checkBracesSecurity.cjs",
"audit:dependencies": "node scripts/auditDependencies.mjs",
"test:dependency-audit": "node --test scripts/auditDependencies.test.mjs"
},
Expand Down
29 changes: 0 additions & 29 deletions patches/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
# Dependency security patches

## braces 3.0.3

`braces@3.0.3.patch` is a local mitigation for
[GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm), following
the parser-depth mitigation described in [upstream issue #70](https://github.com/micromatch/braces/issues/70).
It is not an upstream release or backport. At the time of this change, the
advisory names 3.0.4 as fixed, but that version is unavailable from npm.

The parser rejects more than 100 combined brace/parenthesis nesting levels.
The compile, expand, and stringify walkers enforce the same bound for callers
that provide an AST directly. Escaped, quoted, and bracketed delimiters remain
literal. Normal inputs, existing length/range limits, and ordinary glob behavior
are preserved; deeply nested valid patterns now throw a controlled `SyntaxError`.
Callers must still handle invalid-input errors. This does not change unrelated
expansion-size behavior.

Run `pnpm check:dependency-security` against the actual installed dependency.
Shika's `check` includes this guard because its ESLint dependency tree owns the
patched package. The guard covers the depth boundary, malformed/mixed nesting,
direct and cyclic AST input, literal delimiters, and ordinary expansion behavior.
It fails if the patch is lost. The optional second package-directory argument
runs seeded differential tests against an unpatched 3.0.3 copy.

The raw package audit still reports this advisory because the installed version
remains 3.0.3. No audit waiver is configured. Browser workflows run their audit
last so functional verification can complete while the audit remains a failing
gate. Replace the local patch with a verified compatible upstream release once
available, rerun the regression and owning checks, then remove this patch entry.

## brace-expansion 5.0.12

`brace-expansion@5.0.12.patch` preserves the existing CommonJS/default-export
Expand Down
133 changes: 0 additions & 133 deletions patches/braces@3.0.3.patch

This file was deleted.

Loading
Loading