Back to .md Directory

Project Development Requirements (PDR)

**Generated**: 2026-03-22

May 2, 2026
0 downloads
2 views
automation
View source

Project Development Requirements (PDR)

GlassesTryON — Open Source Release Pipeline

Generated: 2026-03-22
Repository: https://github.com/estephanobrusa/GlassesTryOn
Version: 1.0.0 (pre-release)


Executive Summary

GlassesTryON is a real-time virtual glasses try-on library built on MediaPipe FaceMesh and Three.js. It is structured as a pnpm monorepo with three packages:

  • glasses-tryon-core — Framework-agnostic AR engine (camera, face tracking, 3D overlay)
  • glasses-tryon-react<GlassesTryOn> React 18 component wrapping core
  • glasses-tryon-demo — Vite development/demo app

The library has a solid technical foundation: well-structured TypeScript, dual ESM/CJS output via tsup, linting/formatting configured, and a reasonable README. However, it is not yet ready for public npm publishing — it lacks tests entirely, has no CI/CD pipeline, is missing all standard open-source community files (LICENSE, CONTRIBUTING, CHANGELOG), has no semantic versioning automation, and both packages are pinned at version 1.0.0 without any release process.


Current State Analysis

Architecture

CameraEngine → FaceMeshRunner → FaceGeometryEstimator → PoseApplier → ThreeSceneManager
                                 ↑ CameraCalibration
All orchestrated by GlassesViewer (event emitter pattern)

What EXISTS

ItemStatusNotes
TypeScript sourceEXISTSStrict mode, ES2020 target
Dual ESM/CJS buildEXISTStsup with .d.ts generation
ESLint + PrettierEXISTSRoot-level config covering all packages
Basic READMEEXISTSArchitecture, install, usage, roadmap
pnpm monorepoEXISTSpackages/core, packages/react, packages/demo
Demo app (Vite)EXISTSWorking local development environment
Git repositoryEXISTSHosted at github.com/estephanobrusa/GlassesTryOn
Package exports mapEXISTSexports field in both publishable packages
Source mapsEXISTSGenerated by tsup

What is MISSING or PARTIAL

(Full gap analysis in next section)


Gap Analysis

1. Testing Infrastructure

ItemStatusPriority
Test framework setup (Vitest/Jest)MISSINGP0 — Critical
Unit tests: CameraCalibrationMISSINGP0
Unit tests: FaceGeometryEstimator (pose math)MISSINGP0
Unit tests: PoseApplierMISSINGP0
Unit tests: ThreeSceneManagerMISSINGP1
Unit tests: FaceMeshRunner (mocked)MISSINGP1
Unit tests: GlassesViewer (mocked deps)MISSINGP1
Unit tests: React <GlassesTryOn> componentMISSINGP1
Integration tests (headless browser)MISSINGP2
Visual regression testsMISSINGP3
Test coverage reportingMISSINGP1
Test coverage thresholds (>80%)MISSINGP1

Recommended: Vitest (native ESM, fast, monorepo-friendly) + jsdom for DOM APIs + @testing-library/react for component tests. Use vi.mock to stub navigator.mediaDevices and @mediapipe/face_mesh.

2. CI/CD Pipeline

ItemStatusPriority
GitHub Actions workflow directoryMISSINGP0 — Critical
CI: lint + type-check on PRMISSINGP0
CI: run tests on PRMISSINGP0
CI: build all packages on PRMISSINGP0
CD: automated npm publish on release tagMISSINGP0
CD: changelog generationMISSINGP1
CD: GitHub Release creationMISSINGP1
Branch protection rulesMISSINGP1
Matrix testing (Node 18, 20, 22)MISSINGP2
Demo deployment (GitHub Pages / Vercel)MISSINGP2
Security scanning (CodeQL / Dependabot)MISSINGP2
Dependabot configurationMISSINGP2

Recommended workflow structure:

