-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor individual components with common configuration (#641)
- Loading branch information
Showing
21 changed files
with
212 additions
and
463 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
|
||
import { twPlugin } from "@versini/ui-styles"; | ||
|
||
export const commonTailwindConfigForComponent = () => { | ||
return twPlugin.merge({ | ||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], | ||
}); | ||
}; |
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 |
---|---|---|
@@ -1,68 +1,24 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"ts-node": { | ||
"swc": true | ||
}, | ||
"compilerOptions": { | ||
/** Allow JavaScript files to be imported inside your project, | ||
* instead of just .ts and .tsx files. | ||
*/ | ||
"allowJs": true, | ||
/** | ||
* Allow default imports from modules with no default export. | ||
*/ | ||
"allowSyntheticDefaultImports": true, | ||
/** | ||
* Generate .d.ts files for every TypeScript or JavaScript file | ||
* inside your project. | ||
*/ | ||
"declaration": true, | ||
/** | ||
* Only output d.ts files and not JavaScript files. | ||
*/ | ||
"emitDeclarationOnly": true, | ||
/** | ||
* Emit additional JavaScript to ease support for importing | ||
* CommonJS modules. | ||
*/ | ||
"esModuleInterop": false, | ||
/** | ||
* Ensure that each file can be safely transpiled without | ||
* relying on other imports. | ||
*/ | ||
"isolatedModules": true, | ||
/** | ||
* Specify a set of bundled library declaration files that | ||
* describe the target runtime environment. | ||
*/ | ||
"lib": ["ESNext"], | ||
/** | ||
* Specify what module code is generated. | ||
*/ | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "ESNext", | ||
/** | ||
* Specify the module resolution strategy: | ||
* - 'node' for Node.js’ CommonJS implementation | ||
* - 'node16' or 'nodenext' for Node.js’ ECMAScript Module Support | ||
* from TypeScript 4.7 onwards | ||
*/ | ||
"moduleResolution": "nodenext", | ||
/** | ||
* Enable importing .json files | ||
*/ | ||
"resolveJsonModule": true, | ||
/** | ||
* Skip type checking of all declaration files (*.d.ts). | ||
*/ | ||
"skipLibCheck": true, | ||
/** | ||
* Enable all strict type checking options. | ||
*/ | ||
"strict": false, | ||
/** | ||
* Set the JavaScript language version for emitted JavaScript | ||
* and include compatible library declarations. | ||
*/ | ||
"target": "ESNext" | ||
"types": ["vitest/globals", "@testing-library/jest-dom"], | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export const commonTsupConfig = defineConfig({ | ||
format: "esm", | ||
entry: { | ||
index: "src/components/index.ts", | ||
}, | ||
outDir: "dist", | ||
dts: { | ||
only: 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
File renamed without changes.
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,29 @@ | ||
/// <reference types="vitest" /> | ||
|
||
import path from "node:path"; | ||
import { defineConfig, mergeConfig } from "vitest/config"; | ||
|
||
export const commonVitestConfig = (viteConfig) => { | ||
return defineConfig((configEnv) => | ||
mergeConfig( | ||
viteConfig(configEnv), | ||
defineConfig({ | ||
test: { | ||
globals: true, | ||
setupFiles: [path.join(__dirname, "./vitest.setup.ts")], | ||
environment: "happy-dom", | ||
coverage: { | ||
include: ["src/**/*.ts", "src/**/*.tsx", "!src/style.ts"], | ||
provider: "v8", | ||
thresholds: { | ||
statements: 100, | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
}, | ||
}, | ||
}, | ||
}), | ||
), | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,2 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
|
||
import { twPlugin } from "@versini/ui-styles"; | ||
|
||
export default twPlugin.merge({ | ||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], | ||
}); | ||
import { commonTailwindConfigForComponent } from "../../configuration/tailwind.common"; | ||
export default commonTailwindConfigForComponent(); |
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 |
---|---|---|
@@ -1,26 +1,4 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
"types": ["vitest/globals", "@testing-library/jest-dom"], | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
"extends": "../../configuration/tsconfig.common.json", | ||
"include": ["src"] | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,2 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
format: "esm", | ||
entry: { | ||
index: "src/components/index.ts", | ||
}, | ||
outDir: "dist", | ||
dts: { | ||
only: true, | ||
}, | ||
}); | ||
import { commonTsupConfig } from "../../configuration/tsup.common"; | ||
export default commonTsupConfig; |
Oops, something went wrong.