-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2739329
commit 1eac004
Showing
6 changed files
with
735 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,11 @@ node_modules/ | |
.DS_Store | ||
|
||
# generated files | ||
lib/ | ||
esm/ | ||
dist/ | ||
|
||
# editors | ||
.idea | ||
.vscode | ||
.vscode | ||
|
||
# yard | ||
yarn-error.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: node_js | ||
cache: yarn | ||
node_js: | ||
- '8.4' | ||
- '8.11.3' | ||
script: | ||
- yarn run validate | ||
- yarn run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
"name": "memoize-one", | ||
"version": "3.1.1", | ||
"description": "A memoization library which only remembers the latest invocation", | ||
"main": "lib/index.js", | ||
"module": "esm/index.js", | ||
"main": "dist/memoize-one.cjs.js", | ||
"module": "dist/memoize-one.esm.js", | ||
"sideEffects": false, | ||
"author": "Alex Reardon <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -12,8 +12,7 @@ | |
"url": "https://github.com/alexreardon/memoize-one.git" | ||
}, | ||
"files": [ | ||
"/lib", | ||
"/esm", | ||
"/dist", | ||
"/src" | ||
], | ||
"keywords": [ | ||
|
@@ -25,33 +24,35 @@ | |
"dependencies": {}, | ||
"devDependencies": { | ||
"babel-cli": "6.26.0", | ||
"babel-core": "6.26.0", | ||
"babel-eslint": "8.2.2", | ||
"babel-core": "6.26.3", | ||
"babel-eslint": "8.2.5", | ||
"babel-plugin-transform-flow-strip-types": "6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-flow": "^6.23.0", | ||
"chai": "4.1.2", | ||
"cross-env": "^5.1.4", | ||
"eslint": "4.19.0", | ||
"eslint-plugin-flowtype": "^2.46.1", | ||
"eslint-plugin-jest": "^21.15.0", | ||
"flow-bin": "0.68.0", | ||
"flow-copy-source": "1.3.0", | ||
"jest": "^22.4.2", | ||
"rimraf": "2.6.2" | ||
"cross-env": "^5.2.0", | ||
"eslint": "5.0.1", | ||
"eslint-plugin-flowtype": "^2.49.3", | ||
"eslint-plugin-jest": "^21.17.0", | ||
"flow-bin": "0.75.0", | ||
"jest": "^23.2.0", | ||
"rimraf": "2.6.2", | ||
"rollup": "^0.62.0", | ||
"rollup-plugin-babel": "^3.0.5", | ||
"rollup-plugin-commonjs": "^9.1.3", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"rollup-plugin-uglify": "^4.0.0" | ||
}, | ||
"scripts": { | ||
"validate": "yarn run lint && yarn run typecheck", | ||
"test": "cross-env NODE_ENV=test jest", | ||
"typecheck": "flow check", | ||
"lint": "eslint src test -", | ||
"lint:fix": "yarn run lint --fix", | ||
"build": "yarn run build:clean && yarn run build:lib && yarn run build:esm && yarn run build:flow", | ||
"build:clean": "rimraf lib esm", | ||
"build:lib": "cross-env NODE_ENV=cjs babel src -d lib", | ||
"build:esm": "babel src --out-dir esm", | ||
"build:flow": "flow-copy-source --verbose src lib && flow-copy-source --verbose src esm", | ||
"lint": "eslint src test", | ||
"build": "yarn run build:clean && yarn run build:dist && yarn run build:flow", | ||
"build:clean": "rimraf dist", | ||
"build:dist": "rollup -c", | ||
"build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/memoize-one.cjs.js.flow", | ||
"prepublish": "yarn run build" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// @flow | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import replace from 'rollup-plugin-replace'; | ||
import { uglify } from 'rollup-plugin-uglify'; | ||
|
||
const input = 'src/index.js'; | ||
|
||
export default [ | ||
// Universal module definition (UMD) build | ||
{ | ||
input, | ||
output: { | ||
file: 'dist/memoize-one.js', | ||
format: 'umd', | ||
name: 'memoizeOne', | ||
}, | ||
plugins: [ | ||
// Setting development env before running babel etc | ||
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }), | ||
babel(), | ||
commonjs({ include: 'node_modules/**' }), | ||
], | ||
}, | ||
// Universal module definition (UMD) build (production) | ||
{ | ||
input, | ||
output: { | ||
file: 'dist/memoize-one.min.js', | ||
format: 'umd', | ||
name: 'memoizeOne', | ||
}, | ||
plugins: [ | ||
// Setting production env before running babel etc | ||
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }), | ||
babel(), | ||
commonjs({ include: 'node_modules/**' }), | ||
uglify(), | ||
], | ||
}, | ||
// ESM build | ||
{ | ||
input, | ||
output: { | ||
file: 'dist/memoize-one.esm.js', | ||
format: 'es', | ||
}, | ||
plugins: [babel()], | ||
}, | ||
// CommonJS build | ||
{ | ||
input, | ||
output: { | ||
file: 'dist/memoize-one.cjs.js', | ||
format: 'cjs', | ||
}, | ||
plugins: [babel()], | ||
}, | ||
]; |
Oops, something went wrong.