@grekt/cli 6.41.0 → 6.42.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/dist/index.js +49 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102291,6 +102291,48 @@ 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
|
+
if (process.env.CI) {
|
|
102332
|
+
execOrNull(["push", "origin", tag]);
|
|
102333
|
+
}
|
|
102334
|
+
}
|
|
102335
|
+
|
|
102294
102336
|
// src/workspace/workspace.ts
|
|
102295
102337
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
102296
102338
|
import { join as join30 } from "path";
|
|
@@ -102657,6 +102699,12 @@ async function publishSingleArtifact(artifactPath, projectRoot, options2, silent
|
|
|
102657
102699
|
} else {
|
|
102658
102700
|
success(`Published ${artifact.artifactId}@${artifact.manifest.version}`);
|
|
102659
102701
|
}
|
|
102702
|
+
try {
|
|
102703
|
+
createArtifactTag(artifact.artifactId, artifact.manifest.version);
|
|
102704
|
+
} catch (err) {
|
|
102705
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
102706
|
+
warning(`Failed to create tag for ${artifact.artifactId}@${artifact.manifest.version}: ${message}`);
|
|
102707
|
+
}
|
|
102660
102708
|
}
|
|
102661
102709
|
function showKeywordsExample() {
|
|
102662
102710
|
log("");
|
|
@@ -103393,23 +103441,6 @@ function findArtifacts(basePath) {
|
|
|
103393
103441
|
}
|
|
103394
103442
|
|
|
103395
103443
|
// 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
103444
|
function detectDefaultBranch() {
|
|
103414
103445
|
const symbolicRef = execOrNull([
|
|
103415
103446
|
"symbolic-ref",
|
|
@@ -103421,9 +103452,6 @@ function detectDefaultBranch() {
|
|
|
103421
103452
|
}
|
|
103422
103453
|
return "main";
|
|
103423
103454
|
}
|
|
103424
|
-
function getFirstCommit() {
|
|
103425
|
-
return execOrNull(["rev-list", "--max-parents=0", "HEAD"]);
|
|
103426
|
-
}
|
|
103427
103455
|
function detectBaseRef(overrideSince) {
|
|
103428
103456
|
if (overrideSince) {
|
|
103429
103457
|
const resolved = execOrNull(["rev-parse", "--verify", overrideSince]);
|
|
@@ -103445,22 +103473,6 @@ function detectBaseRef(overrideSince) {
|
|
|
103445
103473
|
warning("No remote found, falling back to local refs");
|
|
103446
103474
|
return defaultBranch;
|
|
103447
103475
|
}
|
|
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
103476
|
function getChangedFiles(baseRef, path8) {
|
|
103465
103477
|
const baseArgs = ["diff", "--name-only"];
|
|
103466
103478
|
const pathFilter = path8 ? ["--", path8] : [];
|
|
@@ -104397,7 +104409,7 @@ var whoamiCommand = new Command("whoami").description("Show current user").actio
|
|
|
104397
104409
|
// package.json
|
|
104398
104410
|
var package_default = {
|
|
104399
104411
|
name: "@grekt/cli",
|
|
104400
|
-
version: "6.
|
|
104412
|
+
version: "6.42.1",
|
|
104401
104413
|
description: "AI tools versioned, synced, and shared across tools and teams",
|
|
104402
104414
|
type: "module",
|
|
104403
104415
|
bin: {
|