create-thexjs-app 1.1.0 → 1.1.1
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/dist/index.js +22 -4
- package/package.json +1 -1
- package/templates/base/_gitignore +26 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { spawnSync } from "child_process";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
cpSync,
|
|
7
|
+
existsSync,
|
|
8
|
+
mkdirSync,
|
|
9
|
+
readdirSync,
|
|
10
|
+
renameSync,
|
|
11
|
+
statSync,
|
|
12
|
+
writeFileSync
|
|
13
|
+
} from "fs";
|
|
6
14
|
import { dirname, join, resolve } from "path";
|
|
7
15
|
import { fileURLToPath } from "url";
|
|
8
16
|
import {
|
|
@@ -175,6 +183,12 @@ function copyAddon(addon, targetDir) {
|
|
|
175
183
|
if (!existsSync(src)) return;
|
|
176
184
|
mergeTree(src, targetDir);
|
|
177
185
|
}
|
|
186
|
+
function finalizeGitignore(targetDir) {
|
|
187
|
+
const from = join(targetDir, "_gitignore");
|
|
188
|
+
if (!existsSync(from)) return;
|
|
189
|
+
const to = join(targetDir, ".gitignore");
|
|
190
|
+
renameSync(from, to);
|
|
191
|
+
}
|
|
178
192
|
function buildPackageJson(name, features, coreVersion, cliVersion) {
|
|
179
193
|
const dependencies = {
|
|
180
194
|
...BASE_DEPENDENCIES,
|
|
@@ -278,6 +292,7 @@ async function main() {
|
|
|
278
292
|
spin.start(`Scaffolding "${slug}"`);
|
|
279
293
|
ensureDir(targetDir);
|
|
280
294
|
mergeTree(BASE_TEMPLATE, targetDir);
|
|
295
|
+
finalizeGitignore(targetDir);
|
|
281
296
|
for (const feature of features) {
|
|
282
297
|
copyAddon(feature, targetDir);
|
|
283
298
|
}
|
|
@@ -292,10 +307,13 @@ async function main() {
|
|
|
292
307
|
spin.stop(`Created ${slug}/`);
|
|
293
308
|
if (options.git) {
|
|
294
309
|
const initSpin = spinner();
|
|
295
|
-
initSpin.start("Initializing git repository");
|
|
296
|
-
const result = spawnSync("git", ["init", "-q"
|
|
310
|
+
initSpin.start("Initializing git repository (main branch)");
|
|
311
|
+
const result = spawnSync("git", ["init", "-q", "-b", "main"], {
|
|
312
|
+
cwd: targetDir,
|
|
313
|
+
stdio: "ignore"
|
|
314
|
+
});
|
|
297
315
|
if (result.status === 0) {
|
|
298
|
-
initSpin.stop("Git repository initialized");
|
|
316
|
+
initSpin.stop("Git repository initialized on main");
|
|
299
317
|
} else {
|
|
300
318
|
initSpin.stop("Git could not be initialized (is git installed?)");
|
|
301
319
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build output
|
|
5
|
+
.x/
|
|
6
|
+
dist/
|
|
7
|
+
|
|
8
|
+
# Runtime data (SQLite, uploads)
|
|
9
|
+
data/
|
|
10
|
+
*.db
|
|
11
|
+
*.db-journal
|
|
12
|
+
|
|
13
|
+
# Env
|
|
14
|
+
.env
|
|
15
|
+
.env.local
|
|
16
|
+
.env.*.local
|
|
17
|
+
|
|
18
|
+
# Compiled styles
|
|
19
|
+
public/styles.css
|
|
20
|
+
|
|
21
|
+
# Vercel
|
|
22
|
+
.vercel/
|
|
23
|
+
|
|
24
|
+
# Misc
|
|
25
|
+
.DS_Store
|
|
26
|
+
*.log
|