@nuucognition/flint-cli 0.4.0-alpha.0 → 0.4.0-alpha.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.
|
@@ -2450,12 +2450,12 @@ async function createRepository(flintPath, name, remote) {
|
|
|
2450
2450
|
if (await pathExists2(repoPath)) {
|
|
2451
2451
|
throw new Error(`Repository folder already exists: ${repoPath}`);
|
|
2452
2452
|
}
|
|
2453
|
+
if (remote) {
|
|
2454
|
+
return cloneRepository(flintPath, name, remote);
|
|
2455
|
+
}
|
|
2453
2456
|
await mkdir42(repoPath, { recursive: true });
|
|
2454
2457
|
try {
|
|
2455
2458
|
await execAsync2("git init", { cwd: repoPath });
|
|
2456
|
-
if (remote) {
|
|
2457
|
-
await execAsync2(`git remote add origin "${remote}"`, { cwd: repoPath });
|
|
2458
|
-
}
|
|
2459
2459
|
} catch (error) {
|
|
2460
2460
|
const message = error instanceof Error ? error.message : String(error);
|
|
2461
2461
|
await rm6(repoPath, { recursive: true, force: true });
|
|
@@ -2489,6 +2489,12 @@ async function removeRepositoryFolder(flintPath, name) {
|
|
|
2489
2489
|
async function updateRepository(flintPath, name, url) {
|
|
2490
2490
|
const repoPath = getRepositoryPath(flintPath, name);
|
|
2491
2491
|
if (await pathExists2(repoPath)) {
|
|
2492
|
+
try {
|
|
2493
|
+
await execAsync2("git rev-parse HEAD", { cwd: repoPath });
|
|
2494
|
+
} catch {
|
|
2495
|
+
await rm6(repoPath, { recursive: true, force: true });
|
|
2496
|
+
return cloneRepository(flintPath, name, url);
|
|
2497
|
+
}
|
|
2492
2498
|
await execAsync2("git pull", { cwd: repoPath });
|
|
2493
2499
|
return repoPath;
|
|
2494
2500
|
}
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
updateSession,
|
|
78
78
|
updateShards,
|
|
79
79
|
updateSourceRepository
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-JYXX4EHB.js";
|
|
81
81
|
import "./chunk-V7YA5RXL.js";
|
|
82
82
|
import {
|
|
83
83
|
findFlintByName,
|
|
@@ -3219,7 +3219,7 @@ Failed to fetch published shards: ${msg}`));
|
|
|
3219
3219
|
return cmd;
|
|
3220
3220
|
})()
|
|
3221
3221
|
).addCommand(
|
|
3222
|
-
new Command5("release").description("Tag and publish a version from a dev shard").argument("<name>", "Shard name").argument("
|
|
3222
|
+
new Command5("release").description("Tag and publish a version from a dev shard (version derived from shard.yaml)").argument("<name>", "Shard name").argument("[version]", "Version to release (default: read from shard.yaml)").option("-p, --path <dir>", "Path to flint").action(async (name, version, options) => {
|
|
3223
3223
|
try {
|
|
3224
3224
|
const flintPath = await resolveFlint(options.path);
|
|
3225
3225
|
const installed = await getInstalledShardsWithVersions(flintPath);
|
|
@@ -3251,12 +3251,13 @@ Shard not found: "${name}"`));
|
|
|
3251
3251
|
Could not read version from shard.yaml`));
|
|
3252
3252
|
process.exit(1);
|
|
3253
3253
|
}
|
|
3254
|
-
if (manifest.version !== version) {
|
|
3254
|
+
if (version && manifest.version !== version) {
|
|
3255
3255
|
console.error(pc8.red(`
|
|
3256
3256
|
Version mismatch: shard.yaml says "${manifest.version}" but you requested "${version}"`));
|
|
3257
3257
|
console.log(pc8.dim(` Update shard.yaml version first, then run release again.`));
|
|
3258
3258
|
process.exit(1);
|
|
3259
3259
|
}
|
|
3260
|
+
version = manifest.version;
|
|
3260
3261
|
const dirty = await hasUncommittedChanges(shardPath);
|
|
3261
3262
|
if (dirty) {
|
|
3262
3263
|
console.error(pc8.red(`
|
|
@@ -3798,10 +3799,12 @@ async function handleSync(flintPath, customMessage) {
|
|
|
3798
3799
|
}
|
|
3799
3800
|
async function buildSyncCommitMessage(flintPath, customMessage) {
|
|
3800
3801
|
const identity = await getIdentity(flintPath);
|
|
3801
|
-
const
|
|
3802
|
+
const now = /* @__PURE__ */ new Date();
|
|
3803
|
+
const timestamp = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")} ${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
3802
3804
|
let msg = "";
|
|
3803
3805
|
if (identity?.person) {
|
|
3804
|
-
|
|
3806
|
+
const displayName = identity.person.replace(/^@/, "");
|
|
3807
|
+
msg += `${displayName}: `;
|
|
3805
3808
|
}
|
|
3806
3809
|
msg += `sync ${timestamp}`;
|
|
3807
3810
|
if (customMessage) {
|
|
@@ -7667,7 +7670,7 @@ var sendCommand = new Command29("send").description("Send files to another Flint
|
|
|
7667
7670
|
console.log();
|
|
7668
7671
|
let sourceFlintName = "Unknown";
|
|
7669
7672
|
try {
|
|
7670
|
-
const { readFlintToml: readFlintToml3 } = await import("./dist-
|
|
7673
|
+
const { readFlintToml: readFlintToml3 } = await import("./dist-DN2YMDQ2.js");
|
|
7671
7674
|
const toml = await readFlintToml3(flintPath);
|
|
7672
7675
|
if (toml?.flint?.name) {
|
|
7673
7676
|
sourceFlintName = toml.flint.name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuucognition/flint-cli",
|
|
3
|
-
"version": "0.4.0-alpha.
|
|
3
|
+
"version": "0.4.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Flint cognitive workspace CLI",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"tsup": "^8.3.5",
|
|
27
27
|
"tsx": "^4.19.2",
|
|
28
28
|
"typescript": "^5.9.2",
|
|
29
|
+
"@nuucognition/eslint-config": "0.0.0",
|
|
29
30
|
"@nuucognition/flint": "0.1.0",
|
|
30
31
|
"@nuucognition/flint-migrations": "0.1.0",
|
|
31
32
|
"@nuucognition/flint-server": "0.0.1",
|
|
32
|
-
"@nuucognition/typescript-config": "0.0.0",
|
|
33
33
|
"@nuucognition/flint-runtime": "0.0.1",
|
|
34
|
-
"@nuucognition/
|
|
34
|
+
"@nuucognition/typescript-config": "0.0.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"predev": "pnpm --dir ../../packages/flint build && pnpm --dir ../../packages/flint-migrations build && pnpm --dir ../../packages/flint-runtime build && pnpm --dir ../../packages/flint-server build",
|