Skip to content

Commit

Permalink
chore: fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomantovani committed Mar 19, 2021
1 parent 0e8ccaa commit 6b9e1e1
Show file tree
Hide file tree
Showing 6 changed files with 625 additions and 27 deletions.
61 changes: 60 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"module": "dist/index.esm.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "FORCE_COLOR=true eslint ./src/**/*.{ts,tsx} --max-warnings=0 --format=codeframe",
"prettier": "FORCE_COLOR=true prettier --write './src/**/*.{jsx,tsx,ts,js,md}' && prettier --write './README.md'",
"lint": "FORCE_COLOR=true eslint ./**/*.{ts,tsx} --max-warnings=0 --format=codeframe",
"prettier": "FORCE_COLOR=true prettier --write './**/*.{jsx,tsx,ts,js,md}' && prettier --write './README.md'",
"i-all": "npm i && cd playground && npm i",
"build": "rollup -c",
"build-watch": "rollup -c -w",
Expand Down Expand Up @@ -50,7 +50,9 @@
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"rollup": "^2.40.0",
"rollup-plugin-babel-minify": "^10.0.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-prettier": "^2.1.0",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-uglify": "^6.0.4",
"typescript": "^4.2.2"
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "CI=false react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
38 changes: 19 additions & 19 deletions playground/src/component-lib/index.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import { useReducer, useEffect } from "react";
import ExpiredStorage from "expired-storage";
function useLocalStorageReducer(o, e, r, t) {
void 0 === t && (t = 1800);
var r = useReducer(e, r, function (r) {
function useLocalStorageReducer(b, c, d, f) {
void 0 === f && (f = 1800);
var d = useReducer(c, d, function (a) {
try {
var e = new ExpiredStorage().getItem(o),
t = JSON.stringify(r);
return e ? JSON.parse(e) : JSON.parse(t);
} catch (e) {
return console.error(e), r;
var c = new ExpiredStorage().getItem(b),
d = JSON.stringify(a);
return c ? JSON.parse(c) : JSON.parse(d);
} catch (b) {
return console.error(b), a;
}
}),
a = r[0],
r = r[1];
g = d[0],
d = d[1];
return (
useEffect(
function () {
try {
var e = new ExpiredStorage();
!1 !== t && "number" == typeof t
? e.setItem(o, JSON.stringify(a), t)
: window.localStorage.setItem(o, JSON.stringify(a));
} catch (e) {
console.error(e);
var a = new ExpiredStorage();
!1 !== f && "number" == typeof f
? a.setItem(b, JSON.stringify(g), f)
: window.localStorage.setItem(b, JSON.stringify(g));
} catch (a) {
console.error(a);
}
localStorage.setItem(o, JSON.stringify(a));
localStorage.setItem(b, JSON.stringify(g));
},
[t, o, a]
[f, b, g]
),
[a, r]
[g, d]
);
}
export { useLocalStorageReducer };
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import typescript from "rollup-plugin-typescript2";
import del from "rollup-plugin-delete";
import { uglify } from "rollup-plugin-uglify";
import pkg from "./package.json";
import minify from "rollup-plugin-babel-minify";

export default [
{
Expand All @@ -19,6 +20,7 @@ export default [
del({ targets: ["dist/*", "playground/src/component-lib"] }),
typescript(),
uglify(),
minify(),
],
external: Object.keys(pkg.peerDependencies || {}),
},
Expand Down
Loading

0 comments on commit 6b9e1e1

Please sign in to comment.