Skip to content

Commit

Permalink
feat: ts migration of all the tools
Browse files Browse the repository at this point in the history
- rollup config
- jest config
- commitlint config

- updated jest snapshots
  • Loading branch information
dominikbulaj committed Aug 2, 2023
1 parent e715ba9 commit d187d72
Show file tree
Hide file tree
Showing 8 changed files with 573 additions and 363 deletions.
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

11 changes: 11 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { UserConfig } from '@commitlint/types'

const Configuration: UserConfig = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ['@commitlint/config-conventional']
}

module.exports = Configuration
14 changes: 0 additions & 14 deletions jest.config.js

This file was deleted.

34 changes: 34 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { Config } from '@jest/types'

const config: Config.InitialOptions = {
verbose: true,
preset: 'ts-jest',
roots: ['<rootDir>/src'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)'
],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest'
},
transformIgnorePatterns: ['<rootDir>/node_modules/'],
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
testEnvironment: 'jest-environment-jsdom'
}

export default config

// module.exports = {
// preset: 'ts-jest',
// roots: ['<rootDir>/src'],
// testMatch: [
// '**/__tests__/**/*.+(ts|tsx|js)',
// '**/?(*.)+(spec|test).+(ts|tsx|js)'
// ],
// transform: {
// '^.+\\.(ts|tsx)$': 'ts-jest'
// },
// transformIgnorePatterns: ['<rootDir>/node_modules/'],
// setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
// testEnvironment: 'jest-environment-jsdom'
// }
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dist/"
],
"scripts": {
"build": "package-check && rollup -c ",
"build": "package-check && rollup --config rollup.config.ts --configPlugin typescript",
"test": "jest",
"tsc": "tsc",
"prepare": "husky install"
Expand All @@ -40,27 +40,29 @@
"@babel/preset-react": "^7.0.0",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@commitlint/types": "^17.4.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"@rollup/plugin-typescript": "^8.3.4",
"@skypack/package-check": "^0.2.2",
"@testing-library/react": "12.1.5",
"@types/jest": "^28.1.6",
"@types/jest": "^29.5.3",
"@types/node": "^18.6.3",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^28.1.3",
"husky": "^8.0.0",
"jest": "^28.1.3",
"jest": "^29.6.2",
"jest-environment-jsdom": "^28.1.3",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-test-renderer": "^16.5.2",
"rollup": "^2.57.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^28.0.7",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
},
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`ScrollInto renders with children 1`] = `
<div
className=""
onClick={[Function]}
style={Object {}}
style={{}}
>
<div>
Some child content
Expand All @@ -16,7 +16,7 @@ exports[`ScrollInto renders with custom className 1`] = `
<div
className="custom-class"
onClick={[Function]}
style={Object {}}
style={{}}
>
<div>
Some child content
Expand All @@ -29,7 +29,7 @@ exports[`ScrollInto renders with custom styles 1`] = `
className=""
onClick={[Function]}
style={
Object {
{
"display": "inline",
}
}
Expand All @@ -45,7 +45,7 @@ exports[`ScrollInto renders with custom styles and className 1`] = `
className="pinky"
onClick={[Function]}
style={
Object {
{
"color": "red",
"display": "inline",
}
Expand Down
Loading

0 comments on commit d187d72

Please sign in to comment.