Skip to content

Commit cc65c7a

Browse files
Merge pull request #95 from web-ridge/new-architecture
New architecture
2 parents 67bc4d2 + e77efb7 commit cc65c7a

File tree

1,504 files changed

+16905
-23035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,504 files changed

+16905
-23035
lines changed

.github/actions/setup/action.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,28 @@ runs:
99
with:
1010
node-version-file: .nvmrc
1111

12-
- name: Cache dependencies
12+
- name: Restore dependencies
1313
id: yarn-cache
14-
uses: actions/cache@v3
14+
uses: actions/cache/restore@v4
1515
with:
1616
path: |
1717
**/node_modules
18-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
18+
.yarn/install-state.gz
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
1920
restore-keys: |
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
2022
${{ runner.os }}-yarn-
2123
2224
- name: Install dependencies
2325
if: steps.yarn-cache.outputs.cache-hit != 'true'
24-
run: |
25-
yarn install --cwd example --frozen-lockfile
26-
yarn install --frozen-lockfile
26+
run: yarn install --immutable
2727
shell: bash
28+
29+
- name: Cache dependencies
30+
if: steps.yarn-cache.outputs.cache-hit != 'true'
31+
uses: actions/cache/save@v4
32+
with:
33+
path: |
34+
**/node_modules
35+
.yarn/install-state.gz
36+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ jobs:
2323
- name: Typecheck files
2424
run: yarn typecheck
2525

26-
test:
27-
runs-on: ubuntu-latest
28-
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v3
31-
32-
- name: Setup
33-
uses: ./.github/actions/setup
34-
35-
- name: Run unit tests
36-
run: yarn test --maxWorkers=2 --coverage
26+
# test:
27+
# runs-on: ubuntu-latest
28+
# steps:
29+
# - name: Checkout
30+
# uses: actions/checkout@v3
31+
#
32+
# - name: Setup
33+
# uses: ./.github/actions/setup
34+
#
35+
# - name: Run unit tests
36+
# run: yarn test --maxWorkers=2 --coverage
3737

3838
build:
3939
runs-on: ubuntu-latest
@@ -45,7 +45,7 @@ jobs:
4545
uses: ./.github/actions/setup
4646

4747
- name: Build package
48-
run: yarn prepack
48+
run: yarn prepare
4949
release:
5050
runs-on: ubuntu-latest
5151
if: github.ref == 'refs/heads/main'

.gitignore

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# OSX
22
#
33
.DS_Store
4-
coverage
4+
55
# XDE
66
.expo/
7-
example/ios
8-
example/android
97

108
# VSCode
119
.vscode/
@@ -62,10 +60,23 @@ buck-out/
6260
android/app/libs
6361
android/keystores/debug.keystore
6462

