@grekt/cli 6.40.0 → 6.40.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 +26 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102329,6 +102329,24 @@ async function loadWorkspace(cwd) {
|
|
|
102329
102329
|
artifacts: discovered.artifacts
|
|
102330
102330
|
};
|
|
102331
102331
|
}
|
|
102332
|
+
function generateWorkspaceFile(root, artifacts) {
|
|
102333
|
+
const workspacePath = join29(root, "pnpm-workspace.yaml");
|
|
102334
|
+
const rootPackageJsonPath = join29(root, "package.json");
|
|
102335
|
+
const relativePaths = artifacts.map((artifact) => artifact.relativePath);
|
|
102336
|
+
fs.writeFile(workspacePath, $stringify2({ packages: relativePaths }));
|
|
102337
|
+
fs.writeFile(rootPackageJsonPath, JSON.stringify({ name: "workspace-root", private: true }, null, 2) + `
|
|
102338
|
+
`);
|
|
102339
|
+
}
|
|
102340
|
+
function cleanWorkspaceFile(root) {
|
|
102341
|
+
const workspacePath = join29(root, "pnpm-workspace.yaml");
|
|
102342
|
+
const rootPackageJsonPath = join29(root, "package.json");
|
|
102343
|
+
if (fs.exists(workspacePath)) {
|
|
102344
|
+
fs.unlink(workspacePath);
|
|
102345
|
+
}
|
|
102346
|
+
if (fs.exists(rootPackageJsonPath)) {
|
|
102347
|
+
fs.unlink(rootPackageJsonPath);
|
|
102348
|
+
}
|
|
102349
|
+
}
|
|
102332
102350
|
function generatePackageJsonFiles(artifacts) {
|
|
102333
102351
|
for (const artifact of artifacts) {
|
|
102334
102352
|
const packageJsonPath = join29(artifact.path, "package.json");
|
|
@@ -103271,11 +103289,12 @@ async function handleExecMode(options2) {
|
|
|
103271
103289
|
info(`Would run: ${command}`);
|
|
103272
103290
|
return;
|
|
103273
103291
|
}
|
|
103274
|
-
const genSpin = spinner("Generating
|
|
103292
|
+
const genSpin = spinner("Generating workspace config files...");
|
|
103275
103293
|
genSpin.start();
|
|
103294
|
+
generateWorkspaceFile(cwd, workspace.artifacts);
|
|
103276
103295
|
generatePackageJsonFiles(workspace.artifacts);
|
|
103277
103296
|
genSpin.stop();
|
|
103278
|
-
success(
|
|
103297
|
+
success("Generated workspace config files");
|
|
103279
103298
|
log("");
|
|
103280
103299
|
info(`Running: ${command}`);
|
|
103281
103300
|
log("");
|
|
@@ -103285,6 +103304,7 @@ async function handleExecMode(options2) {
|
|
|
103285
103304
|
stdio: "inherit"
|
|
103286
103305
|
});
|
|
103287
103306
|
if (result.status !== 0) {
|
|
103307
|
+
cleanWorkspaceFile(cwd);
|
|
103288
103308
|
cleanPackageJsonFiles(workspace.artifacts);
|
|
103289
103309
|
error(`Command failed with exit code ${result.status}`);
|
|
103290
103310
|
process.exit(result.status ?? 1);
|
|
@@ -103295,6 +103315,7 @@ async function handleExecMode(options2) {
|
|
|
103295
103315
|
const updatedWorkspace = await loadWorkspace(cwd);
|
|
103296
103316
|
if (!updatedWorkspace) {
|
|
103297
103317
|
syncSpin.stop();
|
|
103318
|
+
cleanWorkspaceFile(cwd);
|
|
103298
103319
|
cleanPackageJsonFiles(workspace.artifacts);
|
|
103299
103320
|
error("Failed to reload workspace");
|
|
103300
103321
|
process.exit(1);
|
|
@@ -103308,9 +103329,10 @@ async function handleExecMode(options2) {
|
|
|
103308
103329
|
}
|
|
103309
103330
|
const cleanSpin = spinner("Cleaning up...");
|
|
103310
103331
|
cleanSpin.start();
|
|
103332
|
+
cleanWorkspaceFile(cwd);
|
|
103311
103333
|
cleanPackageJsonFiles(workspace.artifacts);
|
|
103312
103334
|
cleanSpin.stop();
|
|
103313
|
-
success("Removed temporary
|
|
103335
|
+
success("Removed temporary config files");
|
|
103314
103336
|
log("");
|
|
103315
103337
|
success("Version update complete");
|
|
103316
103338
|
}
|
|
@@ -104336,7 +104358,7 @@ var whoamiCommand = new Command("whoami").description("Show current user").actio
|
|
|
104336
104358
|
// package.json
|
|
104337
104359
|
var package_default = {
|
|
104338
104360
|
name: "@grekt/cli",
|
|
104339
|
-
version: "6.40.
|
|
104361
|
+
version: "6.40.1",
|
|
104340
104362
|
description: "AI tools versioned, synced, and shared across tools and teams",
|
|
104341
104363
|
type: "module",
|
|
104342
104364
|
bin: {
|