Skip to content

Commit

Permalink
fix: security alerts / package updates 20200505 (#773)
Browse files Browse the repository at this point in the history
* chore: fix security alerts

rm -f yarn.lock && yarn

* chore(lint): dangling comma in JSON file

* chore(lint): workaround react-native import/export issue

Required by facebook/react-native#28549

* chore(types): new flow-bin pointed out usage did not match types

usage is how it was actually working, types should conform to usage

* chore(whitespace): commit results of new prettier major version

they have changed some of their defaults

* chore: `yarn upgrade --latest` except flow-bin pinned to match react-native
  • Loading branch information
mobiledev7 committed May 5, 2020
1 parent 49248d7 commit d385f3b
Show file tree
Hide file tree
Showing 5 changed files with 1,960 additions and 2,461 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"browser": true,
"node": true,
"jest": true,
"es6": true,
"es6": true
},
"plugins": [
"react",
Expand All @@ -27,6 +27,7 @@

],
"settings": {
"import/ignore": ["react-native"],
"import/resolver": {
"node": {
"extensions":[
Expand Down
13 changes: 7 additions & 6 deletions changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@ const argv = require('minimist')(process.argv.slice(1));
git().tags((err, tags) => {
const currentChangelog = fs.readFileSync('./CHANGELOG.md');
const matched = tags.latest.match(/v\d+.\d+.\d+-(\d+)/);
const build = (idx(matched, _ => Number(_[1])) || 0) + 1;
const build = (idx(matched, (_) => Number(_[1])) || 0) + 1;

generate_changelog
.generate({
major: argv.major,
minor: argv.minor,
patch: argv.patch,
})
.then(function(changelog) {
.then(function (changelog) {
const rxVersion = /\d+\.\d+\.\d+/;
const newVersion = argv.version || idx(changelog.match(rxVersion), _ => _[0]) + `-${build}`;
const newVersion = argv.version || idx(changelog.match(rxVersion), (_) => _[0]) + `-${build}`;

changelog = changelog.replace(rxVersion, newVersion) + currentChangelog;
fs.writeFileSync('./CHANGELOG.md', changelog);

const addFile = c => git().add('CHANGELOG.md', c);
const commit = c => git().commit(`build(change-log): v${newVersion}`, c);
const addTag = c => git().addAnnotatedTag(`v${newVersion}`, `build(tag): v${newVersion}`, c);
const addFile = (c) => git().add('CHANGELOG.md', c);
const commit = (c) => git().commit(`build(change-log): v${newVersion}`, c);
const addTag = (c) =>
git().addAnnotatedTag(`v${newVersion}`, `build(tag): v${newVersion}`, c);

addFile(() => commit(() => addTag()));
});
Expand Down
24 changes: 14 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ class ShareSheet extends React.Component<Props> {
}

type Options = {
url: string,
url?: string,
urls?: Array<string>,
filename?: string,
filenames?: Array<string>,
type?: string,
message?: string,
title?: string,
Expand All @@ -97,6 +99,8 @@ type Options = {
type MultipleOptions = {
url?: string,
urls?: Array<string>,
filename?: string,
filenames?: Array<string>,
type?: string,
message?: string,
title?: string,
Expand Down Expand Up @@ -156,14 +160,14 @@ const requireAndAskPermissions = async (options: Options | MultipleOptions): Pro
try {
const resultArr = await Promise.all(
urls.map(
url =>
(url) =>
new Promise((res, rej) => {
NativeModules.RNShare.isBase64File(
url,
e => {
(e) => {
rej(e);
},
isBase64 => {
(isBase64) => {
res(isBase64);
},
);
Expand Down Expand Up @@ -247,7 +251,7 @@ class RNShare {

NativeModules.RNShare.open(
options,
e => {
(e) => {
return reject({ error: e });
},
(success, activityType) => {
Expand All @@ -266,7 +270,7 @@ class RNShare {
},
);
})
.catch(e => reject(e));
.catch((e) => reject(e));
});
}

Expand All @@ -277,7 +281,7 @@ class RNShare {
.then(() => {
NativeModules.RNShare.shareSingle(
options,
e => {
(e) => {
return reject({ error: e });
},
(e, activityType) => {
Expand All @@ -288,7 +292,7 @@ class RNShare {
},
);
})
.catch(e => reject(e));
.catch((e) => reject(e));
});
} else {
throw new Error('Not implemented');
Expand All @@ -300,10 +304,10 @@ class RNShare {
return new Promise((resolve, reject) => {
NativeModules.RNShare.isPackageInstalled(
packageName,
e => {
(e) => {
return reject({ error: e });
},
isInstalled => {
(isInstalled) => {
return resolve({
isInstalled: isInstalled,
message: 'Package is Installed',
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@
"devDependencies": {
"@babel/core": "^7.7.7",
"@babel/runtime": "^7.7.7",
"@commitlint/cli": "8.1.0",
"@commitlint/config-conventional": "8.1.0",
"@react-native-community/eslint-config": "^0.0.6",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@react-native-community/eslint-config": "^1.1.0",
"@react-native-community/eslint-plugin": "^1.0.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.4",
"@semantic-release/npm": "^7.0.4",
"@semantic-release/release-notes-generator": "^9.0.1",
"babel-eslint": "10.0.2",
"babel-eslint": "10.1.0",
"eslint": "^6.8.0",
"eslint-plugin-flowtype": "4.2.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.14.3",
"eslint-plugin-react-native": "3.7.0",
"flow-bin": "^0.105.2",
"eslint-plugin-flowtype": "4.7.0",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-prettier": "3.1.3",
"eslint-plugin-react": "7.19.0",
"eslint-plugin-react-native": "3.8.1",
"flow-bin": "^0.113",
"generate-changelog": "1.8.0",
"husky": "3.0.3",
"husky": "4.2.5",
"idx": "2.5.6",
"lint-staged": "9.2.1",
"metro-react-native-babel-preset": "^0.56.4",
"minimist": "1.2.3",
"lint-staged": "10.2.2",
"metro-react-native-babel-preset": "^0.59.0",
"minimist": "1.2.5",
"pre-commit": "1.2.2",
"prettier": "^1.18.2",
"react": "16.9.0",
"react-native": "0.61.5",
"prettier": "^2.0.5",
"react": "16.13.1",
"react-native": "0.62.2",
"semantic-release": "^17.0.4",
"simple-git": "1.124.0"
"simple-git": "2.4.0"
},
"keywords": [
"react-native",
Expand Down
Loading

0 comments on commit d385f3b

Please sign in to comment.