.github/workflows/
├── ci.yml          # PR checks: lint, typecheck, test, build
├── release.yml     # Tag-triggered: changelog, npm publish, GH release
└── dependabot.yml  # Automated dependency updates

3. NPM Publishing Configuration

ItemStatusPriority
publishConfig in package.jsonMISSINGP0 — Critical
.npmignore or files fieldMISSINGP0
peerDependencies declaredMISSINGP0
engines field (Node >= 18)MISSINGP1
repository, bugs, homepage fieldsMISSINGP1
keywords for npm discoverabilityMISSINGP1
license field in package.jsonMISSINGP0
Scoped package names (@org/...) decisionMISSINGP1
react declared as peerDependency in react pkgMISSINGP0
three declared as peerDependency in core pkgMISSINGP1
Semantic versioning starting point (0.1.0 vs 1.0.0)MISSINGP1
npm provenance (via Actions OIDC)MISSINGP2

Critical fix: glasses-tryon-react lists react as a runtime dependency, not peerDependency. This will cause duplicate React installations in consumer projects.

4. Documentation

ItemStatusPriority
LICENSE fileMISSINGP0 — Critical (required for open source)
CONTRIBUTING.mdMISSINGP1
CHANGELOG.mdMISSINGP1
CODE_OF_CONDUCT.mdMISSINGP2
SECURITY.mdMISSINGP2
API reference docs (TypeDoc)MISSINGP1
README: badges (npm, CI, license, coverage)MISSINGP1
README: browser compatibility tableMISSINGP1
README: performance/hardware requirementsMISSINGP2
README: migration guide formatMISSINGP3
JSDoc comments on public APIPARTIALP1 — Some exist, not consistent
TypeDoc configurationMISSINGP2

5. Code Quality Tools

ItemStatusPriority
ESLint configuredEXISTS
Prettier configuredEXISTS
TypeScript strict modeEXISTS
typecheck script (tsc --noEmit)MISSINGP0 — No way to verify types without building
lint script at rootEXISTS
Pre-commit hooks (husky + lint-staged)MISSINGP1
Commit message linting (commitlint)MISSINGP1
Conventional Commits enforcementMISSINGP1
@typescript-eslint/no-explicit-any rulePARTIALP2 — Several any usages in source
Dead code elimination checkMISSINGP3
Bundle size trackingMISSINGP2

Note: FaceMeshRunner.ts:14 has private faceMesh: any, GlassesViewer.ts:201 uses any in emit. These should be typed properly.

6. Semantic Versioning & Release Automation

ItemStatusPriority
Conventional Commits formatMISSINGP1
release-please or semantic-releaseMISSINGP0 — Critical
Version synchronization across packagesMISSINGP1
Git tags on releasesMISSINGP0
Pre-release (alpha/beta/rc) workflowMISSINGP2
CHANGELOG.md auto-generationMISSINGP1

Recommended: release-please (Google) — integrates natively with GitHub Actions, handles monorepos via release-please-config.json, generates conventional changelog, creates GitHub Releases, and triggers npm publish workflow.

7. Security

ItemStatusPriority
Dependabot alerts enabledMISSINGP1
dependabot.yml configMISSINGP1
CodeQL analysisMISSINGP2
SECURITY.md (vulnerability reporting)MISSINGP2
npm audit in CIMISSINGP1
Package lock integrity checkPARTIALpnpm-lock.yaml exists

8. Examples & Demos

ItemStatusPriority
Local Vite demo appEXISTS
Live hosted demo (GitHub Pages)MISSINGP2
Vanilla JS/TS examplePARTIALIn README only, not runnable standalone
React examplePARTIALIn README only
Vue exampleMISSINGP3
Next.js SSR handling exampleMISSINGP2 — navigator.mediaDevices is browser-only
CodeSandbox / StackBlitz embedMISSINGP2

Prioritized Roadmap

Phase 1 — Foundation (Release Blockers) — P0 Items