63+
# Yarn
64+
.yarn/plugins
65+
!.yarn/patches
66+
!.yarn/plugins
67+
!.yarn/releases
68+
!.yarn/sdks
69+
!.yarn/versions
70+
6571
# Expo
66-
.expo/*
72+
.expo/
73+
74+
# Turborepo
75+
.turbo/
6776

6877
# generated by bob
6978
lib/
70-
.env
71-
example/web-build/*
79+
80+
# React Native Codegen
81+
ios/generated
82+
android/generated

.husky/commit-msg

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,57 @@
11
#!/bin/sh
22

3-
if [ "$LEFTHOOK" = "0" ]; then
4-
exit 0
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
55
fi
66

7-
if [ -t 1 ] ; then
8-
exec < /dev/tty ; # <- enables interactive shell
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
99
fi
1010

11-
dir="$(git rev-parse --show-toplevel)"
12-
1311
call_lefthook()
1412
{
15-
if lefthook -h >/dev/null 2>&1
13+
if test -n "$LEFTHOOK_BIN"
1614
then
17-
eval lefthook $@
18-
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook"
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook -h >/dev/null 2>&1
1917
then
20-
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@"
21-
elif bundle exec lefthook -h >/dev/null 2>&1
22-
then
23-
bundle exec lefthook $@
24-
elif npx @arkweid/lefthook -h >/dev/null 2>&1
25-
then
26-
npx @arkweid/lefthook $@
27-
elif yarn lefthook -h >/dev/null 2>&1
28-
then
29-
yarn lefthook $@
18+
lefthook "$@"
3019
else
31-
echo "Can't find lefthook in PATH"
20+
dir="$(git rev-parse --show-toplevel)"
21+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
22+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
23+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
24+
then
25+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
26+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
27+
then
28+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
32+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
33+
then
34+
"$dir/node_modules/lefthook/bin/index.js" "$@"
35+
36+
elif bundle exec lefthook -h >/dev/null 2>&1
37+
then
38+
bundle exec lefthook "$@"
39+
elif yarn lefthook -h >/dev/null 2>&1
40+
then
41+
yarn lefthook "$@"
42+
elif pnpm lefthook -h >/dev/null 2>&1
43+
then
44+
pnpm lefthook "$@"
45+
elif swift package plugin lefthook >/dev/null 2>&1
46+
then
47+
swift package --disable-sandbox plugin lefthook "$@"
48+
elif command -v mint >/dev/null 2>&1
49+
then
50+
mint run csjones/lefthook-plugin "$@"
51+
else
52+
echo "Can't find lefthook in PATH"
53+
fi
3254
fi
3355
}
3456

35-
36-
37-
call_lefthook "run commit-msg $@"
57+
call_lefthook run "commit-msg" "$@"

.husky/pre-commit

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,57 @@
11
#!/bin/sh
22

3-
if [ "$LEFTHOOK" = "0" ]; then
4-
exit 0
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
55
fi
66

7-
if [ -t 1 ] ; then
8-
exec < /dev/tty ; # <- enables interactive shell
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
99
fi
1010

11-
dir="$(git rev-parse --show-toplevel)"
12-
1311
call_lefthook()
1412
{
15-
if lefthook -h >/dev/null 2>&1
13+
if test -n "$LEFTHOOK_BIN"
1614
then
17-
eval lefthook $@
18-
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook"
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook -h >/dev/null 2>&1
1917
then
20-
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@"
21-
elif bundle exec lefthook -h >/dev/null 2>&1
22-
then
23-
bundle exec lefthook $@
24-
elif npx @arkweid/lefthook -h >/dev/null 2>&1
25-
then
26-
npx @arkweid/lefthook $@
27-
elif yarn lefthook -h >/dev/null 2>&1
28-
then
29-
yarn lefthook $@
18+
lefthook "$@"
3019
else
31-
echo "Can't find lefthook in PATH"
20+
dir="$(git rev-parse --show-toplevel)"
21+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
22+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
23+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
24+
then
25+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
26+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
27+
then
28+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
32+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
33+
then
34+
"$dir/node_modules/lefthook/bin/index.js" "$@"
35+
36+
elif bundle exec lefthook -h >/dev/null 2>&1
37+
then
38+
bundle exec lefthook "$@"
39+
elif yarn lefthook -h >/dev/null 2>&1
40+
then
41+
yarn lefthook "$@"
42+
elif pnpm lefthook -h >/dev/null 2>&1
43+
then
44+
pnpm lefthook "$@"
45+
elif swift package plugin lefthook >/dev/null 2>&1
46+
then
47+
swift package --disable-sandbox plugin lefthook "$@"
48+
elif command -v mint >/dev/null 2>&1
49+
then
50+
mint run csjones/lefthook-plugin "$@"
51+
else
52+
echo "Can't find lefthook in PATH"
53+
fi
3254
fi
3355
}
3456

35-
36-
37-
call_lefthook "run pre-commit $@"
57+
call_lefthook run "pre-commit" "$@"

.husky/prepare-commit-msg

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,57 @@
11
#!/bin/sh
22

3-
if [ "$LEFTHOOK" = "0" ]; then
4-
exit 0
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
55
fi
66

7-
if [ -t 1 ] ; then
8-
exec < /dev/tty ; # <- enables interactive shell
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
99
fi
1010

11-
dir="$(git rev-parse --show-toplevel)"
12-
1311
call_lefthook()
1412
{
15-
if lefthook -h >/dev/null 2>&1
13+
if test -n "$LEFTHOOK_BIN"
1614
then
17-
eval lefthook $@
18-
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook"
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook -h >/dev/null 2>&1
1917
then
20-
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@"
21-
elif bundle exec lefthook -h >/dev/null 2>&1
22-
then
23-
bundle exec lefthook $@
24-
elif npx @arkweid/lefthook -h >/dev/null 2>&1
25-
then
26-
npx @arkweid/lefthook $@
27-
elif yarn lefthook -h >/dev/null 2>&1
28-
then
29-
yarn lefthook $@
18+
lefthook "$@"
3019
else
31-
echo "Can't find lefthook in PATH"
20+
dir="$(git rev-parse --show-toplevel)"
21+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
22+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
23+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
24+
then
25+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
26+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
27+
then
28+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
32+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
33+
then
34+
"$dir/node_modules/lefthook/bin/index.js" "$@"
35+
36+
elif bundle exec lefthook -h >/dev/null 2>&1
37+
then
38+
bundle exec lefthook "$@"
39+
elif yarn lefthook -h >/dev/null 2>&1
40+
then
41+
yarn lefthook "$@"
42+
elif pnpm lefthook -h >/dev/null 2>&1
43+
then
44+
pnpm lefthook "$@"
45+
elif swift package plugin lefthook >/dev/null 2>&1
46+
then
47+
swift package --disable-sandbox plugin lefthook "$@"
48+
elif command -v mint >/dev/null 2>&1
49+
then
50+
mint run csjones/lefthook-plugin "$@"
51+
else
52+
echo "Can't find lefthook in PATH"
53+
fi
3254
fi
3355
}
3456

35-
# lefthook_version: 9df6c1f1f0b607d16db43f25a405e842
36-
37-
call_lefthook "install"
38-
39-
call_lefthook "run prepare-commit-msg $@"
57+
call_lefthook run "prepare-commit-msg" "$@"

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.18.1
1+
v18
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)