Skip to content

Commit 3a870b8

Browse files
authored
chore: Merge PR #56 from feat/with-clerk-auth
2 parents a2edf7e + 6040f00 commit 3a870b8

File tree

143 files changed

+3482
-441
lines changed

Some content is hidden

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

143 files changed

+3482
-441
lines changed

.github/workflows/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Automatic deployments with Github Actions
22

3-
We generally advise that you take full use of either [Vercel](vercel.com) or [Netlify](netlify.com) for automatic web deployments. These are quite good and easy to set-up / link to your repo in their UI.
3+
We generally advise that you take full use of [Vercel](vercel.com) and [Expo](expo.dev) for automatic deployments. These are quite good and easy to set-up and link to your repo in their UI.
44

55
On top of this though, you can also enable automatic deployments through Github Actions to:
6-
- [Chromatic](https://www.chromatic.com/) (deploys your storybook)
7-
- [Expo](https://github.com/expo/expo-github-action) (runs `eas update` whenever a branch updates)
6+
- Deploy your storybook docs with [Chromatic](https://www.chromatic.com/)
7+
- Deploy your feature branches for testing with [Expo](https://github.com/expo/expo-github-action) (runs `eas update` whenever a branch updates)
88

99
Heads up though, as this will require setting up some secrets in your repository.
1010

11-
> We recommend doppler for managing and syncing secrets or env vars between services. You can find more information on how to set this up at [the doppler docs](https://docs.doppler.com/docs/github-actions).
11+
> We recommend [doppler](doppler.com) for managing and syncing secrets or env vars between services. You can find more information on how to set this up at [the doppler docs](https://docs.doppler.com/docs/github-actions).
1212
1313
## Publishing with EAS update
1414

15-
A basic workflow for publishing with EAS update is already added to your project. You can find it in `.github/workflows/eas.yml`.
15+
A basic workflow for publishing with EAS update is already added to your project when forking the repo. You can find it in `.github/workflows/eas.yml`.
1616

17-
However, it will only run when you add an `EXPO_ACCESS_TOKEN` secret to your repository. You can do this in the repository settings, but before you do that, you'll need to generate this token.
17+
However, it will only run when you add an `EXPO_ACCESS_TOKEN` secret to your repository. You can do this in the repository settings, but before you do that, you'll need to generate this token in their UI.
1818

1919
### Creating an Expo project and generating an access token
2020

.github/workflows/eas.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ jobs:
5858
env:
5959
ENV: staging
6060
BACKEND_URL: ${{ secrets.BACKEND_URL }}
61-
NEXT_PUBLIC_APP_LINKS: ${{ secrets.NEXT_PUBLIC_APP_LINKS }}
61+
NEXT_PUBLIC_APP_LINKS: ${{ secrets.NEXT_PUBLIC_APP_LINKS }}
62+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// -i- Mocked to avoid using @clerk/nextjs in Storybook
2+
import React from 'react'
3+
import { useMemo } from 'react'
4+
import { action } from '@storybook/addon-actions'
5+
6+
/* --- useAuth() ------------------------------------------------------------------------------- */
7+
8+
export const useAuth = () => ({
9+
isSignedIn: false,
10+
session: null,
11+
user: null,
12+
signUp: {
13+
isLoaded: true,
14+
create: async () => {},
15+
prepareEmailAddressVerification: async () => {},
16+
},
17+
signIn: {
18+
isLoaded: true,
19+
create: async () => {},
20+
},
21+
signOut: {
22+
isLoaded: true,
23+
create: async () => {},
24+
},
25+
setActive: async () => {},
26+
getActive: async () => {},
27+
})
28+
29+
/* --- useClerk() ------------------------------------------------------------------------------ */
30+
31+
export const useClerk = () => ({
32+
isLoaded: true,
33+
isSignedIn: false,
34+
session: null,
35+
user: null,
36+
signUp: {
37+
isLoaded: true,
38+
create: async () => {},
39+
prepareEmailAddressVerification: async () => {},
40+
},
41+
signIn: {
42+
isLoaded: true,
43+
create: async () => {},
44+
},
45+
signOut: {
46+
isLoaded: true,
47+
create: async () => {},
48+
},
49+
setActive: async () => {},
50+
getActive: async () => {},
51+
})
52+
53+
/* --- useOrganisation() ----------------------------------------------------------------------- */
54+
55+
export const useOrganisation = () => ({
56+
isLoaded: true,
57+
organisation: null,
58+
setOrganisation: async () => {},
59+
getOrganisation: async () => {},
60+
})
61+
62+
/* --- useOrganisationList() ------------------------------------------------------------------- */
63+
64+
export const useOrganisationList = () => ({
65+
isLoaded: true,
66+
organisationList: [],
67+
setOrganisationList: async () => {},
68+
getOrganisationList: async () => {},
69+
})
70+
71+
/* --- useSession() ----------------------------------------------------------------------------- */
72+
73+
export const useSession = () => ({
74+
isLoaded: true,
75+
isSignedIn: false,
76+
session: null,
77+
user: null,
78+
signUp: {
79+
isLoaded: true,
80+
create: async () => {},
81+
prepareEmailAddressVerification: async () => {},
82+
},
83+
signIn: {
84+
isLoaded: true,
85+
create: async () => {},
86+
},
87+
signOut: {
88+
isLoaded: true,
89+
create: async () => {},
90+
},
91+
setActive: async () => {},
92+
getActive: async () => {},
93+
})
94+
95+
/* --- useSignIn() ------------------------------------------------------------------------------ */
96+
97+
export const useSignIn = () => ({
98+
isLoaded: true,
99+
signIn: {
100+
isLoaded: true,
101+
create: async () => {},
102+
},
103+
})
104+
105+
/* --- useSignUp() ------------------------------------------------------------------------------ */
106+
107+
export const useSignUp = () => ({
108+
isLoaded: true,
109+
signUp: {
110+
isLoaded: true,
111+
create: async () => {},
112+
prepareEmailAddressVerification: async () => {},
113+
},
114+
})
115+
116+
/* --- useUser() ------------------------------------------------------------------------------- */
117+
118+
export const useUser = () => ({
119+
isLoaded: true,
120+
user: null,
121+
setUser: async () => {},
122+
getUser: async () => {},
123+
})
124+
125+
/* --- useWarmUpBrowser() ---------------------------------------------------------------------- */
126+
127+
export const useWarmUpBrowser = () => {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '../../../../packages/@aetherspace-clerk-auth/schemas'

.storybook/__mocks__/aetherspaceNavigation.tsx renamed to .storybook/__mocks__/aetherspace/navigation/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import React from 'react'
33
import { useMemo } from 'react'
44
import { action } from '@storybook/addon-actions'
55
import { create as createTailwindWithConfig } from 'twrnc'
6-
import { AetherText, AetherView } from '../../packages/@aetherspace/primitives'
7-
import { useAetherRoute } from '../../packages/@aetherspace/navigation/useAetherRoute'
8-
import { fetchAetherProps } from '../../packages/@aetherspace/navigation/fetchAetherProps'
9-
import { getEnvVar } from '../../packages/@aetherspace/utils'
10-
import tailwindConfig from '../../features/app-core/tailwind.config'
6+
import { AetherText, AetherView } from '../../../../packages/@aetherspace/primitives'
7+
import { useAetherRouteData } from '../../../../packages/@aetherspace/navigation/useAetherRouteData'
8+
import { fetchAetherProps } from '../../../../packages/@aetherspace/navigation/fetchAetherProps'
9+
import { getEnvVar } from '../../../../packages/@aetherspace/utils'
10+
import tailwindConfig from '../../../../features/app-core/tailwind.config'
1111

1212
/* --- Styles ---------------------------------------------------------------------------------- */
1313

@@ -86,5 +86,5 @@ export const AetherLink = (props) => {
8686

8787
/* --- Exports --------------------------------------------------------------------------------- */
8888

89-
export { useAetherRoute, fetchAetherProps }
89+
export { useAetherRouteData, fetchAetherProps }
9090
export const Link = AetherLink

.storybook/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ module.exports = {
5555
config.resolve.alias['react-native$'] = require.resolve('react-native-web')
5656
// Other aliases for web support (https://github.com/expo/expo/issues/21469#issuecomment-1576001543)
5757
config.resolve.alias['expo-asset'] = 'expo-asset-web'
58-
config.resolve.alias['aetherspace/navigation'] = require.resolve('./__mocks__/aetherspaceNavigation.tsx')
58+
config.resolve.alias['aetherspace/navigation'] = require.resolve('./__mocks__/aetherspace/navigation/index.tsx')
59+
config.resolve.alias['@aetherspace/clerk-auth/schemas'] = require.resolve('./__mocks__/@aetherspace-clerk-auth/schemas/index.ts')
60+
config.resolve.alias['@aetherspace/clerk-auth/hooks'] = require.resolve('./__mocks__/@aetherspace-clerk-auth/hooks/index.tsx')
5961
config.resolve.extensions.push('.ts', '.tsx')
6062
config.resolve.fallback = {
6163
...config.resolve.fallback,
@@ -64,6 +66,7 @@ module.exports = {
6466
zlib: false,
6567
http: false,
6668
stream: false,
69+
fs: false
6770
}
6871
// Compatibility
6972
config.optimization = {

.storybook/plugins/README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1+
<img src="/packages/@aetherspace/assets/AetherspaceLogo.svg" width="50" height="50" />
2+
13
# Aetherspace Plugin Branches
24

3-
While you can use any package you want in your Aetherspace monorepo, we've created a few plugin branches to make your life easier.
5+
While you can use any package you want in your Aetherspace monorepo, we've created a few merge ready plugin branches to make the starterkit even more plug & play using git.
6+
7+
Some example use cases:
8+
- Need to provide cross-platform authentication? (e.g. using Clerk) -> `git merge with/clerk-auth`
9+
- Need to convert .svg files into cross-platform Icon components, or use known ones? -> `git merge with/green-stack-icons`
10+
- Need utils to turn your single sources of truth into DB models? (e.g. for Mongoose? -> `git merge with/mongoose`)
11+
12+
Plugins are branches that you can merge (or copy) into your repo, and they'll usually add tools for aetherspace specific ways of working:
13+
- `schemas/` - single sources of truth for the package / solution / plugin (e.g. Clerk auth, Mongoose, ...) and typescript types
14+
- `routes/` - example pages and API routes to integrate the selected solution into your app
15+
- `scripts/` - scripts to generate code from your schemas or assets (e.g. CRUD resolver generators for your DB models)
416

5-
Some example use cases of merging in these plugin branches from the starter repo:
6-
- Scripts to generate code from your schemas or assets (like converting .svg `with/green-stack-icons`)
7-
- Utils to turn your schemas into models for your database (like on the `with/mongoose` branch)
8-
- Extra helpers to make your life easier or integrate better with third party tools
17+
... as well as `components/`, `hooks/`, `screens/`, `styles/`, `utils/` and more to optimize integrations through:
18+
- ✅ Optimizing for cross-platform (Expo + Next.js) development
19+
- ✅ Integrating with your [Single sources of truth](/packages/@aetherspace/schemas/README.md)
20+
- ✅ Adding code generators to skip manual boilerplate
921

1022
---
11-
> 💚 To use plugin branches, you do need [access to the official green-stack-starter](https://github.com/sponsors/codinsonn).
23+
> **💚 To use plugin branches, you do need [access to the official green-stack-starter](https://github.com/sponsors/codinsonn):**
1224
---
1325

26+
![GithubTemplateRepo.png](/.storybook/public/GithubTemplateRepo.png)
27+
28+
![GithubTemplateRepoWithPlugins.png](/.storybook/public/GithubTemplateRepoWithPlugins.png)
29+
1430
While generating your repo from there, you can choose to "✅ include all branches".
1531
Or, if you've already generated your repo, you can merge in the branches manually.
1632

450 KB
Loading
323 KB
Loading

0 commit comments

Comments
 (0)