@edcalderon/versioning 1.1.0 → 1.2.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/README.md CHANGED
@@ -113,32 +113,83 @@ Features:
113
113
  - Local registry support
114
114
  - Dry-run mode
115
115
 
116
- #### Re-entry Status + Roadmap Extension
116
+ ### Re-entry Status + Roadmap Extension
117
117
 
118
118
  Maintains a fast **re-entry** layer (current state + next micro-step) and a slow **roadmap/backlog** layer (long-term plan).
119
119
 
120
120
  Canonical files:
121
+
122
+ Single-project (default):
121
123
  - `.versioning/reentry.status.json` (machine)
122
124
  - `.versioning/REENTRY.md` (generated, minimal diffs)
123
125
  - `.versioning/ROADMAP.md` (human-first; only a small managed header block is auto-updated)
124
126
 
127
+ Multi-project (scoped by `--project <name>`):
128
+ - `.versioning/projects/<project>/reentry.status.json`
129
+ - `.versioning/projects/<project>/REENTRY.md`
130
+ - `.versioning/projects/<project>/ROADMAP.md`
131
+
132
+ **Smart Features:**
133
+ - **Auto-Update:** `versioning reentry update` infers the project phase and next step from your last git commit.
134
+ - `feat: ...` → **Phase: development**
135
+ - `fix: ...` → **Phase: maintenance**
136
+ - **Git Context:** Automatically links status to the latest branch, commit, and author.
137
+
125
138
  Commands:
126
139
 
127
140
  ```bash
128
141
  # Fast layer
129
142
  versioning reentry init
143
+ versioning reentry update # Auto-update status from git commit
144
+ versioning reentry show # Show current status summary
130
145
  versioning reentry sync
131
146
 
147
+ # Fast layer (scoped)
148
+ versioning reentry init --project trader
149
+ versioning reentry update --project trader
150
+ versioning reentry show --project trader
151
+
132
152
  # Slow layer
133
153
  versioning roadmap init --title "My Project"
134
154
  versioning roadmap list
135
155
  versioning roadmap set-milestone --id "now-01" --title "Ship X"
136
- versioning roadmap add --section "Now (1–2 weeks)" --id "now-02" --item "Add observability"
137
156
  ```
138
157
 
139
- Backward compatibility:
140
- - v1.0 status files load safely.
141
- - Schema migrates to v1.1 only when you actually modify status, or explicitly via `versioning reentry sync --migrate`.
158
+ #### Cleanup Repo Extension
159
+
160
+ Keeps your repository root clean by organizing stray files into appropriate directories (docs, scripts, config, archive).
161
+
162
+ Features:
163
+ - **Smart Scanning:** Identifies files that don't belong in the root.
164
+ - **Configurable Routes:** Map extensions to folders (e.g. `.sh` → `scripts/`).
165
+ - **Safety:** Allowlist for root files and Denylist for forced moves.
166
+ - **Husky Integration:** Auto-scan or auto-move on commit.
167
+
168
+ Commands:
169
+
170
+ ```bash
171
+ versioning cleanup scan # Dry-run scan of root
172
+ versioning cleanup move # Move files to configured destinations
173
+ versioning cleanup restore # Restore a moved file
174
+ versioning cleanup config # View/manage configuration
175
+ versioning cleanup husky # Setup git hook
176
+ ```
177
+
178
+ Configuration (`versioning.config.json`):
179
+
180
+ ```json
181
+ {
182
+ "cleanup": {
183
+ "enabled": true,
184
+ "defaultDestination": "docs",
185
+ "allowlist": ["CHANGELOG.md"],
186
+ "routes": {
187
+ ".sh": "scripts",
188
+ ".json": "config"
189
+ }
190
+ }
191
+ }
192
+ ```
142
193
 
143
194
  ### External Extensions
144
195
 
@@ -0,0 +1,49 @@
1
+ import { VersioningExtension } from '../extensions';
2
+ /**
3
+ * The canonical cleanup configuration schema.
4
+ * Everything the plugin needs lives here.
5
+ */
6
+ export interface CleanupRepoConfig {
7
+ /** Master switch. Default: true */
8
+ enabled: boolean;
9
+ /** Default destination for files without a specific route. Default: "docs" */
10
+ defaultDestination: string;
11
+ /**
12
+ * Files explicitly allowed to stay in root (on top of built-in essentials).
13
+ * Supports exact filenames and glob-like patterns (e.g. "*.config.js").
14
+ */
15
+ allowlist: string[];
16
+ /**
17
+ * Files that should ALWAYS be moved, even if they match the allowlist.
18
+ * Useful for forcing cleanup of specific known offenders.
19
+ */
20
+ denylist: string[];
21
+ /**
22
+ * File extensions to consider for cleanup (with leading dot).
23
+ * Default: [".md", ".sh", ".json", ".yaml", ".yml", ".txt", ".log"]
24
+ */
25
+ extensions: string[];
26
+ /**
27
+ * Mapping of file extension → destination directory.
28
+ * Overrides defaultDestination per extension.
29
+ */
30
+ routes: Record<string, string>;
31
+ /**
32
+ * Husky integration settings.
33
+ */
34
+ husky: {
35
+ enabled: boolean;
36
+ /** Which husky hook to attach to. Default: "pre-commit" */
37
+ hook: string;
38
+ /** "scan" = warning only, "enforce" = auto-move + git add. Default: "scan" */
39
+ mode: 'scan' | 'enforce';
40
+ };
41
+ }
42
+ declare const BUILTIN_ALLOWLIST: Set<string>;
43
+ declare const DEFAULT_EXTENSIONS: string[];
44
+ declare const DEFAULT_ROUTES: Record<string, string>;
45
+ declare function loadCleanupConfig(rootConfig: any): CleanupRepoConfig;
46
+ declare const extension: VersioningExtension;
47
+ export { loadCleanupConfig, BUILTIN_ALLOWLIST, DEFAULT_EXTENSIONS, DEFAULT_ROUTES };
48
+ export default extension;
49
+ //# sourceMappingURL=cleanup-repo-extension.d.ts.map