create-rigg 0.0.8 → 0.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/README.md +12 -3
- package/dist/index.mjs +20 -39
- package/package.json +2 -2
- package/template/package.json +9 -1
- package/template/test/index.test.ts +3 -3
- package/template/vitest.config.ts +2 -2
package/README.md
CHANGED
|
@@ -5,20 +5,29 @@
|
|
|
5
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
6
|
</p>
|
|
7
7
|
|
|
8
|
-
**Create Node.js projects with a
|
|
8
|
+
**Create Node.js projects with a modern toolchain**
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
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
11
|
|
|
12
12
|
## Create a new project with rigg
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
+
# pnpm
|
|
15
16
|
pnpm create rigg@latest
|
|
17
|
+
|
|
18
|
+
# npm
|
|
16
19
|
npm create rigg@latest
|
|
20
|
+
|
|
21
|
+
# bun
|
|
22
|
+
bun create rigg@latest
|
|
23
|
+
|
|
24
|
+
# yarn
|
|
25
|
+
yarn create rigg@latest
|
|
17
26
|
```
|
|
18
27
|
|
|
19
28
|
## What you get
|
|
20
29
|
|
|
21
|
-
A project created with rigg gets most of the same tools as the Vite+ toolchain.
|
|
30
|
+
A project created with rigg gets most of the same tools as in the Vite+ toolchain.
|
|
22
31
|
|
|
23
32
|
| Tool | Role |
|
|
24
33
|
| -------------------------------------------------- | ------------------ |
|
package/dist/index.mjs
CHANGED
|
@@ -109,6 +109,15 @@ const PKG_MANAGERS = [
|
|
|
109
109
|
];
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/index.ts
|
|
112
|
+
const THEME = [[
|
|
113
|
+
251,
|
|
114
|
+
146,
|
|
115
|
+
60
|
|
116
|
+
], [
|
|
117
|
+
236,
|
|
118
|
+
72,
|
|
119
|
+
153
|
|
120
|
+
]];
|
|
112
121
|
/** Creates a colored gradient text effect */
|
|
113
122
|
function gradient(text, stops, whiteRange) {
|
|
114
123
|
const chars = [...text];
|
|
@@ -243,17 +252,8 @@ async function scaffoldFiles(options, targetDir) {
|
|
|
243
252
|
async function installDependencies(options, targetDir) {
|
|
244
253
|
const { pkgManager, framework, verbose } = options;
|
|
245
254
|
const stdio = verbose ? "inherit" : "ignore";
|
|
246
|
-
const gradientStops = [[
|
|
247
|
-
168,
|
|
248
|
-
85,
|
|
249
|
-
247
|
|
250
|
-
], [
|
|
251
|
-
99,
|
|
252
|
-
102,
|
|
253
|
-
241
|
|
254
|
-
]];
|
|
255
255
|
const depSpin = p.spinner();
|
|
256
|
-
depSpin.start(`Installing dependencies with ${gradient(pkgManager,
|
|
256
|
+
depSpin.start(`Installing dependencies with ${gradient(pkgManager, THEME)}...`);
|
|
257
257
|
await run(pkgManager, addArgs(pkgManager, [
|
|
258
258
|
"@types/node",
|
|
259
259
|
"oxfmt",
|
|
@@ -266,11 +266,11 @@ async function installDependencies(options, targetDir) {
|
|
|
266
266
|
cwd: targetDir,
|
|
267
267
|
stdio
|
|
268
268
|
});
|
|
269
|
-
depSpin.stop(`Dependencies installed with ${gradient(pkgManager,
|
|
269
|
+
depSpin.stop(`Dependencies installed with ${gradient(pkgManager, THEME)}`);
|
|
270
270
|
if (framework !== "none") {
|
|
271
271
|
const frameworkName = FRAMEWORK_LABELS[framework];
|
|
272
272
|
const frameworkSpin = p.spinner();
|
|
273
|
-
frameworkSpin.start(`Installing ${gradient(frameworkName,
|
|
273
|
+
frameworkSpin.start(`Installing ${gradient(frameworkName, THEME)}...`);
|
|
274
274
|
const { deps, devDeps } = FRAMEWORK_DEPS[framework];
|
|
275
275
|
if (deps.length > 0) await run(pkgManager, addArgs(pkgManager, deps, false), {
|
|
276
276
|
cwd: targetDir,
|
|
@@ -280,42 +280,23 @@ async function installDependencies(options, targetDir) {
|
|
|
280
280
|
cwd: targetDir,
|
|
281
281
|
stdio
|
|
282
282
|
});
|
|
283
|
-
frameworkSpin.stop(`${gradient(frameworkName,
|
|
283
|
+
frameworkSpin.stop(`${gradient(frameworkName, THEME)} installed`);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
/** Prints the gradient intro. */
|
|
287
287
|
function showIntro() {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
[
|
|
295
|
-
168,
|
|
296
|
-
85,
|
|
297
|
-
247
|
|
298
|
-
],
|
|
299
|
-
[
|
|
300
|
-
99,
|
|
301
|
-
102,
|
|
302
|
-
241
|
|
303
|
-
]
|
|
304
|
-
], [0, 6])));
|
|
288
|
+
console.log("");
|
|
289
|
+
p.intro(pc.bold(gradient("rigg - Node.js projects with a modern toolchain", [[
|
|
290
|
+
255,
|
|
291
|
+
255,
|
|
292
|
+
255
|
|
293
|
+
], ...THEME], [0, 6])));
|
|
305
294
|
}
|
|
306
295
|
/** Prints the gradient outro with next steps. */
|
|
307
296
|
function showOutro(options) {
|
|
308
297
|
const { projectName, framework, pkgManager } = options;
|
|
309
298
|
const frameworkLabel = FRAMEWORK_LABELS[framework];
|
|
310
|
-
const title = gradient(frameworkLabel !== "None" ? `Created ${projectName} with ${frameworkLabel}` : `Created ${projectName}`, [
|
|
311
|
-
168,
|
|
312
|
-
85,
|
|
313
|
-
247
|
|
314
|
-
], [
|
|
315
|
-
99,
|
|
316
|
-
102,
|
|
317
|
-
241
|
|
318
|
-
]], [8, 8 + projectName.length]);
|
|
299
|
+
const title = gradient(frameworkLabel !== "None" ? `Created ${projectName} with ${frameworkLabel}` : `Created ${projectName}`, THEME, [8, 8 + projectName.length]);
|
|
319
300
|
const devCmd = pkgManager === "npm" ? "npm run dev" : `${pkgManager} dev`;
|
|
320
301
|
p.outro(`${title}\n\n ${pc.dim("Now run:")}\n cd ${projectName}\n ${devCmd}`);
|
|
321
302
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rigg",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Create Node.js TypeScript projects
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Create Node.js TypeScript projects using the Vite+ Toolchain - for everything outside the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backend",
|
|
7
7
|
"create-rigg",
|
package/template/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "rigg-project",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
+
"description": "Create Node.js TypeScript projects with a Unified Toolchain",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"license": "",
|
|
7
|
+
"author": "",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "",
|
|
10
|
+
"url": ""
|
|
11
|
+
},
|
|
4
12
|
"type": "module",
|
|
5
13
|
"scripts": {
|
|
6
14
|
"dev": "tsx src/index.ts",
|