These MUST be done before any public release:

  1. Add LICENSE file — MIT recommended (compatible with Three.js MIT and MediaPipe Apache-2.0)
  2. Fix peerDependencies — Move react, react-dom to peerDeps in glasses-tryon-react; mark three as peerDep in glasses-tryon-core
  3. Add files field to publishable packages (whitelist dist/ only)
  4. Add license field to all package.json files
  5. Add typecheck scripttsc --noEmit at root covering all packages
  6. Setup Vitest — Configure with jsdom, write first unit tests for pure functions
  7. GitHub Actions CIci.yml: on PR → lint + typecheck + test + build
  8. Semantic release — Add release-please config for monorepo
  9. GitHub Actions CDrelease.yml: on release PR merge → publish to npm

Phase 2 — Quality & Community — P1 Items

  1. CONTRIBUTING.md — Development setup, PR guidelines, commit convention
  2. CHANGELOG.md — Initial entry for v1.0.0
  3. Conventional Commits + commitlint — Enforce on CI
  4. Pre-commit hooks — husky + lint-staged for lint/format
  5. Test coverage ≥ 80% for core package math functions
  6. README badges — npm version, CI status, license, coverage
  7. JSDoc on all public API — Consistent documentation
  8. repository, bugs, homepage in package.json
  9. engines field{ "node": ">=18" }
  10. npm audit in CI
  11. Dependabot config

Phase 3 — Discovery & Polish — P2+ Items

  1. Live demo — Deploy demo to GitHub Pages or Vercel
  2. TypeDoc — Auto-generated API docs site
  3. CodeQL — Security scanning in CI
  4. SECURITY.md — Vulnerability disclosure policy
  5. Bundle size CI check
  6. Next.js compatibility guide — SSR/dynamic import pattern
  7. npm provenance — SLSA Level 3 via OIDC
  8. CODE_OF_CONDUCT.md

Technical Debt Inventory

LocationIssueSeverity
FaceMeshRunner.ts:14private faceMesh: any — should type the MediaPipe FaceMesh instanceMedium
GlassesViewer.ts:201...args: any[] in private emit — use typed event mapLow
ThreeSceneManager.ts:128Multiple (obj as any) casts — can use typed Three.js traversalLow
GlassesTryOn.tsx:37viewerRef.current.start() not awaited in useEffectMedium
FaceMeshRunner.ts:28CDN URL hardcoded in source — should be configurableMedium
All packagesversion: "1.0.0" — should be 0.1.0 for pre-stable APIHigh
packages/reactMissing onFaceLost propLow
packages/reactdebug: true hardcodedMedium

Package.json Corrections Required (Pre-Publish)

packages/core/package.json

{
  "license": "MIT",
  "engines": { "node": ">=18" },
  "files": ["dist"],
  "peerDependencies": {
    "three": ">=0.150.0"
  },
  "repository": { "type": "git", "url": "https://github.com/estephanobrusa/GlassesTryOn.git" },
  "keywords": ["ar", "virtual-try-on", "glasses", "face-mesh", "mediapipe", "three.js", "webgl"]
}

packages/react/package.json

{
  "license": "MIT",
  "engines": { "node": ">=18" },
  "files": ["dist"],
  "peerDependencies": {
    "react": ">=17.0.0",
    "react-dom": ">=17.0.0"
  },
  "dependencies": {
    "glasses-tryon-core": "workspace:*"
  }
}

(Remove react and react-dom from dependencies)


Recommended Tool Choices

CategoryToolRationale
TestingVitestNative ESM, fast HMR, Vite-compatible, monorepo support
DOM testingjsdom + @testing-library/reactStandard, well-supported
Release automationrelease-pleaseGitHub-native, monorepo support, conventional commits
Pre-commit hookshusky + lint-stagedIndustry standard, minimal config
Commit lintingcommitlint + @commitlint/config-conventionalEnforces commit format for release-please
API docsTypeDocTypeScript-native, good output quality
CIGitHub ActionsAlready hosting on GitHub, free for public repos
npm publishnpm + OIDC provenanceMost direct path, provenance for supply chain security

Related Documents