-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: blocknumber setup #9
Changes from 6 commits
06ef8af
9802a89
546d76e
5b57a2d
f291b45
0e8fc5a
baa144a
9965c35
6215697
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add this on the root .gitignore with a wildcard to avoid having a gitignore per package |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto,
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Generated files | ||
pnpm-lock.yaml | ||
node_modules | ||
dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "blocknumber", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.ts", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets add |
||
"scripts": { | ||
"build": "tsc -p tsconfig.build.json", | ||
"lint": "eslint .", | ||
"lint:fix": "pnpm lint --fix", | ||
"format": "prettier --check .", | ||
"format:fix": "prettier --write .", | ||
"test": "vitest run" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto regarding test coverage |
||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { describe, expect, it } from "vitest"; | ||
|
||
import foo from "./helloWorld"; | ||
|
||
describe("test", () => { | ||
it("pass", () => { | ||
const result = foo(); | ||
|
||
expect(result).toBe("bar"); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function foo() { | ||
return "bar"; | ||
} |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,8 @@ | ||||||||
{ | ||||||||
"extends": "../../tsconfig.build.json", | ||||||||
"compilerOptions": { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
"outDir": "dist" | ||||||||
}, | ||||||||
"include": ["src/**/*"], | ||||||||
"exclude": ["**/*.spec.ts"] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["src/**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import { defineConfig } from "vitest/config"; | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, // Use Vitest's global API without importing it in each file | ||
environment: "node", // Use the Node.js environment | ||
include: ["src/**/*.spec.ts"], // Include test files | ||
exclude: ["node_modules", "dist"], // Exclude certain directories | ||
coverage: { | ||
reporter: ["text", "json", "html"], // Coverage reporters | ||
exclude: ["node_modules", "dist", "src/**/*.d.ts"], // Files to exclude from coverage | ||
}, | ||
}, | ||
resolve: { | ||
alias: { | ||
// Setup path alias based on tsconfig paths | ||
"@": path.resolve(__dirname, "src"), | ||
}, | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Based on total-typescript no-dom app config */ | ||
{ | ||
"compilerOptions": { | ||
/* Base Options: */ | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"target": "es2022", | ||
"allowJs": true, | ||
"resolveJsonModule": true, | ||
"moduleDetection": "force", | ||
"isolatedModules": true, | ||
"verbatimModuleSyntax": false, | ||
/* Strictness */ | ||
"strict": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noImplicitOverride": true, | ||
/* If transpiling with TypeScript: */ | ||
"module": "NodeNext", | ||
"sourceMap": true, | ||
/* If your code doesn't run in the DOM: */ | ||
"lib": ["es2022"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"incremental": false, | ||
"noEmit": false | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,4 @@ | ||
/* Based on total-typescript no-dom app config */ | ||
{ | ||
"compilerOptions": { | ||
/* Base Options: */ | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"target": "es2022", | ||
"allowJs": true, | ||
"resolveJsonModule": true, | ||
"moduleDetection": "force", | ||
"isolatedModules": true, | ||
"verbatimModuleSyntax": true, | ||
/* Strictness */ | ||
"strict": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noImplicitOverride": true, | ||
/* If transpiling with TypeScript: */ | ||
"module": "NodeNext", | ||
"sourceMap": true, | ||
/* If your code doesn't run in the DOM: */ | ||
"lib": ["es2022"] | ||
} | ||
"extends": "./tsconfig.base.json", | ||
"include": ["**/*", ".*.js"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can add the test coverage script here too