@tscircuit/cli 0.0.143 → 0.0.145
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/.github/workflows/formatbot.yml +41 -0
- package/biome.json +44 -0
- package/bun.lockb +0 -0
- package/dev-server-api/bun.lockb +0 -0
- package/dev-server-api/routes/api/db/download.ts +2 -2
- package/dev-server-api/routes/api/dev_package_examples/get.ts +1 -1
- package/dev-server-api/routes/api/dev_package_examples/list.ts +2 -2
- package/dev-server-api/routes/api/dev_package_examples/update.ts +1 -1
- package/dev-server-api/routes/api/export_requests/get.ts +2 -2
- package/dev-server-api/routes/index.ts +1 -1
- package/dev-server-api/server.ts +1 -1
- package/dev-server-api/src/db/create-schema.ts +4 -4
- package/dev-server-api/src/db/generic-json-level.ts +2 -2
- package/dev-server-api/src/db/zod-level-db.ts +9 -9
- package/dev-server-api/src/middlewares/with-debug-request-logging.ts +1 -1
- package/dev-server-api/src/middlewares/with-error-response.ts +2 -2
- package/dev-server-api/tests/fixtures/start-server.ts +1 -1
- package/dev-server-api/tests/routes/dev_package_examples/create.test.ts +1 -1
- package/dev-server-api/tests/routes/dev_package_examples/get.test.ts +1 -1
- package/dev-server-api/tests/routes/dev_package_examples/list.test.ts +1 -1
- package/dev-server-api/tests/routes/dev_package_examples/update.test.ts +2 -2
- package/dev-server-api/tests/routes/export_files/download.test.ts +2 -2
- package/dev-server-api/tests/routes/export_requests/create.test.ts +1 -1
- package/dev-server-api/tests/routes/export_requests/get.test.ts +1 -1
- package/dev-server-frontend/.eslintrc.cjs +10 -10
- package/dev-server-frontend/components.json +1 -1
- package/dev-server-frontend/src/ExampleContentView.tsx +2 -2
- package/dev-server-frontend/src/HeaderMenu.tsx +2 -7
- package/dev-server-frontend/src/components/command-k.tsx +1 -1
- package/dev-server-frontend/src/components/dialogs/generic-export-dialog.tsx +3 -3
- package/dev-server-frontend/src/components/dialogs/gerber-export-dialog.tsx +3 -3
- package/dev-server-frontend/src/components/select-example-search.tsx +1 -1
- package/dev-server-frontend/src/components/ui/alert-dialog.tsx +5 -5
- package/dev-server-frontend/src/components/ui/alert.tsx +1 -1
- package/dev-server-frontend/src/components/ui/breadcrumb.tsx +1 -1
- package/dev-server-frontend/src/components/ui/button.tsx +2 -2
- package/dev-server-frontend/src/components/ui/card.tsx +1 -1
- package/dev-server-frontend/src/components/ui/command.tsx +5 -5
- package/dev-server-frontend/src/components/ui/context-menu.tsx +8 -8
- package/dev-server-frontend/src/components/ui/dialog.tsx +5 -5
- package/dev-server-frontend/src/components/ui/menubar.tsx +12 -12
- package/dev-server-frontend/src/components/ui/navigation-menu.tsx +6 -6
- package/dev-server-frontend/src/components/ui/popover.tsx +1 -1
- package/dev-server-frontend/src/components/ui/select.tsx +6 -6
- package/dev-server-frontend/src/components/ui/tabs.tsx +3 -3
- package/dev-server-frontend/src/components/ui/toggle-group.tsx +1 -1
- package/dev-server-frontend/src/components/ui/toggle.tsx +1 -1
- package/dev-server-frontend/src/components/ui/tooltip.tsx +1 -1
- package/dev-server-frontend/src/hooks/use-active-dev-package-example-lite.ts +2 -2
- package/dev-server-frontend/src/main.tsx +1 -1
- package/dev-server-frontend/tailwind.config.js +5 -5
- package/dev-server-frontend/tsconfig.json +1 -1
- package/dist/cli.js +25 -10
- package/example-project/src/manual-edits.ts +34 -34
- package/lib/cmd-fns/add.ts +1 -1
- package/lib/cmd-fns/auth-login.ts +2 -2
- package/lib/cmd-fns/dev/check-if-initialized.ts +1 -1
- package/lib/cmd-fns/dev/derive-selector-from-pcb-component-id.ts +1 -1
- package/lib/cmd-fns/dev/dev-server-request-handler.ts +3 -3
- package/lib/cmd-fns/dev/find-available-port.ts +7 -5
- package/lib/cmd-fns/dev/fulfill-export-requests.ts +14 -14
- package/lib/cmd-fns/dev/get-dev-server-axios.ts +3 -3
- package/lib/cmd-fns/dev/index.ts +3 -3
- package/lib/cmd-fns/dev/infer-export-name-from-source.ts +2 -2
- package/lib/cmd-fns/dev/soupify-and-upload-example-file.ts +4 -4
- package/lib/cmd-fns/dev/start-edit-event-watcher.ts +37 -38
- package/lib/cmd-fns/dev/start-export-request-watcher.ts +2 -3
- package/lib/cmd-fns/dev/start-fs-watcher.ts +1 -1
- package/lib/cmd-fns/dev/upload-examples-from-directory.ts +2 -2
- package/lib/cmd-fns/dev-server-fulfill-export-requests.ts +3 -3
- package/lib/cmd-fns/dev-server-upload.ts +3 -3
- package/lib/cmd-fns/export-gerbers.ts +1 -1
- package/lib/cmd-fns/init/create-or-modify-npmrc.ts +1 -1
- package/lib/cmd-fns/init/index.ts +12 -8
- package/lib/cmd-fns/lint.ts +15 -9
- package/lib/cmd-fns/package-examples-create.ts +1 -1
- package/lib/cmd-fns/package-files-create.ts +1 -1
- package/lib/cmd-fns/package-files-upload-directory.ts +1 -1
- package/lib/cmd-fns/package-releases-create.ts +1 -1
- package/lib/cmd-fns/package-releases-list.ts +1 -1
- package/lib/cmd-fns/publish/index.ts +33 -33
- package/lib/cmd-fns/remove.ts +1 -1
- package/lib/cmd-fns/soupify.ts +1 -1
- package/lib/cmd-fns/version.ts +1 -1
- package/lib/create-config-manager.ts +1 -1
- package/lib/export-fns/export-bom-csv.ts +2 -2
- package/lib/export-fns/export-gerbers.ts +5 -5
- package/lib/export-fns/export-pnp-csv.ts +2 -2
- package/lib/get-program.ts +17 -17
- package/lib/param-handlers/interact-for-package-release-id.ts +2 -3
- package/lib/param-handlers/interact-for-runtime.ts +1 -1
- package/lib/posthog.ts +6 -7
- package/lib/soupify.ts +4 -4
- package/lib/util/create-context-and-run-program.ts +10 -6
- package/lib/util/get-all-package-files.ts +30 -21
- package/lib/util/lint-project.ts +79 -54
- package/package.json +4 -2
- package/renovate.json +2 -4
- package/tests/init.test.ts +1 -1
- package/tsconfig.json +13 -13
- package/tsup.config.ts +3 -3
package/lib/soupify.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const soupify = async (
|
|
|
18
18
|
filePath: string
|
|
19
19
|
exportName?: string
|
|
20
20
|
},
|
|
21
|
-
ctx: Pick<AppContext, "runtime" | "params"
|
|
21
|
+
ctx: Pick<AppContext, "runtime" | "params">,
|
|
22
22
|
) => {
|
|
23
23
|
debug(`reading ${filePath}`)
|
|
24
24
|
const targetFileContent = await readFile(filePath, "utf-8")
|
|
@@ -38,13 +38,13 @@ export const soupify = async (
|
|
|
38
38
|
|
|
39
39
|
if (!exportName) {
|
|
40
40
|
throw new Error(
|
|
41
|
-
`Couldn't derive an export name and didn't find default export in "${filePath}"
|
|
41
|
+
`Couldn't derive an export name and didn't find default export in "${filePath}"`,
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const tmpFilePath = Path.join(
|
|
46
46
|
Path.dirname(filePath),
|
|
47
|
-
Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_entrypoint.tsx"
|
|
47
|
+
Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_entrypoint.tsx",
|
|
48
48
|
)
|
|
49
49
|
|
|
50
50
|
debug(`writing to ${tmpFilePath}`)
|
|
@@ -71,7 +71,7 @@ const elements = await createRoot().render(<Component />, projectBuilder)
|
|
|
71
71
|
|
|
72
72
|
console.log(JSON.stringify(elements))
|
|
73
73
|
|
|
74
|
-
`.trim()
|
|
74
|
+
`.trim(),
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
debug(`using runtime ${ctx.runtime}`)
|
|
@@ -62,8 +62,8 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
62
62
|
kleur.grey(
|
|
63
63
|
`[RES] ${res.status} ${res.config.method?.toUpperCase()} ${
|
|
64
64
|
res.config.url
|
|
65
|
-
}
|
|
66
|
-
)
|
|
65
|
+
}`,
|
|
66
|
+
),
|
|
67
67
|
)
|
|
68
68
|
return res
|
|
69
69
|
})
|
|
@@ -82,7 +82,11 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
82
82
|
// end ignores ---
|
|
83
83
|
|
|
84
84
|
if (err.response?.status === 401) {
|
|
85
|
-
console.log(
|
|
85
|
+
console.log(
|
|
86
|
+
kleur.red(
|
|
87
|
+
"Authentication failed. Please run 'tsci login' to authenticate yourself.",
|
|
88
|
+
),
|
|
89
|
+
)
|
|
86
90
|
process.exit(1)
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -92,12 +96,12 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
92
96
|
err.config.url
|
|
93
97
|
}\n\n${JSON.stringify(err.response?.data, null, " ")}`
|
|
94
98
|
.replace(/\\n/g, "\n")
|
|
95
|
-
.replace(/\\"/g, '"')
|
|
96
|
-
)
|
|
99
|
+
.replace(/\\"/g, '"'),
|
|
100
|
+
),
|
|
97
101
|
)
|
|
98
102
|
console.log(kleur.yellow("[Request Body]:"), err.config.data)
|
|
99
103
|
return Promise.reject(err)
|
|
100
|
-
}
|
|
104
|
+
},
|
|
101
105
|
)
|
|
102
106
|
|
|
103
107
|
const ctx: AppContext = {
|
|
@@ -13,22 +13,25 @@ import ignore from "ignore"
|
|
|
13
13
|
* Returns an array of files paths.
|
|
14
14
|
*/
|
|
15
15
|
export const getAllPackageFiles = async (
|
|
16
|
-
ctx: AppContext
|
|
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
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
...(
|
|
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 =
|
|
44
|
-
|
|
52
|
+
const gitignorePath = "./.gitignore"
|
|
53
|
+
|
|
45
54
|
try {
|
|
46
|
-
const gitignore = await fs.readFile(gitignorePath,
|
|
47
|
-
if (!gitignore.includes(
|
|
48
|
-
await fs.appendFile(gitignorePath,
|
|
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 ===
|
|
52
|
-
await fs.writeFile(gitignorePath,
|
|
60
|
+
if (err.code === "ENOENT") {
|
|
61
|
+
await fs.writeFile(gitignorePath, "node_modules/\n")
|
|
53
62
|
} else {
|
|
54
|
-
console.error(
|
|
63
|
+
console.error("Error while updating .gitignore:", err)
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
|
-
}
|
|
66
|
+
}
|
package/lib/util/lint-project.ts
CHANGED
|
@@ -1,112 +1,137 @@
|
|
|
1
|
-
import * as ts from
|
|
2
|
-
import * as fs from
|
|
3
|
-
import * as path from
|
|
1
|
+
import * as ts from "typescript"
|
|
2
|
+
import * as fs from "fs"
|
|
3
|
+
import * as path from "path"
|
|
4
4
|
|
|
5
5
|
interface LintResult {
|
|
6
|
-
filePath: string
|
|
7
|
-
messages: LintMessage[]
|
|
6
|
+
filePath: string
|
|
7
|
+
messages: LintMessage[]
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
interface LintMessage {
|
|
11
|
-
line: number
|
|
12
|
-
column: number
|
|
13
|
-
message: string
|
|
11
|
+
line: number
|
|
12
|
+
column: number
|
|
13
|
+
message: string
|
|
14
14
|
fix?: {
|
|
15
|
-
range: [number, number]
|
|
16
|
-
text: string
|
|
17
|
-
}
|
|
15
|
+
range: [number, number]
|
|
16
|
+
text: string
|
|
17
|
+
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function lintProject(
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export function lintProject(
|
|
21
|
+
projectPath: string,
|
|
22
|
+
fix: boolean = false,
|
|
23
|
+
): LintResult[] {
|
|
24
|
+
const results: LintResult[] = []
|
|
25
|
+
const files = getTypeScriptFiles(projectPath)
|
|
23
26
|
|
|
24
27
|
for (const file of files) {
|
|
25
28
|
const sourceFile = ts.createSourceFile(
|
|
26
29
|
file,
|
|
27
|
-
fs.readFileSync(file,
|
|
30
|
+
fs.readFileSync(file, "utf8"),
|
|
28
31
|
ts.ScriptTarget.Latest,
|
|
29
|
-
true
|
|
30
|
-
)
|
|
32
|
+
true,
|
|
33
|
+
)
|
|
31
34
|
|
|
32
|
-
const result = lintFile(sourceFile, fix)
|
|
35
|
+
const result = lintFile(sourceFile, fix)
|
|
33
36
|
if (result.messages.length > 0) {
|
|
34
|
-
results.push({ filePath: file, messages: result.messages })
|
|
37
|
+
results.push({ filePath: file, messages: result.messages })
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
if (fix && result.messages.some(m => m.fix)) {
|
|
38
|
-
const newContent = applyFixes(sourceFile.text, result.messages)
|
|
39
|
-
fs.writeFileSync(file, newContent)
|
|
40
|
+
if (fix && result.messages.some((m) => m.fix)) {
|
|
41
|
+
const newContent = applyFixes(sourceFile.text, result.messages)
|
|
42
|
+
fs.writeFileSync(file, newContent)
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
return results
|
|
46
|
+
return results
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
function lintFile(
|
|
47
|
-
|
|
49
|
+
function lintFile(
|
|
50
|
+
sourceFile: ts.SourceFile,
|
|
51
|
+
fix: boolean,
|
|
52
|
+
): { messages: LintMessage[] } {
|
|
53
|
+
const messages: LintMessage[] = []
|
|
48
54
|
|
|
49
55
|
function visit(node: ts.Node) {
|
|
50
|
-
if (
|
|
51
|
-
|
|
56
|
+
if (
|
|
57
|
+
ts.isCallExpression(node) &&
|
|
58
|
+
ts.isIdentifier(node.expression) &&
|
|
59
|
+
node.expression.text === "capacitor"
|
|
60
|
+
) {
|
|
61
|
+
const valueArg = node.arguments.find((arg) =>
|
|
62
|
+
ts.isObjectLiteralExpression(arg),
|
|
63
|
+
)
|
|
52
64
|
if (valueArg && ts.isObjectLiteralExpression(valueArg)) {
|
|
53
65
|
const valueProp = valueArg.properties.find(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
(prop) =>
|
|
67
|
+
ts.isPropertyAssignment(prop) &&
|
|
68
|
+
ts.isIdentifier(prop.name) &&
|
|
69
|
+
prop.name.text === "value",
|
|
70
|
+
)
|
|
71
|
+
if (
|
|
72
|
+
valueProp &&
|
|
73
|
+
ts.isPropertyAssignment(valueProp) &&
|
|
74
|
+
ts.isStringLiteral(valueProp.initializer)
|
|
75
|
+
) {
|
|
76
|
+
const value = valueProp.initializer.text
|
|
58
77
|
if (!value.match(/[µuμ]F$/)) {
|
|
59
|
-
const { line, character } =
|
|
78
|
+
const { line, character } =
|
|
79
|
+
sourceFile.getLineAndCharacterOfPosition(valueProp.getStart())
|
|
60
80
|
messages.push({
|
|
61
81
|
line: line + 1,
|
|
62
82
|
column: character + 1,
|
|
63
83
|
message: 'Capacitor value should include units (e.g., "100F")',
|
|
64
|
-
fix: fix
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
fix: fix
|
|
85
|
+
? {
|
|
86
|
+
range: [
|
|
87
|
+
valueProp.initializer.getStart(),
|
|
88
|
+
valueProp.initializer.getEnd(),
|
|
89
|
+
],
|
|
90
|
+
text: `"${value}F"`,
|
|
91
|
+
}
|
|
92
|
+
: undefined,
|
|
93
|
+
})
|
|
69
94
|
}
|
|
70
95
|
}
|
|
71
96
|
}
|
|
72
97
|
}
|
|
73
98
|
|
|
74
|
-
ts.forEachChild(node, visit)
|
|
99
|
+
ts.forEachChild(node, visit)
|
|
75
100
|
}
|
|
76
101
|
|
|
77
|
-
visit(sourceFile)
|
|
102
|
+
visit(sourceFile)
|
|
78
103
|
|
|
79
|
-
return { messages }
|
|
104
|
+
return { messages }
|
|
80
105
|
}
|
|
81
106
|
|
|
82
107
|
function getTypeScriptFiles(dir: string): string[] {
|
|
83
|
-
const files: string[] = []
|
|
84
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
108
|
+
const files: string[] = []
|
|
109
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
85
110
|
|
|
86
111
|
for (const entry of entries) {
|
|
87
|
-
const fullPath = path.join(dir, entry.name)
|
|
112
|
+
const fullPath = path.join(dir, entry.name)
|
|
88
113
|
if (entry.isDirectory()) {
|
|
89
|
-
if (entry.name !==
|
|
90
|
-
files.push(...getTypeScriptFiles(fullPath))
|
|
114
|
+
if (entry.name !== "node_modules" && entry.name !== "dist") {
|
|
115
|
+
files.push(...getTypeScriptFiles(fullPath))
|
|
91
116
|
}
|
|
92
117
|
} else if (entry.isFile() && /\.tsx?$/.test(entry.name)) {
|
|
93
|
-
files.push(fullPath)
|
|
118
|
+
files.push(fullPath)
|
|
94
119
|
}
|
|
95
120
|
}
|
|
96
121
|
|
|
97
|
-
return files
|
|
122
|
+
return files
|
|
98
123
|
}
|
|
99
124
|
|
|
100
125
|
function applyFixes(source: string, messages: LintMessage[]): string {
|
|
101
126
|
const fixes = messages
|
|
102
|
-
.filter(m => m.fix)
|
|
103
|
-
.sort((a, b) =>
|
|
127
|
+
.filter((m) => m.fix)
|
|
128
|
+
.sort((a, b) => b.fix!.range[0] - a.fix!.range[0])
|
|
104
129
|
|
|
105
|
-
let result = source
|
|
130
|
+
let result = source
|
|
106
131
|
for (const message of fixes) {
|
|
107
|
-
const [start, end] = message.fix!.range
|
|
108
|
-
result = result.slice(0, start) + message.fix!.text + result.slice(end)
|
|
132
|
+
const [start, end] = message.fix!.range
|
|
133
|
+
result = result.slice(0, start) + message.fix!.text + result.slice(end)
|
|
109
134
|
}
|
|
110
135
|
|
|
111
|
-
return result
|
|
112
|
-
}
|
|
136
|
+
return result
|
|
137
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.145",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Command line tool for developing, publishing and installing tscircuit circuits",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"build": "bun build:dev-server && npm run build:cli",
|
|
19
19
|
"dev-with-test-project": "bun cli.ts dev --cwd ./example-project",
|
|
20
20
|
"test:init": "bun cli.ts init --dir ./tmp/test --name test",
|
|
21
|
-
"update-deps": "bun add @tscircuit/builder@latest @tscircuit/react-fiber@latest && cd dev-server-frontend && bun run update-deps && cd ../example-project && bun run update-deps"
|
|
21
|
+
"update-deps": "bun add @tscircuit/builder@latest @tscircuit/react-fiber@latest && cd dev-server-frontend && bun run update-deps && cd ../example-project && bun run update-deps",
|
|
22
|
+
"format": "biome format . --write"
|
|
22
23
|
},
|
|
23
24
|
"bin": {
|
|
24
25
|
"tsci": "./dist/cli.js"
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"@tscircuit/soup-util": "*"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
80
|
+
"@biomejs/biome": "^1.8.3",
|
|
79
81
|
"@tscircuit/builder": "*",
|
|
80
82
|
"@tscircuit/layout": "^0.0.25",
|
|
81
83
|
"@tscircuit/manual-edit-events": "^0.0.4",
|
package/renovate.json
CHANGED
package/tests/init.test.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { $ } from "bun"
|
|
|
4
4
|
test.skip("tsci init", async () => {
|
|
5
5
|
await $`rm -rf ./tests/example-init`
|
|
6
6
|
console.log(
|
|
7
|
-
await $`bun cli.ts init --name init-test --dir ./tests/example-init`.text()
|
|
7
|
+
await $`bun cli.ts init --name init-test --dir ./tests/example-init`.text(),
|
|
8
8
|
)
|
|
9
9
|
})
|
package/tsconfig.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
12
|
|
|
13
13
|
/* Language and Environment */
|
|
14
|
-
"target": "ESNext"
|
|
14
|
+
"target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
15
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
"jsx": "react-jsx"
|
|
16
|
+
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
|
17
17
|
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
18
|
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
19
|
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
26
|
|
|
27
27
|
/* Modules */
|
|
28
|
-
"module": "ESNext"
|
|
28
|
+
"module": "ESNext" /* Specify what module code is generated. */,
|
|
29
29
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
-
"moduleResolution": "Bundler"
|
|
31
|
-
"baseUrl": "./"
|
|
30
|
+
"moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
31
|
+
"baseUrl": "./" /* Specify the base directory to resolve non-relative module names. */,
|
|
32
32
|
"paths": {
|
|
33
33
|
"@server/*": ["./dev-server-api/src/*"]
|
|
34
|
-
}
|
|
34
|
+
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
|
|
35
35
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
36
36
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
37
37
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
38
38
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
39
39
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
40
|
-
"allowImportingTsExtensions": true
|
|
40
|
+
"allowImportingTsExtensions": true /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */,
|
|
41
41
|
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
42
42
|
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
43
43
|
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
44
|
-
"resolveJsonModule": true
|
|
44
|
+
"resolveJsonModule": true /* Enable importing .json files. */,
|
|
45
45
|
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
46
46
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
47
47
|
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
60
60
|
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
61
61
|
// "removeComments": true, /* Disable emitting comments. */
|
|
62
|
-
"noEmit": true
|
|
62
|
+
"noEmit": true /* Disable emitting files from a compilation. */,
|
|
63
63
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
64
64
|
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
65
65
|
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
80
80
|
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
81
81
|
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
82
|
-
"esModuleInterop": true
|
|
82
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
83
83
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
84
|
-
"forceConsistentCasingInFileNames": true
|
|
84
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
85
85
|
|
|
86
86
|
/* Type Checking */
|
|
87
|
-
"strict": true
|
|
87
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
88
88
|
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
89
89
|
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
90
90
|
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
@@ -106,6 +106,6 @@
|
|
|
106
106
|
|
|
107
107
|
/* Completeness */
|
|
108
108
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
109
|
-
"skipLibCheck": true
|
|
109
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
110
110
|
}
|
|
111
111
|
}
|
package/tsup.config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
1
|
+
import { defineConfig } from "tsup"
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
env: {
|
|
5
|
-
POSTHOG_API_KEY: JSON.stringify(process.env.POSTHOG_API_KEY ||
|
|
5
|
+
POSTHOG_API_KEY: JSON.stringify(process.env.POSTHOG_API_KEY || ""),
|
|
6
6
|
},
|
|
7
|
-
})
|
|
7
|
+
})
|