create-react-native-init-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.
- package/README.md +74 -0
- package/bin/index.js +75 -0
- package/package.json +63 -0
- package/scripts/build.ts +39 -0
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-react-native-init-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Interactive CLI to scaffold React Native projects with Clean Architecture",
|
|
6
|
+
"main": "bin/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"react-native-init-app": "./bin/index.js",
|
|
9
|
+
"rnia": "./bin/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"clean": "rm -rf bin/*",
|
|
13
|
+
"dev": "bun src/cli.tsx",
|
|
14
|
+
"build": "bun scripts/build.ts",
|
|
15
|
+
"prepublishOnly": "bun run build",
|
|
16
|
+
"test": "jest"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"react-native",
|
|
20
|
+
"cli",
|
|
21
|
+
"scaffold",
|
|
22
|
+
"clean-architecture",
|
|
23
|
+
"template"
|
|
24
|
+
],
|
|
25
|
+
"author": "CrisangerA",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/CrisangerA/react-native-init-app.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/CrisangerA/react-native-init-app/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/CrisangerA/react-native-init-app#readme",
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"chalk": "^5.6.2",
|
|
40
|
+
"enquirer": "^2.4.1",
|
|
41
|
+
"execa": "^9.6.1",
|
|
42
|
+
"fs-extra": "^11.3.3",
|
|
43
|
+
"ink": "^6.8.0",
|
|
44
|
+
"node-fetch": "^3.3.2",
|
|
45
|
+
"react": "^19.2.3",
|
|
46
|
+
"react-devtools-core": "^7.0.1",
|
|
47
|
+
"tar": "^6.2.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/fs-extra": "^11.0.4",
|
|
51
|
+
"@types/node": "^22.10.0",
|
|
52
|
+
"@types/react": "^19.2.0",
|
|
53
|
+
"typescript": "^5.8.3"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">= 18.0.0"
|
|
57
|
+
},
|
|
58
|
+
"preferGlobal": true,
|
|
59
|
+
"files": [
|
|
60
|
+
"bin",
|
|
61
|
+
"scripts"
|
|
62
|
+
]
|
|
63
|
+
}
|
package/scripts/build.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { build } from "bun";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
console.log("🚀 Building CLI with Bun...");
|
|
6
|
+
|
|
7
|
+
const result = await Bun.build({
|
|
8
|
+
entrypoints: ["./src/cli.tsx"],
|
|
9
|
+
outdir: "./bin",
|
|
10
|
+
target: "node",
|
|
11
|
+
minify: true,
|
|
12
|
+
naming: "index.js",
|
|
13
|
+
define: {
|
|
14
|
+
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (!result.success) {
|
|
19
|
+
console.error("❌ Build failed");
|
|
20
|
+
for (const message of result.logs) {
|
|
21
|
+
console.error(message);
|
|
22
|
+
}
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Ensure the output file exists
|
|
27
|
+
const outfile = path.join(process.cwd(), "bin/index.js");
|
|
28
|
+
|
|
29
|
+
if (fs.existsSync(outfile)) {
|
|
30
|
+
const content = fs.readFileSync(outfile, "utf-8");
|
|
31
|
+
// Prepend shebang if not present
|
|
32
|
+
if (!content.startsWith("#!/usr/bin/env node")) {
|
|
33
|
+
fs.writeFileSync(outfile, "#!/usr/bin/env node\n" + content);
|
|
34
|
+
}
|
|
35
|
+
// Make it executable
|
|
36
|
+
fs.chmodSync(outfile, "755");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log("✅ Build complete! Binary generated at bin/index.js");
|