Skip to content

Commit

Permalink
feat: update deps, test and ts configs
Browse files Browse the repository at this point in the history
  • Loading branch information
dallen4 committed Jan 11, 2025
1 parent 132b9cb commit 588b85e
Show file tree
Hide file tree
Showing 13 changed files with 239 additions and 110 deletions.
3 changes: 2 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"license": "GPL-3.0-only",
"private": true,
"scripts": {
"test": "vitest run",
"prebuild": "sh ./scripts/prebuild.sh",
"build": "node ./scripts/esbuild.js",
"prepackage": "cpx \"../node_modules/figlet/fonts/*.flf\" ./fonts",
Expand All @@ -34,7 +35,7 @@
"cosmiconfig": "^9.0.0",
"envfile": "^7.1.0",
"figlet": "^1.5.2",
"mime-type": "^4.0.0",
"mime": "^4.0.6",
"open": "^10.1.0",
"ora": "^6.1.2",
"semver": "^7.5.4",
Expand Down
2 changes: 1 addition & 1 deletion cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"../shared/types/"
]
},
"include": ["**/*.ts", "**/*.tsx"],
"include": ["**/*.ts", "**/*.tsx", "vitest.config.mts"],
"exclude": ["node_modules"]
}
12 changes: 12 additions & 0 deletions cli/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineProject, mergeConfig } from 'vitest/config';
import configShared from '../vitest.config.mjs';

export default mergeConfig(
configShared,
defineProject({
test: {
include: ['tests/unit/**/*.spec.ts'],
environment: 'node',
},
}),
);
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
"start": "yarn web start",
"build": "yarn web build",
"start:prod": "yarn web start:prod",
"test": "vitest run",
"test:watch": "vitest",
"test:cov": "vitest run --coverage.enabled true",
"test:e2e": "yarn web test:e2e",
"cli:build": "yarn cli build",
"cli:release": "cd cli && yarn install --frozen-lockfile && yarn release",
"worker:deploy": "yarn worker deploy",
"analyze:dup": "jscpd",
"analyze:unused": "ts-prune",
"postversion": "git push --tags"
"postversion": "git push --tags",
"prepare": "husky"
},
"dependencies": {
"@clerk/clerk-js": "^5.22.3",
Expand All @@ -54,13 +58,17 @@
"@types/node": "^20",
"@types/qrcode": "^1.5.5",
"@vitest/coverage-istanbul": "^2.1.8",
"@vitest/ui": "^2.1.8",
"eslint": "^8.31.0",
"happy-dom": "^16.5.2",
"husky": "^9.1.7",
"jscpd": "^4.0.5",
"postcss": "^8.4.49",
"prettier": "^2.8.2",
"ts-prune": "^0.10.3",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
},
"browser": {
Expand Down
32 changes: 16 additions & 16 deletions shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"typeRoots": [
"./node_modules/@types/",
"../node_modules/@types/",
"./types/"
]
},
"include": ["**/*.ts"],
"exclude": ["node_modules"]
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"typeRoots": [
"./node_modules/@types/",
"../node_modules/@types/",
"./types/"
]
},
"include": ["**/*.ts", "vitest.config.mts"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion cli/vitest.config.ts → shared/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
import configShared from '../vitest.config';
import configShared from '../vitest.config.mts';

export default mergeConfig(
configShared,
Expand Down
38 changes: 23 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
{
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["**/*.ts", "**/*.tsx", "**/*.mdx"],
"exclude": ["node_modules"]
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"allowImportingTsExtensions": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.mdx",
"vitest.config.mts",
"web/vitest.config.mts"
, "shared/vitest.config.mts", "cli/vitest.config.mts" ],
"exclude": ["node_modules"]
}
19 changes: 19 additions & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// vitest.config.ts
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';

const reporters = ['verbose'];

if (process.env.CI)
reporters.push('json-summary', 'html', 'github-actions');

export default defineConfig({
test: {
reporters,
coverage: {
provider: 'istanbul',
reportOnFailure: true,
},
},
plugins: [tsconfigPaths()],
});
11 changes: 0 additions & 11 deletions vitest.config.ts

This file was deleted.

23 changes: 23 additions & 0 deletions vitest.workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineWorkspace } from 'vitest/config';

export default defineWorkspace([
'cli/vitest.config.mts',
'web/vitest.config.mts',
{
extends: './vitest.config.mts',
test: {
include: ['shared/tests/**/*.spec.ts'],
name: 'shared (browser)',
// using happy-dom, but will swap to jsdom if hits limitations
environment: 'happy-dom',
},
},
{
extends: './vitest.config.mts',
test: {
include: ['shared/tests/**/*.spec.ts'],
name: 'shared (node)',
environment: 'node',
},
},
]);
64 changes: 35 additions & 29 deletions web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"jsx": "preserve",
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"paths": {
"@config/*": ["config/*"],
"@shared/*": ["../shared/*"]
},
"typeRoots": [
"./node_modules/@types/",
"../node_modules/@types/",
"./types/",
"../shared/types/"
]
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"jsx": "preserve",
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"paths": {
"@config/*": ["config/*"],
"@shared/*": ["../shared/*"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.mdx"],
"exclude": ["node_modules"]
"typeRoots": [
"./node_modules/@types/",
"../node_modules/@types/",
"./types/",
"../shared/types/"
]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.mdx",
"vitest.config.mts"
],
"exclude": ["node_modules"]
}
12 changes: 12 additions & 0 deletions web/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineProject, mergeConfig } from 'vitest/config';
import configShared from '../vitest.config.mts';

export default mergeConfig(
configShared,
defineProject({
test: {
include: ['tests/unit/**/*.spec.ts'],
environment: 'happy-dom',
},
}),
);
Loading

0 comments on commit 588b85e

Please sign in to comment.