truecourse 0.3.1 → 0.3.3

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 CHANGED
@@ -85,12 +85,15 @@ truecourse add # Register repo without analyzing
85
85
  Configure which rule categories and LLM-powered rules are enabled per repository:
86
86
 
87
87
  ```bash
88
- truecourse rules categories # Show enabled/disabled rule categories
89
- truecourse rules categories --disable style # Disable a category
88
+ # Categories
89
+ truecourse rules categories # Show enabled/disabled
90
90
  truecourse rules categories --enable style # Enable a category
91
- truecourse rules llm # Show LLM rules status
92
- truecourse rules llm --disable # Disable LLM rules for this repo
93
- truecourse rules llm --enable # Enable LLM rules for this repo
91
+ truecourse rules categories --disable style # Disable a category
92
+
93
+ # LLM-powered rules
94
+ truecourse rules llm # Show LLM rules status
95
+ truecourse rules llm --enable # Enable LLM rules
96
+ truecourse rules llm --disable # Disable LLM rules
94
97
  ```
95
98
 
96
99
  ### Git Hooks
package/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import { createRequire as __cR } from 'node:module'; const require = __cR(import.meta.url);
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -9694,7 +9694,7 @@ var require_websocket_server = __commonJS({
9694
9694
  socket.on("error", socketOnError);
9695
9695
  const key = req.headers["sec-websocket-key"];
9696
9696
  const upgrade = req.headers.upgrade;
9697
- const version2 = +req.headers["sec-websocket-version"];
9697
+ const version = +req.headers["sec-websocket-version"];
9698
9698
  if (req.method !== "GET") {
9699
9699
  const message = "Invalid HTTP method";
9700
9700
  abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
@@ -9710,7 +9710,7 @@ var require_websocket_server = __commonJS({
9710
9710
  abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
9711
9711
  return;
9712
9712
  }
9713
- if (version2 !== 13 && version2 !== 8) {
9713
+ if (version !== 13 && version !== 8) {
9714
9714
  const message = "Missing or invalid Sec-WebSocket-Version header";
9715
9715
  abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {
9716
9716
  "Sec-WebSocket-Version": "13, 8"
@@ -9754,7 +9754,7 @@ var require_websocket_server = __commonJS({
9754
9754
  }
9755
9755
  if (this.options.verifyClient) {
9756
9756
  const info = {
9757
- origin: req.headers[`${version2 === 8 ? "sec-websocket-origin" : "origin"}`],
9757
+ origin: req.headers[`${version === 8 ? "sec-websocket-origin" : "origin"}`],
9758
9758
  secure: !!(req.socket.authorized || req.socket.encrypted),
9759
9759
  req
9760
9760
  };
@@ -14056,11 +14056,11 @@ function datetimeRegex(args) {
14056
14056
  regex = `${regex}(${opts.join("|")})`;
14057
14057
  return new RegExp(`^${regex}$`);
14058
14058
  }
14059
- function isValidIP(ip, version2) {
14060
- if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
14059
+ function isValidIP(ip, version) {
14060
+ if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
14061
14061
  return true;
14062
14062
  }
14063
- if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
14063
+ if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
14064
14064
  return true;
14065
14065
  }
14066
14066
  return false;
@@ -14087,11 +14087,11 @@ function isValidJWT(jwt, alg) {
14087
14087
  return false;
14088
14088
  }
14089
14089
  }
14090
- function isValidCidr(ip, version2) {
14091
- if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
14090
+ function isValidCidr(ip, version) {
14091
+ if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
14092
14092
  return true;
14093
14093
  }
14094
- if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
14094
+ if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
14095
14095
  return true;
14096
14096
  }
14097
14097
  return false;
@@ -20238,15 +20238,15 @@ var require_source_map_consumer = __commonJS({
20238
20238
  if (typeof aSourceMap === "string") {
20239
20239
  sourceMap = util2.parseSourceMapInput(aSourceMap);
20240
20240
  }
20241
- var version2 = util2.getArg(sourceMap, "version");
20241
+ var version = util2.getArg(sourceMap, "version");
20242
20242
  var sources = util2.getArg(sourceMap, "sources");
20243
20243
  var names = util2.getArg(sourceMap, "names", []);
20244
20244
  var sourceRoot = util2.getArg(sourceMap, "sourceRoot", null);
20245
20245
  var sourcesContent = util2.getArg(sourceMap, "sourcesContent", null);
20246
20246
  var mappings = util2.getArg(sourceMap, "mappings");
20247
20247
  var file = util2.getArg(sourceMap, "file", null);
20248
- if (version2 != this._version) {
20249
- throw new Error("Unsupported version: " + version2);
20248
+ if (version != this._version) {
20249
+ throw new Error("Unsupported version: " + version);
20250
20250
  }
20251
20251
  if (sourceRoot) {
20252
20252
  sourceRoot = util2.normalize(sourceRoot);
@@ -20551,10 +20551,10 @@ var require_source_map_consumer = __commonJS({
20551
20551
  if (typeof aSourceMap === "string") {
20552
20552
  sourceMap = util2.parseSourceMapInput(aSourceMap);
20553
20553
  }
20554
- var version2 = util2.getArg(sourceMap, "version");
20554
+ var version = util2.getArg(sourceMap, "version");
20555
20555
  var sections = util2.getArg(sourceMap, "sections");
20556
- if (version2 != this._version) {
20557
- throw new Error("Unsupported version: " + version2);
20556
+ if (version != this._version) {
20557
+ throw new Error("Unsupported version: " + version);
20558
20558
  }
20559
20559
  this._sources = new ArraySet();
20560
20560
  this._names = new ArraySet();
@@ -23748,7 +23748,7 @@ var require_typescript = __commonJS({
23748
23748
  usingSingleLineStringWriter: () => usingSingleLineStringWriter,
23749
23749
  utf16EncodeAsString: () => utf16EncodeAsString,
23750
23750
  validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage,
23751
- version: () => version2,
23751
+ version: () => version,
23752
23752
  versionMajorMinor: () => versionMajorMinor,
23753
23753
  visitArray: () => visitArray,
23754
23754
  visitCommaListElements: () => visitCommaListElements,
@@ -23772,7 +23772,7 @@ var require_typescript = __commonJS({
23772
23772
  });
23773
23773
  module2.exports = __toCommonJS(typescript_exports);
23774
23774
  var versionMajorMinor = "5.9";
23775
- var version2 = "5.9.3";
23775
+ var version = "5.9.3";
23776
23776
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
23777
23777
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
23778
23778
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -26408,9 +26408,9 @@ ${lanes.join("\n")}
26408
26408
  * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
26409
26409
  * in `node-semver`.
26410
26410
  */
26411
- test(version22) {
26412
- if (typeof version22 === "string") version22 = new Version(version22);
26413
- return testDisjunction(version22, this._alternatives);
26411
+ test(version2) {
26412
+ if (typeof version2 === "string") version2 = new Version(version2);
26413
+ return testDisjunction(version2, this._alternatives);
26414
26414
  }
26415
26415
  toString() {
26416
26416
  return formatDisjunction(this._alternatives);
@@ -26444,14 +26444,14 @@ ${lanes.join("\n")}
26444
26444
  const match2 = partialRegExp.exec(text);
26445
26445
  if (!match2) return void 0;
26446
26446
  const [, major, minor = "*", patch = "*", prerelease, build2] = match2;
26447
- const version22 = new Version(
26447
+ const version2 = new Version(
26448
26448
  isWildcard(major) ? 0 : parseInt(major, 10),
26449
26449
  isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10),
26450
26450
  isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10),
26451
26451
  prerelease,
26452
26452
  build2
26453
26453
  );
26454
- return { version: version22, major, minor, patch };
26454
+ return { version: version2, major, minor, patch };
26455
26455
  }
26456
26456
  function parseHyphen(left, right, comparators) {
26457
26457
  const leftResult = parsePartial(left);
@@ -26471,46 +26471,46 @@ ${lanes.join("\n")}
26471
26471
  function parseComparator(operator, text, comparators) {
26472
26472
  const result = parsePartial(text);
26473
26473
  if (!result) return false;
26474
- const { version: version22, major, minor, patch } = result;
26474
+ const { version: version2, major, minor, patch } = result;
26475
26475
  if (!isWildcard(major)) {
26476
26476
  switch (operator) {
26477
26477
  case "~":
26478
- comparators.push(createComparator(">=", version22));
26478
+ comparators.push(createComparator(">=", version2));
26479
26479
  comparators.push(createComparator(
26480
26480
  "<",
26481
- version22.increment(
26481
+ version2.increment(
26482
26482
  isWildcard(minor) ? "major" : "minor"
26483
26483
  )
26484
26484
  ));
26485
26485
  break;
26486
26486
  case "^":
26487
- comparators.push(createComparator(">=", version22));
26487
+ comparators.push(createComparator(">=", version2));
26488
26488
  comparators.push(createComparator(
26489
26489
  "<",
26490
- version22.increment(
26491
- version22.major > 0 || isWildcard(minor) ? "major" : version22.minor > 0 || isWildcard(patch) ? "minor" : "patch"
26490
+ version2.increment(
26491
+ version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch"
26492
26492
  )
26493
26493
  ));
26494
26494
  break;
26495
26495
  case "<":
26496
26496
  case ">=":
26497
26497
  comparators.push(
26498
- isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version22.with({ prerelease: "0" })) : createComparator(operator, version22)
26498
+ isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version2.with({ prerelease: "0" })) : createComparator(operator, version2)
26499
26499
  );
26500
26500
  break;
26501
26501
  case "<=":
26502
26502
  case ">":
26503
26503
  comparators.push(
26504
- isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version22.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version22.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version22)
26504
+ isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version2)
26505
26505
  );
26506
26506
  break;
26507
26507
  case "=":
26508
26508
  case void 0:
26509
26509
  if (isWildcard(minor) || isWildcard(patch)) {
26510
- comparators.push(createComparator(">=", version22.with({ prerelease: "0" })));
26511
- comparators.push(createComparator("<", version22.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
26510
+ comparators.push(createComparator(">=", version2.with({ prerelease: "0" })));
26511
+ comparators.push(createComparator("<", version2.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
26512
26512
  } else {
26513
- comparators.push(createComparator("=", version22));
26513
+ comparators.push(createComparator("=", version2));
26514
26514
  }
26515
26515
  break;
26516
26516
  default:
@@ -26527,21 +26527,21 @@ ${lanes.join("\n")}
26527
26527
  function createComparator(operator, operand) {
26528
26528
  return { operator, operand };
26529
26529
  }
26530
- function testDisjunction(version22, alternatives) {
26530
+ function testDisjunction(version2, alternatives) {
26531
26531
  if (alternatives.length === 0) return true;
26532
26532
  for (const alternative of alternatives) {
26533
- if (testAlternative(version22, alternative)) return true;
26533
+ if (testAlternative(version2, alternative)) return true;
26534
26534
  }
26535
26535
  return false;
26536
26536
  }
26537
- function testAlternative(version22, comparators) {
26537
+ function testAlternative(version2, comparators) {
26538
26538
  for (const comparator of comparators) {
26539
- if (!testComparator(version22, comparator.operator, comparator.operand)) return false;
26539
+ if (!testComparator(version2, comparator.operator, comparator.operand)) return false;
26540
26540
  }
26541
26541
  return true;
26542
26542
  }
26543
- function testComparator(version22, operator, operand) {
26544
- const cmp = version22.compareTo(operand);
26543
+ function testComparator(version2, operator, operand) {
26544
+ const cmp = version2.compareTo(operand);
26545
26545
  switch (operator) {
26546
26546
  case "<":
26547
26547
  return cmp < 0;
@@ -68884,7 +68884,7 @@ ${lanes.join("\n")}
68884
68884
  }
68885
68885
  var typeScriptVersion;
68886
68886
  function getPackageJsonTypesVersionsPaths(typesVersions) {
68887
- if (!typeScriptVersion) typeScriptVersion = new Version(version2);
68887
+ if (!typeScriptVersion) typeScriptVersion = new Version(version);
68888
68888
  for (const key in typesVersions) {
68889
68889
  if (!hasProperty(typesVersions, key)) continue;
68890
68890
  const keyRange = VersionRange.tryParse(key);
@@ -70432,9 +70432,9 @@ ${lanes.join("\n")}
70432
70432
  state
70433
70433
  );
70434
70434
  if (peerPackageJson) {
70435
- const version22 = peerPackageJson.contents.packageJsonContent.version;
70436
- result += `+${key}@${version22}`;
70437
- if (state.traceEnabled) trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version22);
70435
+ const version2 = peerPackageJson.contents.packageJsonContent.version;
70436
+ result += `+${key}@${version2}`;
70437
+ if (state.traceEnabled) trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
70438
70438
  } else {
70439
70439
  if (state.traceEnabled) trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
70440
70440
  }
@@ -70532,7 +70532,7 @@ ${lanes.join("\n")}
70532
70532
  false
70533
70533
  );
70534
70534
  if (state.traceEnabled) {
70535
- trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version2, moduleName);
70535
+ trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, moduleName);
70536
70536
  }
70537
70537
  const pathPatterns = tryParsePatterns(versionPaths.paths);
70538
70538
  const result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, pathPatterns, loader2, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);
@@ -71014,7 +71014,7 @@ ${lanes.join("\n")}
71014
71014
  if (!startsWith(key, "types@")) return false;
71015
71015
  const range2 = VersionRange.tryParse(key.substring("types@".length));
71016
71016
  if (!range2) return false;
71017
- return range2.test(version2);
71017
+ return range2.test(version);
71018
71018
  }
71019
71019
  function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache2, redirectedReference) {
71020
71020
  return loadModuleFromNearestNodeModulesDirectoryWorker(
@@ -71150,7 +71150,7 @@ ${lanes.join("\n")}
71150
71150
  const versionPaths = rest !== "" && packageInfo ? getVersionPathsOfPackageJsonInfo(packageInfo, state) : void 0;
71151
71151
  if (versionPaths) {
71152
71152
  if (state.traceEnabled) {
71153
- trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version2, rest);
71153
+ trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, rest);
71154
71154
  }
71155
71155
  const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host);
71156
71156
  const pathPatterns = tryParsePatterns(versionPaths.paths);
@@ -151159,7 +151159,7 @@ ${lanes.join("\n")}
151159
151159
  emitSkipped = true;
151160
151160
  return;
151161
151161
  }
151162
- const buildInfo = host.getBuildInfo() || { version: version2 };
151162
+ const buildInfo = host.getBuildInfo() || { version };
151163
151163
  writeFile(
151164
151164
  host,
151165
151165
  emitterDiagnostics,
@@ -161078,7 +161078,7 @@ ${lanes.join("\n")}
161078
161078
  const useOldState = canReuseOldState(referencedMap, oldState);
161079
161079
  newProgram.getTypeChecker();
161080
161080
  for (const sourceFile of newProgram.getSourceFiles()) {
161081
- const version22 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
161081
+ const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
161082
161082
  const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
161083
161083
  const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
161084
161084
  if (referencedMap) {
@@ -161088,7 +161088,7 @@ ${lanes.join("\n")}
161088
161088
  }
161089
161089
  }
161090
161090
  fileInfos.set(sourceFile.resolvedPath, {
161091
- version: version22,
161091
+ version: version2,
161092
161092
  signature,
161093
161093
  // No need to calculate affectsGlobalScope with --out since its not used at all
161094
161094
  affectsGlobalScope: !options.outFile ? isFileAffectingGlobalScope(sourceFile) || void 0 : void 0,
@@ -161892,7 +161892,7 @@ ${lanes.join("\n")}
161892
161892
  root: arrayFrom(rootFileNames, (r) => relativeToBuildInfo(r)),
161893
161893
  errors: state.hasErrors ? true : void 0,
161894
161894
  checkPending: state.checkPending,
161895
- version: version2
161895
+ version
161896
161896
  };
161897
161897
  return buildInfo2;
161898
161898
  }
@@ -161924,7 +161924,7 @@ ${lanes.join("\n")}
161924
161924
  // Actual value
161925
161925
  errors: state.hasErrors ? true : void 0,
161926
161926
  checkPending: state.checkPending,
161927
- version: version2
161927
+ version
161928
161928
  };
161929
161929
  return buildInfo2;
161930
161930
  }
@@ -162021,7 +162021,7 @@ ${lanes.join("\n")}
162021
162021
  latestChangedDtsFile,
162022
162022
  errors: state.hasErrors ? true : void 0,
162023
162023
  checkPending: state.checkPending,
162024
- version: version2
162024
+ version
162025
162025
  };
162026
162026
  return buildInfo;
162027
162027
  function relativeToBuildInfoEnsuringAbsolutePath(path14) {
@@ -162798,8 +162798,8 @@ ${lanes.join("\n")}
162798
162798
  const resolvedRoots = new Map(program3.resolvedRoot);
162799
162799
  program3.fileInfos.forEach((fileInfo, index) => {
162800
162800
  const path14 = toPath(program3.fileNames[index], buildInfoDirectory, getCanonicalFileName);
162801
- const version22 = isString(fileInfo) ? fileInfo : fileInfo.version;
162802
- fileInfos.set(path14, version22);
162801
+ const version2 = isString(fileInfo) ? fileInfo : fileInfo.version;
162802
+ fileInfos.set(path14, version2);
162803
162803
  if (rootIndex < program3.root.length) {
162804
162804
  const current = program3.root[rootIndex];
162805
162805
  const fileId = index + 1;
@@ -164699,7 +164699,7 @@ ${lanes.join("\n")}
164699
164699
  if (!content) return void 0;
164700
164700
  buildInfo = getBuildInfo(buildInfoPath, content);
164701
164701
  }
164702
- if (!buildInfo || buildInfo.version !== version2 || !isIncrementalBuildInfo(buildInfo)) return void 0;
164702
+ if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
164703
164703
  return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
164704
164704
  }
164705
164705
  function createIncrementalCompilerHost(options, system = sys2) {
@@ -166402,7 +166402,7 @@ ${lanes.join("\n")}
166402
166402
  };
166403
166403
  }
166404
166404
  const incrementalBuildInfo = isIncremental && isIncrementalBuildInfo(buildInfo) ? buildInfo : void 0;
166405
- if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version2) {
166405
+ if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version) {
166406
166406
  return {
166407
166407
  type: 14,
166408
166408
  version: buildInfo.version
@@ -166458,17 +166458,17 @@ ${lanes.join("\n")}
166458
166458
  }
166459
166459
  const inputPath = toPath2(state, inputFile);
166460
166460
  if (buildInfoTime < inputTime) {
166461
- let version22;
166461
+ let version2;
166462
166462
  let currentVersion;
166463
166463
  if (incrementalBuildInfo) {
166464
166464
  if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
166465
166465
  const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
166466
- version22 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
166467
- const text = version22 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
166466
+ version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
166467
+ const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
166468
166468
  currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0;
166469
- if (version22 && version22 === currentVersion) pseudoInputUpToDate = true;
166469
+ if (version2 && version2 === currentVersion) pseudoInputUpToDate = true;
166470
166470
  }
166471
- if (!version22 || version22 !== currentVersion) {
166471
+ if (!version2 || version2 !== currentVersion) {
166472
166472
  return {
166473
166473
  type: 5,
166474
166474
  outOfDateOutputFileName: buildInfoPath,
@@ -167221,7 +167221,7 @@ ${lanes.join("\n")}
167221
167221
  Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
167222
167222
  relName(state, configFileName),
167223
167223
  status.version,
167224
- version2
167224
+ version
167225
167225
  );
167226
167226
  case 17:
167227
167227
  return reportStatus(
@@ -167309,7 +167309,7 @@ ${lanes.join("\n")}
167309
167309
  return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter2(optionDeclarations.concat(tscBuildOption), (v) => !!v.showInSimplifiedHelpView);
167310
167310
  }
167311
167311
  function printVersion(sys22) {
167312
- sys22.write(getDiagnosticText(Diagnostics.Version_0, version2) + sys22.newLine);
167312
+ sys22.write(getDiagnosticText(Diagnostics.Version_0, version) + sys22.newLine);
167313
167313
  }
167314
167314
  function createColors(sys22) {
167315
167315
  const showColors = defaultIsPretty(sys22);
@@ -167561,7 +167561,7 @@ ${lanes.join("\n")}
167561
167561
  }
167562
167562
  function printEasyHelp(sys22, simpleOptions) {
167563
167563
  const colors = createColors(sys22);
167564
- let output = [...getHeader(sys22, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version2)}`)];
167564
+ let output = [...getHeader(sys22, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
167565
167565
  output.push(colors.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys22.newLine + sys22.newLine);
167566
167566
  example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
167567
167567
  example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
@@ -167608,7 +167608,7 @@ ${lanes.join("\n")}
167608
167608
  }
167609
167609
  }
167610
167610
  function printAllHelp(sys22, compilerOptions, buildOptions, watchOptions) {
167611
- let output = [...getHeader(sys22, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version2)}`)];
167611
+ let output = [...getHeader(sys22, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
167612
167612
  output = [...output, ...generateSectionOptionsOutput(
167613
167613
  sys22,
167614
167614
  getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS),
@@ -167640,7 +167640,7 @@ ${lanes.join("\n")}
167640
167640
  }
167641
167641
  }
167642
167642
  function printBuildHelp(sys22, buildOptions) {
167643
- let output = [...getHeader(sys22, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version2)}`)];
167643
+ let output = [...getHeader(sys22, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
167644
167644
  output = [...output, ...generateSectionOptionsOutput(
167645
167645
  sys22,
167646
167646
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
@@ -175173,38 +175173,38 @@ ${lanes.join("\n")}
175173
175173
  }
175174
175174
  return settingsOrHost;
175175
175175
  }
175176
- function acquireDocument(fileName, compilationSettings, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
175176
+ function acquireDocument(fileName, compilationSettings, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) {
175177
175177
  const path14 = toPath(fileName, currentDirectory, getCanonicalFileName);
175178
175178
  const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
175179
- return acquireDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions);
175179
+ return acquireDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions);
175180
175180
  }
175181
- function acquireDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
175181
+ function acquireDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) {
175182
175182
  return acquireOrUpdateDocument(
175183
175183
  fileName,
175184
175184
  path14,
175185
175185
  compilationSettings,
175186
175186
  key,
175187
175187
  scriptSnapshot,
175188
- version22,
175188
+ version2,
175189
175189
  /*acquiring*/
175190
175190
  true,
175191
175191
  scriptKind,
175192
175192
  languageVersionOrOptions
175193
175193
  );
175194
175194
  }
175195
- function updateDocument(fileName, compilationSettings, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
175195
+ function updateDocument(fileName, compilationSettings, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) {
175196
175196
  const path14 = toPath(fileName, currentDirectory, getCanonicalFileName);
175197
175197
  const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
175198
- return updateDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions);
175198
+ return updateDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions);
175199
175199
  }
175200
- function updateDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
175200
+ function updateDocumentWithKey(fileName, path14, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) {
175201
175201
  return acquireOrUpdateDocument(
175202
175202
  fileName,
175203
175203
  path14,
175204
175204
  getCompilationSettings(compilationSettings),
175205
175205
  key,
175206
175206
  scriptSnapshot,
175207
- version22,
175207
+ version2,
175208
175208
  /*acquiring*/
175209
175209
  false,
175210
175210
  scriptKind,
@@ -175216,7 +175216,7 @@ ${lanes.join("\n")}
175216
175216
  Debug.assert(scriptKind === void 0 || !entry || entry.sourceFile.scriptKind === scriptKind, `Script kind should match provided ScriptKind:${scriptKind} and sourceFile.scriptKind: ${entry == null ? void 0 : entry.sourceFile.scriptKind}, !entry: ${!entry}`);
175217
175217
  return entry;
175218
175218
  }
175219
- function acquireOrUpdateDocument(fileName, path14, compilationSettingsOrHost, key, scriptSnapshot, version22, acquiring, scriptKind, languageVersionOrOptions) {
175219
+ function acquireOrUpdateDocument(fileName, path14, compilationSettingsOrHost, key, scriptSnapshot, version2, acquiring, scriptKind, languageVersionOrOptions) {
175220
175220
  var _a2, _b, _c, _d;
175221
175221
  scriptKind = ensureScriptKind(fileName, scriptKind);
175222
175222
  const compilationSettings = getCompilationSettings(compilationSettingsOrHost);
@@ -175260,7 +175260,7 @@ ${lanes.join("\n")}
175260
175260
  fileName,
175261
175261
  scriptSnapshot,
175262
175262
  sourceFileOptions,
175263
- version22,
175263
+ version2,
175264
175264
  /*setNodeParents*/
175265
175265
  false,
175266
175266
  scriptKind
@@ -175274,8 +175274,8 @@ ${lanes.join("\n")}
175274
175274
  };
175275
175275
  setBucketEntry();
175276
175276
  } else {
175277
- if (entry.sourceFile.version !== version22) {
175278
- entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version22, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
175277
+ if (entry.sourceFile.version !== version2) {
175278
+ entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version2, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
175279
175279
  if (externalCache) {
175280
175280
  externalCache.setDocument(keyWithMode, path14, entry.sourceFile);
175281
175281
  }
@@ -184120,7 +184120,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
184120
184120
  throw new Error("Could not find file: '" + fileName + "'.");
184121
184121
  }
184122
184122
  const scriptKind = getScriptKind(fileName, this.host);
184123
- const version22 = this.host.getScriptVersion(fileName);
184123
+ const version2 = this.host.getScriptVersion(fileName);
184124
184124
  let sourceFile;
184125
184125
  if (this.currentFileName !== fileName) {
184126
184126
  const options = {
@@ -184140,17 +184140,17 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
184140
184140
  fileName,
184141
184141
  scriptSnapshot,
184142
184142
  options,
184143
- version22,
184143
+ version2,
184144
184144
  /*setNodeParents*/
184145
184145
  true,
184146
184146
  scriptKind
184147
184147
  );
184148
- } else if (this.currentFileVersion !== version22) {
184148
+ } else if (this.currentFileVersion !== version2) {
184149
184149
  const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
184150
- sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version22, editRange);
184150
+ sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version2, editRange);
184151
184151
  }
184152
184152
  if (sourceFile) {
184153
- this.currentFileVersion = version22;
184153
+ this.currentFileVersion = version2;
184154
184154
  this.currentFileName = fileName;
184155
184155
  this.currentFileScriptSnapshot = scriptSnapshot;
184156
184156
  this.currentSourceFile = sourceFile;
@@ -184158,18 +184158,18 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
184158
184158
  return this.currentSourceFile;
184159
184159
  }
184160
184160
  };
184161
- function setSourceFileFields(sourceFile, scriptSnapshot, version22) {
184162
- sourceFile.version = version22;
184161
+ function setSourceFileFields(sourceFile, scriptSnapshot, version2) {
184162
+ sourceFile.version = version2;
184163
184163
  sourceFile.scriptSnapshot = scriptSnapshot;
184164
184164
  }
184165
- function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version22, setNodeParents, scriptKind) {
184165
+ function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind) {
184166
184166
  const sourceFile = createSourceFile2(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind);
184167
- setSourceFileFields(sourceFile, scriptSnapshot, version22);
184167
+ setSourceFileFields(sourceFile, scriptSnapshot, version2);
184168
184168
  return sourceFile;
184169
184169
  }
184170
- function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version22, textChangeRange, aggressiveChecks) {
184170
+ function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, textChangeRange, aggressiveChecks) {
184171
184171
  if (textChangeRange) {
184172
- if (version22 !== sourceFile.version) {
184172
+ if (version2 !== sourceFile.version) {
184173
184173
  let newText;
184174
184174
  const prefix = textChangeRange.span.start !== 0 ? sourceFile.text.substr(0, textChangeRange.span.start) : "";
184175
184175
  const suffix = textSpanEnd(textChangeRange.span) !== sourceFile.text.length ? sourceFile.text.substr(textSpanEnd(textChangeRange.span)) : "";
@@ -184180,7 +184180,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
184180
184180
  newText = prefix && suffix ? prefix + changedText + suffix : prefix ? prefix + changedText : changedText + suffix;
184181
184181
  }
184182
184182
  const newSourceFile = updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
184183
- setSourceFileFields(newSourceFile, scriptSnapshot, version22);
184183
+ setSourceFileFields(newSourceFile, scriptSnapshot, version2);
184184
184184
  newSourceFile.nameTable = void 0;
184185
184185
  if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
184186
184186
  if (sourceFile.scriptSnapshot.dispose) {
@@ -184201,7 +184201,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
184201
184201
  sourceFile.fileName,
184202
184202
  scriptSnapshot,
184203
184203
  options,
184204
- version22,
184204
+ version2,
184205
184205
  /*setNodeParents*/
184206
184206
  true,
184207
184207
  sourceFile.scriptKind
@@ -219251,7 +219251,7 @@ ${options.prefix}` : "\n" : options.prefix
219251
219251
  usingSingleLineStringWriter: () => usingSingleLineStringWriter,
219252
219252
  utf16EncodeAsString: () => utf16EncodeAsString,
219253
219253
  validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage,
219254
- version: () => version2,
219254
+ version: () => version,
219255
219255
  versionMajorMinor: () => versionMajorMinor,
219256
219256
  visitArray: () => visitArray,
219257
219257
  visitCommaListElements: () => visitCommaListElements,
@@ -219276,7 +219276,7 @@ ${options.prefix}` : "\n" : options.prefix
219276
219276
  var enableDeprecationWarnings = true;
219277
219277
  var typeScriptVersion2;
219278
219278
  function getTypeScriptVersion() {
219279
- return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(version2));
219279
+ return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(version));
219280
219280
  }
219281
219281
  function formatDeprecationMessage(name, error2, errorAfter, since, message) {
219282
219282
  let deprecationMessage = error2 ? "DeprecationError: " : "DeprecationWarning: ";
@@ -219316,12 +219316,12 @@ ${options.prefix}` : "\n" : options.prefix
219316
219316
  };
219317
219317
  }
219318
219318
  function createDeprecation(name, options = {}) {
219319
- const version22 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : options.typeScriptVersion ?? getTypeScriptVersion();
219319
+ const version2 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : options.typeScriptVersion ?? getTypeScriptVersion();
219320
219320
  const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter;
219321
219321
  const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter;
219322
219322
  const since = typeof options.since === "string" ? new Version(options.since) : options.since ?? warnAfter;
219323
- const error2 = options.error || errorAfter && version22.compareTo(errorAfter) >= 0;
219324
- const warn = !warnAfter || version22.compareTo(warnAfter) >= 0;
219323
+ const error2 = options.error || errorAfter && version2.compareTo(errorAfter) >= 0;
219324
+ const warn = !warnAfter || version2.compareTo(warnAfter) >= 0;
219325
219325
  return error2 ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop;
219326
219326
  }
219327
219327
  function wrapFunction(deprecation, func) {
@@ -219716,11 +219716,11 @@ ${options.prefix}` : "\n" : options.prefix
219716
219716
  this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`);
219717
219717
  }
219718
219718
  const info = npmLock.packages && getProperty(npmLock.packages, `node_modules/${key}`) || getProperty(npmLock.dependencies, key);
219719
- const version22 = info && info.version;
219720
- if (!version22) {
219719
+ const version2 = info && info.version;
219720
+ if (!version2) {
219721
219721
  continue;
219722
219722
  }
219723
- const newTyping = { typingLocation: typingFile, version: new Version(version22) };
219723
+ const newTyping = { typingLocation: typingFile, version: new Version(version2) };
219724
219724
  this.packageNameToTypingLocation.set(packageName, newTyping);
219725
219725
  }
219726
219726
  }
@@ -219785,7 +219785,7 @@ ${options.prefix}` : "\n" : options.prefix
219785
219785
  this.sendResponse({
219786
219786
  kind: EventBeginInstallTypes,
219787
219787
  eventId: requestId,
219788
- typingsInstallerVersion: version2,
219788
+ typingsInstallerVersion: version,
219789
219789
  projectName: req.projectName
219790
219790
  });
219791
219791
  const scopedTypings = filteredTypings.map(typingsName);
@@ -219827,7 +219827,7 @@ ${options.prefix}` : "\n" : options.prefix
219827
219827
  projectName: req.projectName,
219828
219828
  packagesToInstall: scopedTypings,
219829
219829
  installSuccess: ok,
219830
- typingsInstallerVersion: version2
219830
+ typingsInstallerVersion: version
219831
219831
  };
219832
219832
  this.sendResponse(response);
219833
219833
  }
@@ -224866,7 +224866,7 @@ ${options.prefix}` : "\n" : options.prefix
224866
224866
  configFileName: configFileName(),
224867
224867
  projectType: project instanceof ExternalProject ? "external" : "configured",
224868
224868
  languageServiceEnabled: project.languageServiceEnabled,
224869
- version: version2
224869
+ version
224870
224870
  };
224871
224871
  this.eventHandler({ eventName: ProjectInfoTelemetryEvent, data });
224872
224872
  function configFileName() {
@@ -227834,7 +227834,7 @@ ${json2}${newLine}`;
227834
227834
  "status"
227835
227835
  /* Status */
227836
227836
  ]: () => {
227837
- const response = { version: version2 };
227837
+ const response = { version };
227838
227838
  return this.requiredResponse(response);
227839
227839
  },
227840
227840
  [
@@ -231392,11 +231392,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
231392
231392
  this.minVersion = 0;
231393
231393
  this.currentVersion = 0;
231394
231394
  }
231395
- versionToIndex(version22) {
231396
- if (version22 < this.minVersion || version22 > this.currentVersion) {
231395
+ versionToIndex(version2) {
231396
+ if (version2 < this.minVersion || version2 > this.currentVersion) {
231397
231397
  return void 0;
231398
231398
  }
231399
- return version22 % _ScriptVersionCache2.maxVersions;
231399
+ return version2 % _ScriptVersionCache2.maxVersions;
231400
231400
  }
231401
231401
  currentVersionToIndex() {
231402
231402
  return this.currentVersion % _ScriptVersionCache2.maxVersions;
@@ -231481,8 +231481,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
231481
231481
  _ScriptVersionCache.maxVersions = 8;
231482
231482
  var ScriptVersionCache = _ScriptVersionCache;
231483
231483
  var LineIndexSnapshot = class _LineIndexSnapshot {
231484
- constructor(version22, cache2, index, changesSincePreviousVersion = emptyArray2) {
231485
- this.version = version22;
231484
+ constructor(version2, cache2, index, changesSincePreviousVersion = emptyArray2) {
231485
+ this.version = version2;
231486
231486
  this.cache = cache2;
231487
231487
  this.index = index;
231488
231488
  this.changesSincePreviousVersion = changesSincePreviousVersion;
@@ -256049,8 +256049,8 @@ var init_weak_ssl = __esm({
256049
256049
  }
256050
256050
  }
256051
256051
  if (key?.text === "minVersion" && value2) {
256052
- const version2 = value2.text.replace(/['"]/g, "").toLowerCase();
256053
- if (version2 === "tlsv1" || version2 === "tlsv1.0") {
256052
+ const version = value2.text.replace(/['"]/g, "").toLowerCase();
256053
+ if (version === "tlsv1" || version === "tlsv1.0") {
256054
256054
  return makeViolation(this.ruleKey, node, filePath, "high", "Weak SSL/TLS protocol", "Setting minimum TLS version to 1.0 allows insecure connections.", sourceCode, 'Set minVersion to "TLSv1.2" or higher.');
256055
256055
  }
256056
256056
  }
@@ -257148,14 +257148,14 @@ var init_ssl_version_unsafe = __esm({
257148
257148
  const key = node.childForFieldName("key");
257149
257149
  const value2 = node.childForFieldName("value");
257150
257150
  if (key?.text === "minVersion" && value2) {
257151
- const version2 = value2.text.replace(/['"]/g, "").toLowerCase();
257152
- if (version2 === "tlsv1" || version2 === "tlsv1.0" || version2 === "tlsv1.1") {
257151
+ const version = value2.text.replace(/['"]/g, "").toLowerCase();
257152
+ if (version === "tlsv1" || version === "tlsv1.0" || version === "tlsv1.1") {
257153
257153
  return makeViolation(this.ruleKey, node, filePath, "high", "Unsafe SSL/TLS minimum version", `Minimum TLS version set to "${value2.text.replace(/['"]/g, "")}". TLS 1.0 and 1.1 are deprecated.`, sourceCode, 'Set minVersion to "TLSv1.2" or higher.');
257154
257154
  }
257155
257155
  }
257156
257156
  if (key?.text === "maxVersion" && value2) {
257157
- const version2 = value2.text.replace(/['"]/g, "").toLowerCase();
257158
- if (version2 === "tlsv1" || version2 === "tlsv1.0" || version2 === "tlsv1.1") {
257157
+ const version = value2.text.replace(/['"]/g, "").toLowerCase();
257158
+ if (version === "tlsv1" || version === "tlsv1.0" || version === "tlsv1.1") {
257159
257159
  return makeViolation(this.ruleKey, node, filePath, "high", "Unsafe SSL/TLS minimum version", `Maximum TLS version set to "${value2.text.replace(/['"]/g, "")}". This prevents use of modern TLS.`, sourceCode, 'Set maxVersion to "TLSv1.3" or remove the restriction.');
257160
257160
  }
257161
257161
  }
@@ -315308,7 +315308,6 @@ var {
315308
315308
  init_dist4();
315309
315309
  init_setup();
315310
315310
  init_start();
315311
- import { createRequire } from "node:module";
315312
315311
  import fs9 from "node:fs";
315313
315312
  import path13 from "node:path";
315314
315313
  import os7 from "node:os";
@@ -318818,10 +318817,8 @@ async function runHooksRun() {
318818
318817
  }
318819
318818
 
318820
318819
  // tools/cli/src/index.ts
318821
- var require2 = createRequire(import.meta.url);
318822
- var { version } = require2("../package.json");
318823
318820
  var program2 = new Command();
318824
- program2.name("truecourse").version(version).description("TrueCourse CLI - Setup and manage your TrueCourse instance");
318821
+ program2.name("truecourse").version("0.3.3").description("TrueCourse CLI - Setup and manage your TrueCourse instance");
318825
318822
  program2.command("setup").description("Run the setup wizard to configure TrueCourse").action(async () => {
318826
318823
  await runSetup();
318827
318824
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "truecourse",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Visualize your codebase architecture as an interactive graph",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,15 +18,15 @@
18
18
  "dotenv": "^16.4.0",
19
19
  "embedded-postgres": "18.3.0-beta.16",
20
20
  "postgres": "^3.4.0",
21
- "pyright": "^1.1.408",
21
+ "pyright": "^1.1.408"
22
+ },
23
+ "optionalDependencies": {
24
+ "node-windows": "^1.0.0-beta.8",
22
25
  "tree-sitter": "^0.25.0",
23
26
  "tree-sitter-javascript": "^0.25.0",
24
27
  "tree-sitter-python": "^0.25.0",
25
28
  "tree-sitter-typescript": "^0.23.2"
26
29
  },
27
- "optionalDependencies": {
28
- "node-windows": "^1.0.0-beta.8"
29
- },
30
30
  "license": "MIT",
31
31
  "repository": {
32
32
  "type": "git",
package/postinstall.cjs CHANGED
@@ -7,12 +7,39 @@
7
7
  * only specifies C++17. This script detects the failure and retries the
8
8
  * build with the correct flag.
9
9
  *
10
+ * Logs are written to ~/.truecourse/install.log for debugging.
11
+ *
10
12
  * See: https://github.com/truecourse-ai/truecourse/issues/22
11
13
  */
12
14
 
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const os = require('os');
18
+
19
+ const logDir = path.join(os.homedir(), '.truecourse');
20
+ const logFile = path.join(logDir, 'install.log');
21
+
22
+ function log(msg) {
23
+ const line = `[${new Date().toISOString()}] ${msg}`;
24
+ try {
25
+ fs.mkdirSync(logDir, { recursive: true });
26
+ fs.appendFileSync(logFile, line + '\n');
27
+ } catch {
28
+ // best effort
29
+ }
30
+ console.log(`[TrueCourse] ${msg}`);
31
+ }
32
+
33
+ log('--- postinstall started ---');
34
+ log(`Node ${process.version}, platform=${process.platform}, arch=${process.arch}`);
35
+ log(`CXXFLAGS=${process.env.CXXFLAGS || '(not set)'}`);
36
+
13
37
  try {
14
38
  require('tree-sitter');
15
- } catch {
39
+ log('tree-sitter: loaded OK');
40
+ } catch (err) {
41
+ log(`tree-sitter: failed to load — ${err.message}`);
42
+
16
43
  const { execSync } = require('child_process');
17
44
  const packages = [
18
45
  'tree-sitter',
@@ -21,15 +48,16 @@ try {
21
48
  'tree-sitter-python',
22
49
  ].join(' ');
23
50
 
24
- console.log('[TrueCourse] tree-sitter native module not found, rebuilding with C++20...');
51
+ log('Rebuilding with CXXFLAGS="-std=c++20"...');
25
52
 
26
53
  try {
27
54
  execSync(`CXXFLAGS="-std=c++20" npm rebuild ${packages}`, {
28
55
  stdio: 'inherit',
29
56
  env: { ...process.env, CXXFLAGS: '-std=c++20' },
30
57
  });
31
- console.log('[TrueCourse] tree-sitter rebuilt successfully.');
58
+ log('tree-sitter: rebuilt OK');
32
59
  } catch {
60
+ log('tree-sitter: rebuild failed');
33
61
  console.warn(
34
62
  '\n[TrueCourse] Could not rebuild tree-sitter automatically.\n' +
35
63
  'Fix: set the C++20 flag manually and reinstall:\n' +
@@ -37,7 +65,8 @@ try {
37
65
  ' npx truecourse\n\n' +
38
66
  'See: https://github.com/truecourse-ai/truecourse/issues/22\n'
39
67
  );
40
- // Exit 0 — don't fail the install
41
68
  process.exit(0);
42
69
  }
43
70
  }
71
+
72
+ log('--- postinstall done ---');