2.2 KiB
2.2 KiB
Repository Guidelines
Project Structure & Module Organization
legacy/contains the application source. This is the active codebase.- PHP entry points live under
legacy/andlegacy/hwe/(for examplelegacy/index.php,legacy/hwe/index.php). - Core PHP domain code is under
legacy/src/sammo/(PSR-4sammo\\namespace). - Frontend TypeScript/Vue sources are in
legacy/hwe/ts/with shared components inlegacy/hwe/ts/components/. - Styles are split between
legacy/css/and SCSS inlegacy/hwe/scss/. - Tests: PHPUnit in
legacy/tests/, TypeScript tests inlegacy/hwe/test-ts/. - Static data/assets: scenarios in
legacy/hwe/scenario/, templates inlegacy/hwe/templates/.
Build, Test, and Development Commands
Run commands from legacy/ unless noted.
composer installinstalls PHP dependencies.npm installinstalls frontend/tooling dependencies.npm run buildbuilds production JS/CSS via webpack.npm run buildDevbuilds development assets.npm run watchornpm run watchProdruns webpack in watch mode.npm run lintlintslegacy/hwe/tswith ESLint.npm testruns all tests (phpunit+mocha).vendor/bin/phpunit --bootstrap vendor/autoload.php testsruns PHP tests only.npm run test-tsruns TypeScript tests only.
Coding Style & Naming Conventions
- Indentation: 4 spaces, no tabs; line length ~120
- PHP modules follow PSR-4 in
legacy/src/sammo/. - Legacy endpoints are named by role: JSON handlers
legacy/hwe/j_*.php, viewslegacy/hwe/v_*.php, admin pageslegacy/hwe/_admin*.php. - Vue components use PascalCase filenames (e.g.,
legacy/hwe/ts/components/MapViewer.vue).
Testing Guidelines
- PHPUnit for PHP (
legacy/tests/*Test.php). - Mocha for TypeScript (
legacy/hwe/test-ts/*.test.ts). - Prefer adding tests alongside the module you change; keep naming consistent with existing patterns.
Commit & Pull Request Guidelines
- Git history is minimal and does not define a strict convention; use short, imperative messages (e.g., "Fix map cache loading").
- PRs should include a concise description, testing notes/commands, and screenshots for UI changes.
- Avoid committing secrets; use templates in
legacy/f_install/templates/and settings files underlegacy/hwe/d_setting/as references.