@slats/claude-assets-sync 0.0.1 → 0.0.2

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.md +541 -45
  3. package/dist/commands/add.cjs +61 -0
  4. package/dist/commands/add.d.ts +12 -0
  5. package/dist/commands/add.mjs +59 -0
  6. package/dist/commands/index.d.ts +91 -0
  7. package/dist/commands/list.cjs +83 -0
  8. package/dist/commands/list.d.ts +6 -0
  9. package/dist/commands/list.mjs +81 -0
  10. package/dist/commands/migrate.cjs +9 -0
  11. package/dist/commands/migrate.d.ts +6 -0
  12. package/dist/commands/migrate.mjs +7 -0
  13. package/dist/commands/remove.cjs +109 -0
  14. package/dist/commands/remove.d.ts +6 -0
  15. package/dist/commands/remove.mjs +86 -0
  16. package/dist/commands/status.cjs +193 -0
  17. package/dist/commands/status.d.ts +6 -0
  18. package/dist/commands/status.mjs +171 -0
  19. package/dist/commands/sync.cjs +28 -0
  20. package/dist/commands/sync.d.ts +6 -0
  21. package/dist/commands/sync.mjs +26 -0
  22. package/dist/commands/types.d.ts +82 -0
  23. package/dist/components/add/AddCommand.cjs +92 -0
  24. package/dist/components/add/AddCommand.d.ts +14 -0
  25. package/dist/components/add/AddCommand.mjs +90 -0
  26. package/dist/components/add/index.d.ts +2 -0
  27. package/dist/components/index.d.ts +2 -0
  28. package/dist/components/list/EditableTreeItem.d.ts +13 -0
  29. package/dist/components/list/ListCommand.cjs +440 -0
  30. package/dist/components/list/ListCommand.d.ts +8 -0
  31. package/dist/components/list/ListCommand.mjs +418 -0
  32. package/dist/components/list/SyncedPackageTree.d.ts +14 -0
  33. package/dist/components/list/index.d.ts +9 -0
  34. package/dist/components/primitives/Box.d.ts +4 -0
  35. package/dist/components/primitives/Spinner.d.ts +6 -0
  36. package/dist/components/primitives/Text.d.ts +4 -0
  37. package/dist/components/primitives/index.d.ts +3 -0
  38. package/dist/components/status/PackageStatusCard.d.ts +10 -0
  39. package/dist/components/status/StatusDisplay.cjs +25 -0
  40. package/dist/components/status/StatusDisplay.d.ts +25 -0
  41. package/dist/components/status/StatusDisplay.mjs +23 -0
  42. package/dist/components/status/StatusTreeNode.cjs +40 -0
  43. package/dist/components/status/StatusTreeNode.d.ts +15 -0
  44. package/dist/components/status/StatusTreeNode.mjs +38 -0
  45. package/dist/components/status/index.d.ts +6 -0
  46. package/dist/components/tree/AssetTreeNode.cjs +37 -0
  47. package/dist/components/tree/AssetTreeNode.d.ts +12 -0
  48. package/dist/components/tree/AssetTreeNode.mjs +35 -0
  49. package/dist/components/tree/TreeSelect.cjs +121 -0
  50. package/dist/components/tree/TreeSelect.d.ts +12 -0
  51. package/dist/components/tree/TreeSelect.mjs +119 -0
  52. package/dist/components/tree/index.d.ts +4 -0
  53. package/dist/core/assetStructure.cjs +30 -0
  54. package/dist/core/assetStructure.d.ts +36 -0
  55. package/dist/core/assetStructure.mjs +27 -0
  56. package/dist/core/cli.cjs +92 -0
  57. package/dist/core/cli.mjs +89 -0
  58. package/dist/core/constants.cjs +23 -0
  59. package/dist/core/constants.d.ts +83 -0
  60. package/dist/core/constants.mjs +17 -0
  61. package/dist/core/filesystem.cjs +62 -51
  62. package/dist/core/filesystem.d.ts +38 -18
  63. package/dist/core/filesystem.mjs +56 -44
  64. package/dist/core/github.cjs +8 -11
  65. package/dist/core/github.d.ts +4 -6
  66. package/dist/core/github.mjs +8 -11
  67. package/dist/core/io.cjs +46 -0
  68. package/dist/core/io.d.ts +40 -0
  69. package/dist/core/io.mjs +39 -0
  70. package/dist/core/migration.cjs +199 -0
  71. package/dist/core/migration.d.ts +57 -0
  72. package/dist/core/migration.mjs +196 -0
  73. package/dist/core/packageScanner.cjs +259 -0
  74. package/dist/core/packageScanner.d.ts +17 -0
  75. package/dist/core/packageScanner.mjs +257 -0
  76. package/dist/core/sync.cjs +244 -61
  77. package/dist/core/sync.d.ts +6 -2
  78. package/dist/core/sync.mjs +246 -63
  79. package/dist/core/syncMeta.cjs +93 -0
  80. package/dist/core/syncMeta.d.ts +71 -0
  81. package/dist/core/syncMeta.mjs +84 -0
  82. package/dist/index.cjs +7 -4
  83. package/dist/index.d.ts +4 -2
  84. package/dist/index.mjs +3 -2
  85. package/dist/utils/nameTransform.cjs +12 -0
  86. package/dist/utils/nameTransform.d.ts +76 -0
  87. package/dist/utils/nameTransform.mjs +9 -0
  88. package/dist/utils/package.cjs +22 -17
  89. package/dist/utils/package.d.ts +25 -0
  90. package/dist/utils/package.mjs +11 -7
  91. package/dist/utils/packageName.cjs +24 -0
  92. package/dist/utils/packageName.d.ts +32 -0
  93. package/dist/utils/packageName.mjs +21 -0
  94. package/dist/utils/paths.cjs +18 -0
  95. package/dist/utils/paths.d.ts +55 -0
  96. package/dist/utils/paths.mjs +15 -0
  97. package/dist/utils/types.d.ts +153 -6
  98. package/dist/utils/version.cjs +17 -0
  99. package/dist/utils/version.d.ts +55 -0
  100. package/dist/utils/version.mjs +14 -0
  101. package/dist/version.cjs +5 -0
  102. package/dist/version.d.ts +5 -0
  103. package/dist/version.mjs +3 -0
  104. package/package.json +15 -6
  105. package/dist/cli/index.cjs +0 -56
  106. package/dist/cli/index.mjs +0 -53
  107. /package/dist/{cli/index.d.ts → core/cli.d.ts} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,189 @@
