- Stencil.js web component library orchestrated with Nx (monorepo)
- Core components live in
libs/core/src/components/ - All components are prefixed with
pds-(e.g.,pds-button,pds-table) - Each component may include:
*.tsx,*.scss,*.figma.ts,stories/,docs/,test/, and auto-generatedreadme.md - Composite components have nested subcomponent directories (e.g.,
pds-table/pds-table-row/) - React wrappers are generated in
libs/react/
- Commits, branches, and linting are enforced by lefthook hooks (commitlint, validate-branch-name, lint-staged) — do not skip hooks
- Branch names must follow:
{type}/{description}— accepted types:chore,ci,docs,feat,fix,hotfix,perf,refactor,revert,style,test - Do NOT include ticket or issue numbers in branch names or commit messages
- Commit scope should match the component name (e.g.,
feat(pds-table):,fix(pds-button):) - Keep commit messages to a single line
feat(component):— new props, events, methods, or component behavior in*.tsxfix(component):— bug fixes in component codetest(component):— test files (*.spec.tsx,*.e2e.ts)docs(component):— MDX docs, Storybook stories, and documentation updatesstyle(component):— SCSS/CSS-only changesrefactor(component):— code restructuring with no behavior changechore:— tooling, config, dependencies
- PR title must follow conventional commits format:
type(scope): description - Always use the repo PR template at
.github/pull_request_template.mdfor the PR body - If your branch is behind
main, rebase before pushing:git rebase main - Requires at least two approved reviews before merging
- See
CONTRIBUTING.mdfor full contributor guidelines
- Spec tests go in the component's
test/folder (e.g.,pds-chip/test/pds-chip.spec.tsx) using Stencil'snewSpecPage - E2E tests also in the component's
test/folder using Stencil'snewE2EPage - Every new prop, event, or behavior needs corresponding test coverage
- JSDoc descriptions on
@Prop,@Event, and@Methodmust use consistent terminology across components — review similar props/events on other components before writing new descriptions - When adding a prop or event that exists in a similar form on another component, match the wording and phrasing of the existing description
- Build all:
npm run build.all(npx nx run-many --target=build) - Test all:
npm run test.all(npx nx run-many --target=test) - Lint all:
npm run lint.all(npx nx run-many --target=lint) - Target core only:
npx nx run @pine-ds/core:build,npx nx run @pine-ds/core:test - After modifying a component's
*.tsx, rebuild to regeneratecomponents.d.tsandreadme.md - Dev server:
npm run start(Storybook at localhost:6006) - Linting: ESLint (with
@stencil-community/recommended+@typescript-eslint), Prettier, and Stylelint - Generate a new component:
npm run stencil.generate pds-[component-name]— choose*.scss Formatwhen prompted, then copystories/anddocs/folders from an existing component
- Always: follow existing component patterns, run lint and tests before committing, use conventional commits with component scope, match JSDoc terminology from similar components
- Ask first: adding new dependencies, creating files outside component directories, making breaking API changes (removing props/events), modifying CI/CD or build config
- Never: skip lefthook hooks, edit auto-generated files (
readme.md,components.d.ts) manually, commit secrets or.envfiles, modifynode_modules/ordist/