Compare commits

..

18 Commits

Author SHA1 Message Date
adc828d9bb 1.19.9
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-05 22:55:29 +00:00
fff1d39338 fix(mod_commit): Refactor version bumping to a unified implementation for npm and Deno; remove npm-exec based helpers and add file-based version readers/updaters to avoid npm warning pollution 2025-11-05 22:55:29 +00:00
5afbe6ccbc 1.19.8
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-04 03:44:42 +00:00
9de17a428d fix(package.json): Bump @git.zone/tsdoc dependency to ^1.9.2 2025-11-04 03:44:42 +00:00
c9985102c3 1.19.7
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-04 02:31:22 +00:00
73f98c1c3f fix(dependencies): Bump @git.zone/tsdoc to ^1.9.1 2025-11-04 02:31:22 +00:00
ae93e6f146 1.19.6
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-04 02:22:44 +00:00
2abaeee500 fix(cli): Bump @git.zone/tsdoc dependency to ^1.9.0 2025-11-04 02:22:44 +00:00
0538ba2586 1.19.5
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-04 01:54:04 +00:00
a451779724 fix(cli): Bump @git.zone/tsdoc to ^1.8.3 2025-11-04 01:54:04 +00:00
cd3246d659 1.19.4
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-03 17:54:18 +00:00
d37ffd7177 fix(tsdoc): update tsdoc 2025-11-03 17:54:07 +00:00
a69b613087 1.19.3
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-03 13:38:17 +00:00
1ea186d233 fix(tsdoc): Bump @git.zone/tsdoc to ^1.8.0 and add .claude local settings 2025-11-03 13:38:17 +00:00
f5e7d43cf3 1.19.2
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-03 11:55:57 +00:00
d80faa044a fix(tsdoc): Bump @git.zone/tsdoc to ^1.6.1 2025-11-03 11:55:57 +00:00
64062e5c43 1.19.1
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-02 23:11:02 +00:00
bd22844280 fix(dependencies): Bump dependencies and add local Claude settings 2025-11-02 23:11:02 +00:00
6 changed files with 1422 additions and 1050 deletions

View File

@@ -1,5 +1,55 @@
# Changelog # Changelog
## 2025-11-05 - 1.19.9 - fix(mod_commit)
Refactor version bumping to a unified implementation for npm and Deno; remove npm-exec based helpers and add file-based version readers/updaters to avoid npm warning pollution
- Removed legacy npm/deno-specific helpers (bumpNpmVersion, syncVersionToDenoJson, bumpDenoVersion) that relied on executing npm and caused warning pollution
- Added readCurrentVersion() to read version from package.json or deno.json
- Added updateVersionFile() helper to write version directly into JSON files
- Added unified bumpProjectVersion() that handles npm, deno and both with a single code path; reuses calculateNewVersion()
- Stages updated files, commits v<newVersion> and creates a tag v<newVersion>
- Benefits: no npm warning pollution in deno.json, simpler git history, consistent behavior across project types
## 2025-11-04 - 1.19.8 - fix(package.json)
Bump @git.zone/tsdoc dependency to ^1.9.2
- Updated dependency @git.zone/tsdoc from ^1.9.1 to ^1.9.2 in package.json
## 2025-11-04 - 1.19.7 - fix(dependencies)
Bump @git.zone/tsdoc to ^1.9.1
- Updated package.json dependency @git.zone/tsdoc from ^1.9.0 to ^1.9.1
## 2025-11-04 - 1.19.6 - fix(cli)
Bump @git.zone/tsdoc dependency to ^1.9.0
- Updated dependency @git.zone/tsdoc from ^1.8.3 to ^1.9.0 in package.json
## 2025-11-04 - 1.19.5 - fix(cli)
Bump @git.zone/tsdoc to ^1.8.3 and add local .claude settings for allowed permissions
- Updated dependency @git.zone/tsdoc from ^1.8.2 to ^1.8.3
- Added .claude/settings.local.json to declare allowed permissions for local tooling (Bash commands, Docker, npm, WebFetch and MCP actions)
## 2025-11-03 - 1.19.3 - fix(tsdoc)
Bump @git.zone/tsdoc to ^1.8.0 and add .claude local settings
- Upgrade dependency @git.zone/tsdoc from ^1.6.1 to ^1.8.0 in package.json
- Add .claude/settings.local.json for local assistant permissions/configuration
## 2025-11-03 - 1.19.2 - fix(tsdoc)
Bump @git.zone/tsdoc to ^1.6.1 and add .claude/settings.local.json
- Update dependency @git.zone/tsdoc from ^1.6.0 to ^1.6.1
- Add .claude/settings.local.json to include local Claude settings/permissions
## 2025-11-02 - 1.19.1 - fix(dependencies)
Bump dependencies and add local Claude settings
- Bump devDependencies: @git.zone/tsbuild -> ^2.7.1, @git.zone/tsrun -> ^1.6.2, @git.zone/tstest -> ^2.7.0
- Upgrade runtime dependencies: @git.zone/tsdoc -> ^1.6.0; update @push.rocks packages (smartcli ^4.0.19, smartjson ^5.2.0, smartlog ^3.1.10, smartnetwork ^4.4.0, etc.)
- Add .claude/settings.local.json (local project permissions/settings file)
## 2025-10-23 - 1.19.0 - feat(mod_commit) ## 2025-10-23 - 1.19.0 - feat(mod_commit)
Add CLI UI helpers and improve commit workflow with progress, recommendations and summary Add CLI UI helpers and improve commit workflow with progress, recommendations and summary