1
+ # Changelog
2
+
3
+ All notable changes to @slats/claude-assets-sync will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.0.1] - 2025-02-05
9
+
10
+ ### Added
11
+
12
+ #### Phase 1: Version Management Unification
13
+ - Unified version management system across all packages
14
+ - Single `.sync-meta.json` file replacing per-package metadata
15
+ - Comprehensive package tracking with original names and file mappings
16
+ - Timestamp tracking for all sync operations
17
+ - Version comparison logic to skip unnecessary syncs
18
+
19
+ #### Phase 2: Code Consolidation & Architecture
20
+ - Modular command architecture with pluggable command system
21
+ - New `src/commands/` directory for command implementations
22
+ - Command registry system (`COMMANDS` export) with metadata
23
+ - Centralized command types in `src/commands/types.ts`
24
+ - Unified CLI structure using Commander.js
25
+ - Better separation of concerns between CLI and command logic
26
+
27
+ #### Phase 3: Flat Directory Structure Support
28
+ - Modern flat file organization with prefixed filenames
29
+ - Name transformation system for scoped packages
30
+ - Support for both flat and nested directory structures
31
+ - `--no-flat` flag to maintain backward compatibility with legacy structure
32
+ - Smart detection of directory structure type during sync operations
33
+
34
+ #### Phase 4: Package Management Features
35
+ - **list command**: List all synced packages with asset details
36
+ - Human-readable output with package names, versions, and asset counts
37
+ - JSON output support for scripting and automation
38
+ - Asset breakdown by type (commands, skills, etc.)
39
+ - Sort by package name for consistency
40
+
41
+ - **remove command**: Remove synced packages safely
42
+ - Support for both flat and nested structures
43
+ - Confirmation prompts (skip with `-y/--yes`)
44
+ - Dry-run mode for preview
45
+ - Automatic metadata cleanup after removal
46
+ - Graceful error handling for missing files
47
+
48
+ - **status command**: Monitor sync status and check for updates
49
+ - Real-time remote version checking via npm registry
50
+ - Version mismatch detection with visual indicators
51
+ - Cached remote version checks (5-minute TTL)
52
+ - `--no-remote` flag to skip remote checks
53
+ - Summary statistics of sync status
54
+
55
+ - **migrate command**: Migrate from legacy to flat structure
56
+ - Automatic conversion of nested directories to flat naming
57
+ - Comprehensive dry-run support
58
+ - Metadata preservation during migration
59
+ - Safe multi-run operation
60
+
61
+ #### Phase 5: Interactive UI Infrastructure
62
+ - Ink + React configuration for interactive CLI components
63
+ - TypeScript JSX support (jsx: "react-jsx")
64
+ - UI component infrastructure with fallback to plain text
65
+ - ink (^4.4.1), ink-spinner (^5.0.0), react (^18.2.0) dependencies
66
+ - Type definitions for React components (@types/react)
67
+ - ESM compatibility maintained with interactive UI support
68
+
69
+ #### Phase 6: Testing & Documentation
70
+ - Comprehensive README documentation for all commands
71
+ - Korean translation (README-ko_kr.md) with all features
72
+ - Detailed command usage examples and workflows
73
+ - Environment variable documentation
74
+ - Troubleshooting guide with common issues and solutions
75
+ - Architecture documentation explaining data flow
76
+ - CI/CD integration examples
77
+ - Rate limit documentation with mitigation strategies
78
+
79
+ ### Enhanced
80
+
81
+ - **Sync Logic**: Extended to support both flat and nested structures
82
+ - **Error Handling**: Improved error messages with context-aware suggestions
83
+ - **Logging**: Color-coded output with picocolors for better visibility
84
+ - **GitHub Integration**: Support for custom git refs (branches, tags, commits)
85
+ - **Local Workspace Support**: Option to read packages from local workspace
86
+ - **File System Operations**: Safe handling of both file and directory removal
87
+
88
+ ### Changed
89
+
90
+ - CLI structure: Main sync is now default command with sub-commands (list, remove, status, migrate)
91
+ - Version checking: Now compares against unified metadata instead of per-package files
92
+ - Directory organization: Flat structure is now default (use `--no-flat` for legacy)
93
+ - Metadata format: Unified schema with package prefixes as keys
94
+ - File naming: Scoped packages now use hyphen-separated prefixes (e.g., @scope-package-file.md)
95
+
96
+ ### Fixed
97
+
98
+ - Version comparison for flat structure packages
99
+ - Metadata update timing during removal operations
100
+ - Directory creation for deeply nested legacy structures
101
+ - File path handling for Windows compatibility
102
+
103
+ ### Technical Details
104
+
105
+ #### New File Mappings
106
+ Each file is now tracked with original and transformed names:
107
+ ```json
108
+ {
109
+ "original": "my-command.md",
110
+ "transformed": "@scope-package-my-command.md"
111
+ }
112
+ ```
113
+
114
+ #### Updated Metadata Structure
115
+ ```json
116
+ {
117
+ "version": "0.0.1",
118
+ "syncedAt": "2025-02-05T10:30:00.000Z",
119
+ "packages": {
120
+ "@scope-package": {
121
+ "originalName": "@scope/package",
122
+ "version": "1.0.0",
123
+ "files": {
124
+ "commands": [...],
125
+ "skills": [...]
126
+ }
127
+ }
128
+ }
129
+ }
130
+ ```
131
+
132
+ #### Command Dependencies
133
+ - **sync**: Core functionality, no command dependencies
134
+ - **list**: Depends on unified metadata reading
135
+ - **remove**: Depends on unified metadata, file system operations
136
+ - **status**: Depends on npm registry API, version caching
137
+ - **migrate**: Depends on legacy structure detection, transformation logic
138
+
139
+ ### Dependencies Added
140
+
141
+ - **ink** (^4.4.1): React renderer for terminal UIs
142
+ - **ink-spinner** (^5.0.0): Loading spinner component for ink
143
+ - **react** (^18.2.0): UI component framework
144
+ - **@types/react** (^18.2.0): TypeScript types for React
145
+
146
+ ### Dependencies Unchanged
147
+
148
+ - **commander** (^12.1.0): CLI argument parsing
149
+ - **picocolors** (^1.1.1): Terminal color output
150
+
151
+ ### Breaking Changes
152
+
153
+ None. The tool maintains backward compatibility:
154
+ - `--no-flat` flag allows using legacy nested structure
155
+ - Existing metadata files are automatically migrated
156
+ - All previous commands and options continue to work
157
+
158
+ ### Security
159
+
160
+ - No security vulnerabilities introduced
161
+ - Confirmation prompts for destructive operations
162
+ - Dry-run mode for all write operations
163
+ - Safe file system operations with error handling
164
+
165
+ ### Performance
166
+
167
+ - Efficient metadata reading and writing
168
+ - Cached remote version checks reduce API calls
169
+ - Parallel package processing capability ready (infrastructure in place)
170
+ - Minimal memory overhead for large package lists
171
+
172
+ ### Compatibility
173
+
174
+ - Node.js: Compatible with modern Node versions supporting ES modules
175
+ - Operating Systems: Windows, macOS, Linux
176
+ - npm Packages: Works with all npm packages providing claude assets
177
+
178
+ ## [Unreleased]
179
+
180
+ ### Planned
181
+
182
+ - Interactive UI components for progress visualization
183
+ - Batch operations with progress indication
184
+ - Configuration file support (.claude-sync.json)
185
+ - Pre/post sync hooks
186
+ - Asset validation and schema checking
187
+ - Custom asset type support
188
+ - Asset versioning and conflict resolution
189
+ - Cloud storage integration (optional)