Skip to content

Commit

Permalink
feat!: migrate to tsup
Browse files Browse the repository at this point in the history
- Removed post install script
- Removed compile scripts & build:watch
- Fixed TS types in several components (SelectControl,
  CellExpandWrapper, DateTimeRangeFloatingPicker,
  DateTimeFloatingPicker, ...)
- Removed dead code
- Missing LICENSE file in datetime package
- Added mergeStyles test
  • Loading branch information
jlopezcur committed Dec 26, 2024
1 parent 6d705e7 commit 0741306
Show file tree
Hide file tree
Showing 77 changed files with 2,079 additions and 1,306 deletions.
11 changes: 2 additions & 9 deletions tsconfig.json → common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@
"@testing-library/jest-dom"
],
"resolveJsonModule": true,
"baseUrl": ".",
"jsx": "react",
"strictBindCallApply": true,
"noUncheckedIndexedAccess": true,
"paths": {
"test-utils": [
"./test/test-utils.tsx"
]
},
"skipLibCheck": true,
},
"jsx": "react"
}
}
17 changes: 17 additions & 0 deletions common/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Options } from 'tsup';
import styledComponentsPlugin from 'esbuild-plugin-styled-components';

export const tsupConfig: Options = {
// Here is the plugin for that allow us to use the
// styled-components CSS prop properly
// https://github.com/appzic/esbuild-plugin-styled-components
esbuildPlugins: [styledComponentsPlugin({})],
sourcemap: true,
clean: true,
dts: true,
minify: 'terser',
format: ['esm', 'cjs'],
metafile: true,
treeshake: true,
// silent: true,
};
33 changes: 33 additions & 0 deletions common/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';

export const vitestConfig = defineConfig({
// Here is the plugin for React that allow us to use the babel plugin for
// styled-components and test the CSS prop output properly
// https://styled-components.com/docs/tooling#babel-plugin
plugins: [
react({
babel: {
plugins: [
[
'babel-plugin-styled-components',
{
ssr: false,
pure: true,
displayName: command !== 'build',
fileName: command !== 'build',
},
],
],
},
}),
],
test: {
environment: 'happy-dom',
include: ['{src,stories}/**/*.test.ts?(x)'],
coverage: {
provider: 'v8',
include: ['{src,stories}/**/*'],
},
},
});
Loading

0 comments on commit 0741306

Please sign in to comment.