truecourse 0.6.0-next.7 → 0.6.0-next.8
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/README.md +2 -0
- package/cli.mjs +22 -3
- package/package.json +1 -1
- package/public/assets/{index-CkKIAyL2.js → index-BABCLoif.js} +3 -3
- package/public/index.html +1 -1
- package/server.mjs +15 -2
package/README.md
CHANGED
|
@@ -193,6 +193,8 @@ truecourse verify # Check code against the contracts → d
|
|
|
193
193
|
|
|
194
194
|
Resolve conflicts and review drifts visually in the [dashboard](#dashboard-web-ui)'s BL Drift section, or drive every step from the CLI.
|
|
195
195
|
|
|
196
|
+
> Like `analyze`, the spec → contracts → verify track requires a **git repository** — TrueCourse's baselines are commit-anchored (committable `LATEST.json`, diff vs HEAD, stashing the committed state). On a non-git folder these commands stop with a clear message and the dashboard hides their actions.
|
|
197
|
+
|
|
196
198
|
## How it works
|
|
197
199
|
|
|
198
200
|
Three stages run in order, each producing artifacts the next consumes:
|
package/cli.mjs
CHANGED
|
@@ -10077,15 +10077,17 @@ async function getGit(repoPath) {
|
|
|
10077
10077
|
const git = simpleGit(repoPath);
|
|
10078
10078
|
const isRepo = await isGitRepo(repoPath);
|
|
10079
10079
|
if (!isRepo) {
|
|
10080
|
-
throw createAppError(
|
|
10080
|
+
throw createAppError(NOT_A_GIT_REPO_MESSAGE, 400);
|
|
10081
10081
|
}
|
|
10082
10082
|
return git;
|
|
10083
10083
|
}
|
|
10084
|
+
var NOT_A_GIT_REPO_MESSAGE;
|
|
10084
10085
|
var init_git = __esm({
|
|
10085
10086
|
"packages/core/dist/lib/git.js"() {
|
|
10086
10087
|
"use strict";
|
|
10087
10088
|
init_esm();
|
|
10088
10089
|
init_errors();
|
|
10090
|
+
NOT_A_GIT_REPO_MESSAGE = "The selected folder is not a git repository. Please select a folder that has been initialized with git.";
|
|
10089
10091
|
}
|
|
10090
10092
|
});
|
|
10091
10093
|
|
|
@@ -128242,7 +128244,7 @@ function readToolVersion() {
|
|
|
128242
128244
|
if (cachedVersion)
|
|
128243
128245
|
return cachedVersion;
|
|
128244
128246
|
if (true) {
|
|
128245
|
-
cachedVersion = "0.6.0-next.
|
|
128247
|
+
cachedVersion = "0.6.0-next.8";
|
|
128246
128248
|
return cachedVersion;
|
|
128247
128249
|
}
|
|
128248
128250
|
try {
|
|
@@ -149108,9 +149110,21 @@ function removeManualInclude(repoRoot6, docPath) {
|
|
|
149108
149110
|
|
|
149109
149111
|
// tools/cli/src/commands/contracts.ts
|
|
149110
149112
|
init_helpers();
|
|
149113
|
+
|
|
149114
|
+
// tools/cli/src/commands/git-guard.ts
|
|
149115
|
+
init_dist4();
|
|
149116
|
+
init_git();
|
|
149117
|
+
async function requireGitRepo(root) {
|
|
149118
|
+
if (await isGitRepo(root)) return;
|
|
149119
|
+
pt(NOT_A_GIT_REPO_MESSAGE);
|
|
149120
|
+
process.exit(1);
|
|
149121
|
+
}
|
|
149122
|
+
|
|
149123
|
+
// tools/cli/src/commands/contracts.ts
|
|
149111
149124
|
async function runContractsGenerate(options = {}) {
|
|
149112
149125
|
const repoRoot6 = options.cwd ?? process.cwd();
|
|
149113
149126
|
mt(options.diff ? "Contracts (dry run)" : "Contracts");
|
|
149127
|
+
await requireGitRepo(repoRoot6);
|
|
149114
149128
|
if (!hasCanonicalSpec(repoRoot6)) {
|
|
149115
149129
|
O2.error(
|
|
149116
149130
|
"No .truecourse/specs/claims.json found. Run `truecourse spec scan` first to build the canonical claim set."
|
|
@@ -149361,6 +149375,7 @@ function withTracker(stepDefs) {
|
|
|
149361
149375
|
async function runSpecScan(opts = {}) {
|
|
149362
149376
|
const root = repoRoot(opts);
|
|
149363
149377
|
mt("Spec scan");
|
|
149378
|
+
await requireGitRepo(root);
|
|
149364
149379
|
const { renderer, tracker } = withTracker(SCAN_STEPS);
|
|
149365
149380
|
try {
|
|
149366
149381
|
const { consolidate: consolidate2 } = await scanInProcess(root, { tracker });
|
|
@@ -149408,6 +149423,7 @@ async function runSpecResolve(opts = {}) {
|
|
|
149408
149423
|
return;
|
|
149409
149424
|
}
|
|
149410
149425
|
mt("Spec resolve \u2014 accepting all defaults");
|
|
149426
|
+
await requireGitRepo(root);
|
|
149411
149427
|
const { renderer, tracker } = withTracker(RESOLVE_STEPS);
|
|
149412
149428
|
try {
|
|
149413
149429
|
const { additions } = await resolveAllDefaultsInProcess(root, { tracker });
|
|
@@ -149456,6 +149472,7 @@ async function runVerify(opts = {}) {
|
|
|
149456
149472
|
const root = repoRoot(opts);
|
|
149457
149473
|
const { skipStash } = await resolveStashDecision({ stash: opts.stash }, root);
|
|
149458
149474
|
mt("Verify");
|
|
149475
|
+
await requireGitRepo(root);
|
|
149459
149476
|
const { renderer, tracker } = withTracker(VERIFY_STEPS);
|
|
149460
149477
|
try {
|
|
149461
149478
|
const { verify: verify2 } = await verifyInProcess(root, { tracker, codeDir: opts.codeDir, skipStash });
|
|
@@ -149494,6 +149511,7 @@ async function runVerify(opts = {}) {
|
|
|
149494
149511
|
async function runVerifyDiff(opts) {
|
|
149495
149512
|
const root = repoRoot(opts);
|
|
149496
149513
|
mt("Verify diff");
|
|
149514
|
+
await requireGitRepo(root);
|
|
149497
149515
|
const { renderer, tracker } = withTracker(VERIFY_STEPS);
|
|
149498
149516
|
try {
|
|
149499
149517
|
const { diff } = await verifyDiffInProcess(root, { tracker, codeDir: opts.codeDir });
|
|
@@ -149524,6 +149542,7 @@ async function runVerifyDiff(opts) {
|
|
|
149524
149542
|
async function runInfer(opts = {}) {
|
|
149525
149543
|
const root = repoRoot(opts);
|
|
149526
149544
|
mt("Infer");
|
|
149545
|
+
await requireGitRepo(root);
|
|
149527
149546
|
const { renderer, tracker } = withTracker(INFER_STEPS);
|
|
149528
149547
|
try {
|
|
149529
149548
|
const { infer: infer2, written, proposed } = await inferInProcess(root, {
|
|
@@ -152888,7 +152907,7 @@ async function runHooksRun() {
|
|
|
152888
152907
|
|
|
152889
152908
|
// tools/cli/src/index.ts
|
|
152890
152909
|
var program2 = new Command();
|
|
152891
|
-
program2.name("truecourse").version("0.6.0-next.
|
|
152910
|
+
program2.name("truecourse").version("0.6.0-next.8").description("TrueCourse CLI \u2014 analyze your repository and open the dashboard");
|
|
152892
152911
|
var dashboardCmd = program2.command("dashboard").description("Start the TrueCourse dashboard and open it in your browser").option("--reconfigure", "Re-prompt for console vs background service mode").option("--service", "Run as a background service (skips mode prompt)").option("--console", "Run in this terminal (skips mode prompt)").action(async (options) => {
|
|
152893
152912
|
if (options.service && options.console) {
|
|
152894
152913
|
console.error("error: --service and --console are mutually exclusive");
|