@bambr-io/create-app 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.
Files changed (3) hide show
  1. package/README.md +32 -0
  2. package/bin/index.js +34 -0
  3. package/package.json +20 -0
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @bambr-io/create-app
2
+
3
+ Scaffold a Bambr app (Expo + `expo-router`) and install dependencies automatically.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npm create @bambr-io/app my-app
9
+ # or
10
+ npx @bambr-io/create-app my-app
11
+ ```
12
+
13
+ This will:
14
+
15
+ 1. Clone the template repo (`bambr-io/app-template`) into `my-app` via degit.
16
+ 2. Run `npm install` inside it automatically.
17
+
18
+ Then:
19
+
20
+ ```bash
21
+ cd my-app
22
+ npm start
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ The template source is the `TEMPLATE` constant in [`bin/index.js`](bin/index.js).
28
+ Set it to your real GitHub repo. It supports:
29
+
30
+ - `user/repo`
31
+ - `user/repo#branch`
32
+ - `user/repo/subdir`
package/bin/index.js ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readdirSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
+ import { execSync } from "node:child_process";
5
+ import degit from "degit";
6
+
7
+ // GitHub repo that holds the template. Update to your real repo/branch.
8
+ // Supports "user/repo", "user/repo#branch", or "user/repo/subdir".
9
+ const TEMPLATE = "bambr-io/app";
10
+
11
+ async function main() {
12
+ const dest = process.argv[2] || "my-app";
13
+ const target = resolve(process.cwd(), dest);
14
+
15
+ if (existsSync(target) && readdirSync(target).length > 0) {
16
+ console.error(`✖ Target directory "${dest}" already exists and is not empty.`);
17
+ process.exit(1);
18
+ }
19
+
20
+ console.log(`\n› Cloning ${TEMPLATE} into ${dest} ...`);
21
+ await degit(TEMPLATE, { cache: false, force: true }).clone(target);
22
+
23
+ console.log("› Installing dependencies ...\n");
24
+ execSync("npm install", { cwd: target, stdio: "inherit" });
25
+
26
+ console.log(`\n✔ Done. Next steps:\n`);
27
+ console.log(` cd ${dest}`);
28
+ console.log(` npm start\n`);
29
+ }
30
+
31
+ main().catch((err) => {
32
+ console.error(`\n✖ ${err.message}`);
33
+ process.exit(1);
34
+ });
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@bambr-io/create-app",
3
+ "version": "1.0.0",
4
+ "description": "Scaffold a Bambr app (Expo + expo-router) and install deps automatically.",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-app": "bin/index.js"
8
+ },
9
+ "files": [
10
+ "bin"
11
+ ],
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "dependencies": {
16
+ "degit": "^2.8.4"
17
+ },
18
+ "author": "",
19
+ "license": "ISC"
20
+ }