create-matwad-app 1.0.2 → 1.0.7
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/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -67,6 +67,18 @@ export async function run() {
|
|
|
67
67
|
console.log(`\n${blue(bold("Setting up Server..."))}`);
|
|
68
68
|
await fse.copy(serverTemplate, serverDir);
|
|
69
69
|
|
|
70
|
+
// Rename _gitignore to .gitignore
|
|
71
|
+
const gitignorePath = path.join(serverDir, "_gitignore");
|
|
72
|
+
if (fse.existsSync(gitignorePath)) {
|
|
73
|
+
await fse.move(gitignorePath, path.join(serverDir, ".gitignore"));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Rename _env.local to .env.local
|
|
77
|
+
const envPath = path.join(serverDir, "_env.local");
|
|
78
|
+
if (fse.existsSync(envPath)) {
|
|
79
|
+
await fse.move(envPath, path.join(serverDir, ".env.local"));
|
|
80
|
+
}
|
|
81
|
+
|
|
70
82
|
// Update server package.json name
|
|
71
83
|
const serverPkgPath = path.join(serverDir, "package.json");
|
|
72
84
|
const serverPkg = await fse.readJson(serverPkgPath);
|
|
@@ -127,6 +139,24 @@ export async function run() {
|
|
|
127
139
|
stdio: "inherit",
|
|
128
140
|
});
|
|
129
141
|
|
|
142
|
+
// 4. Initialize Git
|
|
143
|
+
console.log(`\n${blue(bold("Initializing Git..."))}`);
|
|
144
|
+
try {
|
|
145
|
+
await runCommand("git", ["init"], { cwd: root });
|
|
146
|
+
await runCommand("git", ["add", "."], { cwd: root });
|
|
147
|
+
await runCommand(
|
|
148
|
+
"git",
|
|
149
|
+
["commit", "-m", '"Initial commit via create-matwad-app"'],
|
|
150
|
+
{ cwd: root }
|
|
151
|
+
);
|
|
152
|
+
console.log(green("Git initialized and initial commit created."));
|
|
153
|
+
} catch (error) {
|
|
154
|
+
console.warn(
|
|
155
|
+
red("Failed to initialize git or create initial commit:"),
|
|
156
|
+
error.message
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
130
160
|
console.log(`\n${green("Success!")} Created ${bold(projectName)} at ${root}`);
|
|
131
161
|
console.log("\nNext steps:");
|
|
132
162
|
console.log(` cd ${projectName}`);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Environment variables
|
|
7
|
+
.env
|
|
8
|
+
.env.local
|
|
9
|
+
.env.development.local
|
|
10
|
+
.env.test.local
|
|
11
|
+
.env.production.local
|
|
12
|
+
|
|
13
|
+
# Logs
|
|
14
|
+
npm-debug.log*
|
|
15
|
+
yarn-debug.log*
|
|
16
|
+
yarn-error.log*
|
|
17
|
+
|
|
18
|
+
# OS
|
|
19
|
+
.DS_Store
|
|
20
|
+
Thumbs.db
|
|
File without changes
|