Skip to content

Commit

Permalink
📦 use father replace rc-tools (#8)
Browse files Browse the repository at this point in the history
* 📦 use father replace rc-tools

* ✅ fix test case

* fix npm build

* fix extra space in scripts

* update .gitignore

* clean up package.json and gitignore

* fix eslint
  • Loading branch information
afc163 authored Jul 8, 2020
1 parent ed27781 commit 8de411b
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.eslintrc.js
lib
es
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const base = require('@umijs/fabric/dist/eslint');

module.exports = {
...base,
rules: {
...base.rules,
'no-template-curly-in-string': 0,
'prefer-promise-reject-errors': 0,
'react/no-array-index-key': 0,
'react/sort-comp': 0,
'import/no-named-as-default': 0,
'import/no-named-as-default-member': 0,
},
};
11 changes: 11 additions & 0 deletions .fatherrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
entry: ['src/index.js'],
cjs: 'babel',
esm: { type: 'babel', importLibToEs: true },
doc: { base: '/switch' },
preCommit: {
eslint: true,
prettier: true,
},
runtimeHelpers: true,
};
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.storybook
/node_modules
/npm-debug.log
npm-debug.log.*
.DS_Store
lib/
es/
coverage/
coverage/
.doc
32 changes: 3 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,15 @@ language: node_js

sudo: false

notifications:
email:
- hust2012jiangkai@gmail.com

node_js:
- 6.0.0

before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
phantomjs --version
- 14

script:
- |
if [ "$TEST_TYPE" = test ]; then
npm test
else
npm run $TEST_TYPE
fi
npm run $TEST_TYPE
env:
matrix:
- TEST_TYPE=lint
- TEST_TYPE=test
- TEST_TYPE=coverage
- TEST_TYPE=saucelabs
global:
- secure: S1VwbaPzLnSH/IUT/wlJulxAX5VHRIDmSt53h/ycHcZsszUpWcLCJRQAe0fTVB2dAx5MdBbSZ+o+tr3tRwVB5TRAYm0oTCsYAkOZaWOB28RuUQtdGt3wf9xxTG1UiPiaLLUW3waX9zAaf3yqKBcJGf1op0RD8dksxbCFw/7xVbU=
- secure: EBEDg8k///IlEsnx0AE8X3mbFl0QE5+xGKbG4AxXlGZda12uTIPUSMKJzdZQ2hVbZXduTzf1cQl9rcu9nGoSnkL/DWnIax9cvHi+1orx5+YPlxPHNWAwWByTnHosBn2MJhfy1s5paJfHC9cUzmmEL6x4fYthWxjsPUo+irEZH6E=


matrix:
allow_failures:
- env: "TEST_TYPE=saucelabs"
- TEST_TYPE=coverage
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
"index.d.ts"
],
"scripts": {
"compile": "rc-tools run compile --babel-runtime",
"test": "rc-test run test",
"coverage": "rc-test run coverage",
"lint": "rc-tools run lint",
"eslint-fix": "eslint --fix ./index.js ./test",
"build": "rc-tools run build",
"gh-pages": "rc-tools run gh-pages",
"start": "rc-tools run server",
"pub": "rc-tools run pub --babel-runtime",
"prepublish": "rc-tools run guard"
"start": "father doc dev --storybook",
"build": "father doc build --storybook",
"compile": "father build",
"gh-pages": "father doc deploy",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"lint": "eslint .",
"test": "father test",
"coverage": "father test --coverage"
},
"repository": {
"type": "git",
Expand All @@ -37,10 +35,14 @@
"url": "https://github.com/benjycui/omit.js/issues"
},
"homepage": "https://github.com/benjycui/omit.js#readme",
"dependencies": {},
"dependencies": {
"@babel/runtime": "^7.10.4"
},
"devDependencies": {
"@umijs/fabric": "^2.2.2",
"assert": "^1.4.1",
"rc-test": "^6.0.7",
"eslint": "^7.4.0",
"father": "^2.29.5",
"rc-tools": "^6.3.3"
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function omit(obj, fields) {
const shallowCopy = {
...obj,
};
for (let i = 0; i < fields.length; i++) {
for (let i = 0; i < fields.length; i += 1) {
const key = fields[i];
delete shallowCopy[key];
}
Expand Down
File renamed without changes.

0 comments on commit 8de411b

Please sign in to comment.