app-expo-cli 1.0.0
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/bin/index.js +3 -0
- package/bun.lock +82 -0
- package/package.json +26 -0
- package/src/copy-template.js +156 -0
- package/src/create-expo.js +10 -0
- package/src/index.js +39 -0
- package/src/install-deps.js +22 -0
- package/src/utils/logger.js +29 -0
- package/tailwind.config.js +69 -0
- package/template/src/app/_layout.tsx +61 -0
- package/template/src/app/auth/_layout.tsx +41 -0
- package/template/src/app/auth/change_pass.tsx +138 -0
- package/template/src/app/auth/change_pass_modal.tsx +74 -0
- package/template/src/app/auth/forgot.tsx +124 -0
- package/template/src/app/auth/index.tsx +274 -0
- package/template/src/app/auth/opt_verify.tsx +145 -0
- package/template/src/app/auth/register.tsx +334 -0
- package/template/src/app/auth/reset_pass.tsx +152 -0
- package/template/src/app/common/image.tsx +202 -0
- package/template/src/app/common/openurl.tsx +42 -0
- package/template/src/app/home/_layout.tsx +29 -0
- package/template/src/app/home/drawer/_layout.tsx +27 -0
- package/template/src/app/home/tabs/_layout.tsx +75 -0
- package/template/src/app/home/tabs/index.tsx +11 -0
- package/template/src/app/index.tsx +11 -0
- package/template/src/app/modals/confirmation_logout_modal.tsx +78 -0
- package/template/src/app/modals/payment_modal.tsx +105 -0
- package/template/src/app/modals/success_modal.tsx +72 -0
- package/template/src/app/modals/toaster.tsx +31 -0
- package/template/src/app/settings/_layout.tsx +19 -0
- package/template/src/app/settings/about_us.tsx +61 -0
- package/template/src/app/settings/privacy_policy.tsx +61 -0
- package/template/src/app/settings/terms_and_conditions.tsx +60 -0
- package/template/src/hooks/useCheckLocation.ts +36 -0
- package/template/src/hooks/useDocPicker.ts +83 -0
- package/template/src/hooks/useImgePicker.ts +70 -0
- package/template/src/hooks/useSuggestionLocation.ts +36 -0
- package/template/src/hooks/useUploadProgress.ts +127 -0
- package/template/src/redux/api-config/baseApi.ts +89 -0
- package/template/src/redux/api-slices/authSlices.ts +175 -0
- package/template/src/redux/interface/common.ts +19 -0
- package/template/src/redux/interface/interface.ts +196 -0
- package/template/src/redux/interface/tag-types.ts +13 -0
- package/template/src/redux/service/demo.ts +27 -0
- package/template/src/redux/store.ts +17 -0
- package/template/src/utils/utils.ts +27 -0
package/bin/index.js
ADDED
package/bun.lock
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"workspaces": {
|
|
4
|
+
"": {
|
|
5
|
+
"name": "app-expo-cli",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@clack/prompts": "^1.0.1",
|
|
8
|
+
"chalk": "^5.6.2",
|
|
9
|
+
"degit": "^2.8.4",
|
|
10
|
+
"execa": "^9.6.1",
|
|
11
|
+
"fs-extra": "^11.3.3",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
"packages": {
|
|
16
|
+
"@clack/core": ["@clack/core@1.0.1", "", { "dependencies": { "picocolors": "^1.0.0", "sisteransi": "^1.0.5" } }, "sha512-WKeyK3NOBwDOzagPR5H08rFk9D/WuN705yEbuZvKqlkmoLM2woKtXb10OO2k1NoSU4SFG947i2/SCYh+2u5e4g=="],
|
|
17
|
+
|
|
18
|
+
"@clack/prompts": ["@clack/prompts@1.0.1", "", { "dependencies": { "@clack/core": "1.0.1", "picocolors": "^1.0.0", "sisteransi": "^1.0.5" } }, "sha512-/42G73JkuYdyWZ6m8d/CJtBrGl1Hegyc7Fy78m5Ob+jF85TOUmLR5XLce/U3LxYAw0kJ8CT5aI99RIvPHcGp/Q=="],
|
|
19
|
+
|
|
20
|
+
"@sec-ant/readable-stream": ["@sec-ant/readable-stream@0.4.1", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="],
|
|
21
|
+
|
|
22
|
+
"@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="],
|
|
23
|
+
|
|
24
|
+
"chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
|
|
25
|
+
|
|
26
|
+
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
|
27
|
+
|
|
28
|
+
"degit": ["degit@2.8.4", "", { "bin": "degit" }, "sha512-vqYuzmSA5I50J882jd+AbAhQtgK6bdKUJIex1JNfEUPENCgYsxugzKVZlFyMwV4i06MmnV47/Iqi5Io86zf3Ng=="],
|
|
29
|
+
|
|
30
|
+
"execa": ["execa@9.6.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="],
|
|
31
|
+
|
|
32
|
+
"figures": ["figures@6.1.0", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="],
|
|
33
|
+
|
|
34
|
+
"fs-extra": ["fs-extra@11.3.3", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg=="],
|
|
35
|
+
|
|
36
|
+
"get-stream": ["get-stream@9.0.1", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="],
|
|
37
|
+
|
|
38
|
+
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
|
39
|
+
|
|
40
|
+
"human-signals": ["human-signals@8.0.1", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="],
|
|
41
|
+
|
|
42
|
+
"is-plain-obj": ["is-plain-obj@4.1.0", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="],
|
|
43
|
+
|
|
44
|
+
"is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="],
|
|
45
|
+
|
|
46
|
+
"is-unicode-supported": ["is-unicode-supported@2.1.0", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="],
|
|
47
|
+
|
|
48
|
+
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
|
|
49
|
+
|
|
50
|
+
"jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="],
|
|
51
|
+
|
|
52
|
+
"npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="],
|
|
53
|
+
|
|
54
|
+
"parse-ms": ["parse-ms@4.0.0", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="],
|
|
55
|
+
|
|
56
|
+
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
|
|
57
|
+
|
|
58
|
+
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
|
59
|
+
|
|
60
|
+
"pretty-ms": ["pretty-ms@9.3.0", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="],
|
|
61
|
+
|
|
62
|
+
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
|
63
|
+
|
|
64
|
+
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
|
65
|
+
|
|
66
|
+
"signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],
|
|
67
|
+
|
|
68
|
+
"sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],
|
|
69
|
+
|
|
70
|
+
"strip-final-newline": ["strip-final-newline@4.0.0", "", {}, "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw=="],
|
|
71
|
+
|
|
72
|
+
"unicorn-magic": ["unicorn-magic@0.3.0", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="],
|
|
73
|
+
|
|
74
|
+
"universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
|
|
75
|
+
|
|
76
|
+
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
|
|
77
|
+
|
|
78
|
+
"yoctocolors": ["yoctocolors@2.1.2", "", {}, "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug=="],
|
|
79
|
+
|
|
80
|
+
"npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="],
|
|
81
|
+
}
|
|
82
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "app-expo-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"app-expo-cli": "./bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [],
|
|
17
|
+
"author": "",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@clack/prompts": "^1.0.1",
|
|
21
|
+
"chalk": "^5.6.2",
|
|
22
|
+
"degit": "^2.8.4",
|
|
23
|
+
"execa": "^9.6.1",
|
|
24
|
+
"fs-extra": "^11.3.3"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { confirm, intro, log, outro, spinner } from "@clack/prompts";
|
|
2
|
+
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import { execa } from "execa";
|
|
5
|
+
import fs from "fs-extra";
|
|
6
|
+
import path from "path";
|
|
7
|
+
|
|
8
|
+
export async function copyDefaultFiles(projectPath, __dirname) {
|
|
9
|
+
intro(chalk.bgCyan.black(" CONFIGURING PROJECT ARCHITECTURE "));
|
|
10
|
+
|
|
11
|
+
const s = spinner();
|
|
12
|
+
const templateSrcPath = path.resolve(__dirname, "../template/src");
|
|
13
|
+
const destSrcPath = path.join(projectPath, "src");
|
|
14
|
+
const newAppPath = path.join(destSrcPath, "app");
|
|
15
|
+
|
|
16
|
+
// 1. Reset project logic
|
|
17
|
+
s.start("Resetting project structure");
|
|
18
|
+
try {
|
|
19
|
+
await execa("npm", ["run", "reset-project"], {
|
|
20
|
+
cwd: projectPath,
|
|
21
|
+
stdio: ["pipe", "inherit", "inherit"],
|
|
22
|
+
input: "n\n",
|
|
23
|
+
});
|
|
24
|
+
s.stop("Project structure reset complete");
|
|
25
|
+
} catch (error) {
|
|
26
|
+
s.stop(chalk.red("Reset failed, continuing..."));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 2. Copy Base Folders (lib, hooks, etc.)
|
|
30
|
+
s.start("Copying core folders");
|
|
31
|
+
const baseFolders = ["hooks", "redux", "utils", "components"];
|
|
32
|
+
await fs.ensureDir(destSrcPath);
|
|
33
|
+
|
|
34
|
+
for (const folder of baseFolders) {
|
|
35
|
+
const src = path.join(templateSrcPath, folder);
|
|
36
|
+
const dest = path.join(destSrcPath, folder);
|
|
37
|
+
if (await fs.pathExists(src)) {
|
|
38
|
+
await fs.copy(src, dest, { overwrite: true });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
s.stop("Core folders copied");
|
|
42
|
+
|
|
43
|
+
// 3. Add Lib Folder in Src if user want
|
|
44
|
+
|
|
45
|
+
const addLibFolder = await confirm({
|
|
46
|
+
message: "Are you want to add library (lib) folder ?",
|
|
47
|
+
initialValue: false,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (addLibFolder === true) {
|
|
51
|
+
s.start("Cloning lib from GitHub");
|
|
52
|
+
try {
|
|
53
|
+
const targetLibPath = path.join(destSrcPath, "lib");
|
|
54
|
+
|
|
55
|
+
// 1. Clone only the latest commit (depth 1) to a temp folder
|
|
56
|
+
const tempGitPath = path.join(projectPath, "temp_git_lib");
|
|
57
|
+
await execa("git", [
|
|
58
|
+
"clone",
|
|
59
|
+
"--depth",
|
|
60
|
+
"1",
|
|
61
|
+
"https://github.com/arifbiswas/lib.git",
|
|
62
|
+
tempGitPath,
|
|
63
|
+
]);
|
|
64
|
+
|
|
65
|
+
// 2. Copy the content to your project's lib folder
|
|
66
|
+
await fs.ensureDir(targetLibPath);
|
|
67
|
+
await fs.copy(tempGitPath, targetLibPath, { overwrite: true });
|
|
68
|
+
|
|
69
|
+
// 3. Remove the temp folder and its .git directory
|
|
70
|
+
await fs.remove(tempGitPath);
|
|
71
|
+
|
|
72
|
+
s.stop("Lib folder synced from GitHub");
|
|
73
|
+
} catch (error) {
|
|
74
|
+
s.stop(chalk.red("Git clone failed"));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 4. Organize 'app' folder and copy specific files
|
|
79
|
+
const oldAppPath = path.join(projectPath, "app");
|
|
80
|
+
if (await fs.pathExists(oldAppPath)) {
|
|
81
|
+
await fs.move(oldAppPath, newAppPath, { overwrite: true });
|
|
82
|
+
|
|
83
|
+
// --- NEW: Copy _layout and index files from template/src/app ---
|
|
84
|
+
const rootFiles = ["_layout.tsx", "index.tsx"];
|
|
85
|
+
for (const file of rootFiles) {
|
|
86
|
+
const srcFile = path.join(templateSrcPath, "app", file);
|
|
87
|
+
const destFile = path.join(newAppPath, file);
|
|
88
|
+
|
|
89
|
+
if (await fs.pathExists(srcFile)) {
|
|
90
|
+
await fs.copy(srcFile, destFile, { overwrite: true });
|
|
91
|
+
log.step(`File ${file} updated from template`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Copy app sub-folders
|
|
96
|
+
const appSubFolders = ["auth", "common", "modals", "settings"];
|
|
97
|
+
for (const sub of appSubFolders) {
|
|
98
|
+
const src = path.join(templateSrcPath, "app", sub);
|
|
99
|
+
const dest = path.join(newAppPath, sub);
|
|
100
|
+
if (await fs.pathExists(src)) {
|
|
101
|
+
await fs.copy(src, dest, { overwrite: true });
|
|
102
|
+
log.step(`Added ${sub} to src/app`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 5. Interactive Tabs and Drawer
|
|
107
|
+
const needTabs = await confirm({
|
|
108
|
+
message: "Do you need Bottom Tabs navigation?",
|
|
109
|
+
initialValue: true,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (needTabs === true) {
|
|
113
|
+
const tabsSrc = path.join(templateSrcPath, "app/home/tabs/");
|
|
114
|
+
const tabsDest = path.join(newAppPath, "home/(tabs)");
|
|
115
|
+
if (await fs.pathExists(tabsSrc)) {
|
|
116
|
+
await fs.copy(tabsSrc, tabsDest, { overwrite: true });
|
|
117
|
+
log.success("Tabs navigation added");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const needDrawer = await confirm({
|
|
122
|
+
message: "Do you need Drawer navigation?",
|
|
123
|
+
initialValue: false,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
if (needDrawer === true) {
|
|
127
|
+
const drawerSrc = path.join(templateSrcPath, "app/home/drawer/");
|
|
128
|
+
const drawerDest = path.join(newAppPath, "home/(drawer)");
|
|
129
|
+
if (await fs.pathExists(drawerSrc)) {
|
|
130
|
+
await fs.copy(drawerSrc, drawerDest, { overwrite: true });
|
|
131
|
+
log.success("Drawer navigation added");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Define the source path for the config file
|
|
137
|
+
const tailwindSrc = path.resolve(__dirname, "../tailwind.config.js");
|
|
138
|
+
|
|
139
|
+
// Define the destination path including the filename
|
|
140
|
+
const tailwindDest = path.join(projectPath, "tailwind.config.js");
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
if (await fs.pathExists(tailwindSrc)) {
|
|
144
|
+
await fs.copy(tailwindSrc, tailwindDest, {
|
|
145
|
+
overwrite: true,
|
|
146
|
+
});
|
|
147
|
+
console.log(chalk.green("✔ tailwind.config.js copied to project root"));
|
|
148
|
+
} else {
|
|
149
|
+
console.log(chalk.red("✘ tailwind.config.js not found in template"));
|
|
150
|
+
}
|
|
151
|
+
} catch (err) {
|
|
152
|
+
console.error(chalk.red("Error copying tailwind config:"), err.message);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
outro(chalk.green.bold("✨ Architecture setup complete!"));
|
|
156
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { execa } from "execa";
|
|
3
|
+
|
|
4
|
+
export async function createExpoApp(projectName) {
|
|
5
|
+
console.log(chalk.blue("Creating latest Expo app..."));
|
|
6
|
+
|
|
7
|
+
await execa("bunx", ["create-expo-app", projectName], {
|
|
8
|
+
stdio: "inherit",
|
|
9
|
+
});
|
|
10
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { copyDefaultFiles } from "./copy-template.js";
|
|
5
|
+
import { createExpoApp } from "./create-expo.js";
|
|
6
|
+
import { installDependencies } from "./install-deps.js";
|
|
7
|
+
import { logError } from "./utils/logger.js";
|
|
8
|
+
const projectName = process.argv[2];
|
|
9
|
+
|
|
10
|
+
if (!projectName) {
|
|
11
|
+
logError("Please provide project name");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// __dirname replacement for ESM
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = path.dirname(__filename);
|
|
18
|
+
|
|
19
|
+
async function init() {
|
|
20
|
+
try {
|
|
21
|
+
const projectPath = path.join(process.cwd(), projectName);
|
|
22
|
+
|
|
23
|
+
if (await fs.pathExists(projectPath)) {
|
|
24
|
+
logError("Project already exists");
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
await createExpoApp(projectName);
|
|
29
|
+
|
|
30
|
+
await copyDefaultFiles(projectPath, __dirname);
|
|
31
|
+
await installDependencies(projectPath);
|
|
32
|
+
|
|
33
|
+
console.log("\n✅ Project ready 🚀");
|
|
34
|
+
} catch (err) {
|
|
35
|
+
logError(err.message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
init();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { execa } from "execa";
|
|
3
|
+
|
|
4
|
+
export async function installDependencies(projectPath) {
|
|
5
|
+
console.log(chalk.green("Installing extra dependencies..."));
|
|
6
|
+
|
|
7
|
+
await execa(
|
|
8
|
+
"bun",
|
|
9
|
+
[
|
|
10
|
+
"install",
|
|
11
|
+
"@reduxjs/toolkit",
|
|
12
|
+
"react-redux",
|
|
13
|
+
"@react-native-async-storage/async-storage",
|
|
14
|
+
"axios",
|
|
15
|
+
"react-native-svg",
|
|
16
|
+
],
|
|
17
|
+
{
|
|
18
|
+
cwd: projectPath,
|
|
19
|
+
stdio: "inherit",
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
|
|
3
|
+
export function logError(message) {
|
|
4
|
+
console.log(chalk.red("❌ " + message));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function logSuccess(message) {
|
|
8
|
+
console.log(chalk.green("✅ " + message));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function logWarning(message) {
|
|
12
|
+
console.log(chalk.yellow("⚠️ " + message));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function logInfo(message) {
|
|
16
|
+
console.log(chalk.blue("i️ " + message));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function logDebug(message) {
|
|
20
|
+
console.log(chalk.gray("🐛 " + message));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function logTest(message) {
|
|
24
|
+
console.log(chalk.magenta("🧪 " + message));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function logDone(message) {
|
|
28
|
+
console.log(chalk.green("✔️ " + message));
|
|
29
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
theme: {
|
|
3
|
+
screens: {
|
|
4
|
+
sm: "300px",
|
|
5
|
+
md: "400px",
|
|
6
|
+
lg: "700px",
|
|
7
|
+
tablet: "700px",
|
|
8
|
+
|
|
9
|
+
// Add more screen sizes here
|
|
10
|
+
},
|
|
11
|
+
extend: {
|
|
12
|
+
// fontSize: {
|
|
13
|
+
// fontNormalLizard: "-tracking-[2px]",
|
|
14
|
+
// },
|
|
15
|
+
fontFamily: {
|
|
16
|
+
// Nunito fonts
|
|
17
|
+
InterBlack: "InterBlack",
|
|
18
|
+
InterBlackItalic: "InterBlackItalic",
|
|
19
|
+
InterBold: "InterBold",
|
|
20
|
+
InterBoldItalic: "InterBoldItalic",
|
|
21
|
+
InterExtraBold: "InterExtraBold",
|
|
22
|
+
InterExtraLight: "InterExtraLight",
|
|
23
|
+
InterExtraLightItalic: "InterExtraLightItalic",
|
|
24
|
+
InterItalic: "InterItalic",
|
|
25
|
+
InterLight: "InterLight",
|
|
26
|
+
InterLightItalic: "InterLightItalic",
|
|
27
|
+
InterMedium: "InterMedium",
|
|
28
|
+
InterMediumItalic: "InterMediumItalic",
|
|
29
|
+
InterRegular: "InterRegular",
|
|
30
|
+
InterSemiBold: "InterSemiBold",
|
|
31
|
+
InterSemiBoldItalic: "InterSemiBoldItalic",
|
|
32
|
+
InterThin: "InterThin",
|
|
33
|
+
InterThinItalic: "InterThinItalic",
|
|
34
|
+
// You can replace 'YourCustomFont' with your desired font
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
colors: {
|
|
38
|
+
primary: "#1F8FFF",
|
|
39
|
+
secondary: "#3D3D3D",
|
|
40
|
+
Warning500: "#EAD852",
|
|
41
|
+
base: "#121212",
|
|
42
|
+
danger600: "#DC3545",
|
|
43
|
+
danger50: "#FEF2F2",
|
|
44
|
+
black50: "#F6F6F6",
|
|
45
|
+
black60: "#FFFFFF99",
|
|
46
|
+
black100: "#E7E7E7",
|
|
47
|
+
black200: "#D1D1D1",
|
|
48
|
+
black400: "#888888",
|
|
49
|
+
black500: "#5D5D5D",
|
|
50
|
+
black600: "#5D5D5D",
|
|
51
|
+
black800: "#454545",
|
|
52
|
+
black900: "#333333",
|
|
53
|
+
black950: "#262626",
|
|
54
|
+
black1000: "#1D1929",
|
|
55
|
+
|
|
56
|
+
white50: "#F6F6F6",
|
|
57
|
+
white60: "rgba(255, 255, 255, 0.6)",
|
|
58
|
+
white100: "rgba(217, 217, 217, 1)",
|
|
59
|
+
white200: "#D1D1D1",
|
|
60
|
+
white400: "#888888",
|
|
61
|
+
white500: "#5D5D5D",
|
|
62
|
+
white600: "#5D5D5D",
|
|
63
|
+
white800: "#454545",
|
|
64
|
+
white900: "#333333",
|
|
65
|
+
white1000: "#1D1929",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
2
|
+
import { Provider } from "react-redux";
|
|
3
|
+
import { Stack } from "expo-router";
|
|
4
|
+
import store from "../redux/store";
|
|
5
|
+
import tw from "../lib/tailwind";
|
|
6
|
+
|
|
7
|
+
export const unstable_settings = {
|
|
8
|
+
initialRouteName: "index",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default function RootLayout() {
|
|
12
|
+
return (
|
|
13
|
+
<Provider store={store}>
|
|
14
|
+
<GestureHandlerRootView>
|
|
15
|
+
<Stack
|
|
16
|
+
screenOptions={{
|
|
17
|
+
headerShown: false,
|
|
18
|
+
statusBarStyle: "light",
|
|
19
|
+
contentStyle: tw`bg-base`,
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<Stack.Screen name="index" options={{}} />
|
|
23
|
+
<Stack.Screen name="auth" />
|
|
24
|
+
<Stack.Screen name="home" />
|
|
25
|
+
<Stack.Screen name="settings" />
|
|
26
|
+
<Stack.Screen name="common/image" />
|
|
27
|
+
|
|
28
|
+
{/*=========================== Modals Start ============== */}
|
|
29
|
+
|
|
30
|
+
<Stack.Screen
|
|
31
|
+
name="modals/toaster"
|
|
32
|
+
options={{
|
|
33
|
+
presentation: "formSheet",
|
|
34
|
+
sheetAllowedDetents: "fitToContents",
|
|
35
|
+
contentStyle: tw`bg-base `,
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<Stack.Screen
|
|
40
|
+
name="modals/confirmation_logout_modal"
|
|
41
|
+
options={{
|
|
42
|
+
presentation: "containedTransparentModal",
|
|
43
|
+
animation: "fade_from_bottom",
|
|
44
|
+
contentStyle: tw`bg-base`,
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<Stack.Screen
|
|
49
|
+
name="modals/success_modal"
|
|
50
|
+
options={{
|
|
51
|
+
presentation: "transparentModal",
|
|
52
|
+
animation: "fade_from_bottom",
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
{/*=========================== Modals End ============== */}
|
|
57
|
+
</Stack>
|
|
58
|
+
</GestureHandlerRootView>
|
|
59
|
+
</Provider>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Stack } from "expo-router";
|
|
2
|
+
|
|
3
|
+
export const unstable_settings = {
|
|
4
|
+
initialRouteName: "index",
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default function RootLayout() {
|
|
8
|
+
return (
|
|
9
|
+
<Stack
|
|
10
|
+
screenOptions={{
|
|
11
|
+
headerShown: false,
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
<Stack.Screen
|
|
15
|
+
name="index"
|
|
16
|
+
options={{
|
|
17
|
+
statusBarStyle: "light",
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
<Stack.Screen
|
|
21
|
+
name="register"
|
|
22
|
+
options={{
|
|
23
|
+
statusBarStyle: "light",
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<Stack.Screen
|
|
28
|
+
name="change_pass"
|
|
29
|
+
options={{
|
|
30
|
+
statusBarStyle: "light",
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
<Stack.Screen
|
|
34
|
+
name="change_pass_modal"
|
|
35
|
+
options={{
|
|
36
|
+
presentation: "transparentModal",
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
</Stack>
|
|
40
|
+
);
|
|
41
|
+
}
|