@kaitranntt/ccs 5.0.2 → 5.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/VERSION +1 -1
- package/package.json +10 -5
- package/scripts/bump-version.sh +39 -10
- package/scripts/sync-version-plugin.cjs +41 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.0
|
|
1
|
+
5.1.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaitranntt/ccs",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -58,16 +58,15 @@
|
|
|
58
58
|
"lint:fix": "eslint src/ --fix",
|
|
59
59
|
"format": "prettier --write src/",
|
|
60
60
|
"format:check": "prettier --check src/",
|
|
61
|
-
"validate": "bun run typecheck && bun run lint && bun run format:check && bun run test",
|
|
61
|
+
"validate": "bun run typecheck && bun run lint:fix && bun run format:check && bun run test",
|
|
62
62
|
"test": "bun run build && bun run test:all",
|
|
63
63
|
"test:all": "bun run test:unit && bun run test:npm",
|
|
64
|
-
"test:unit": "mocha tests/
|
|
64
|
+
"test:unit": "mocha 'tests/**/unit/**/*.test.js' 'tests/unit/**/*.test.js' --timeout 5000",
|
|
65
65
|
"test:npm": "mocha tests/npm/**/*.test.js --timeout 10000",
|
|
66
66
|
"test:native": "bash tests/native/unix/edge-cases.sh",
|
|
67
|
-
"test:edge-cases": "bash tests/edge-cases.sh",
|
|
68
67
|
"prepublishOnly": "npm run validate && node scripts/sync-version.js",
|
|
69
68
|
"prepack": "npm run validate && node scripts/sync-version.js",
|
|
70
|
-
"prepare": "
|
|
69
|
+
"prepare": "husky",
|
|
71
70
|
"postinstall": "node scripts/postinstall.js"
|
|
72
71
|
},
|
|
73
72
|
"dependencies": {
|
|
@@ -75,13 +74,19 @@
|
|
|
75
74
|
"ora": "^9.0.0"
|
|
76
75
|
},
|
|
77
76
|
"devDependencies": {
|
|
77
|
+
"@commitlint/cli": "^20.1.0",
|
|
78
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
79
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
80
|
+
"@semantic-release/git": "^10.0.1",
|
|
78
81
|
"@types/node": "^20.19.25",
|
|
79
82
|
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
80
83
|
"@typescript-eslint/parser": "^8.48.0",
|
|
81
84
|
"eslint": "^9.39.1",
|
|
82
85
|
"eslint-config-prettier": "^10.1.8",
|
|
86
|
+
"husky": "^9.1.7",
|
|
83
87
|
"mocha": "^11.7.5",
|
|
84
88
|
"prettier": "^3.6.2",
|
|
89
|
+
"semantic-release": "^25.0.2",
|
|
85
90
|
"typescript": "5.3"
|
|
86
91
|
}
|
|
87
92
|
}
|
package/scripts/bump-version.sh
CHANGED
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# DEPRECATED: This script is kept for emergency manual releases only.
|
|
4
4
|
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
5
|
+
# Releases are now automated via semantic-release:
|
|
6
|
+
# - Merge to main → stable release (npm @latest)
|
|
7
|
+
# - Merge to beta → beta release (npm @beta)
|
|
8
|
+
#
|
|
9
|
+
# Version is determined automatically from conventional commits:
|
|
10
|
+
# - feat: commit → MINOR bump (5.0.2 → 5.1.0)
|
|
11
|
+
# - fix: commit → PATCH bump (5.0.2 → 5.0.3)
|
|
12
|
+
# - feat!: commit → MAJOR bump (5.0.2 → 6.0.0)
|
|
13
|
+
#
|
|
14
|
+
# See: docs/version-management.md
|
|
15
|
+
# =============================================================================
|
|
16
|
+
#
|
|
17
|
+
# Legacy usage (emergency only): ./scripts/bump-version.sh [major|minor|patch]
|
|
7
18
|
|
|
8
19
|
set -euo pipefail
|
|
9
20
|
|
|
21
|
+
# Show deprecation warning
|
|
22
|
+
echo "============================================================="
|
|
23
|
+
echo "[!] DEPRECATED: This script is for emergency use only."
|
|
24
|
+
echo ""
|
|
25
|
+
echo " Releases are now automated via semantic-release."
|
|
26
|
+
echo " Simply merge to 'main' or 'beta' branch."
|
|
27
|
+
echo ""
|
|
28
|
+
echo " Version is determined from conventional commits:"
|
|
29
|
+
echo " feat: commit -> MINOR (5.0.2 -> 5.1.0)"
|
|
30
|
+
echo " fix: commit -> PATCH (5.0.2 -> 5.0.3)"
|
|
31
|
+
echo " feat!: commit -> MAJOR (5.0.2 -> 6.0.0)"
|
|
32
|
+
echo "============================================================="
|
|
33
|
+
echo ""
|
|
34
|
+
|
|
35
|
+
# Require explicit confirmation
|
|
36
|
+
read -p "Continue with manual bump? (y/N) " -n 1 -r
|
|
37
|
+
echo
|
|
38
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
39
|
+
echo "Cancelled. Use conventional commits + merge to main instead."
|
|
40
|
+
exit 0
|
|
41
|
+
fi
|
|
42
|
+
echo ""
|
|
43
|
+
|
|
10
44
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
45
|
CCS_DIR="$(dirname "$SCRIPT_DIR")"
|
|
12
46
|
VERSION_FILE="$CCS_DIR/VERSION"
|
|
@@ -68,13 +102,8 @@ echo ""
|
|
|
68
102
|
echo "Note: lib/ccs and lib/ccs.ps1 are now bootstraps"
|
|
69
103
|
echo " (delegate to Node.js, no version hardcoded)"
|
|
70
104
|
echo ""
|
|
71
|
-
read -p "Continue? (y/N) " -n 1 -r
|
|
72
|
-
echo
|
|
73
105
|
|
|
74
|
-
|
|
75
|
-
echo "Cancelled."
|
|
76
|
-
exit 0
|
|
77
|
-
fi
|
|
106
|
+
# Already confirmed above in deprecation warning
|
|
78
107
|
|
|
79
108
|
# Update VERSION file
|
|
80
109
|
echo "$NEW_VERSION" > "$VERSION_FILE"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* semantic-release plugin to sync VERSION file
|
|
3
|
+
*
|
|
4
|
+
* semantic-release updates package.json but not the VERSION file.
|
|
5
|
+
* This plugin keeps VERSION in sync for shell scripts and installers.
|
|
6
|
+
*/
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
/**
|
|
12
|
+
* Called during the prepare step before git commit
|
|
13
|
+
*/
|
|
14
|
+
prepare(_pluginConfig, context) {
|
|
15
|
+
const { nextRelease, logger } = context;
|
|
16
|
+
const versionFile = path.join(process.cwd(), 'VERSION');
|
|
17
|
+
|
|
18
|
+
// Write version without 'v' prefix (e.g., "5.1.0" not "v5.1.0")
|
|
19
|
+
const version = nextRelease.version;
|
|
20
|
+
fs.writeFileSync(versionFile, version + '\n');
|
|
21
|
+
logger.log('[sync-version-plugin] Updated VERSION file to %s', version);
|
|
22
|
+
|
|
23
|
+
// Also update installers for standalone installs
|
|
24
|
+
const installSh = path.join(process.cwd(), 'installers', 'install.sh');
|
|
25
|
+
const installPs1 = path.join(process.cwd(), 'installers', 'install.ps1');
|
|
26
|
+
|
|
27
|
+
if (fs.existsSync(installSh)) {
|
|
28
|
+
let content = fs.readFileSync(installSh, 'utf8');
|
|
29
|
+
content = content.replace(/^CCS_VERSION=".*"/m, `CCS_VERSION="${version}"`);
|
|
30
|
+
fs.writeFileSync(installSh, content);
|
|
31
|
+
logger.log('[sync-version-plugin] Updated installers/install.sh');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (fs.existsSync(installPs1)) {
|
|
35
|
+
let content = fs.readFileSync(installPs1, 'utf8');
|
|
36
|
+
content = content.replace(/^\$CcsVersion = ".*"/m, `$CcsVersion = "${version}"`);
|
|
37
|
+
fs.writeFileSync(installPs1, content);
|
|
38
|
+
logger.log('[sync-version-plugin] Updated installers/install.ps1');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|