View File

@@ -1,7 +1,7 @@
{ {
"name": "@git.zone/cli", "name": "@git.zone/cli",
"private": false, "private": false,
"version": "1.19.0", "version": "1.19.9",
"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.", "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", "main": "dist_ts/index.ts",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
@@ -57,18 +57,18 @@
}, },
"homepage": "https://gitlab.com/gitzone/private/gitzone#readme", "homepage": "https://gitlab.com/gitzone/private/gitzone#readme",
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.6.8", "@git.zone/tsbuild": "^2.7.1",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.6.2",
"@git.zone/tstest": "^2.3.6", "@git.zone/tstest": "^2.7.0",
"@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartfile": "^11.2.7", "@push.rocks/smartfile": "^11.2.7",
"@push.rocks/smartinteract": "^2.0.16", "@push.rocks/smartinteract": "^2.0.16",
"@push.rocks/smartnetwork": "^4.1.2", "@push.rocks/smartnetwork": "^4.4.0",
"@push.rocks/smartshell": "^3.3.0", "@push.rocks/smartshell": "^3.3.0",
"@types/node": "^22.15.18" "@types/node": "^22.15.18"
}, },
"dependencies": { "dependencies": {
"@git.zone/tsdoc": "^1.5.2", "@git.zone/tsdoc": "^1.9.2",
"@git.zone/tspublish": "^1.10.3", "@git.zone/tspublish": "^1.10.3",
"@push.rocks/commitinfo": "^1.0.12", "@push.rocks/commitinfo": "^1.0.12",
"@push.rocks/early": "^4.0.4", "@push.rocks/early": "^4.0.4",
@@ -77,12 +77,12 @@
"@push.rocks/npmextra": "^5.3.3", "@push.rocks/npmextra": "^5.3.3",
"@push.rocks/projectinfo": "^5.0.2", "@push.rocks/projectinfo": "^5.0.2",
"@push.rocks/smartchok": "^1.1.1", "@push.rocks/smartchok": "^1.1.1",
"@push.rocks/smartcli": "^4.0.11", "@push.rocks/smartcli": "^4.0.19",
"@push.rocks/smartdiff": "^1.0.3", "@push.rocks/smartdiff": "^1.0.3",
"@push.rocks/smartgulp": "^3.0.4", "@push.rocks/smartgulp": "^3.0.4",
"@push.rocks/smartjson": "^5.0.20", "@push.rocks/smartjson": "^5.2.0",
"@push.rocks/smartlegal": "^1.0.27", "@push.rocks/smartlegal": "^1.0.27",
"@push.rocks/smartlog": "^3.1.9", "@push.rocks/smartlog": "^3.1.10",
"@push.rocks/smartlog-destination-local": "^9.0.2", "@push.rocks/smartlog-destination-local": "^9.0.2",
"@push.rocks/smartmustache": "^3.0.2", "@push.rocks/smartmustache": "^3.0.2",
"@push.rocks/smartnpm": "^2.0.6", "@push.rocks/smartnpm": "^2.0.6",

2190
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -89,6 +89,26 @@ The format module is responsible for project standardization:
5. **Performance Optimizations**: Parallel execution and caching 5. **Performance Optimizations**: Parallel execution and caching
6. **Reporting**: Diff views, statistics, verbose logging 6. **Reporting**: Diff views, statistics, verbose logging
7. **Architecture**: Clean separation of concerns with new classes 7. **Architecture**: Clean separation of concerns with new classes
8. **Unified Version Bumping**: Self-managed version updates eliminating npm warning pollution in deno.json
### Version Bumping Refactor (Latest)
The commit module's version bumping has been refactored to eliminate npm command dependencies:
**Changes:**
- Removed `bumpNpmVersion()` - was causing npm warnings to pollute deno.json
- Removed `syncVersionToDenoJson()` - no longer needed with unified approach
- Removed separate `bumpDenoVersion()` - replaced by unified implementation
- Added `readCurrentVersion()` helper - reads from either package.json or deno.json
- Added `updateVersionFile()` helper - updates JSON files directly
- Unified `bumpProjectVersion()` - handles npm/deno/both with single clean code path
**Benefits:**
- No npm warning pollution in version fields
- Full control over version bumping process
- Simpler git history (no amending, no force-tagging)
- Same code path for all project types
- Reuses existing `calculateNewVersion()` function
## Development Tips ## Development Tips

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/cli', name: '@git.zone/cli',
version: '1.19.0', version: '1.19.9',
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.' 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.'
} }

