Skip to content

Commit b1a896a

Browse files
committed
chore: update build
- drop scss - inject css - drop umd support - drop minimal css support - switch to pnpm - switch to tsup
1 parent 0934f94 commit b1a896a

19 files changed

+8056
-10832
lines changed

.eslintrc.json

-25
This file was deleted.

.husky/pre-commit

-4
This file was deleted.

babel.config.js

-11
This file was deleted.

build-addons.mjs

-65
This file was deleted.

package.json

+18-70
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"version": "10.0.6",
33
"license": "MIT",
4-
"typings": "dist/index.d.ts",
54
"description": "React notification made easy",
65
"keywords": [
76
"react",
@@ -14,40 +13,23 @@
1413
],
1514
"files": [
1615
"dist",
17-
"addons",
18-
"scss"
16+
"addons"
1917
],
20-
"sideEffects": true,
2118
"scripts": {
22-
"start": "cd playground && yarn dev",
19+
"setup": "pnpm link .",
20+
"start": "cd playground && pnpm dev",
2321
"test": "cypress open --component",
2422
"test:run": "cypress run --component -b chrome",
25-
"clean": "rimraf dist && rimraf addons",
2623
"lint": "eslint \"src/**/*.{ts,tsx}\"",
2724
"prettier": "prettier --write src",
28-
"prettier-scss": "prettier --write scss",
29-
"sass": "sass scss/main.scss dist/ReactToastify.css",
30-
"sass-minimal": "sass scss/minimal.scss dist/ReactToastify.minimal.css",
31-
"postsass": "postcss dist/ReactToastify.css --use autoprefixer -m -o dist/ReactToastify.css",
32-
"postsass-minimal": "cssnano dist/ReactToastify.minimal.css dist/ReactToastify.minimal.css --no-zindex --no-reduceIdents",
33-
"style": "npm run sass && npm run sass-minimal && cssnano dist/ReactToastify.css dist/ReactToastify.min.css --no-zindex --no-reduceIdents && npm run style-injector",
34-
"style-injector": "style2js --out-dir dist dist/ReactToastify.min.css",
35-
"build": "npm run clean && npm run build:core && npm run pack-and-extract && npm run build:addons && npm run style && husky install",
36-
"build:core": "microbundle --jsx React.createElement --jsxFragment React.Fragment --tsconfig tsconfig.build.json",
37-
"build:addons": "node build-addons.mjs",
38-
"postbuild": "./prepend-use-client.sh",
39-
"setup": "npm run clean && npm run build && npm run pack-and-extract",
40-
"setup:core": "npm run clean && npm run build:core && npm run pack-and-extract",
41-
"pack-and-extract": "yarn pack -f react-toastify.tgz && npm run rm-pkg && npm run extract-pkg",
42-
"rm-pkg": "rimraf node_modules/react-toastify && mkdir -p node_modules/react-toastify",
43-
"extract-pkg": "tar xzvf react-toastify.tgz -C node_modules/react-toastify --strip-components 1 && rimraf react-toastify.tgz"
25+
"build": "tsup && cp src/style.css dist/ReactToastify.css"
4426
},
4527
"peerDependencies": {
46-
"react": ">=18",
47-
"react-dom": ">=18"
28+
"react": ">=18.0.0",
29+
"react-dom": ">=18.0.0"
4830
},
4931
"prettier": {
50-
"printWidth": 80,
32+
"printWidth": 120,
5133
"semi": true,
5234
"singleQuote": true,
5335
"trailingComma": "none",
@@ -58,7 +40,7 @@
5840
"type": "git",
5941
"url": "git+https://github.com/fkhadra/react-toastify.git"
6042
},
61-
"author": "Fadi Khadra <[email protected]> (https://fkhadra.github.io)",
43+
"author": "Fadi Khadra <[email protected]> (https://fkhadra.github.io)",
6244
"bugs": {
6345
"url": "https://github.com/fkhadra/react-toastify/issues"
6446
},
@@ -68,75 +50,41 @@
6850
"@cypress/code-coverage": "^3.12.18",
6951
"@istanbuljs/nyc-config-typescript": "^1.0.2",
7052
"@testing-library/cypress": "^10.0.1",
53+
"@types/node": "^22.9.3",
7154
"@types/react": "^18.2.47",
7255
"@types/react-dom": "^18.2.18",
73-
"@typescript-eslint/eslint-plugin": "^6.18.1",
74-
"@typescript-eslint/parser": "^6.18.1",
7556
"@vitejs/plugin-react": "^4.2.1",
7657
"coveralls": "^3.0.9",
77-
"cssnano": "^6.0.3",
78-
"cssnano-cli": "^1.0.5",
7958
"cypress": "^13.6.2",
80-
"eslint": "^8.56.0",
81-
"eslint-plugin-import": "^2.29.1",
82-
"eslint-plugin-jsx-a11y": "^6.8.0",
83-
"eslint-plugin-react": "^7.32.2",
84-
"eslint-plugin-react-hooks": "^4.4.0",
85-
"husky": "^8.0.3",
86-
"microbundle": "^0.15.1",
8759
"postcss": "^8.4.33",
88-
"postcss-cli": "^11.0.0",
8960
"prettier": "3.2.2",
9061
"react": "^18.0.0",
9162
"react-dom": "^18.0.0",
92-
"rimraf": "^5.0.0",
93-
"sass": "^1.69.7",
94-
"style2js": "^1.0.3",
95-
"ts-jest": "^29.1.0",
96-
"tslib": "^2.5.0",
63+
"tsup": "^8.3.5",
9764
"typescript": "^5.3.3",
9865
"vite": "^5.0.11",
9966
"vite-plugin-istanbul": "^5.0.0"
10067
},
10168
"dependencies": {
10269
"clsx": "^2.1.0"
10370
},
104-
"main": "dist/react-toastify.js",
105-
"module": "dist/react-toastify.esm.mjs",
106-
"umd:main": "dist/react-toastify.umd.js",
107-
"unpkg": "dist/react-toastify.umd.js",
71+
"main": "dist/index.js",
72+
"typings": "dist/index.d.ts",
73+
"module": "dist/index.mjs",
10874
"source": "src/index.ts",
10975
"exports": {
11076
".": {
11177
"types": "./dist/index.d.ts",
112-
"require": "./dist/react-toastify.js",
113-
"import": "./dist/react-toastify.esm.mjs",
114-
"umd": "./dist/react-toastify.umd.js"
78+
"import": "./dist/index.mjs",
79+
"require": "./dist/index.js"
11580
},
116-
"./dist/ReactToastify.min.css": "./dist/ReactToastify.min.css",
11781
"./dist/ReactToastify.css": "./dist/ReactToastify.css",
118-
"./dist/ReactToastify.css.map": "./dist/ReactToastify.css.map",
119-
"./dist/ReactToastify.minimal.css": "./dist/ReactToastify.minimal.css",
120-
"./ReactToastify.min.css": "./dist/ReactToastify.min.css",
12182
"./ReactToastify.css": "./dist/ReactToastify.css",
122-
"./ReactToastify.css.map": "./dist/ReactToastify.css.map",
123-
"./ReactToastify.minimal.css": "./dist/ReactToastify.minimal.css",
124-
"./dist/inject-style": {
125-
"types": "./dist/inject-style.d.ts",
126-
"require": "./dist/inject-style.js",
127-
"import": "./dist/inject-style.esm.mjs"
128-
},
129-
"./inject-style": {
130-
"types": "./dist/inject-style.d.ts",
131-
"require": "./dist/inject-style.js",
132-
"import": "./dist/inject-style.esm.mjs"
133-
},
13483
"./package.json": "./package.json",
135-
"./scss/": "./scss/",
13684
"./addons/use-notification-center": {
13785
"types": "./addons/use-notification-center/index.d.ts",
138-
"require": "./addons/use-notification-center/index.js",
139-
"import": "./addons/use-notification-center/index.esm.mjs"
86+
"import": "./addons/use-notification-center/index.esm.mjs",
87+
"require": "./addons/use-notification-center/index.js"
14088
}
14189
}
142-
}
90+
}

playground/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"react": "^18.2.0",
14-
"react-dom": "^18.2.0"
13+
"react": "19.0.0-rc.1",
14+
"react-dom": "19.0.0-rc.1"
1515
},
1616
"devDependencies": {
1717
"@types/react": "^18.0.28",

0 commit comments

Comments
 (0)