create-rigg 0.1.2 → 0.1.3
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.mjs +5 -2
- package/package.json +15 -13
- package/template/_gitignore +21 -0
- package/template/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -168,12 +168,13 @@ function run(cmd, args, opts) {
|
|
|
168
168
|
});
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
/** Recursively copies a directory, renaming _gitignore
|
|
171
|
+
/** Recursively copies a directory, renaming _gitignore → .gitignore (npm strips dotfiles during publish). */
|
|
172
172
|
function copyDir(src, dest) {
|
|
173
173
|
fs.mkdirSync(dest, { recursive: true });
|
|
174
174
|
for (const entry of fs.readdirSync(src)) {
|
|
175
175
|
const srcPath = path.join(src, entry);
|
|
176
|
-
const
|
|
176
|
+
const destName = entry === "_gitignore" ? ".gitignore" : entry;
|
|
177
|
+
const destPath = path.join(dest, destName);
|
|
177
178
|
if (fs.statSync(srcPath).isDirectory()) copyDir(srcPath, destPath);
|
|
178
179
|
else fs.copyFileSync(srcPath, destPath);
|
|
179
180
|
}
|
|
@@ -242,7 +243,9 @@ async function scaffoldFiles(options, targetDir) {
|
|
|
242
243
|
const pkgJsonPath = path.join(targetDir, "package.json");
|
|
243
244
|
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
244
245
|
pkg.name = options.projectName;
|
|
246
|
+
if (options.pkgManager === "npm") pkg.allowScripts = { esbuild: true };
|
|
245
247
|
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
248
|
+
if (options.pkgManager === "pnpm") fs.writeFileSync(path.join(targetDir, "pnpm-workspace.yaml"), "allowBuilds:\n esbuild: true\n");
|
|
246
249
|
/** Replace the placeholder project name in README.md. */
|
|
247
250
|
const readmePath = path.join(targetDir, "README.md");
|
|
248
251
|
const readme = fs.readFileSync(readmePath, "utf-8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rigg",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Create Node.js TypeScript projects using the Vite+ Toolchain - for everything outside the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backend",
|
|
@@ -38,6 +38,18 @@
|
|
|
38
38
|
"template"
|
|
39
39
|
],
|
|
40
40
|
"type": "module",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "vitest",
|
|
43
|
+
"lint": "oxlint",
|
|
44
|
+
"lint:fix": "oxlint --fix",
|
|
45
|
+
"fmt": "oxfmt",
|
|
46
|
+
"fmt:check": "oxfmt --check",
|
|
47
|
+
"check": "oxlint && oxfmt --check && tsc --noEmit",
|
|
48
|
+
"dev": "tsx src/index.ts",
|
|
49
|
+
"build": "tsdown src/index.ts",
|
|
50
|
+
"start": "node dist/index.mjs",
|
|
51
|
+
"prepublishOnly": "git diff --exit-code && git diff --cached --exit-code && oxlint && oxfmt && tsc --noEmit && vitest run && pnpm build"
|
|
52
|
+
},
|
|
41
53
|
"dependencies": {
|
|
42
54
|
"@clack/prompts": "^1.1.0",
|
|
43
55
|
"cross-spawn": "^7.0.6",
|
|
@@ -57,15 +69,5 @@
|
|
|
57
69
|
"engines": {
|
|
58
70
|
"node": ">=22.12.0"
|
|
59
71
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
"lint": "oxlint",
|
|
63
|
-
"lint:fix": "oxlint --fix",
|
|
64
|
-
"fmt": "oxfmt",
|
|
65
|
-
"fmt:check": "oxfmt --check",
|
|
66
|
-
"check": "oxlint && oxfmt --check && tsc --noEmit",
|
|
67
|
-
"dev": "tsx src/index.ts",
|
|
68
|
-
"build": "tsdown src/index.ts",
|
|
69
|
-
"start": "node dist/index.mjs"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
+
"packageManager": "pnpm@10.30.3"
|
|
73
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# macOS settings file
|
|
2
|
+
.DS_Store
|
|
3
|
+
|
|
4
|
+
# Contains all your dependencies
|
|
5
|
+
node_modules
|
|
6
|
+
|
|
7
|
+
/dist
|
|
8
|
+
|
|
9
|
+
# Deal with environment files
|
|
10
|
+
.env
|
|
11
|
+
.env.*
|
|
12
|
+
|
|
13
|
+
# We'll allow an example .env file which can be copied + schemas
|
|
14
|
+
!.env.example
|
|
15
|
+
!.env.schema
|
|
16
|
+
|
|
17
|
+
# Coverage directory used by testing tools
|
|
18
|
+
coverage
|
|
19
|
+
|
|
20
|
+
# Visual Studio Code configuration
|
|
21
|
+
.vscode/
|