@tscircuit/cli 0.1.113 → 0.1.115

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.
Files changed (2) hide show
  1. package/dist/main.js +43 -6
  2. package/package.json +2 -1
package/dist/main.js CHANGED
@@ -437163,7 +437163,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
437163
437163
  import { execSync as execSync2 } from "node:child_process";
437164
437164
  var import_semver = __toESM2(require_semver2(), 1);
437165
437165
  // package.json
437166
- var version = "0.1.112";
437166
+ var version = "0.1.114";
437167
437167
  var package_default = {
437168
437168
  name: "@tscircuit/cli",
437169
437169
  version,
@@ -437178,6 +437178,7 @@ var package_default = {
437178
437178
  "@types/configstore": "^6.0.2",
437179
437179
  "@types/debug": "^4.1.12",
437180
437180
  "@types/jsonwebtoken": "^9.0.9",
437181
+ "@types/micromatch": "^4.0.9",
437181
437182
  "@types/prompts": "^2.4.9",
437182
437183
  "@types/react": "^19.0.8",
437183
437184
  "@types/semver": "^7.5.8",
@@ -442077,7 +442078,8 @@ import * as path12 from "node:path";
442077
442078
  // lib/project-config/project-config-schema.ts
442078
442079
  init_lib();
442079
442080
  var projectConfigSchema = z.object({
442080
- mainEntrypoint: z.string().optional()
442081
+ mainEntrypoint: z.string().optional(),
442082
+ ignoredFiles: z.array(z.string()).optional()
442081
442083
  });
442082
442084
 
442083
442085
  // lib/project-config/index.ts
@@ -442672,11 +442674,37 @@ var isDynamicPattern = normalizeArgumentsSync((patterns, options) => patterns.so
442672
442674
  var generateGlobTasks = normalizeArguments(generateTasks);
442673
442675
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
442674
442676
 
442677
+ // lib/shared/should-ignore-path.ts
442678
+ var import_micromatch = __toESM2(require_micromatch(), 1);
442679
+ var DEFAULT_IGNORED_PATTERNS = [
442680
+ "**/node_modules/**",
442681
+ "**/.git/**",
442682
+ "**/.vscode/**",
442683
+ "**/.*/*",
442684
+ "**/.*"
442685
+ ];
442686
+ var normalizeIgnorePattern = (pattern) => {
442687
+ if (/[\*\?\[\]\{\}]/.test(pattern))
442688
+ return pattern;
442689
+ return `**/${pattern}/**`;
442690
+ };
442691
+ var shouldIgnorePath = (relativePath, configIgnored = []) => {
442692
+ const extraPatterns = configIgnored.map(normalizeIgnorePattern);
442693
+ return import_micromatch.default.isMatch(relativePath, [
442694
+ ...DEFAULT_IGNORED_PATTERNS,
442695
+ ...extraPatterns
442696
+ ]);
442697
+ };
442698
+
442675
442699
  // cli/dev/get-package-file-paths.ts
442676
- var getPackageFilePaths = (projectDir) => {
442700
+ var getPackageFilePaths = (projectDir, ignored = []) => {
442701
+ const ignorePatterns = [
442702
+ ...DEFAULT_IGNORED_PATTERNS,
442703
+ ...ignored.map(normalizeIgnorePattern)
442704
+ ];
442677
442705
  const fileNames = globbySync("**", {
442678
442706
  cwd: projectDir,
442679
- ignore: ["**/node_modules/**", "**/.git/**", ".env", "**/.*"]
442707
+ ignore: ignorePatterns
442680
442708
  });
442681
442709
  return fileNames.map((fileName) => path15.join(projectDir, fileName));
442682
442710
  };
@@ -442944,6 +442972,7 @@ class DevServer {
442944
442972
  port;
442945
442973
  componentFilePath;
442946
442974
  projectDir;
442975
+ ignoredFiles;
442947
442976
  httpServer;
442948
442977
  eventsWatcher;
442949
442978
  fsKy;
@@ -442956,6 +442985,8 @@ class DevServer {
442956
442985
  this.port = port;
442957
442986
  this.componentFilePath = componentFilePath;
442958
442987
  this.projectDir = path18.dirname(componentFilePath);
442988
+ const projectConfig = loadProjectConfig(this.projectDir);
442989
+ this.ignoredFiles = projectConfig?.ignoredFiles ?? [];
442959
442990
  this.fsKy = distribution_default.create({
442960
442991
  prefixUrl: `http://localhost:${port}`
442961
442992
  });
@@ -442972,7 +443003,7 @@ class DevServer {
442972
443003
  this.filesystemWatcher = watch(this.projectDir, {
442973
443004
  persistent: true,
442974
443005
  ignoreInitial: true,
442975
- ignored: ["**/node_modules/**", "**/.git/**"]
443006
+ ignored: (p) => shouldIgnorePath(path18.relative(this.projectDir, p), this.ignoredFiles)
442976
443007
  });
442977
443008
  this.filesystemWatcher.on("change", (filePath) => this.handleFileChangedOnFilesystem(filePath));
442978
443009
  this.filesystemWatcher.on("add", (filePath) => this.handleFileChangedOnFilesystem(filePath));
@@ -442999,6 +443030,8 @@ class DevServer {
442999
443030
  const relativeFilePath = path18.relative(this.projectDir, absoluteFilePath);
443000
443031
  if (relativeFilePath.includes("manual-edits.json"))
443001
443032
  return;
443033
+ if (shouldIgnorePath(relativeFilePath, this.ignoredFiles))
443034
+ return;
443002
443035
  await this.typesHandler?.handleFileTypeDependencies(absoluteFilePath);
443003
443036
  console.log(kleur_default.green(`Saving: ${relativeFilePath}`));
443004
443037
  await this.fsKy.post("api/files/upsert", {
@@ -443011,6 +443044,8 @@ class DevServer {
443011
443044
  }
443012
443045
  async handleFileRemovedFromFilesystem(absoluteFilePath) {
443013
443046
  const relativeFilePath = path18.relative(this.projectDir, absoluteFilePath);
443047
+ if (shouldIgnorePath(relativeFilePath, this.ignoredFiles))
443048
+ return;
443014
443049
  if (!relativeFilePath || relativeFilePath.trim() === "") {
443015
443050
  debug2("Skipping delete for empty file path");
443016
443051
  return;
@@ -443048,6 +443083,8 @@ class DevServer {
443048
443083
  async handleFileRename(oldPath, newPath) {
443049
443084
  const oldRelativePath = path18.relative(this.projectDir, oldPath);
443050
443085
  const newRelativePath = path18.relative(this.projectDir, newPath);
443086
+ if (shouldIgnorePath(oldRelativePath, this.ignoredFiles) || shouldIgnorePath(newRelativePath, this.ignoredFiles))
443087
+ return;
443051
443088
  await this.handleFileRemovedFromFilesystem(oldPath);
443052
443089
  const fileContent = fs18.readFileSync(newPath, "utf-8");
443053
443090
  await this.fsKy.post("api/files/upsert", {
@@ -443060,7 +443097,7 @@ class DevServer {
443060
443097
  debug2(`File renamed from ${oldRelativePath} to ${newRelativePath}`);
443061
443098
  }
443062
443099
  async upsertInitialFiles() {
443063
- const filePaths = getPackageFilePaths(this.projectDir);
443100
+ const filePaths = getPackageFilePaths(this.projectDir, this.ignoredFiles);
443064
443101
  for (const filePath of filePaths) {
443065
443102
  const fileContent = fs18.readFileSync(filePath, "utf-8");
443066
443103
  await this.fsKy.post("api/files/upsert", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.113",
3
+ "version": "0.1.115",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",
@@ -12,6 +12,7 @@
12
12
  "@types/configstore": "^6.0.2",
13
13
  "@types/debug": "^4.1.12",
14
14
  "@types/jsonwebtoken": "^9.0.9",
15
+ "@types/micromatch": "^4.0.9",
15
16
  "@types/prompts": "^2.4.9",
16
17
  "@types/react": "^19.0.8",
17
18
  "@types/semver": "^7.5.8",