create-rigg 0.1.1 → 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/README.md +3 -1
- package/dist/index.mjs +9 -2
- package/package.json +15 -12
- package/template/README.md +17 -0
- package/template/_gitignore +21 -0
- package/template/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
<p>
|
|
4
4
|
<a href="https://npmx.dev/package/create-rigg"><img src="https://npmx.dev/api/registry/badge/version/create-rigg" alt="Version"></a>
|
|
5
|
-
<a href="https://www.npmjs.com/package/create-rigg"><img src="https://img.shields.io/npm/v/create-rigg.svg" alt="Version"></a>
|
|
6
5
|
</p>
|
|
7
6
|
|
|
8
7
|
**Create Node.js projects with a modern toolchain**
|
|
9
8
|
|
|
10
9
|
I really like what [VoidZero](https://voidzero.dev) and [Vite+](https://github.com/voidzero-dev/vite-plus) are doing for web development. **rigg** brings the same toolchain to every Node.js project outside the browser. Use it for backends, CLIs, libraries, scripts, whatever you're building.
|
|
11
10
|
|
|
11
|
+

|
|
12
|
+
|
|
12
13
|
## Create a new project with rigg
|
|
13
14
|
|
|
14
15
|
```bash
|
|
@@ -53,6 +54,7 @@ Every generated project includes:
|
|
|
53
54
|
```bash
|
|
54
55
|
pnpm dev # Run with tsx (no build step)
|
|
55
56
|
pnpm build # Build with tsdown
|
|
57
|
+
pnpm start # Run compiled output
|
|
56
58
|
pnpm test # Run Vitest
|
|
57
59
|
pnpm check # Lint + format check + type check
|
|
58
60
|
pnpm fmt # Format
|
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,13 @@ 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");
|
|
249
|
+
/** Replace the placeholder project name in README.md. */
|
|
250
|
+
const readmePath = path.join(targetDir, "README.md");
|
|
251
|
+
const readme = fs.readFileSync(readmePath, "utf-8");
|
|
252
|
+
fs.writeFileSync(readmePath, readme.replaceAll("{{project_name}}", options.projectName));
|
|
246
253
|
/** Create the src directory and write the framework starter code. */
|
|
247
254
|
fs.mkdirSync(path.join(targetDir, "src"), { recursive: true });
|
|
248
255
|
fs.writeFileSync(path.join(targetDir, "src", "index.ts"), FRAMEWORK_INDEX[options.framework]);
|
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,14 +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
|
-
}
|
|
70
|
-
}
|
|
72
|
+
"packageManager": "pnpm@10.30.3"
|
|
73
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
> Short description of your project.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm dev # Run with tsx (no compile step)
|
|
9
|
+
pnpm build # Compile to dist/
|
|
10
|
+
pnpm start # Run compiled output
|
|
11
|
+
pnpm test # Vitest
|
|
12
|
+
pnpm check # Lint + format check + type check
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Scaffolded with [rigg](https://github.com/ehs5/rigg).
|
|
@@ -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/
|
package/template/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rigg-project",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "",
|
|
7
7
|
"author": "",
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
|
-
"dev": "tsx src/index.ts",
|
|
14
|
+
"dev": "tsx watch src/index.ts",
|
|
15
15
|
"build": "tsdown src/index.ts",
|
|
16
|
+
"start": "node dist/index.mjs",
|
|
16
17
|
"test": "vitest",
|
|
17
18
|
"lint": "oxlint",
|
|
18
19
|
"lint:fix": "oxlint --fix",
|