Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cli/src/init/scaffold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,19 @@ fn generate_package_json(name: &str, ts_sdk: TypeScriptSdk) -> String {
"name": "{name}",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {{
"check-types": "tsc --noEmit",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having quick access to a type check is useful, it helps find issues like the one fixed in #82

"test": "vitest run"
}},
"dependencies": {{
"@blueshift-gg/quasar-svm": "^0.1.11",
{solana_dep}
}},
"devDependencies": {{
"@types/node": "^22.0.0",
"@types/node": "^22.13.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version of Node stabilized the WebCrypto api.

"typescript": "^5.9.3",
"vitest": "^3.1.0"
"vitest": "^4.1.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the latest version

}}
}}
"#
Expand Down
9 changes: 5 additions & 4 deletions cli/src/init/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ pub enum MyError {

pub(super) const TS_TEST_TSCONFIG: &str = r#"{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"module": "preserve",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "ESNext",
Comment on lines +80 to +85
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are modern settings that fix the error in the screenshot, and make TypeScript convenient to work with (no need to use .js/.ts for imports, for example).

Image

"types": ["node"]
},
"include": ["tests/*.test.ts"]
Expand Down
Loading