svn-visualizer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +60 -0
- package/.gitignore +100 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.release-it.json +23 -0
- package/AGENTS.md +90 -0
- package/CHANGELOG.md +1 -0
- package/CONTRIBUTING.md +65 -0
- package/GENERATED.md +129 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/commitlint.config.js +5 -0
- package/dist/index.js +474 -0
- package/oxc.config.ts +198 -0
- package/oxfmt.config.ts +9 -0
- package/oxlint.config.ts +36 -0
- package/package.json +72 -0
- package/src/aggregation.test.ts +118 -0
- package/src/aggregation.ts +198 -0
- package/src/cli.test.ts +10 -0
- package/src/cli.ts +61 -0
- package/src/client/main.ts +117 -0
- package/src/gather.ts +93 -0
- package/src/index.ts +9 -0
- package/src/model.ts +32 -0
- package/src/report.test.ts +91 -0
- package/src/report.ts +88 -0
- package/src/store.test.ts +52 -0
- package/src/store.ts +48 -0
- package/src/svn-parser.test.ts +34 -0
- package/src/svn-parser.ts +78 -0
- package/tsconfig.json +43 -0
- package/vite.client.config.ts +15 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Node.js CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [22.x, 24.x, 26.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v7
|
|
20
|
+
|
|
21
|
+
- name: Setup pnpm
|
|
22
|
+
uses: pnpm/action-setup@v6
|
|
23
|
+
with:
|
|
24
|
+
version: 10.17.1
|
|
25
|
+
run_install: false
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js
|
|
28
|
+
uses: actions/setup-node@v7
|
|
29
|
+
with:
|
|
30
|
+
node-version: ${{ matrix.node-version }}
|
|
31
|
+
cache: "pnpm"
|
|
32
|
+
|
|
33
|
+
- name: Verify pnpm
|
|
34
|
+
run: pnpm --version
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: pnpm install --frozen-lockfile
|
|
38
|
+
|
|
39
|
+
- name: CI checks (typecheck, lint, format, build, unit, integration)
|
|
40
|
+
run: pnpm run ci
|
|
41
|
+
|
|
42
|
+
- name: Coveralls
|
|
43
|
+
uses: coverallsapp/github-action@v2
|
|
44
|
+
with:
|
|
45
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
46
|
+
file: coverage/lcov.info
|
|
47
|
+
format: lcov
|
|
48
|
+
flag-name: node-${{ matrix.node-version }}
|
|
49
|
+
parallel: true
|
|
50
|
+
|
|
51
|
+
finish:
|
|
52
|
+
needs: build
|
|
53
|
+
if: ${{ always() }}
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
steps:
|
|
56
|
+
- name: Coveralls Finished
|
|
57
|
+
uses: coverallsapp/github-action@v2
|
|
58
|
+
with:
|
|
59
|
+
parallel-finished: true
|
|
60
|
+
carryforward: "node-22.x,node-24.x,node-26.x"
|
package/.gitignore
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# ---------------------------
|
|
2
|
+
# OS / Filesystem
|
|
3
|
+
# ---------------------------
|
|
4
|
+
.DS_Store
|
|
5
|
+
Thumbs.db
|
|
6
|
+
Desktop.ini
|
|
7
|
+
|
|
8
|
+
# ---------------------------
|
|
9
|
+
# Editor / IDE
|
|
10
|
+
# ---------------------------
|
|
11
|
+
.vscode/
|
|
12
|
+
.idea/
|
|
13
|
+
*.swp
|
|
14
|
+
*.swo
|
|
15
|
+
*~
|
|
16
|
+
|
|
17
|
+
# ---------------------------
|
|
18
|
+
# AI
|
|
19
|
+
# ---------------------------
|
|
20
|
+
.opencode
|
|
21
|
+
|
|
22
|
+
# ---------------------------
|
|
23
|
+
# Logs
|
|
24
|
+
# ---------------------------
|
|
25
|
+
logs/
|
|
26
|
+
*.log
|
|
27
|
+
npm-debug.log*
|
|
28
|
+
yarn-debug.log*
|
|
29
|
+
pnpm-debug.log*
|
|
30
|
+
|
|
31
|
+
# ---------------------------
|
|
32
|
+
# Env / Secrets
|
|
33
|
+
# ---------------------------
|
|
34
|
+
.env
|
|
35
|
+
.env.*
|
|
36
|
+
!.env.example
|
|
37
|
+
|
|
38
|
+
# ---------------------------
|
|
39
|
+
# Dependency directories
|
|
40
|
+
# ---------------------------
|
|
41
|
+
node_modules/
|
|
42
|
+
.pnpm-store/
|
|
43
|
+
.npm/
|
|
44
|
+
|
|
45
|
+
# ---------------------------
|
|
46
|
+
# Build output
|
|
47
|
+
# ---------------------------
|
|
48
|
+
dist/
|
|
49
|
+
dist-demo/
|
|
50
|
+
docs/
|
|
51
|
+
coverage/
|
|
52
|
+
.nyc_output/
|
|
53
|
+
playwright-report/
|
|
54
|
+
test-results/
|
|
55
|
+
.vitest-attachments/
|
|
56
|
+
tmp/
|
|
57
|
+
temp/
|
|
58
|
+
.tmp/
|
|
59
|
+
.temp/
|
|
60
|
+
|
|
61
|
+
# ---------------------------
|
|
62
|
+
# TypeScript
|
|
63
|
+
# ---------------------------
|
|
64
|
+
*.tsbuildinfo
|
|
65
|
+
|
|
66
|
+
# ---------------------------
|
|
67
|
+
# Package managers
|
|
68
|
+
# ---------------------------
|
|
69
|
+
package-lock.json
|
|
70
|
+
yarn.lock
|
|
71
|
+
|
|
72
|
+
# NOTE:
|
|
73
|
+
# keep EXACTLY ONE lockfile depending on PM:
|
|
74
|
+
# - npm -> keep package-lock.json
|
|
75
|
+
# - yarn -> keep yarn.lock
|
|
76
|
+
# - pnpm -> keep pnpm-lock.yaml
|
|
77
|
+
|
|
78
|
+
# ---------------------------
|
|
79
|
+
# Caches
|
|
80
|
+
# ---------------------------
|
|
81
|
+
.cache/
|
|
82
|
+
.eslintcache
|
|
83
|
+
.oxc_cache
|
|
84
|
+
|
|
85
|
+
# ---------------------------
|
|
86
|
+
# Misc
|
|
87
|
+
# ---------------------------
|
|
88
|
+
*.tgz
|
|
89
|
+
*.bak
|
|
90
|
+
*.tmp
|
|
91
|
+
|
|
92
|
+
# ---------------------------
|
|
93
|
+
# Custom
|
|
94
|
+
# ---------------------------
|
|
95
|
+
|
|
96
|
+
# NOTE:
|
|
97
|
+
# add custom ignores here
|
|
98
|
+
|
|
99
|
+
/svn-data.json
|
|
100
|
+
/output/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no -- commitlint --edit "$1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm run ci
|
package/.release-it.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"npm": {
|
|
3
|
+
"publish": false
|
|
4
|
+
},
|
|
5
|
+
"git": {
|
|
6
|
+
"requireCleanWorkingDir": true,
|
|
7
|
+
"commit": true,
|
|
8
|
+
"commitMessage": "chore: release ${version}",
|
|
9
|
+
"tag": true,
|
|
10
|
+
"tagName": "v${version}",
|
|
11
|
+
"push": true,
|
|
12
|
+
"pushArgs": ["--follow-tags"]
|
|
13
|
+
},
|
|
14
|
+
"github": {
|
|
15
|
+
"release": true,
|
|
16
|
+
"autoGenerate": true
|
|
17
|
+
},
|
|
18
|
+
"hooks": {
|
|
19
|
+
"before:init": "pnpm run ci",
|
|
20
|
+
"after:bump": "pnpm run create-changelog",
|
|
21
|
+
"before:git:commit": "git add CHANGELOG.md"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Agent Guidelines: svn-visualizer
|
|
2
|
+
|
|
3
|
+
This document provides essential instructions for autonomous agents (like Cursor, GitHub Copilot, or CLI agents) working on the `svn-visualizer` repository.
|
|
4
|
+
|
|
5
|
+
## Build/Lint/Test
|
|
6
|
+
|
|
7
|
+
- `pnpm run ci`: Runs lint, build, and all tests.
|
|
8
|
+
- `pnpm run dev`: Rebuilds the CLI in watch mode.
|
|
9
|
+
- `pnpm run test`: Runs unit tests.
|
|
10
|
+
- `pnpm exec vitest <file>`: Runs a specific test file.
|
|
11
|
+
- `pnpm run lint`: Lints the codebase with Oxlint.
|
|
12
|
+
|
|
13
|
+
## Project Overview
|
|
14
|
+
|
|
15
|
+
A Node.js CLI that incrementally gathers SVN history and generates a self-contained Chart.js HTML report.
|
|
16
|
+
|
|
17
|
+
## Build, Lint, and Test Commands
|
|
18
|
+
|
|
19
|
+
### Core Commands
|
|
20
|
+
|
|
21
|
+
- **Install dependencies:** `pnpm install`
|
|
22
|
+
- **Build project:** `pnpm run build`
|
|
23
|
+
- **Lint code:** `pnpm run lint` (runs Oxlint)
|
|
24
|
+
- **Check types:** `pnpm run typecheck`
|
|
25
|
+
- **Check formatting:** `pnpm run format:check`
|
|
26
|
+
- **Run all tests:** `pnpm run test` (uses `vitest` with coverage)
|
|
27
|
+
- **Run CI suite:** `pnpm run ci` (lint + build + test)
|
|
28
|
+
|
|
29
|
+
### Targeted Testing
|
|
30
|
+
|
|
31
|
+
- **Run a single test file:** `pnpm exec vitest src/index.test.ts`
|
|
32
|
+
- **Run tests matching a pattern:** `pnpm exec vitest -t "feature"`
|
|
33
|
+
- **Watch mode:** `pnpm exec vitest`
|
|
34
|
+
|
|
35
|
+
## Code Style & Conventions
|
|
36
|
+
|
|
37
|
+
### Language & Runtime
|
|
38
|
+
|
|
39
|
+
- **TypeScript:** Strict mode is mandatory. Use explicit types for function boundaries.
|
|
40
|
+
- **Node.js:** Targets >= 22.0.0.
|
|
41
|
+
- **ESM:** The project uses ES Modules (`"type": "module"` in `package.json`).
|
|
42
|
+
|
|
43
|
+
### Imports
|
|
44
|
+
|
|
45
|
+
- **Extensions:** Always use `.js` extensions in relative imports (e.g., `import { main } from './lib.js';`) to comply with ESM requirements in Node.js, even though source files are `.ts`.
|
|
46
|
+
- **Built-ins:** Use the `node:` prefix for built-in modules (e.g., `import path from 'node:path';`).
|
|
47
|
+
|
|
48
|
+
### Linting & Formatting Configuration
|
|
49
|
+
|
|
50
|
+
This project uses a layered configuration approach:
|
|
51
|
+
|
|
52
|
+
- **`oxc.config.ts`** — Managed source of truth for `oxlint` and `oxfmt` defaults. **Do not edit this file**; it is overwritten during template updates.
|
|
53
|
+
- **`oxlint.config.ts`** — User-customizable linting overrides. Preserved across updates. Use this to add or relax lint rules for your project.
|
|
54
|
+
- **`oxfmt.config.ts`** — User-customizable formatting overrides. Preserved across updates. Use this to adjust formatting preferences.
|
|
55
|
+
- **Tooling:** oxfmt is enforced via `pnpm run lint`.
|
|
56
|
+
- **Indentation:** Tabs are used for indentation.
|
|
57
|
+
- **Quotes:** Single quotes for strings, except when double quotes prevent escaping.
|
|
58
|
+
|
|
59
|
+
### Architecture & Types
|
|
60
|
+
|
|
61
|
+
- **Modularity:** Keep logic modularized.
|
|
62
|
+
- **Type Safety:** Use `zod` for runtime schema validation and `z.infer` for type definitions.
|
|
63
|
+
- **Immutability:** Prefer `readonly` and `const` where possible to ensure data integrity.
|
|
64
|
+
|
|
65
|
+
### Naming Conventions
|
|
66
|
+
|
|
67
|
+
- **Variables/Functions:** `camelCase`.
|
|
68
|
+
- **Constants:** `UPPER_SNAKE_CASE`.
|
|
69
|
+
- **Files:** `kebab-case.ts`.
|
|
70
|
+
|
|
71
|
+
### Error Handling
|
|
72
|
+
|
|
73
|
+
- **CLI Errors:** Throw descriptive errors.
|
|
74
|
+
- **Safety:** Always use `try...finally` or `using` (if applicable) to ensure resources like file handles or connections are closed.
|
|
75
|
+
- **Validation:** Validate all user inputs and CLI arguments using Zod schemas before processing.
|
|
76
|
+
|
|
77
|
+
## Mandatory Completion Protocol (Definition of Done)
|
|
78
|
+
|
|
79
|
+
No task involving code changes is considered complete until the agent provides the following "Evidence of Done" in its final response:
|
|
80
|
+
|
|
81
|
+
1. **CI Verification:** The agent MUST run `pnpm run ci` and include the full terminal output (showing `Found 0 warnings and 0 errors` and `Tests passed`).
|
|
82
|
+
2. **Test Coverage:** The agent MUST ensure that all new code is covered by tests and all existing tests pass.
|
|
83
|
+
|
|
84
|
+
**Failure to provide these logs means the task is INCOMPLETE.** The user is encouraged to reject any response that lacks this section.
|
|
85
|
+
|
|
86
|
+
## Git Workflow
|
|
87
|
+
|
|
88
|
+
- **Conventional Commits:** Adhere to the specification (e.g., `feat:`, `fix:`, `chore:`, `test:`).
|
|
89
|
+
- **Hooks:** Husky runs `pnpm run ci` on pre-commit. Do not bypass hooks.
|
|
90
|
+
- **Branches:** Use descriptive branch names like `feat/feature-name` or `fix/issue-description`.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# 0.1.0 (2026-09-24)
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
## Commit Message Guidelines
|
|
2
|
+
|
|
3
|
+
We follow the **Conventional Commits** specification. This is **enforced** by `commitlint` and is required for automated changelog generation.
|
|
4
|
+
|
|
5
|
+
**Format:** `type(scope): subject`
|
|
6
|
+
|
|
7
|
+
**Common Types:**
|
|
8
|
+
- `feat`: A new feature
|
|
9
|
+
- `fix`: A bug fix
|
|
10
|
+
- `docs`: Documentation only changes
|
|
11
|
+
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
|
12
|
+
- `refactor`: A code change that neither fixes a bug nor adds a feature
|
|
13
|
+
- `perf`: A code change that improves performance
|
|
14
|
+
- `test`: Adding missing tests or correcting existing tests
|
|
15
|
+
- `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
|
16
|
+
|
|
17
|
+
**Examples:**
|
|
18
|
+
- `feat(cli): add support for jsonc files`
|
|
19
|
+
- `fix(parser): handle empty input gracefully`
|
|
20
|
+
- `docs: update contributing guidelines`
|
|
21
|
+
|
|
22
|
+
## Release Process
|
|
23
|
+
|
|
24
|
+
To release a new version:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pnpm release -- patch # or minor / major
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This will automatically:
|
|
31
|
+
1. Run the CI suite (`pnpm run ci`).
|
|
32
|
+
2. Bump the version in `package.json`.
|
|
33
|
+
3. Update the `CHANGELOG.md` using `conventional-changelog` with the Angular preset.
|
|
34
|
+
4. Commit, tag, and push the changes.
|
|
35
|
+
5. Create a GitHub release with auto-generated notes.
|
|
36
|
+
6. Publish to npm (if configured).
|
|
37
|
+
|
|
38
|
+
**Note:** NPM publishing is **disabled** by default for new projects. To enable it:
|
|
39
|
+
1. Set `"private": false` in `package.json`.
|
|
40
|
+
2. Set `"publish": true` in `.release-it.json`.
|
|
41
|
+
3. Ensure you have the necessary `NPM_TOKEN` configured.
|
|
42
|
+
|
|
43
|
+
## Dependencies
|
|
44
|
+
|
|
45
|
+
- **zod**: TypeScript-first schema validation with static type inference.
|
|
46
|
+
- **eslint-plugin-regexp**: ESLint plugin for finding regexp mistakes and style guide violations.
|
|
47
|
+
- **release-it**: Interactive release-tool for Git repositories.
|
|
48
|
+
- **debug**: A tiny JavaScript debugging utility modelled after Node.js core debugging technique.
|
|
49
|
+
- **@commitlint/cli**: Lint commit messages to ensure they follow conventional commits.
|
|
50
|
+
- **@commitlint/config-conventional**: Shareable commitlint config enforcing conventional commits.
|
|
51
|
+
- **@types/debug**: TypeScript definitions for debug.
|
|
52
|
+
- **@types/node**: TypeScript definitions for Node.js.
|
|
53
|
+
- **@vitest/coverage-v8**: V8 coverage provider for Vitest.
|
|
54
|
+
- **conventional-changelog**: Generate a changelog from git metadata.
|
|
55
|
+
- **conventional-changelog-angular**: Angular preset for conventional-changelog.
|
|
56
|
+
- **husky**: Modern native git hooks made easy.
|
|
57
|
+
- **oxlint**: A JavaScript linter written in Rust.
|
|
58
|
+
- **oxlint-tsgolint**: TypeScript-specific rules for oxlint.
|
|
59
|
+
- **oxfmt**: High performance JavaScript / TypeScript formatter.
|
|
60
|
+
- **typescript**: A superset of JavaScript that compiles to clean JavaScript output.
|
|
61
|
+
- **vitest**: A Vite-native unit test framework.
|
|
62
|
+
- **vite**: Native-ESM powered web dev build tool
|
|
63
|
+
- **commander**: The complete solution for node.js command-line interfaces.
|
|
64
|
+
- **cli-progress**: Easy to use progress-bar for command-line/terminal applications.
|
|
65
|
+
- **@types/cli-progress**: TypeScript definitions for cli-progress.
|
package/GENERATED.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# 🚀 Project Setup Guide: svn-visualizer
|
|
2
|
+
|
|
3
|
+
Welcome to your newly generated **cli** project! This document outlines what was scaffolded, the automated steps already completed, and the remaining manual adjustments required to finalize your setup.
|
|
4
|
+
|
|
5
|
+
**Status:** 🟢 **Successfully Completed**
|
|
6
|
+
|
|
7
|
+
## 📦 What Was Generated
|
|
8
|
+
* **Project Name:** `svn-visualizer`
|
|
9
|
+
* **Template Used:** `cli`
|
|
10
|
+
* **Package Manager:** `pnpm`
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 📋 Initialization Checklist
|
|
15
|
+
The following tasks were executed during the generation process:
|
|
16
|
+
- [x] Scaffold project files and directories
|
|
17
|
+
- [x] Configure `package.json` with appropriate dependencies
|
|
18
|
+
- [ ] Install dependencies using `pnpm` *(Skipped)*
|
|
19
|
+
- [x] Initialize Git repository (main branch)
|
|
20
|
+
- [ ] Create and push GitHub repository *(Skipped)*
|
|
21
|
+
- [ ] Run initial CI pipeline (lint, build, test) *(Skipped)*
|
|
22
|
+
|
|
23
|
+
## ⏭️ Complete Skipped Steps Manually
|
|
24
|
+
Some initialization steps were marked as *(Skipped)*. Use the guidance below to complete them yourself:
|
|
25
|
+
- [ ] **Install dependencies manually:** Run `pnpm install` from the project root.
|
|
26
|
+
- [ ] **Create and push GitHub repository manually:** Verify GitHub CLI auth with `gh auth status`, then run `gh repo create svn-visualizer --public --source=. --remote=origin --push`.
|
|
27
|
+
- [ ] **Run CI checks manually:** After dependencies are installed, run `pnpm run ci`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🛠️ Manual Adjustments Needed
|
|
32
|
+
To complete your project setup, please review and manually update the following:
|
|
33
|
+
- [ ] **`LICENSE`**: Verify the copyright year and author name.
|
|
34
|
+
- [ ] **`package.json`**: Review the description, keywords, author, and repository links.
|
|
35
|
+
- [ ] **`README.md`**: Update with project-specific instructions, architecture details, and contribution guidelines.
|
|
36
|
+
- [ ] **`.gitignore`**: Note that there is a **`# Custom`** section at the end of the file for your own ignores.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 💡 Next Steps
|
|
41
|
+
1. Review the generated codebase to familiarize yourself with the structure.
|
|
42
|
+
2. Start the development server using `pnpm run dev`.
|
|
43
|
+
3. Make your first commit and push to your remote repository.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 💻 Available Commands
|
|
48
|
+
You can run these commands from the project root using `pnpm run <command>`:
|
|
49
|
+
|
|
50
|
+
| Command | Description |
|
|
51
|
+
| :--- | :--- |
|
|
52
|
+
| `dev` | Starts the development server |
|
|
53
|
+
| `build` | Builds the project for production |
|
|
54
|
+
| `test` | Runs the unit test suite (Vitest) |
|
|
55
|
+
| `lint` | Lints and formats the codebase |
|
|
56
|
+
| `ci` | Runs lint, build, and test (used by CI/CD) |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🏗️ CLI Architecture
|
|
61
|
+
This project uses `commander` for argument parsing and `@clack/prompts` for interactive CLI interfaces.
|
|
62
|
+
|
|
63
|
+
### Source Files Generated
|
|
64
|
+
- **`src/index.ts`**: The main execution entry point. Handles top-level errors and bootstraps the CLI application.
|
|
65
|
+
- **`src/cli.ts`**: Parses command-line arguments and orchestrates your user prompts.
|
|
66
|
+
|
|
67
|
+
### How to Enhance
|
|
68
|
+
- Add new sub-commands directly in `src/cli.ts`.
|
|
69
|
+
- Extract logic into a new `src/commands/` directory as your application scales.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🧪 Testing Strategy
|
|
74
|
+
|
|
75
|
+
### Unit Testing (Vitest)
|
|
76
|
+
This project is pre-configured with **Vitest** for blazing-fast unit testing and coverage reporting.
|
|
77
|
+
- **Where to put tests**: Create files with the `.test.ts` or `.spec.ts` extension next to your source files (e.g., `src/main.test.ts`).
|
|
78
|
+
- **How to run**: `pnpm run test`
|
|
79
|
+
- **Watch mode**: `pnpm exec vitest` to automatically re-run tests on file changes.
|
|
80
|
+
- **Coverage**: Coverage is generated automatically during the test run. Aim for high coverage on core logic!
|
|
81
|
+
|
|
82
|
+
### End-to-End (E2E) Testing
|
|
83
|
+
Currently, only unit tests are scaffolded by default. To enhance your project's reliability, we highly recommend adding E2E testing:
|
|
84
|
+
- **For Web Apps**: Consider installing [Playwright](https://playwright.dev/) (`pnpm create playwright`) to simulate real user interactions in the browser.
|
|
85
|
+
- **For CLIs**: Consider using `execa` within your Vitest suite to invoke your compiled CLI binary and assert its `stdout`/`stderr` outputs.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🐙 Key Git Commands
|
|
90
|
+
Here are the most common Git operations you will use to manage your codebase:
|
|
91
|
+
|
|
92
|
+
| Command | Description |
|
|
93
|
+
| :--- | :--- |
|
|
94
|
+
| `git status` | Check the current state of your working directory |
|
|
95
|
+
| `git add .` | Stage all your changes for the next commit |
|
|
96
|
+
| `git commit -m "feat: your feature"` | Create a new commit (following Conventional Commits) |
|
|
97
|
+
| `git push` | Push your committed changes to the remote repository |
|
|
98
|
+
| `git pull` | Fetch and merge changes from the remote repository |
|
|
99
|
+
| `git checkout -b <branch>` | Create and switch to a new branch |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 🐈 Key GitHub (`gh`) Commands
|
|
104
|
+
The `gh` CLI provides powerful tools to interact with GitHub right from your terminal:
|
|
105
|
+
|
|
106
|
+
| Command | Description |
|
|
107
|
+
| :--- | :--- |
|
|
108
|
+
| `gh repo view --web` | Open the repository in your default web browser |
|
|
109
|
+
| `gh repo create <name> --public --source=. --remote=origin --push` | Create and push a new GitHub repository |
|
|
110
|
+
| `gh pr create` | Create a new Pull Request |
|
|
111
|
+
| `gh pr checkout <pr-number>` | Checkout a Pull Request branch locally |
|
|
112
|
+
| `gh issue create` | Create a new Issue |
|
|
113
|
+
| `gh issue list` | List all open Issues |
|
|
114
|
+
| `gh repo delete <owner>/<repo> --yes` | Dangerously delete a repository completely (use with caution!) |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 🚀 Creating a Release
|
|
119
|
+
This project uses Conventional Commits and automated changelogs. To create a new release:
|
|
120
|
+
1. **Run the release command:** `pnpm release`
|
|
121
|
+
|
|
122
|
+
This single command will automatically run your CI suite, bump the version, generate a changelog, create a Git tag, push to GitHub, and create a GitHub release.
|
|
123
|
+
|
|
124
|
+
**Note:** NPM publishing is disabled by default. See `CONTRIBUTING.md` for details on how to enable it.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
<br>
|
|
129
|
+
<p align="center"><i>This file was auto-generated by <b>create-template-project</b>.</i></p>
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dieter Oberkofler
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# svn-visualizer
|
|
2
|
+
|
|
3
|
+
Generate a self-contained HTML activity report from Subversion history. The repository is hosted on GitHub and the package is private; it is not published to npm.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/doberkofler/svn-visualizer/actions/workflows/ci.yml)
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- Node.js 22 or newer
|
|
11
|
+
- pnpm
|
|
12
|
+
- The `svn` command-line client for `gather` and `report`
|
|
13
|
+
|
|
14
|
+
## Install and build
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm run build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The build produces the Node CLI at `dist/index.js` and a Chart.js browser bundle at `dist/client/main.js`. Report generation embeds the browser bundle into `output/index.html`; the result needs no server or external assets.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Gather history incrementally:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm svn-visualizer gather --url https://svn.example.com/project/trunk
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Generate a report from local data:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm svn-visualizer generate --relative-days 90 --title "Project activity"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Gather and generate in one command:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm svn-visualizer report --url https://svn.example.com/project/trunk --output-dir output
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`gather` uses the SVN client's existing authentication configuration when no credentials are supplied. To provide credentials non-interactively, use `--username` and place the password in `SVN_PASSWORD`, or select another environment variable with `--password-env`. There is deliberately no literal password option, and supplied credentials are not cached. Certificate failures are not bypassed.
|
|
44
|
+
|
|
45
|
+
Common defaults:
|
|
46
|
+
|
|
47
|
+
| Option | Default |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `--data-file` | `svn-data.json` |
|
|
50
|
+
| `--output-dir` | `output` |
|
|
51
|
+
| `--password-env` | `SVN_PASSWORD` |
|
|
52
|
+
| `--svn-binary` | `svn` |
|
|
53
|
+
|
|
54
|
+
Use `--from YYYY-MM-DD` and `--to YYYY-MM-DD` for an inclusive UTC period, or `--relative-days N` for a range ending on the current UTC date. These modes cannot be combined.
|
|
55
|
+
|
|
56
|
+
## Development
|
|
57
|
+
|
|
58
|
+
- `pnpm run format`: Format source files.
|
|
59
|
+
- `pnpm run typecheck`: Check TypeScript.
|
|
60
|
+
- `pnpm run test`: Run unit tests with coverage.
|
|
61
|
+
- `pnpm run ci`: Run all checks, builds, and tests.
|
|
62
|
+
|
|
63
|
+
The project retains the create-template-project marker and generated tooling so template updates remain possible. Release tooling creates GitHub releases only; npm publishing is disabled.
|