Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 001721a8e9 | |||
| b191464ff9 |
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-12-15 - 2.11.1 - fix(mod_format/formatters)
|
||||
fix(packagejson.formatter): correctly parse scoped package dependency arguments and default to latest
|
||||
|
||||
- Handle scoped packages (e.g. @scope/name@version) by detecting the last '@' after the scope slash so package name and version are split correctly.
|
||||
- Fallback to 'latest' when no version is provided.
|
||||
- Fixes earlier incorrect splitting on every '@' which broke scoped package names.
|
||||
|
||||
## 2025-12-15 - 2.11.0 - feat(mod_format)
|
||||
feat(mod_format): use unified diff formatter with filenames and context in BaseFormatter.displayDiff
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@git.zone/cli",
|
||||
"private": false,
|
||||
"version": "2.11.0",
|
||||
"version": "2.11.1",
|
||||
"description": "A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.",
|
||||
"main": "dist_ts/index.ts",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/cli',
|
||||
version: '2.11.0',
|
||||
version: '2.11.1',
|
||||
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
|
||||
}
|
||||
|
||||
@@ -13,9 +13,18 @@ const ensureDependency = async (
|
||||
constraint: 'exclude' | 'include' | 'latest',
|
||||
dependencyArg: string,
|
||||
): Promise<void> => {
|
||||
const [packageName, version] = dependencyArg.includes('@')
|
||||
? dependencyArg.split('@').filter(Boolean)
|
||||
: [dependencyArg, 'latest'];
|
||||
// Parse package name and version, handling scoped packages like @scope/name@version
|
||||
const isScoped = dependencyArg.startsWith('@');
|
||||
const lastAtIndex = dependencyArg.lastIndexOf('@');
|
||||
|
||||
// For scoped packages, the version @ must come after the /
|
||||
// For unscoped packages, any @ indicates a version
|
||||
const hasVersion = isScoped
|
||||
? lastAtIndex > dependencyArg.indexOf('/')
|
||||
: lastAtIndex >= 0;
|
||||
|
||||
const packageName = hasVersion ? dependencyArg.slice(0, lastAtIndex) : dependencyArg;
|
||||
const version = hasVersion ? dependencyArg.slice(lastAtIndex + 1) : 'latest';
|
||||
|
||||
const targetSections: string[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user