View File

@@ -91,118 +91,47 @@ function calculateNewVersion(currentVersion: string, versionType: VersionType):
} }
/** /**
* Bumps the version in deno.json, commits the change, and creates a tag * Reads the current version from package.json or deno.json
* @param versionType Type of version bump * @param projectType The project type to determine which file to read
* @returns The new version string * @returns The current version string
*/ */
export async function bumpDenoVersion(versionType: VersionType): Promise<string> { function readCurrentVersion(projectType: ProjectType): string {
const denoJsonPath = plugins.path.join(paths.cwd, 'deno.json'); if (projectType === 'npm' || projectType === 'both') {
const smartshellInstance = new plugins.smartshell.Smartshell({ const packageJsonPath = plugins.path.join(paths.cwd, 'package.json');
executor: 'bash', const packageJson = plugins.smartfile.fs.toObjectSync(packageJsonPath) as { version?: string };
sourceFilePaths: [],
});
try { if (!packageJson.version) {
// Read deno.json throw new Error('package.json does not contain a version field');
const denoConfig = plugins.smartfile.fs.toObjectSync( }
denoJsonPath return packageJson.version;
) as { version?: string }; } else {
const denoJsonPath = plugins.path.join(paths.cwd, 'deno.json');
const denoConfig = plugins.smartfile.fs.toObjectSync(denoJsonPath) as { version?: string };
if (!denoConfig.version) { if (!denoConfig.version) {
throw new Error('deno.json does not contain a version field'); throw new Error('deno.json does not contain a version field');
} }
return denoConfig.version;
const currentVersion = denoConfig.version;
const newVersion = calculateNewVersion(currentVersion, versionType);
logger.log('info', `Bumping deno.json version: ${currentVersion}${newVersion}`);
// Update version
denoConfig.version = newVersion;
// Write back to disk
await plugins.smartfile.memory.toFs(
JSON.stringify(denoConfig, null, 2) + '\n',
denoJsonPath
);
// Stage the deno.json file
await smartshellInstance.exec('git add deno.json');
// Commit the version bump
await smartshellInstance.exec(`git commit -m "v${newVersion}"`);
// Create the version tag
await smartshellInstance.exec(`git tag v${newVersion} -m "v${newVersion}"`);
logger.log('info', `Created commit and tag v${newVersion}`);
return newVersion;
} catch (error) {
throw new Error(`Failed to bump deno.json version: ${error.message}`);
} }
} }
/** /**
* Bumps the version in package.json using npm version command * Updates the version field in a JSON file (package.json or deno.json)
* @param versionType Type of version bump * @param filePath Path to the JSON file
* @returns The new version string * @param newVersion The new version to write
*/ */
async function bumpNpmVersion(versionType: VersionType): Promise<string> { async function updateVersionFile(filePath: string, newVersion: string): Promise<void> {
const smartshellInstance = new plugins.smartshell.Smartshell({ const config = plugins.smartfile.fs.toObjectSync(filePath) as { version?: string };
executor: 'bash', config.version = newVersion;
sourceFilePaths: [], await plugins.smartfile.memory.toFs(
}); JSON.stringify(config, null, 2) + '\n',
filePath
logger.log('info', `Bumping package.json version using npm version ${versionType}`); );
const result = await smartshellInstance.exec(`npm version ${versionType}`);
// npm version returns the new version with a 'v' prefix, e.g., "v1.2.3"
const newVersion = result.stdout.trim().replace(/^v/, '');
return newVersion;
}
/**
* Syncs the version from package.json to deno.json and amends the npm commit
* @param version The version to sync
*/
async function syncVersionToDenoJson(version: string): Promise<void> {
const denoJsonPath = plugins.path.join(paths.cwd, 'deno.json');
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
sourceFilePaths: [],
});
try {
const denoConfig = plugins.smartfile.fs.toObjectSync(
denoJsonPath
) as { version?: string };
logger.log('info', `Syncing version to deno.json: ${version}`);
denoConfig.version = version;
await plugins.smartfile.memory.toFs(
JSON.stringify(denoConfig, null, 2) + '\n',
denoJsonPath
);
// Stage the deno.json file
await smartshellInstance.exec('git add deno.json');
// Amend the npm version commit to include deno.json
await smartshellInstance.exec('git commit --amend --no-edit');
// Re-create the tag with force to update it
await smartshellInstance.exec(`git tag -fa v${version} -m "v${version}"`);
logger.log('info', `Amended commit to include deno.json and updated tag v${version}`);
} catch (error) {
throw new Error(`Failed to sync version to deno.json: ${error.message}`);
}
} }
/** /**
* Bumps the project version based on project type * Bumps the project version based on project type
* Handles npm-only, deno-only, and dual projects with unified logic
* @param projectType The detected project type * @param projectType The detected project type
* @param versionType The type of version bump * @param versionType The type of version bump
* @param currentStep The current step number for progress display * @param currentStep The current step number for progress display
@@ -215,6 +144,10 @@ export async function bumpProjectVersion(
currentStep?: number, currentStep?: number,
totalSteps?: number totalSteps?: number
): Promise<string> { ): Promise<string> {
if (projectType === 'none') {
throw new Error('Cannot bump version: no package.json or deno.json found');
}
const projectEmoji = projectType === 'npm' ? '📦' : projectType === 'deno' ? '🦕' : '🔀'; const projectEmoji = projectType === 'npm' ? '📦' : projectType === 'deno' ? '🦕' : '🔀';
const description = `🏷️ Bumping version (${projectEmoji} ${projectType})`; const description = `🏷️ Bumping version (${projectEmoji} ${projectType})`;
@@ -222,35 +155,52 @@ export async function bumpProjectVersion(
ui.printStep(currentStep, totalSteps, description, 'in-progress'); ui.printStep(currentStep, totalSteps, description, 'in-progress');
} }
let newVersion: string; const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
sourceFilePaths: [],
});
switch (projectType) { try {
case 'npm': // 1. Read current version
newVersion = await bumpNpmVersion(versionType); const currentVersion = readCurrentVersion(projectType);
break;
case 'deno': // 2. Calculate new version (reuse existing function!)
newVersion = await bumpDenoVersion(versionType); const newVersion = calculateNewVersion(currentVersion, versionType);
break;
case 'both': { logger.log('info', `Bumping version: ${currentVersion}${newVersion}`);
// Bump npm version first (it handles git tags)
newVersion = await bumpNpmVersion(versionType); // 3. Determine which files to update
// Then sync to deno.json const filesToUpdate: string[] = [];
await syncVersionToDenoJson(newVersion); const packageJsonPath = plugins.path.join(paths.cwd, 'package.json');
break; const denoJsonPath = plugins.path.join(paths.cwd, 'deno.json');
if (projectType === 'npm' || projectType === 'both') {
await updateVersionFile(packageJsonPath, newVersion);
filesToUpdate.push('package.json');
} }
case 'none': if (projectType === 'deno' || projectType === 'both') {
throw new Error('Cannot bump version: no package.json or deno.json found'); await updateVersionFile(denoJsonPath, newVersion);
filesToUpdate.push('deno.json');
}
default: // 4. Stage all updated files
throw new Error(`Unknown project type: ${projectType}`); await smartshellInstance.exec(`git add ${filesToUpdate.join(' ')}`);
// 5. Create version commit
await smartshellInstance.exec(`git commit -m "v${newVersion}"`);
// 6. Create version tag
await smartshellInstance.exec(`git tag v${newVersion} -m "v${newVersion}"`);
logger.log('info', `Created commit and tag v${newVersion}`);
if (currentStep && totalSteps) {
ui.printStep(currentStep, totalSteps, description, 'done');
}
return newVersion;
} catch (error) {
throw new Error(`Failed to bump project version: ${error.message}`);
} }
if (currentStep && totalSteps) {
ui.printStep(currentStep, totalSteps, description, 'done');
}
return newVersion;
} }