@tscircuit/cli 0.1.877 → 0.1.878

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/cli/main.js CHANGED
@@ -74344,7 +74344,6 @@ class Ky {
74344
74344
  return streamRequest(request, this.#options.onUploadProgress, originalBody ?? this.#options.body ?? undefined);
74345
74345
  }
74346
74346
  }
74347
-
74348
74347
  // node_modules/ky/distribution/index.js
74349
74348
  /*! MIT License © Sindre Sorhus */
74350
74349
  var createInstance = (defaults) => {
@@ -74384,7 +74383,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74384
74383
  import { execSync as execSync2 } from "node:child_process";
74385
74384
  var import_semver2 = __toESM2(require_semver2(), 1);
74386
74385
  // package.json
74387
- var version = "0.1.876";
74386
+ var version = "0.1.877";
74388
74387
  var package_default = {
74389
74388
  name: "@tscircuit/cli",
74390
74389
  main: "dist/cli/main.js",
@@ -83899,13 +83898,11 @@ class DevServer {
83899
83898
  return;
83900
83899
  const filePayload = this.createFileUploadPayload(absoluteFilePath, relativeFilePath);
83901
83900
  console.log(kleur_default.green(`Saving: ${relativeFilePath}`));
83902
- await this.fsKy.post("api/files/upsert", {
83903
- json: {
83904
- file_path: relativeFilePath,
83905
- initiator: "filesystem_change",
83906
- ...filePayload
83907
- }
83908
- }).json();
83901
+ await this.postFileUpsert({
83902
+ filePath: relativeFilePath,
83903
+ initiator: "filesystem_change",
83904
+ filePayload
83905
+ });
83909
83906
  await this.checkAndUploadNewNodeModules(absoluteFilePath);
83910
83907
  }
83911
83908
  async checkAndUploadNewNodeModules(filePath) {
@@ -83973,12 +83970,10 @@ class DevServer {
83973
83970
  return;
83974
83971
  await this.handleFileRemovedFromFilesystem(oldPath);
83975
83972
  const filePayload = this.createFileUploadPayload(newPath, newRelativePath);
83976
- await this.fsKy.post("api/files/upsert", {
83977
- json: {
83978
- file_path: newRelativePath,
83979
- initiator: "filesystem_change",
83980
- ...filePayload
83981
- }
83973
+ await this.postFileUpsert({
83974
+ filePath: newRelativePath,
83975
+ initiator: "filesystem_change",
83976
+ filePayload
83982
83977
  });
83983
83978
  debug2(`File renamed from ${oldRelativePath} to ${newRelativePath}`);
83984
83979
  }
@@ -83990,12 +83985,10 @@ class DevServer {
83990
83985
  for (const filePath of filePaths) {
83991
83986
  const relativeFilePath = path28.relative(this.projectDir, filePath);
83992
83987
  const filePayload = this.createFileUploadPayload(filePath, relativeFilePath);
83993
- await this.fsKy.post("api/files/upsert", {
83994
- json: {
83995
- file_path: relativeFilePath,
83996
- initiator: "filesystem_change",
83997
- ...filePayload
83998
- }
83988
+ await this.postFileUpsert({
83989
+ filePath: relativeFilePath,
83990
+ initiator: "filesystem_change",
83991
+ filePayload
83999
83992
  });
84000
83993
  }
84001
83994
  await this.uploadInitialNodeModules();
@@ -84025,15 +84018,37 @@ class DevServer {
84025
84018
  const relativeFilePath = path28.relative(this.projectDir, nodeModuleFile);
84026
84019
  this.uploadedNodeModules.add(relativeFilePath);
84027
84020
  const filePayload = this.createFileUploadPayload(nodeModuleFile, relativeFilePath);
84021
+ await this.postFileUpsert({
84022
+ filePath: relativeFilePath,
84023
+ initiator: "filesystem_change",
84024
+ filePayload
84025
+ });
84026
+ }
84027
+ }
84028
+ async postFileUpsert({
84029
+ filePath,
84030
+ initiator,
84031
+ filePayload
84032
+ }) {
84033
+ try {
84028
84034
  await this.fsKy.post("api/files/upsert", {
84029
84035
  json: {
84030
- file_path: relativeFilePath,
84031
- initiator: "filesystem_change",
84036
+ file_path: filePath,
84037
+ initiator,
84032
84038
  ...filePayload
84033
84039
  }
84034
84040
  });
84041
+ } catch (error) {
84042
+ this.logFileUpsertTimeout(error, filePath);
84043
+ throw error;
84035
84044
  }
84036
84045
  }
84046
+ logFileUpsertTimeout(error, filePath) {
84047
+ if (!(error instanceof TimeoutError))
84048
+ return;
84049
+ console.error(kleur_default.red(`Timeout while uploading "${filePath}" to the local file server.`));
84050
+ console.error(kleur_default.yellow(`Additional info: the file server at http://localhost:${this.port}/api/files/upsert did not respond in time. ` + "Make sure the dev server started successfully, the port is not blocked, and try again."));
84051
+ }
84037
84052
  async saveSnippet() {
84038
84053
  const postEvent = async (event, message) => this.fsKy.post("api/events/create", {
84039
84054
  json: { event_type: event, ...message ? { message } : {} },
package/dist/lib/index.js CHANGED
@@ -60414,7 +60414,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60414
60414
  }));
60415
60415
  };
60416
60416
  // package.json
60417
- var version = "0.1.876";
60417
+ var version = "0.1.877";
60418
60418
  var package_default = {
60419
60419
  name: "@tscircuit/cli",
60420
60420
  main: "dist/cli/main.js",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ".": "./dist/cli/main.js",
6
6
  "./lib": "./dist/lib/index.js"
7
7
  },
8
- "version": "0.1.877",
8
+ "version": "0.1.878",
9
9
  "devDependencies": {
10
10
  "@babel/standalone": "^7.26.9",
11
11
  "@biomejs/biome": "^1.9.4",