@appsbyme/create-basekit 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/commands/app/index.cjs +361 -357
- package/dist/commands/mobile/index.cjs +68 -43
- package/dist/commands/web/index.cjs +108 -83
- package/dist/index.cjs +427 -423
- package/package.json +11 -3
- package/template-mobile/README.md +2 -2
- package/template-mobile/_yarnrc.yml +1 -0
- package/template-mobile/src/__mocks__/expo-env.ts +2 -1
- package/template-mobile/src/features/auth/api/auth.api.ts +1 -1
- package/template-mobile/src/features/auth/components/AuthBackButton.tsx +2 -1
- package/template-mobile/src/features/auth/guestAuth.ts +1 -1
- package/template-mobile/src/lib/certPinning.ts +2 -2
- package/template-mobile/src/lib/sentry.ts +1 -1
- package/template-mobile/src/services/http.ts +1 -1
- package/template-mobile/src/services/refreshSession.ts +1 -1
- package/template-mobile/src/services/websocket.ts +1 -1
- package/template-web/AGENTS.md +4 -4
- package/template-web/Dockerfile +2 -2
- package/template-web/_yarnrc.yml +4 -0
- package/template-web/docker-compose.yml +1 -1
- package/template-web/package.json +3 -0
- package/template-web/scripts/setup-add-docker.js +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsbyme/create-basekit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Scaffold Basekit web, mobile, or full-stack apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.cjs",
|
|
@@ -19,10 +19,18 @@
|
|
|
19
19
|
"prepublishOnly": "yarn build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@appsbyme/basekit-ai-helpers": "^1.0.1",
|
|
23
22
|
"prompts": "^2.4.2"
|
|
24
23
|
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@appsbyme/basekit-ai-helpers": "^1.0.1"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"@appsbyme/basekit-ai-helpers": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
25
32
|
"devDependencies": {
|
|
33
|
+
"@appsbyme/basekit-ai-helpers": "^1.0.1",
|
|
26
34
|
"@appsbyme/basekit-tsconfig": "^1.0.0",
|
|
27
35
|
"@types/node": "^24.0.14",
|
|
28
36
|
"@types/prompts": "^2.4.9",
|
|
@@ -50,6 +58,6 @@
|
|
|
50
58
|
],
|
|
51
59
|
"license": "MIT",
|
|
52
60
|
"engines": {
|
|
53
|
-
"node": ">=
|
|
61
|
+
"node": ">=22"
|
|
54
62
|
}
|
|
55
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Basekit Expo Starter
|
|
2
2
|
|
|
3
|
-
Production-ready Expo (React Native) app template with authentication, navigation, and shared cross-platform code.
|
|
3
|
+
Production-ready Expo (React Native) app template with authentication, navigation, and shared cross-platform code. Shared types live in a sibling `packages/shared` package — `create-basekit app --mobile` creates that package for you; standalone `create-basekit mobile` expects you to provide a compatible `@shared` package (this is not a Django/basekit checkout).
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ Production-ready Expo (React Native) app template with authentication, navigatio
|
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
├── assets/ # App icons and splash screen
|
|
22
|
-
├── ../packages/shared/ #
|
|
22
|
+
├── ../packages/shared/ # Shared types/schemas (from app --mobile, or your own)
|
|
23
23
|
├── src/
|
|
24
24
|
│ ├── App.tsx # Root component with providers
|
|
25
25
|
│ ├── components/ # Shared UI components
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const env: Record<string, string | undefined> = {};
|
|
2
|
+
export default env;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import type { User, LoginResponse, RegisterResponse } from '@shared/types/user';
|
|
12
12
|
import type { LoginInput, RegisterBaseInput, ForgotPasswordInput, ChangePasswordInput } from '@shared/schemas/auth.schema';
|
|
13
13
|
|
|
14
|
-
const API_URL = process.env
|
|
14
|
+
const API_URL = process.env['EXPO_PUBLIC_API_URL'] || 'http://localhost:8000/api/v1';
|
|
15
15
|
|
|
16
16
|
const mobileHeaders = { 'X-Client-Type': 'mobile' };
|
|
17
17
|
|
|
@@ -15,9 +15,9 @@ import { addBreadcrumb } from '@/lib/sentry';
|
|
|
15
15
|
* to avoid bricking the app if the leaf cert rotates.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const API_HOST = process.env
|
|
18
|
+
const API_HOST = process.env['EXPO_PUBLIC_API_HOST'] ?? '';
|
|
19
19
|
const PIN_HASHES: string[] = JSON.parse(
|
|
20
|
-
process.env
|
|
20
|
+
process.env['EXPO_PUBLIC_SSL_PINS'] ?? '[]',
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
let pinningInitialised = false;
|
|
@@ -4,7 +4,7 @@ import { addBreadcrumb } from '@/lib/sentry';
|
|
|
4
4
|
import { showErrorToast } from '@/components/Toast';
|
|
5
5
|
import i18next from 'i18next';
|
|
6
6
|
|
|
7
|
-
const API_URL = process.env
|
|
7
|
+
const API_URL = process.env['EXPO_PUBLIC_API_URL'] || 'http://localhost:8000/api/v1';
|
|
8
8
|
|
|
9
9
|
export const http = axios.create({
|
|
10
10
|
baseURL: API_URL,
|
|
@@ -3,7 +3,7 @@ import axios from 'axios';
|
|
|
3
3
|
import { addBreadcrumb, captureException } from '@/lib/sentry';
|
|
4
4
|
import { tokenStorage } from '@/lib/storage';
|
|
5
5
|
|
|
6
|
-
const API_URL = process.env
|
|
6
|
+
const API_URL = process.env['EXPO_PUBLIC_API_URL'] || 'http://localhost:8000/api/v1';
|
|
7
7
|
|
|
8
8
|
let inFlight: Promise<string> | null = null;
|
|
9
9
|
|
|
@@ -6,7 +6,7 @@ export type WSEvent = { type: string; [key: string]: unknown };
|
|
|
6
6
|
|
|
7
7
|
type Listener = (event: WSEvent) => void;
|
|
8
8
|
|
|
9
|
-
const BASE_WS_URL = (process.env
|
|
9
|
+
const BASE_WS_URL = (process.env['EXPO_PUBLIC_API_URL'] || 'http://localhost:8000/api/v1')
|
|
10
10
|
.replace(/\/api\/v1\/?$/, '')
|
|
11
11
|
.replace(/^http/, 'ws');
|
|
12
12
|
|
package/template-web/AGENTS.md
CHANGED
|
@@ -86,16 +86,16 @@ yarn check # audit + type-check + lint + stylelint + test
|
|
|
86
86
|
|
|
87
87
|
### Branching & Commits
|
|
88
88
|
|
|
89
|
-
- Default branch: **
|
|
89
|
+
- Default branch: **master**
|
|
90
90
|
- Commits follow **Conventional Commits** (enforced by Commitlint + Husky):
|
|
91
91
|
`feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`, `build`, `revert`
|
|
92
92
|
- Pre-commit hooks run **lint-staged** (ESLint fix, Stylelint fix, Prettier)
|
|
93
93
|
|
|
94
94
|
### CI Pipeline (`.github/workflows/ci.yml`)
|
|
95
95
|
|
|
96
|
-
Runs on push/PR to `
|
|
96
|
+
Runs on push/PR to `master`:
|
|
97
97
|
|
|
98
|
-
1. Checkout → Enable Corepack → Setup Node 22 → `yarn install --
|
|
98
|
+
1. Checkout → Enable Corepack → Setup Node 22 → `yarn install --immutable`
|
|
99
99
|
2. `yarn type-check`
|
|
100
100
|
3. `yarn lint` (ESLint)
|
|
101
101
|
4. `yarn stylelint` (Stylelint)
|
|
@@ -104,7 +104,7 @@ Runs on push/PR to `main`:
|
|
|
104
104
|
|
|
105
105
|
### Deployment Pipeline (`.github/workflows/release.yml`)
|
|
106
106
|
|
|
107
|
-
Runs on push to `
|
|
107
|
+
Runs on push to `master`:
|
|
108
108
|
|
|
109
109
|
1. Same setup as CI
|
|
110
110
|
2. Builds the application
|
package/template-web/Dockerfile
CHANGED
|
@@ -13,12 +13,12 @@ WORKDIR /app
|
|
|
13
13
|
RUN corepack enable
|
|
14
14
|
|
|
15
15
|
# Copy dependency files first so dependency installation is cached separately.
|
|
16
|
-
COPY package.json .yarnrc.yml ./
|
|
16
|
+
COPY package.json yarn.lock .yarnrc.yml ./
|
|
17
17
|
|
|
18
18
|
# Install dependencies
|
|
19
19
|
# Uses BuildKit cache for faster rebuilds.
|
|
20
20
|
RUN --mount=type=cache,target=/root/.yarn/berry/cache \
|
|
21
|
-
yarn install --
|
|
21
|
+
yarn install --immutable
|
|
22
22
|
|
|
23
23
|
# Copy project files
|
|
24
24
|
COPY . .
|
|
@@ -31,10 +31,10 @@ FROM node:22-alpine AS builder
|
|
|
31
31
|
|
|
32
32
|
WORKDIR /app
|
|
33
33
|
|
|
34
|
-
COPY package.json .yarnrc.yml ./
|
|
34
|
+
COPY package.json yarn.lock .yarnrc.yml ./
|
|
35
35
|
|
|
36
36
|
RUN --mount=type=cache,target=/root/.yarn/berry/cache \\
|
|
37
|
-
yarn install --
|
|
37
|
+
yarn install --immutable
|
|
38
38
|
|
|
39
39
|
COPY . .
|
|
40
40
|
|
|
@@ -78,7 +78,7 @@ const DOCKER_COMPOSE = `services:
|
|
|
78
78
|
- CHOKIDAR_USEPOLLING=true
|
|
79
79
|
- WATCHPACK_POLLING=true
|
|
80
80
|
command: >-
|
|
81
|
-
sh -c "yarn install --
|
|
81
|
+
sh -c "yarn install --immutable
|
|
82
82
|
&& yarn dev"
|
|
83
83
|
stdin_open: true
|
|
84
84
|
tty: true
|
|
@@ -240,7 +240,18 @@ function createDockerFiles(rootDir) {
|
|
|
240
240
|
* @param {string} [options.rootDir]
|
|
241
241
|
* @returns {Promise<{changed: boolean}>}
|
|
242
242
|
*/
|
|
243
|
+
function isMonorepoFrontend(rootDir) {
|
|
244
|
+
return exists(path.join(rootDir, '..', 'packages', 'shared'));
|
|
245
|
+
}
|
|
246
|
+
|
|
243
247
|
export async function apply({ rootDir = getRootDir() } = {}) {
|
|
248
|
+
if (isMonorepoFrontend(rootDir)) {
|
|
249
|
+
logWarn(
|
|
250
|
+
'Monorepo frontend detected — Docker is owned by frontend/Dockerfile + docker-compose.yml (build context: monorepo root). Skipping.',
|
|
251
|
+
);
|
|
252
|
+
return { changed: false };
|
|
253
|
+
}
|
|
254
|
+
|
|
244
255
|
if (hasDocker(rootDir)) {
|
|
245
256
|
logWarn('Docker configuration already detected — no changes made.');
|
|
246
257
|
return { changed: false };
|