Set up the package, compiler and quality gates before any app code so every later change lands under the same rules: Node 26 via .nvmrc and engines, TypeScript 7 in strict mode with the extra strictness flags, swc for transpiling, oxlint with type-aware, Unicorn and security rules (eslint-plugin-security and no-unsanitized loaded as JS plugins), oxfmt, Vitest with a 100% coverage gate, and husky hooks that run the checks and commitlint. Type escape hatches, lint suppressions and coverage exemptions are banned unless registered in exceptions.json. scripts/audit-exceptions enforces that, and its test runs it against this repository, so an unregistered suppression fails both the pre-commit hook and CI. npm 11 blocks dependency install scripts by default. None are needed: Electron downloads its binary on first use, swc's native binding comes from optionalDependencies, fsevents ships prebuilt, and electron-winstaller only serves Squirrel installers, which aren't used. They are recorded as denied in allowScripts.
88 lines
2.8 KiB
JSON
88 lines
2.8 KiB
JSON
{
|
|
"name": "mdts-desktop",
|
|
"productName": "mdts Desktop",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"description": "Desktop app for browsing and previewing Markdown folders, built on mdts and Electron",
|
|
"homepage": "https://github.com/JMR-dev/mdts-desktop",
|
|
"bugs": "https://github.com/JMR-dev/mdts-desktop/issues",
|
|
"license": "MIT",
|
|
"author": {
|
|
"name": "Jason Ross",
|
|
"email": "jason.ross841@gmail.com"
|
|
},
|
|
"repository": "github:JMR-dev/mdts-desktop",
|
|
"type": "module",
|
|
"main": "dist/main/index.js",
|
|
"scripts": {
|
|
"prepare": "husky",
|
|
"postinstall": "patch-package",
|
|
"clean": "node --eval \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
"build": "npm run clean && npm run build:esm && npm run build:preload",
|
|
"build:esm": "swc src/main src/host src/shared src/renderer --out-dir dist --strip-leading-paths --copy-files --ignore \"**/*.test.ts\" --config-file swc/esm.swcrc",
|
|
"build:preload": "swc src/preload/start.ts --out-file dist/preload/start.cjs --config-file swc/preload.swcrc",
|
|
"start": "npm run build && electron .",
|
|
"typecheck": "tsc --build",
|
|
"lint": "oxlint --type-aware --deny-warnings",
|
|
"format": "oxfmt",
|
|
"format:check": "oxfmt --check",
|
|
"audit:exceptions": "node scripts/audit-exceptions.ts",
|
|
"check": "npm run format:check && npm run lint && npm run typecheck && npm run audit:exceptions",
|
|
"test:unit": "vitest run --coverage",
|
|
"test:e2e": "npm run build && playwright test",
|
|
"dist": "npm run build && electron-builder --publish never"
|
|
},
|
|
"dependencies": {
|
|
"mdts": "0.21.0",
|
|
"zod": "4.6.5"
|
|
},
|
|
"devDependencies": {
|
|
"@commitlint/cli": "21.2.3",
|
|
"@commitlint/config-conventional": "21.2.3",
|
|
"@commitlint/types": "21.2.3",
|
|
"@cyclonedx/cyclonedx-npm": "6.0.1",
|
|
"@playwright/test": "1.63.0",
|
|
"@swc/cli": "0.8.1",
|
|
"@swc/core": "1.16.2",
|
|
"@types/node": "24.19.0",
|
|
"@types/ws": "8.18.1",
|
|
"@vitest/browser": "5.0.2",
|
|
"@vitest/browser-playwright": "5.0.2",
|
|
"@vitest/coverage-v8": "5.0.2",
|
|
"electron": "44.4.5",
|
|
"electron-builder": "26.17.0",
|
|
"eslint-plugin-no-unsanitized": "4.1.5",
|
|
"eslint-plugin-security": "4.1.0",
|
|
"husky": "9.1.7",
|
|
"monocart-coverage-reports": "2.13.0",
|
|
"oxfmt": "0.71.0",
|
|
"oxlint": "1.86.0",
|
|
"oxlint-tsgolint": "7.0.2003",
|
|
"patch-package": "8.0.1",
|
|
"playwright": "1.63.0",
|
|
"typescript": "7.0.2",
|
|
"vitest": "5.0.2",
|
|
"ws": "8.22.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=26 <27"
|
|
},
|
|
"devEngines": {
|
|
"runtime": {
|
|
"name": "node",
|
|
"version": ">=26 <27",
|
|
"onFail": "error"
|
|
},
|
|
"packageManager": {
|
|
"name": "npm",
|
|
"version": ">=11",
|
|
"onFail": "error"
|
|
}
|
|
},
|
|
"allowScripts": {
|
|
"@swc/core": false,
|
|
"electron-winstaller": false,
|
|
"fsevents": false
|
|
}
|
|
}
|