@tscircuit/cli 0.0.142 → 0.0.144

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.
@@ -30,9 +30,9 @@
30
30
  "integrity": "sha512-iB+oaYyaVK1hQ0cODubnoSDg4gGYL9cp/4ad7G1b9Z0/IqehPztp5qE3KP2mV9Ns0UYmzwvtkEhTCmKUuhorbg=="
31
31
  },
32
32
  "node_modules/@tscircuit/builder": {
33
- "version": "1.5.146",
34
- "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.146.tgz",
35
- "integrity": "sha512-yqms9P2q5AfUeKxA/hss4B00RCdDcrQ4xy//msgoxwCEZOT9JToYuEHzEB7SFtwG+6nOKWZN4qLOivEsDqmsQA==",
33
+ "version": "1.5.148",
34
+ "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.148.tgz",
35
+ "integrity": "sha512-H8zn2XD1Ie1GITG7nH8DzLYHrUbMPtlc8aXe9krPMDE+zxl5OBIwfDe5Hmi8bO0G0790cvUQU71b8qZeDVh35w==",
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
38
  "@lume/kiwi": "^0.1.0",
@@ -15,20 +15,23 @@ import ignore from "ignore"
15
15
  export const getAllPackageFiles = async (
16
16
  ctx: AppContext
17
17
  ): Promise<Array<string>> => {
18
- await ensureNodeModulesIgnored();
19
-
20
- const gitignore = await fs
21
- .readFile("./.gitignore")
22
- .then((b) => b.toString().split("\n").filter(Boolean))
23
- .catch((e) => null)
18
+ await ensureNodeModulesIgnored()
24
19
 
25
- const npmignore = await fs
26
- .readFile("./.promptignore")
27
- .then((b) => b.toString().split("\n").filter(Boolean))
28
- .catch((e) => null)
20
+ const [gitIgnore, promptIgnore, npmIgnore] = await Promise.all([
21
+ readIgnoreFile("./.gitignore"),
22
+ readIgnoreFile("./.promptignore"),
23
+ readIgnoreFile("./.npmignore"),
24
+ ])
25
+
26
+ const npmAndPromptIgnoreFiles = [
27
+ ...(promptIgnore ?? []),
28
+ ...(npmIgnore ?? []),
29
+ ]
29
30
 
30
31
  const ig = ignore().add([
31
- ...(npmignore ?? gitignore ?? []),
32
+ ...(npmAndPromptIgnoreFiles.length > 0
33
+ ? npmAndPromptIgnoreFiles
34
+ : gitIgnore ?? []),
32
35
  ".tscircuit",
33
36
  "node_modules/*",
34
37
  ])
@@ -36,22 +39,28 @@ export const getAllPackageFiles = async (
36
39
  return Glob.globSync("**/*.{ts,tsx,md}", {}).filter((fp) => !ig.ignores(fp))
37
40
  }
38
41
 
42
+ const readIgnoreFile = async (filePath: string): Promise<string[] | null> =>
43
+ await fs
44
+ .readFile(filePath)
45
+ .then((b) => b.toString().split("\n").filter(Boolean))
46
+ .catch((e) => null)
47
+
39
48
  /**
40
49
  * Ensure 'node_modules/' is in .gitignore
41
50
  */
42
51
  const ensureNodeModulesIgnored = async () => {
43
- const gitignorePath = './.gitignore';
44
-
52
+ const gitignorePath = "./.gitignore"
53
+
45
54
  try {
46
- const gitignore = await fs.readFile(gitignorePath, 'utf8');
47
- if (!gitignore.includes('node_modules/')) {
48
- await fs.appendFile(gitignorePath, '\nnode_modules/\n');
55
+ const gitignore = await fs.readFile(gitignorePath, "utf8")
56
+ if (!gitignore.includes("node_modules/")) {
57
+ await fs.appendFile(gitignorePath, "\nnode_modules/\n")
49
58
  }
50
59
  } catch (err) {
51
- if (err.code === 'ENOENT') {
52
- await fs.writeFile(gitignorePath, 'node_modules/\n');
60
+ if (err.code === "ENOENT") {
61
+ await fs.writeFile(gitignorePath, "node_modules/\n")
53
62
  } else {
54
- console.error('Error while updating .gitignore:', err);
63
+ console.error("Error while updating .gitignore:", err)
55
64
  }
56
65
  }
57
- }
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.142",
3
+ "version": "0.0.144",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",