Skip to content

Commit b5cc038

Browse files
committed
Eslint github actions node module caching
1 parent fbce800 commit b5cc038

File tree

10 files changed

+43
-14
lines changed

10 files changed

+43
-14
lines changed

.DS_Store

-10 KB
Binary file not shown.

.github/.DS_Store

-6 KB
Binary file not shown.

.github/workflows/.DS_Store

-6 KB
Binary file not shown.

.github/workflows/example-lint-check.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- 'master'
77

8+
defaults:
9+
run:
10+
working-directory: example
11+
812
jobs:
913
eslint:
1014
name: Run lint check
@@ -19,8 +23,15 @@ jobs:
1923
with:
2024
node-version: 14
2125

22-
- name: Install Node.js dependencies
23-
working-directory: example
26+
- name: Cache node modules
27+
uses: actions/cache@v3
28+
id: npmcache
29+
with:
30+
path: example/node_modules
31+
key: node-modules-${{ hashFiles('**/yarn.lock') }}
32+
33+
- name: Install example dependencies
34+
if: steps.npmcache.outputs.cache-hit != 'true'
2435
run: yarn install
2536

2637
- name: Lint check

.github/workflows/lib-lint-check.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- 'master'
77

8+
defaults:
9+
run:
10+
working-directory: lib
11+
812
jobs:
913
eslint:
1014
name: Run lint check
@@ -19,8 +23,15 @@ jobs:
1923
with:
2024
node-version: 14
2125

22-
- name: Install Node.js dependencies
23-
working-directory: lib
26+
- name: Cache node modules
27+
uses: actions/cache@v3
28+
id: npmcache
29+
with:
30+
path: lib/node_modules
31+
key: node-modules-${{ hashFiles('**/yarn.lock') }}
32+
33+
- name: Install lib dependencies
34+
if: steps.npmcache.outputs.cache-hit != 'true'
2435
run: yarn install
2536

2637
- name: Lint check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea/
2+
**/.DS_Store

example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ buck-out/
5959
# Ruby / CocoaPods
6060
/ios/Pods/
6161
/vendor/bundle/
62+
63+
.watchman*

example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"babel-jest": "^26.6.3",
4646
"detox": "^19.7.1",
4747
"eslint": "^8.17.0",
48+
"eslint-config-prettier": "^8.5.0",
49+
"prettier": "^2.6.2",
4850
"jest": "^26.6.3",
4951
"jest-circus": "^26.6.3",
5052
"metro-react-native-babel-preset": "^0.67.0",

example/yarn.lock

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@
13261326
dependencies:
13271327
"@sinonjs/commons" "^1.7.0"
13281328

1329-
"@synonymdev/react-native-ldk@../":
1329+
"@synonymdev/react-native-ldk@../lib":
13301330
version "0.0.43"
13311331

13321332
"@tootallnate/once@1":
@@ -3116,7 +3116,7 @@ escodegen@^2.0.0:
31163116
optionalDependencies:
31173117
source-map "~0.6.1"
31183118

3119-
eslint-config-prettier@^8.3.0:
3119+
eslint-config-prettier@^8.3.0, eslint-config-prettier@^8.5.0:
31203120
version "8.5.0"
31213121
resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz"
31223122
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
@@ -6211,6 +6211,11 @@ prettier-linter-helpers@^1.0.0:
62116211
dependencies:
62126212
fast-diff "^1.1.2"
62136213

6214+
prettier@^2.6.2:
6215+
version "2.7.1"
6216+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
6217+
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
6218+
62146219
pretty-format@^26.5.2, pretty-format@^26.6.2:
62156220
version "26.6.2"
62166221
resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz"

lib/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@synonymdev/react-native-ldk",
33
"title": "React Native LDK",
4-
"version": "0.0.43",
4+
"version": "0.0.44",
55
"description": "React Native wrapper for LDK",
66
"main": "./dist/index.js",
77
"types": "./dist/index.d.ts",
@@ -24,9 +24,9 @@
2424
"lint:check": "eslint . --ext .js,.jsx,.ts,.tsx",
2525
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx",
2626
"prepublish": "yarn lint:fix && yarn run build && npm --no-git-tag-version version patch",
27-
"dev:save-ios-updates": "cp example/node_modules/@synonymdev/react-native-ldk/ios/*.{m,swift,h} ./ios && cp example/node_modules/@synonymdev/react-native-ldk/ios/Classes/*.swift ./ios/Classes/",
28-
"dev:save-android-updates": "cp example/node_modules/@synonymdev/react-native-ldk/android/src/main/java/com/reactnativeldk/*.kt ./android/src/main/java/com/reactnativeldk/ && cp example/node_modules/@synonymdev/react-native-ldk/android/src/main/java/com/reactnativeldk/classes/*.kt ./android/src/main/java/com/reactnativeldk/classes/ && cp example/node_modules/@synonymdev/react-native-ldk/android/build.gradle ./android/",
29-
"dev:update-example-dist": "yarn build && cp -R dist example/node_modules/@synonymdev/react-native-ldk",
27+
"dev:save-ios-updates": "cp ../example/node_modules/@synonymdev/react-native-ldk/ios/*.{m,swift,h} ./ios && cp ../example/node_modules/@synonymdev/react-native-ldk/ios/Classes/*.swift ./ios/Classes/",
28+
"dev:save-android-updates": "cp ../example/node_modules/@synonymdev/react-native-ldk/android/src/main/java/com/reactnativeldk/*.kt ./android/src/main/java/com/reactnativeldk/ && cp ../example/node_modules/@synonymdev/react-native-ldk/android/src/main/java/com/reactnativeldk/classes/*.kt ./android/src/main/java/com/reactnativeldk/classes/ && cp ../example/node_modules/@synonymdev/react-native-ldk/android/build.gradle ./android/",
29+
"dev:update-example-dist": "yarn build && cp -R dist ../example/node_modules/@synonymdev/react-native-ldk",
3030
"dev:example": "yarn dev:save-ios-updates && yarn dev:save-android-updates && yarn dev:update-example-dist"
3131
},
3232
"repository": {
@@ -64,8 +64,5 @@
6464
"bugs": {
6565
"url": "https://github.com/synonymdev/react-native-ldk/issues"
6666
},
67-
"homepage": "https://github.com/synonymdev/react-native-ldk#readme",
68-
"directories": {
69-
"example": "example"
70-
}
67+
"homepage": "https://github.com/synonymdev/react-native-ldk#readme"
7168
}

0 commit comments

Comments
 (0)