-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored sync code and added refetchCollections() action (#458)
* [tech] Refactored sync code and added reftechCollections() action * [fix] Added PouchDB mock so that tests can run * [fix] Linting...
- Loading branch information
Showing
25 changed files
with
2,995 additions
and
1,581 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 |
---|---|---|
|
@@ -4,24 +4,18 @@ | |
"main": "src/main.jsx", | ||
"scripts": { | ||
"build:drive": "npm run build:drive:browser", | ||
"build:drive:browser": | ||
"npm run internal:build -- --env.app=drive --env.target=browser --env.production", | ||
"build:drive:mobile": | ||
"npm run internal:build -- --env.app=drive --env.target=mobile --env.production", | ||
"build:drive:browser": "npm run internal:build -- --env.app=drive --env.target=browser --env.production", | ||
"build:drive:mobile": "npm run internal:build -- --env.app=drive --env.target=mobile --env.production", | ||
"build:photos": "npm run build:photos:browser", | ||
"build:photos:browser": | ||
"npm run internal:build -- --env.app=photos --env.target=browser --env.production", | ||
"build:photos:browser": "npm run internal:build -- --env.app=photos --env.target=browser --env.production", | ||
"clean:browser": "rm -rf build/*", | ||
"clean:drive:browser": "rm -rf build/drive/*", | ||
"clean:photos:browser": "rm -rf build/photos/*", | ||
"clean:mobile": "rm -rf targets/*/mobile/www/*", | ||
"deploy:drive": | ||
"git-directory-deploy --directory=build/drive/ --username=Cozy [email protected] --repo=https://[email protected]/cozy/cozy-drive.git", | ||
"deploy:photos": | ||
"git-directory-deploy --directory=build/photos/ --username=Cozy [email protected] --repo=https://[email protected]/cozy/cozy-drive.git", | ||
"deploy:drive": "git-directory-deploy --directory=build/drive/ --username=Cozy [email protected] --repo=https://[email protected]/cozy/cozy-drive.git", | ||
"deploy:photos": "git-directory-deploy --directory=build/photos/ --username=Cozy [email protected] --repo=https://[email protected]/cozy/cozy-drive.git", | ||
"internal:build": "webpack --config webpack.config.js --bail", | ||
"internal:watch": | ||
"webpack --config webpack.config.js --watch --display-modules --display-chunks", | ||
"internal:watch": "webpack --config webpack.config.js --watch --display-modules --display-chunks", | ||
"tx": "tx pull --all || true", | ||
"preinternal:build": "npm-run-all lint tx", | ||
"prebuild:drive:browser": "npm run clean:drive:browser", | ||
|
@@ -37,32 +31,21 @@ | |
"precommit": "lint-staged", | ||
"test": "node_modules/.bin/jest --coverage --config=jest.config.json", | ||
"watch:drive": "npm run watch:drive:browser", | ||
"watch:drive:browser": | ||
"npm run internal:watch -- --env.app=drive --env.target=browser", | ||
"watch:drive:mobile": | ||
"npm run internal:watch -- --env.app=drive --env.target=mobile", | ||
"watch:drive:standalone": | ||
"webpack-dev-server --config webpack.config.js --env.app=drive --env.target=mobile --port 8084 --display-modules --display-chunks --inline --hot", | ||
"watch:drive:browser": "npm run internal:watch -- --env.app=drive --env.target=browser", | ||
"watch:drive:mobile": "npm run internal:watch -- --env.app=drive --env.target=mobile", | ||
"watch:drive:standalone": "webpack-dev-server --config webpack.config.js --env.app=drive --env.target=mobile --port 8084 --display-modules --display-chunks --inline --hot", | ||
"watch:photos": "npm run watch:photos:browser", | ||
"watch:photos:browser": | ||
"npm run internal:watch -- --env.app=photos --env.target=browser", | ||
"mobile:drive:icon": | ||
"(cd targets/drive/mobile && splashicon-generator --imagespath='./res/model')", | ||
"watch:photos:browser": "npm run internal:watch -- --env.app=photos --env.target=browser", | ||
"mobile:drive:icon": "(cd targets/drive/mobile && splashicon-generator --imagespath='./res/model')", | ||
"mobile:drive:prepare": "(cd targets/drive/mobile && cordova prepare)", | ||
"android:drive:run": | ||
"(cd targets/drive/mobile && cordova run android --device)", | ||
"android:drive:run:emulator": | ||
"(cd targets/drive/mobile && cordova run android --emulator)", | ||
"android:drive:release": | ||
"npm run build:drive:mobile && (cd targets/drive/mobile && cordova build android --release)", | ||
"android:drive:signed": | ||
"npm run android:drive:release && (cd targets/drive/mobile && apksigner sign --ks keys/android/cozy-drive-release-key.jks --out build/android/cozy-drive.apk platforms/android/build/outputs/apk/android-release-unsigned.apk)", | ||
"android:drive:run": "(cd targets/drive/mobile && cordova run android --device)", | ||
"android:drive:run:emulator": "(cd targets/drive/mobile && cordova run android --emulator)", | ||
"android:drive:release": "npm run build:drive:mobile && (cd targets/drive/mobile && cordova build android --release)", | ||
"android:drive:signed": "npm run android:drive:release && (cd targets/drive/mobile && apksigner sign --ks keys/android/cozy-drive-release-key.jks --out build/android/cozy-drive.apk platforms/android/build/outputs/apk/android-release-unsigned.apk)", | ||
"android:drive:publish": "(cd targets/drive/mobile && fastlane supply)", | ||
"ios:drive:run": "(cd targets/drive/mobile && cordova run ios --device)", | ||
"ios:drive:run:emulator": | ||
"(cd targets/drive/mobile && cordova run ios --emulator)", | ||
"ios:drive:publish": | ||
"npm run build:drive:mobile && (cd targets/drive/mobile && fastlane ios pushtest)" | ||
"ios:drive:run:emulator": "(cd targets/drive/mobile && cordova run ios --emulator)", | ||
"ios:drive:publish": "npm run build:drive:mobile && (cd targets/drive/mobile && fastlane ios pushtest)" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -90,7 +73,7 @@ | |
"autoprefixer": "^6.5.0", | ||
"babel-core": "^6.0.0", | ||
"babel-eslint": "^8.0.0", | ||
"babel-jest": "^18.0.0", | ||
"babel-jest": "^21.2.0", | ||
"babel-loader": "^6.0.0", | ||
"babel-plugin-transform-class-properties": "^6.23.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.22.0", | ||
|
@@ -124,7 +107,7 @@ | |
"husky": "^0.14.3", | ||
"identity-obj-proxy": "^3.0.0", | ||
"imports-loader": "^0.7.0", | ||
"jest": "^20.0.4", | ||
"jest": "^21.2.1", | ||
"json-loader": "^0.5.0", | ||
"lint-staged": "^4.2.1", | ||
"npm-run-all": "^3.1.0", | ||
|
@@ -181,12 +164,19 @@ | |
"redux-thunk": "^2.1.0" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": ["js", "jsx", "json", "styl"], | ||
"moduleFileExtensions": [ | ||
"js", | ||
"jsx", | ||
"json", | ||
"styl" | ||
], | ||
"moduleNameMapper": { | ||
"\\.(png|gif|jpe?g|svg)$": "<rootDir>/test/__mocks__/fileMock.js", | ||
"styles": "identity-obj-proxy" | ||
}, | ||
"transformIgnorePatterns": ["node_modules/(?!cozy-ui)"], | ||
"transformIgnorePatterns": [ | ||
"node_modules/(?!cozy-ui)" | ||
], | ||
"globals": { | ||
"__ALLOW_HTTP__": false, | ||
"__TARGET__": "browser", | ||
|
@@ -204,7 +194,11 @@ | |
"prettier/react", | ||
"prettier/standard" | ||
], | ||
"plugins": ["react", "prettier", "standard"], | ||
"plugins": [ | ||
"react", | ||
"prettier", | ||
"standard" | ||
], | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
|
@@ -231,6 +225,9 @@ | |
"singleQuote": true | ||
}, | ||
"lint-staged": { | ||
"{src,test}/**/*.{js,jsx}": ["prettier --write", "git add"] | ||
"{src,test}/**/*.{js,jsx}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
} | ||
} |
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
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
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
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
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,3 @@ | ||
var PouchDB = jest.genMockFunction() | ||
|
||
module.exports = PouchDB |
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
Oops, something went wrong.