create-vttforge 0.3.2

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.
Files changed (3) hide show
  1. package/README.md +17 -0
  2. package/bin.mjs +65 -0
  3. package/package.json +37 -0
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # create-vttforge
2
+
3
+ Scaffold a new Foundry VTT system or module with VTTForge.
4
+
5
+ ```bash
6
+ pnpm create vttforge my-system
7
+ # or
8
+ npm create vttforge@latest my-system
9
+ # or
10
+ bun create vttforge my-system
11
+ # or
12
+ yarn create vttforge my-system
13
+ ```
14
+
15
+ This package is a thin wrapper around `@vttforge/cli init`. The scaffolder asks for the package type, language, id, title, author, license, and Foundry version, then writes a runnable Foundry v13+ scaffold into the named directory.
16
+
17
+ See [`@vttforge/cli`](https://www.npmjs.com/package/@vttforge/cli) for the full CLI surface (`init`, `dev`, `build`, `audit`).
package/bin.mjs ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * create-vttforge — npm `create-*` convention wrapper.
4
+ *
5
+ * `pnpm create vttforge my-system` (or `npm create vttforge@latest my-system`,
6
+ * `bun create vttforge my-system`, `yarn create vttforge my-system`) invokes
7
+ * this binary. We forward the args directly to `@vttforge/cli`'s `init`
8
+ * subcommand so the scaffolder code lives in exactly one place.
9
+ */
10
+ import { runInit } from '@vttforge/cli';
11
+
12
+ const args = process.argv.slice(2);
13
+
14
+ let name;
15
+ let type;
16
+ let lang;
17
+ let noInstall = false;
18
+ let noGit = false;
19
+
20
+ for (let i = 0; i < args.length; i += 1) {
21
+ const arg = args[i];
22
+ if (arg === undefined) continue;
23
+ // Accept both the create-* convention (--no-install, --no-git) and the
24
+ // affirmative form (--install=false). Defaults are install + git enabled.
25
+ if (arg === '--no-install' || arg === '--install=false') {
26
+ noInstall = true;
27
+ continue;
28
+ }
29
+ if (arg === '--no-git' || arg === '--git=false') {
30
+ noGit = true;
31
+ continue;
32
+ }
33
+ if (arg === '--type' || arg === '-t') {
34
+ i += 1;
35
+ type = args[i];
36
+ continue;
37
+ }
38
+ if (arg === '--lang' || arg === '-l') {
39
+ i += 1;
40
+ lang = args[i];
41
+ continue;
42
+ }
43
+ if (arg.startsWith('--type=')) {
44
+ type = arg.slice('--type='.length);
45
+ continue;
46
+ }
47
+ if (arg.startsWith('--lang=')) {
48
+ lang = arg.slice('--lang='.length);
49
+ continue;
50
+ }
51
+ if (arg.startsWith('-')) {
52
+ // Unknown flag — skip silently rather than crash the create-* flow.
53
+ continue;
54
+ }
55
+ if (name === undefined) {
56
+ name = arg;
57
+ }
58
+ }
59
+
60
+ try {
61
+ await runInit({ name, type, lang, noInstall, noGit });
62
+ } catch (err) {
63
+ console.error(err instanceof Error ? err.message : String(err));
64
+ process.exit(1);
65
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "create-vttforge",
3
+ "version": "0.3.2",
4
+ "description": "Scaffold a Foundry VTT system or module with VTTForge. Thin wrapper around `@vttforge/cli init`.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/vttforge/vttforge#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/vttforge/vttforge.git",
11
+ "directory": "packages/create-vttforge"
12
+ },
13
+ "bugs": "https://github.com/vttforge/vttforge/issues",
14
+ "keywords": [
15
+ "foundryvtt",
16
+ "vttforge",
17
+ "scaffold",
18
+ "create"
19
+ ],
20
+ "bin": {
21
+ "create-vttforge": "./bin.mjs"
22
+ },
23
+ "files": [
24
+ "bin.mjs",
25
+ "README.md"
26
+ ],
27
+ "dependencies": {
28
+ "@vttforge/cli": "workspace:*"
29
+ },
30
+ "engines": {
31
+ "node": ">=26.0.0"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public",
35
+ "provenance": false
36
+ }
37
+ }