Skip to content

Commit e6e19b9

Browse files
committed
feat(docs): fix missed files in docs
1 parent dd6ba56 commit e6e19b9

File tree

4 files changed

+76
-202
lines changed

4 files changed

+76
-202
lines changed

cli/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
22
"name": "create-obytes-app",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"description": "Obytes expo starter cli",
55
"homepage": "https://github.com/obytes/react-native-template-obytes",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/obytes/react-native-template-obytes"
8+
"url": "git+https://github.com/obytes/react-native-template-obytes.git"
99
},
1010
"main": "index.js",
1111
"scripts": {
1212
"start": "node ."
1313
},
14-
"bin": "./index.js",
14+
"bin": {
15+
"create-obytes-app": "index.js"
16+
},
1517
"files": [
1618
"index.js",
17-
"utils.js"
19+
"utils.js",
20+
"clone-repo.js",
21+
"setup-project.js"
1822
],
1923
"dependencies": {
2024
"consola": "^3.2.3",

docs/src/content/docs/getting-started/project-structure.mdx

Lines changed: 46 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -11,95 +11,59 @@ import Code from '../../../components/code.astro';
1111
If you open the new project in VSCode you will see the following structure:
1212

1313
```bash title="Project Structure"
14-
.
14+
1515
├── api ## any thing related to api calls and data fetching
16-
│   ├── common ##common api files such as axios client and react query provider
17-
│   │   ├── api-provider.tsx
18-
│   │   ├── client.tsx
19-
│   │   ├── index.tsx
20-
│   │   └── utils.tsx
21-
│   ├── index.tsx
22-
│   ├── posts ## query and mutation related to post
23-
│   │   ├── index.ts
24-
│   │   ├── types.ts
25-
│   │   ├── use-add-post.ts
26-
│   │   ├── use-post.ts
27-
│   │   └── use-posts.ts
28-
│   └── types.ts
16+
│ ├── common
17+
│ ├── index.tsx
18+
│ ├── posts
19+
│ └── types.ts
2920
├── app ## app routes and layouts
30-
│   ├── (app)
31-
│   │   ├── _layout.tsx
32-
│   │   ├── index.tsx
33-
│   │   ├── settings.tsx
34-
│   │   └── style.tsx
35-
│ ├── feed
36-
│  │  ├── [id].tsx
37-
│   │   └── add_post.tsx
21+
│ ├── (app)
3822
│ ├── _layout.tsx
23+
│ ├── feed
3924
│ ├── login.tsx
40-
│ ├── onboarding.tsx
41-
├── components
42-
│   ├── settings
43-
│   │   ├── item.tsx
44-
│   │   ├── items-container.tsx
45-
│   │   ├── language-item.tsx
46-
│   │   └── theme-item.tsx
47-
│   ├── buttons.tsx
25+
│ └── onboarding.tsx
26+
├── components ## any reusable components
27+
│ ├── buttons.tsx
4828
│ ├── card.tsx
49-
│   ├── colors.tsx
50-
│   ├── cover.tsx
51-
│   ├── inputs.tsx
52-
│   ├── login-form.test.tsx
53-
│   ├── login-form.tsx
54-
│   ├── title.tsx
55-
│   └── typography.tsx
56-
├── core # core files such as auth, localization, storage and more
57-
│   ├── auth
58-
│   │   ├── index.tsx
59-
│   │   └── utils.tsx
60-
│   ├── env.js
61-
│   ├── hooks
62-
│   │   ├── index.tsx
63-
│   │   ├── use-is-first-time.tsx
64-
│   │   └── use-selected-theme.tsx
65-
│   ├── i18n
66-
│   │   ├── index.tsx
67-
│   │   ├── react-i18next.d.ts
68-
│   │   ├── resources.ts
69-
│   │   ├── types.ts
70-
│   │   └── utils.tsx
71-
│   ├── keyboard.ts
72-
│   ├── storage.tsx
73-
│   ├── test-utils.tsx
74-
│   ├── use-theme-config.tsx
75-
│   └── utils.ts
76-
├── translations # translation resources files
77-
│   ├── ar.json
78-
│   └── en.json
79-
├── types
80-
│   └── index.ts
81-
└── ui # ui components and theme configuration
82-
├── core
83-
│   ├── list
84-
│   ├── button.tsx
85-
│   ├── image.tsx
86-
│   ├── index.tsx
87-
│   ├── input.tsx
88-
│   ├── modal.tsx
89-
│   ├── progress-bar.tsx
90-
│   ├── select.tsx
91-
│   └── text.tsx
92-
├── error-handler
93-
│   ├── error-fallback.tsx
94-
│   └── index.tsx
29+
│ ├── colors.tsx
30+
│ ├── cover.tsx
31+
│ ├── inputs.tsx
32+
│ ├── login-form.test.tsx
33+
│ ├── login-form.tsx
34+
│ ├── settings
35+
│ ├── title.tsx
36+
│ └── typography.tsx
37+
├── core ## core files such as auth, localization, storage and more
38+
│ ├── auth
39+
│ ├── env.js
40+
│ ├── hooks
41+
│ ├── i18n
42+
│ ├── index.tsx
43+
│ ├── keyboard.ts
44+
│ ├── storage.tsx
45+
│ ├── test-utils.tsx
46+
│ ├── use-theme-config.tsx
47+
│ └── utils.ts
48+
├── translations ## translation resources files
49+
│ ├── ar.json
50+
│ └── en.json
51+
├── types ## global types
52+
│ └── index.ts
53+
└── ui ## core ui and theme configuration
54+
├── button.tsx
55+
├── checkbox.tsx
56+
├── colors.js
9557
├── focus-aware-status-bar.tsx
9658
├── icons
59+
├── image.tsx
9760
├── index.tsx
98-
├── screen.tsx
99-
├── theme
100-
│   ├── colors.js
101-
│   ├── constants.tsx
102-
│   └── index.ts
61+
├── input.tsx
62+
├── list.tsx
63+
├── modal.tsx
64+
├── progress-bar.tsx
65+
├── select.tsx
66+
├── text.tsx
10367
└── utils.tsx
10468
```
10569

@@ -128,44 +92,7 @@ We use absolute imports to import files using the Babel module resolver plugin a
12892

12993
Here is a simple example of how the Feed screen looks with absolute imports.
13094

131-
```tsx title="Feed Screen" {4-6}
132-
import { FlashList } from '@shopify/flash-list';
133-
import React from 'react';
134-
135-
import type { Post } from '@/api';
136-
import { usePosts } from '@/api';
137-
import { EmptyList, FocusAwareStatusBar, Text, View } from '@/ui';
138-
139-
import { Card } from '@/components/card';
140-
141-
export default function Feed() {
142-
const { data, isLoading, isError } = usePosts();
143-
const renderItem = React.useCallback(
144-
({ item }: { item: Post }) => <Card {...item} />,
145-
[]
146-
);
147-
148-
if (isError) {
149-
return (
150-
<View>
151-
<Text> Error Loading data </Text>
152-
</View>
153-
);
154-
}
155-
return (
156-
<View className="flex-1 ">
157-
<FocusAwareStatusBar />
158-
<FlashList
159-
data={data}
160-
renderItem={renderItem}
161-
keyExtractor={(_, index) => `item-${index}`}
162-
ListEmptyComponent={<EmptyList isLoading={isLoading} />}
163-
estimatedItemSize={300}
164-
/>
165-
</View>
166-
);
167-
}
168-
```
95+
<Code file="src/app/(app)/index.tsx" meta="{4-7}" />
16996

17097
This approach is very useful when you are working on a large project with a lot of files and folders and it can be done by updating the `babel.config.js` file and `tsconfig.json` file to the following:
17198

docs/src/content/docs/ui-and-theme/Forms.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ As we mention in the components section of the documentation [here](../component
2020

2121
Here is the complete code of our `ControlledInput` when we use `useController` hook from react-hook-form to handle form state and validation rules:
2222

23-
<CodeBlock file="src/ui/core/input.tsx" />
23+
<CodeBlock file="src/ui/input.tsx" />
2424

2525
If you want to create your own controlled component, you just need to make sure your component props type extends from `InputControllerType` the same way we are using it with `ControlledInput`.
2626
Here is another example of a Select input we create using the same approach as `ControlledInput`:
2727

28-
<CodeBlock file="src/ui/core/select.tsx" />
28+
<CodeBlock file="src/ui/select.tsx" />
2929

3030
## Use Case
3131

0 commit comments

Comments
 (0)