improve repo structure

This commit is contained in:
Rene Haas
2022-10-21 12:39:53 +02:00
parent 2599fc2cd1
commit b277dded6a
38 changed files with 28688 additions and 46301 deletions
@@ -1 +0,0 @@
module.exports = require('@~local/config/jest-babel');
@@ -1,7 +0,0 @@
/** @type {import('jest').Config} */
module.exports = {
coverageDirectory: './.coverage',
testEnvironment: 'jsdom',
testMatch: ['**/test/**/*.test.[jt]s?(x)'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
};
@@ -1 +0,0 @@
import '@testing-library/jest-dom';
+2 -12
View File
@@ -21,29 +21,19 @@
"react": ">=16.4.0"
},
"devDependencies": {
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.68",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"babel-jest": "^29.2.1",
"jest": "^27.5.1",
"npm-run-all": "^4.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.8.4",
"vite": "^3.1.8"
"typescript": "^4.8.4"
},
"scripts": {
"build": "run-p build-js build-types",
"build-js": "vite build",
"build-types": "tsc --emitDeclarationOnly -p tsconfig.types.json",
"test": "jest"
"test": "vitest run"
}
}
@@ -1,9 +0,0 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { OverlayScrollbarsComponents } from "../src/overlayscrollbars-react";
test("renders learn react link", () => {
render(<OverlayScrollbarsComponents msg="hi" />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
@@ -0,0 +1,9 @@
import { test, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-react';
test('renders learn react link', () => {
render(<OverlayScrollbarsComponent msg="hi" />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
@@ -6,7 +6,10 @@
"strict": true,
"module": "ES2015",
"moduleResolution": "node",
"jsx": "react-jsx"
},
"include": ["src/**/*"]
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
}
}
}
@@ -5,5 +5,6 @@
"outDir": "dist",
"declaration": true,
"types": ["react"]
}
},
"include": ["src/**/*"]
}
@@ -5,6 +5,8 @@ import react from '@vitejs/plugin-react';
export default defineConfig({
build: {
sourcemap: true,
outDir: 'dist',
lib: {
entry: resolve(__dirname, 'src/overlayscrollbars-react.ts'),
name: 'OverlayScrollbarsReact',
@@ -13,8 +15,6 @@ export default defineConfig({
rollupOptions: {
external: ['react'],
output: {
sourcemap: true,
dir: 'dist',
globals: {
react: 'React',
},
@@ -0,0 +1,5 @@
import { mergeConfig } from 'vite';
import vitestConfig from '@~local/config/vitest';
import viteConfig from './vite.config';
export default mergeConfig(viteConfig, vitestConfig);