Skip to content

Commit

Permalink
switch to pure ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsinulhaq committed Nov 17, 2023
1 parent 3381a5b commit 7b9bdd0
Show file tree
Hide file tree
Showing 23 changed files with 10,318 additions and 12,268 deletions.
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime"
],
"parserOptions": {
"ecmaVersion": 2020,
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js v16
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- name: yarn install, build, and test
node-version: latest
- name: pnpm install, build, and test
run: |
yarn --frozen-lockfile
yarn typecheck
yarn build
yarn test --ci --coverage
yarn lint
pnpm --frozen-lockfile install
pnpm build
pnpm test -w false --coverage
pnpm lint
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
env:
CI: true
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"bracketSpacing": false,
"singleAttributePerLine": true,
"singleQuote": true
}
16 changes: 0 additions & 16 deletions .size-snapshot.json

This file was deleted.

10 changes: 0 additions & 10 deletions .storybook/main.js

This file was deleted.

20 changes: 20 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type {StorybookConfig} from '@storybook/react-vite';

const config: StorybookConfig = {
stories: ['../stories/**/*.stories.tsx'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
};

export default config;
3 changes: 0 additions & 3 deletions .storybook/preview.js

This file was deleted.

15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type {Preview} from '@storybook/react';

const preview: Preview = {
parameters: {
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
8 changes: 0 additions & 8 deletions babel.config.json

This file was deleted.

101 changes: 43 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-popper-tooltip",
"version": "4.4.2",
"version": "5.0.0",
"description": "React tooltip library built around react-popper",
"author": "Mohsin Ul Haq <mohsinulhaq01@gmail.com>",
"license": "MIT",
Expand All @@ -16,10 +16,12 @@
"react-tooltip",
"react-popper"
],
"main": "dist/cjs/react-popper-tooltip.js",
"module": "dist/esm/react-popper-tooltip.js",
"browser": "dist/esm/react-popper-tooltip.js",
"typings": "dist/index.d.ts",
"type": "module",
"engines": {
"node": ">=16"
},
"exports": "./dist/main.js",
"typings": "dist/main.d.ts",
"style": "dist/styles.css",
"files": [
"dist"
Expand All @@ -28,73 +30,56 @@
"dist/styles.css"
],
"scripts": {
"build": "rm -rf dist && rollup -c && cp src/styles.css dist && yarn tsc && rm -rf compiled",
"prepare": "husky install && yarn typecheck && yarn build && yarn test && yarn lint-staged",
"build": "rm -rf dist && tsup src/main.ts --format esm --dts --sourcemap",
"prepare": "husky install",
"prettier": "prettier --write src/**/*.{ts,tsx}",
"typecheck": "tsc --noEmit",
"lint": "eslint \"{src,tests,examples}**/*.{ts,tsx}\"",
"start": "rollup -c -w",
"test": "jest --env=jsdom tests",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"jest": {
"modulePathIgnorePatterns": [
"<rootDir>/examples/"
],
"setupFilesAfterEnv": [
"@testing-library/jest-dom/extend-expect"
]
"test": "vitest --globals --environment happy-dom -w false",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"lint-staged": {
"**/*.(ts|tsx)": [
"yarn lint --fix"
]
},
"peerDependencies": {
"react": ">=16.6.0",
"react-dom": ">=16.6.0"
"react": ">=16.14.0",
"react-dom": ">=16.14.0"
},
"dependencies": {
"@babel/runtime": "^7.18.3",
"@popperjs/core": "^2.11.5",
"@popperjs/core": "^2.11.8",
"react-popper": "^2.3.0"
},
"devDependencies": {
"@babel/core": "^7.18.5",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@storybook/addon-actions": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-links": "^6.5.9",
"@storybook/react": "^6.5.9",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.2.1",
"@types/jest": "^28.1.3",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.1",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-interactions": "^7.5.3",
"@storybook/addon-links": "^7.5.3",
"@storybook/addon-onboarding": "^1.0.8",
"@storybook/blocks": "^7.5.3",
"@storybook/react": "^7.5.3",
"@storybook/react-vite": "^7.5.3",
"@storybook/testing-library": "^0.2.2",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^12",
"@testing-library/user-event": "^14.5.1",
"@types/react": "^17",
"@types/react-dom": "^17",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@vitest/coverage-v8": "^1.0.0-beta.4",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.1",
"jest": "^28.1.1",
"jest-environment-jsdom": "^28.1.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.75.7",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-size-snapshot": "^0.12.0",
"typescript": "^4.7.4"
"happy-dom": "^12.10.3",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"react": "^17",
"react-dom": "^17",
"storybook": "^7.5.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^1.0.0-beta.4"
}
}

0 comments on commit 7b9bdd0

Please sign in to comment.