@grekt/cli 6.41.0 → 6.42.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/dist/index.js +46 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102291,6 +102291,45 @@ async function publishArtifact(publisher, ctx) {
|
|
|
102291
102291
|
return publisher.publish(ctx);
|
|
102292
102292
|
}
|
|
102293
102293
|
|
|
102294
|
+
// src/shared/git/git.ts
|
|
102295
|
+
function exec(args) {
|
|
102296
|
+
return shell.execFile("git", args).trim();
|
|
102297
|
+
}
|
|
102298
|
+
function execOrNull(args) {
|
|
102299
|
+
try {
|
|
102300
|
+
const result = exec(args);
|
|
102301
|
+
return result || null;
|
|
102302
|
+
} catch {
|
|
102303
|
+
return null;
|
|
102304
|
+
}
|
|
102305
|
+
}
|
|
102306
|
+
function splitLines(output) {
|
|
102307
|
+
if (!output)
|
|
102308
|
+
return [];
|
|
102309
|
+
return output.split(`
|
|
102310
|
+
`).map((line) => line.trim()).filter(Boolean);
|
|
102311
|
+
}
|
|
102312
|
+
function detectArtifactBaseRef(artifactName) {
|
|
102313
|
+
const lastTag = execOrNull([
|
|
102314
|
+
"describe",
|
|
102315
|
+
"--tags",
|
|
102316
|
+
"--abbrev=0",
|
|
102317
|
+
"--match",
|
|
102318
|
+
`${artifactName}@*`
|
|
102319
|
+
]);
|
|
102320
|
+
if (lastTag)
|
|
102321
|
+
return lastTag;
|
|
102322
|
+
const firstCommit = execOrNull(["rev-list", "--max-parents=0", "HEAD"]);
|
|
102323
|
+
if (firstCommit)
|
|
102324
|
+
return firstCommit;
|
|
102325
|
+
warning(`${artifactName}: no tags found, falling back to HEAD~1`);
|
|
102326
|
+
return "HEAD~1";
|
|
102327
|
+
}
|
|
102328
|
+
function createArtifactTag(artifactName, version3) {
|
|
102329
|
+
const tag = `${artifactName}@${version3}`;
|
|
102330
|
+
exec(["tag", tag]);
|
|
102331
|
+
}
|
|
102332
|
+
|
|
102294
102333
|
// src/workspace/workspace.ts
|
|
102295
102334
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
102296
102335
|
import { join as join30 } from "path";
|
|
@@ -102657,6 +102696,12 @@ async function publishSingleArtifact(artifactPath, projectRoot, options2, silent
|
|
|
102657
102696
|
} else {
|
|
102658
102697
|
success(`Published ${artifact.artifactId}@${artifact.manifest.version}`);
|
|
102659
102698
|
}
|
|
102699
|
+
try {
|
|
102700
|
+
createArtifactTag(artifact.artifactId, artifact.manifest.version);
|
|
102701
|
+
} catch (err) {
|
|
102702
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
102703
|
+
warning(`Failed to create tag for ${artifact.artifactId}@${artifact.manifest.version}: ${message}`);
|
|
102704
|
+
}
|
|
102660
102705
|
}
|
|
102661
102706
|
function showKeywordsExample() {
|
|
102662
102707
|
log("");
|
|
@@ -103393,23 +103438,6 @@ function findArtifacts(basePath) {
|
|
|
103393
103438
|
}
|
|
103394
103439
|
|
|
103395
103440
|
// src/commands/changelog/git.ts
|
|
103396
|
-
function exec(args) {
|
|
103397
|
-
return shell.execFile("git", args).trim();
|
|
103398
|
-
}
|
|
103399
|
-
function execOrNull(args) {
|
|
103400
|
-
try {
|
|
103401
|
-
const result = exec(args);
|
|
103402
|
-
return result || null;
|
|
103403
|
-
} catch {
|
|
103404
|
-
return null;
|
|
103405
|
-
}
|
|
103406
|
-
}
|
|
103407
|
-
function splitLines(output) {
|
|
103408
|
-
if (!output)
|
|
103409
|
-
return [];
|
|
103410
|
-
return output.split(`
|
|
103411
|
-
`).map((line) => line.trim()).filter(Boolean);
|
|
103412
|
-
}
|
|
103413
103441
|
function detectDefaultBranch() {
|
|
103414
103442
|
const symbolicRef = execOrNull([
|
|
103415
103443
|
"symbolic-ref",
|
|
@@ -103421,9 +103449,6 @@ function detectDefaultBranch() {
|
|
|
103421
103449
|
}
|
|
103422
103450
|
return "main";
|
|
103423
103451
|
}
|
|
103424
|
-
function getFirstCommit() {
|
|
103425
|
-
return execOrNull(["rev-list", "--max-parents=0", "HEAD"]);
|
|
103426
|
-
}
|
|
103427
103452
|
function detectBaseRef(overrideSince) {
|
|
103428
103453
|
if (overrideSince) {
|
|
103429
103454
|
const resolved = execOrNull(["rev-parse", "--verify", overrideSince]);
|
|
@@ -103445,22 +103470,6 @@ function detectBaseRef(overrideSince) {
|
|
|
103445
103470
|
warning("No remote found, falling back to local refs");
|
|
103446
103471
|
return defaultBranch;
|
|
103447
103472
|
}
|
|
103448
|
-
function detectArtifactBaseRef(artifactName) {
|
|
103449
|
-
const lastTag = execOrNull([
|
|
103450
|
-
"describe",
|
|
103451
|
-
"--tags",
|
|
103452
|
-
"--abbrev=0",
|
|
103453
|
-
"--match",
|
|
103454
|
-
`${artifactName}@*`
|
|
103455
|
-
]);
|
|
103456
|
-
if (lastTag)
|
|
103457
|
-
return lastTag;
|
|
103458
|
-
const firstCommit = getFirstCommit();
|
|
103459
|
-
if (firstCommit)
|
|
103460
|
-
return firstCommit;
|
|
103461
|
-
warning(`${artifactName}: no tags found, falling back to HEAD~1`);
|
|
103462
|
-
return "HEAD~1";
|
|
103463
|
-
}
|
|
103464
103473
|
function getChangedFiles(baseRef, path8) {
|
|
103465
103474
|
const baseArgs = ["diff", "--name-only"];
|
|
103466
103475
|
const pathFilter = path8 ? ["--", path8] : [];
|
|
@@ -104397,7 +104406,7 @@ var whoamiCommand = new Command("whoami").description("Show current user").actio
|
|
|
104397
104406
|
// package.json
|
|
104398
104407
|
var package_default = {
|
|
104399
104408
|
name: "@grekt/cli",
|
|
104400
|
-
version: "6.
|
|
104409
|
+
version: "6.42.0",
|
|
104401
104410
|
description: "AI tools versioned, synced, and shared across tools and teams",
|
|
104402
104411
|
type: "module",
|
|
104403
104412
|
bin: {
|