@cuewright/skills 0.1.0 → 0.1.1
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/package.json +2 -2
- package/src/commands/update.js +2 -2
- package/src/storage/submodule.js +15 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuewright/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "CLI installer for the Cuewright skills framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/scriswell/cuewright-cli.git"
|
|
40
|
+
"url": "git+https://github.com/scriswell/cuewright-cli.git"
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/scriswell/cuewright-cli#readme"
|
|
43
43
|
}
|
package/src/commands/update.js
CHANGED
|
@@ -29,8 +29,8 @@ export async function update(options) {
|
|
|
29
29
|
const isSubmodule = await exists(join(projectRoot, '.gitmodules'))
|
|
30
30
|
&& await isSubmoduleInstall(projectRoot, frameworkDir);
|
|
31
31
|
|
|
32
|
-
// Determine target version
|
|
33
|
-
const targetVersion = options.to || await resolveLatestTag(frameworkDir);
|
|
32
|
+
// Determine target version — always bare (no leading v)
|
|
33
|
+
const targetVersion = ((options.to || await resolveLatestTag(frameworkDir))).replace(/^v/, '');
|
|
34
34
|
|
|
35
35
|
if (targetVersion === oldVersion) {
|
|
36
36
|
console.log(chalk.cyan(`Already at v${oldVersion} (latest). Nothing to update.`));
|
package/src/storage/submodule.js
CHANGED
|
@@ -5,6 +5,7 @@ const FRAMEWORK_REPO = 'https://github.com/scriswell/cuewright';
|
|
|
5
5
|
/**
|
|
6
6
|
* Add the framework as a git submodule.
|
|
7
7
|
* If tag is provided, checks out that tag after adding.
|
|
8
|
+
* Tag may be bare (0.14.33) or prefixed (v0.14.33) — normalized internally.
|
|
8
9
|
*/
|
|
9
10
|
export async function addSubmodule(projectRoot, submodulePath, tag) {
|
|
10
11
|
const git = simpleGit(projectRoot);
|
|
@@ -13,7 +14,7 @@ export async function addSubmodule(projectRoot, submodulePath, tag) {
|
|
|
13
14
|
|
|
14
15
|
if (tag) {
|
|
15
16
|
const subGit = simpleGit(`${projectRoot}/${submodulePath}`);
|
|
16
|
-
await subGit.checkout(tag);
|
|
17
|
+
await subGit.checkout(toGitTag(tag));
|
|
17
18
|
|
|
18
19
|
// Update the superproject's submodule pointer to this commit
|
|
19
20
|
await git.submoduleUpdate(['--init', submodulePath]);
|
|
@@ -29,17 +30,13 @@ export async function updateSubmodule(projectRoot, submodulePath, tag) {
|
|
|
29
30
|
|
|
30
31
|
await subGit.fetch(['--tags']);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} else {
|
|
35
|
-
// Checkout the latest semver tag
|
|
36
|
-
const latestTag = await getLatestTag(subGit);
|
|
37
|
-
await subGit.checkout(latestTag);
|
|
38
|
-
}
|
|
33
|
+
const gitTag = tag ? toGitTag(tag) : toGitTag(await getLatestTag(subGit));
|
|
34
|
+
await subGit.checkout(gitTag);
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
/**
|
|
42
|
-
* Return the latest semver tag
|
|
38
|
+
* Return the latest semver tag as a bare version string (no leading v).
|
|
39
|
+
* e.g. "0.14.33" not "v0.14.33"
|
|
43
40
|
*/
|
|
44
41
|
export async function getLatestTag(git) {
|
|
45
42
|
const result = await git.tags(['--sort=-version:refname']);
|
|
@@ -47,5 +44,13 @@ export async function getLatestTag(git) {
|
|
|
47
44
|
if (semverTags.length === 0) {
|
|
48
45
|
throw new Error('No semver tags found in framework repo');
|
|
49
46
|
}
|
|
50
|
-
return semverTags[0];
|
|
47
|
+
return semverTags[0].replace(/^v/, '');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Normalize a version string to a git tag with v prefix.
|
|
52
|
+
* "0.14.33" → "v0.14.33", "v0.14.33" → "v0.14.33"
|
|
53
|
+
*/
|
|
54
|
+
function toGitTag(version) {
|
|
55
|
+
return version.startsWith('v') ? version : `v${version}`;
|
|
51
56
|
}
|