Skip to content

Commit 7c731a8

Browse files
chore: monorepo cleanup — correct override floors, healthchecks, hygiene
- pnpm-workspace.yaml override floors: previously over-applied patches mass-bumped transitive consumers to unblessed branches. Tighten to the minimum fixed version per advisory: - lodash ">=4.18.0" → ">=4.17.21" (CVE-2019-10744 fixed in 4.17.12) - tar ">=7.5.11" → ">=6.2.1" (CVE-2024-28863 fixed in 6.2.1; was forcing every consumer through a tar 6→7 major) - minimatch ">=5.0.0" → ">=3.0.5" (GHSA fixed in 3.0.5; was forcing a two-major jump) - brace-expansion ">=2.0.3" → ">=2.0.2" (GHSA fixed in 2.0.2) Drop redundant pnpm 11 defaults (linkWorkspacePackages: deep, preferWorkspacePackages, saveWorkspaceProtocol, dedupePeerDependents). Relabel the esbuild pin as "regression workaround, not CVE" — it was misleadingly grouped with vuln overrides. - Root package.json: relocate misplaced deps to where they're used. All @capacitor/* runtime deps + capacitor-plugin-safe-area moved to standalone/webapp. @resvg/resvg-js moved to webapp devDeps (only used by tests/helpers/resvgRender.ts). @emotion/* removed from root (library already devDeps them; webapp now has them as direct deps so MUI's styled-engine resolves). Removed `yaml` (zero usages) and `iobuffer` (zero usages). @types/pdfmake at root (v0.3.2) removed — server uses the correct pinned v0.2.x. vite at root removed — each workspace has its own pin. - Library theatre tests cut: textUtils.test.ts deleted (tested the jsdom mock equal to itself); storeUtils.test.ts engine-dependent "may be true or false" assertion removed. 772 → 772 useful tests. - Library: trim long getBBox comment block in conversion-service.ts (now in extracted jsdom-shims.ts), kill file-wide eslint-disable. Pre-call patches hoisted to one-time worker init. - Library: narrow esbuild `drop` to `["debugger"]`. `console`-drop was silently stripping React/MUI runtime warnings from the formerly-inlined standalone bundle. - Library: ditch 5-line JSDoc bloat in lib/utils/textUtils.ts that duplicated the function signature. - Library description trimmed from keyword-stuffed paragraph to one factual sentence. - Library engines.node stays at >=22 (public package supports Node 22 LTS through 2027); rest of monorepo pinned at >=24.15.0. - Server, webapp Dockerfiles: HEALTHCHECK directives added so orchestrators get liveness signals from the image directly, not only from compose. - .dockerignore tightened — excludes **/tests, **/__tests__, **/*.test.ts, vscode-extension/{src,*/src,*/dist,dist}, scripts/, .husky/, .changeset/. Saves cache layer hits. - Webapp eslint warning: remove unused-disable-directive in LegalPage.tsx (no-console rule no longer fires here). - release-library.yml: replace brittle `pnpm pack | tail -n 1` (pnpm/pnpm#10200 — pnpm warnings on stdout) with `pnpm pack --json | jq -r '.filename // .[0].filename'`. - commitlint: add scope-enum (library | server | webapp | vscode | vscode-extension | deps | ci | docker | docs | release). - Add .gitattributes: pnpm-lock.yaml as linguist-generated + binary merge, LF normalization, common binary types. - Add lint-staged "ts/tsx prettier only" + json/md/yml prettier rules to root package.json (ESLint stays out of pre-commit; runs in CI). - VS Code extension pre-existing lint errors fixed: - menu-provider.ts: drop unused `context`/`token` params from resolveWebviewView signature; drop unused `error` catch binding. - extension.ts: drop unused `error` catch binding.
1 parent bad222b commit 7c731a8

10 files changed

Lines changed: 172 additions & 1087 deletions

File tree

.dockerignore

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.git
22
.github
33
.gitignore
4+
.husky
45
.context
56
.env
67
.env.*
@@ -16,15 +17,29 @@ test-results/
1617
*.log
1718

1819
node_modules/
20+
**/node_modules/
1921
dist/
22+
**/dist/
23+
24+
**/tests/
25+
**/__tests__/
26+
**/*.test.ts
27+
**/*.test.tsx
28+
**/*.spec.ts
29+
**/playwright.config.ts
30+
**/vitest.config.ts
2031

21-
standalone/webapp/dist
22-
standalone/webapp/node_modules
2332
standalone/webapp/android
2433
standalone/webapp/ios
2534

26-
standalone/server/dist
27-
standalone/server/node_modules
35+
# Keep the vscode-extension package.json files (pnpm install reads them
36+
# as workspace manifests), but drop the source.
37+
vscode-extension/src
38+
vscode-extension/menu/src
39+
vscode-extension/editor/src
40+
vscode-extension/menu/dist
41+
vscode-extension/editor/dist
42+
vscode-extension/dist
2843

29-
library/node_modules
30-
library/dist
44+
scripts/
45+
.changeset/

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto eol=lf
2+
3+
pnpm-lock.yaml linguist-generated=true -diff merge=binary
4+
5+
*.png binary
6+
*.jpg binary
7+
*.jpeg binary
8+
*.gif binary
9+
*.ico binary
10+
*.svg text
11+
*.vsix binary

.github/workflows/release-library.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ jobs:
8686
- name: Pack
8787
id: pack
8888
working-directory: library
89+
# `pnpm pack --json` writes the tarball path to stdout as structured
90+
# output; previous `pnpm pack | tail -n 1` broke when pnpm logged
91+
# warnings on stdout (pnpm/pnpm#10200).
8992
run: |
90-
TARBALL=$(pnpm pack | tail -n 1)
93+
set -euo pipefail
94+
TARBALL=$(pnpm pack --json | jq -r '.filename // .[0].filename')
95+
test -f "$TARBALL"
9196
echo "tarball=${TARBALL}" >> "$GITHUB_OUTPUT"
9297
9398
- name: Publish to npm with OIDC trusted publishing

commitlint.config.mjs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
export default { extends: ['@commitlint/config-conventional'] };
1+
export default {
2+
extends: ["@commitlint/config-conventional"],
3+
rules: {
4+
"scope-enum": [
5+
2,
6+
"always",
7+
[
8+
"library",
9+
"server",
10+
"webapp",
11+
"vscode",
12+
"vscode-extension",
13+
"deps",
14+
"ci",
15+
"docker",
16+
"docs",
17+
"release",
18+
],
19+
],
20+
},
21+
}

package.json

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,16 @@
5454
"@capacitor/cli": "8.3.0",
5555
"@commitlint/cli": "19.6.0",
5656
"@commitlint/config-conventional": "19.6.0",
57-
"@emotion/react": "11.11.1",
58-
"@emotion/styled": "11.11.0",
59-
"@resvg/resvg-js": "2.6.2",
6057
"@types/node": "24.12.4",
6158
"concurrently": "9.1.0",
6259
"husky": "9.1.7",
6360
"lint-staged": "15.5.2",
64-
"prettier": "3.4.2",
65-
"vite": "6.4.2",
66-
"yaml": "2.8.3"
61+
"prettier": "3.4.2"
6762
},
6863
"lint-staged": {
69-
"*.{js,jsx,mjs,cjs,ts,tsx,json,md,yml,yaml}": "prettier --ignore-unknown --write"
70-
},
71-
"dependencies": {
72-
"@capacitor/android": "8.3.0",
73-
"@capacitor/core": "8.3.0",
74-
"@capacitor/file-transfer": "2.0.4",
75-
"@capacitor/filesystem": "8.1.2",
76-
"@capacitor/ios": "8.3.0",
77-
"@capacitor/share": "8.0.1",
78-
"@capacitor/splash-screen": "8.0.1",
79-
"@capacitor/status-bar": "8.0.2",
80-
"capacitor-plugin-safe-area": "4.0.0"
64+
"*.{js,jsx,mjs,cjs,ts,tsx}": [
65+
"prettier --ignore-unknown --write"
66+
],
67+
"*.{json,md,yml,yaml}": "prettier --ignore-unknown --write"
8168
}
8269
}

0 commit comments

Comments
 (0)