-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(examples): type declarations * seperate tsconfig for examples as they are react components * new lock * update init * tests: init * ux * old lock * new bun lock 1.2.* * Update register.ts * deps -> devDeps
- Loading branch information
Showing
8 changed files
with
2,414 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "ESNext", | ||
"jsx": "react-jsx", | ||
"outDir": "dist", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"sourceMap": true, | ||
"allowSyntheticDefaultImports": true, | ||
"experimentalDecorators": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { getCliTestFixture } from "../../fixtures/get-cli-test-fixture" | ||
import { test, expect } from "bun:test" | ||
import { join } from "node:path" | ||
import { execSync } from "node:child_process" | ||
|
||
test("init command installs @types/react and passes type-checking", async () => { | ||
const { tmpDir, runCommand } = await getCliTestFixture() | ||
|
||
const { stdout } = await runCommand("tsci init") | ||
console.log(stdout) | ||
|
||
const pkgJsonPath = join(tmpDir, "package.json") | ||
const pkgJson = JSON.parse(await Bun.file(pkgJsonPath).text()) | ||
expect(pkgJson.devDependencies["@types/react"]).toBeDefined() | ||
expect(pkgJson.devDependencies["@tscircuit/core"]).toBeDefined() | ||
|
||
const npmrcPath = join(tmpDir, ".npmrc") | ||
const npmrcContent = await Bun.file(npmrcPath).text() | ||
expect(npmrcContent).toContain("@tsci:registry=https://npm.tscircuit.com") | ||
|
||
const tsconfigPath = join(tmpDir, "tsconfig.json") | ||
const tsconfigExists = await Bun.file(tsconfigPath).exists() | ||
expect(tsconfigExists).toBeTrue() | ||
|
||
try { | ||
const typeCheckResult = execSync("npx tsc --noEmit", { | ||
cwd: tmpDir, | ||
stdio: "pipe", | ||
}) | ||
console.log(typeCheckResult.toString()) | ||
} catch (error) { | ||
throw new Error("Type-checking failed") | ||
} | ||
}) |