@tavora/create-module 0.1.0 → 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/CHANGELOG.md +5 -0
- package/README.md +2 -2
- package/dist/index.js +86 -29
- package/dist/index.js.map +1 -1
- package/dist/versions.d.ts +2 -2
- package/dist/versions.js +2 -2
- package/package.json +3 -2
- package/templates/react/src/main.tsx +1 -1
- package/templates/shared/README.md +1 -1
- package/templates/vanilla/src/main.ts +1 -1
- package/templates/vue/src/App.vue +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in `@tavora/create-module`, newest first.
|
|
4
4
|
|
|
5
|
+
## 0.1.1
|
|
6
|
+
|
|
7
|
+
- Asks with arrow keys: where the project goes (the empty folder you are in, or a new folder in it) and which template.
|
|
8
|
+
- The next steps say to leave `npm run dev` running and which folder to add in Tavora under Settings > Development; a folder with several projects works too (Tavora 0.17.20).
|
|
9
|
+
|
|
5
10
|
## 0.1.0
|
|
6
11
|
|
|
7
12
|
- First release on npm: `npm create @tavora/module` makes a vanilla TypeScript, Vue or React module project.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ npm create @tavora/module
|
|
|
8
8
|
pnpm create @tavora/module
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
It asks
|
|
11
|
+
It asks where the project goes (the empty folder you are in, or a new folder in it), the module's name, its id (`publisher.module-name`) and a template: **vanilla** TypeScript, **vue** or **react**, picked with the arrow keys. Give them up front to skip the questions:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
npm create @tavora/module raid-timer -- --template vue --id example.raid-timer --name "Raid Timer"
|
|
@@ -17,6 +17,6 @@ pnpm create @tavora/module raid-timer --template vue --id example.raid-timer --n
|
|
|
17
17
|
|
|
18
18
|
`--yes` takes the suggestions for anything not given.
|
|
19
19
|
|
|
20
|
-
The project builds with Vite, has a `dev` script that rebuilds on every change (add the folder in Tavora under **Settings >
|
|
20
|
+
The project builds with Vite, has a `dev` script that rebuilds on every change (add the folder in Tavora under **Settings > Development > Add a development folder…**; a folder with several projects in it works too), and a `zip` script that packs and signs it with `@tavora/pack`. Its manifest sets `minTavora` to the oldest Tavora that has everything the SDK it starts with offers. The project's README says the rest.
|
|
21
21
|
|
|
22
22
|
More in the [developer docs](https://docs.mytavora.app/guide/getting-started).
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// npm create @tavora/module [folder] -- [--template vanilla|vue|react] [--id publisher.name] [--name "Name"] [--yes]
|
|
3
3
|
// pnpm create @tavora/module [folder] [--template ...]
|
|
4
|
-
// Makes a new Tavora module project. Asks for what was not given, unless --yes (or no terminal)
|
|
4
|
+
// Makes a new Tavora module project. Asks for what was not given, unless --yes (or no terminal):
|
|
5
|
+
// where (this empty folder or a new one in it) and the template are picked with the arrow keys.
|
|
6
|
+
import { readdir } from "node:fs/promises";
|
|
5
7
|
import path from "node:path";
|
|
6
|
-
import { createInterface } from "node:readline/promises";
|
|
7
8
|
import { parseArgs } from "node:util";
|
|
9
|
+
import { cancel, intro, isCancel, note, outro, select, text } from "@clack/prompts";
|
|
8
10
|
import { createModule, CreateError, defaultsFor, idProblem, nameProblem, TEMPLATES } from "./create.js";
|
|
9
11
|
const USAGE = "usage: npm create @tavora/module [folder] -- [--template vanilla|vue|react] [--id publisher.module-name] [--name \"Module name\"] [--yes]";
|
|
12
|
+
const TEMPLATE_LABELS = { vanilla: "Vanilla TypeScript", vue: "Vue", react: "React" };
|
|
10
13
|
/** The package manager that ran the starter, so the printed commands fit. */
|
|
11
14
|
function packageManager() {
|
|
12
15
|
const agent = process.env.npm_config_user_agent ?? "";
|
|
13
16
|
return agent.startsWith("pnpm") ? "pnpm" : agent.startsWith("yarn") ? "yarn" : "npm";
|
|
14
17
|
}
|
|
18
|
+
/** Thrown when the developer pressed Ctrl+C or Esc in a question. */
|
|
19
|
+
class Cancelled extends Error {
|
|
20
|
+
}
|
|
21
|
+
function answer(value) {
|
|
22
|
+
if (isCancel(value))
|
|
23
|
+
throw new Cancelled();
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
async function isEmptyFolder(dir) {
|
|
27
|
+
return ((await readdir(dir).catch(() => null))?.length ?? -1) === 0;
|
|
28
|
+
}
|
|
15
29
|
async function main() {
|
|
16
30
|
let parsed;
|
|
17
31
|
try {
|
|
@@ -29,48 +43,91 @@ async function main() {
|
|
|
29
43
|
console.log(USAGE);
|
|
30
44
|
return values.help ? 0 : 2;
|
|
31
45
|
}
|
|
46
|
+
if (values.template !== undefined && !TEMPLATES.includes(values.template)) {
|
|
47
|
+
console.error(`create-module: the template is one of ${TEMPLATES.join(", ")}`);
|
|
48
|
+
return 2;
|
|
49
|
+
}
|
|
32
50
|
const interactive = !values.yes && process.stdin.isTTY === true;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const ask = async (question, suggestion, problem = () => null) => {
|
|
36
|
-
if (!prompt)
|
|
37
|
-
return suggestion;
|
|
38
|
-
for (;;) {
|
|
39
|
-
const answer = (await prompt.question(`${question} (${suggestion}): `)).trim() || suggestion;
|
|
40
|
-
const wrong = problem(answer);
|
|
41
|
-
if (!wrong)
|
|
42
|
-
return answer;
|
|
43
|
-
console.log(` ${wrong}`);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
51
|
+
const here = process.cwd();
|
|
52
|
+
const emptyHere = await isEmptyFolder(here);
|
|
46
53
|
try {
|
|
47
|
-
|
|
54
|
+
if (interactive)
|
|
55
|
+
intro("A new Tavora module");
|
|
56
|
+
// Where: the empty folder the developer is in, or a new folder in it.
|
|
57
|
+
let folder = positionals[0];
|
|
58
|
+
if (folder === undefined && interactive) {
|
|
59
|
+
const where = emptyHere
|
|
60
|
+
? answer(await select({
|
|
61
|
+
message: "Where should the project go?",
|
|
62
|
+
options: [
|
|
63
|
+
{ value: ".", label: `This folder (${path.basename(here)})`, hint: "it is empty" },
|
|
64
|
+
{ value: "new", label: "A new folder in it" },
|
|
65
|
+
],
|
|
66
|
+
}))
|
|
67
|
+
: "new";
|
|
68
|
+
folder =
|
|
69
|
+
where === "."
|
|
70
|
+
? "."
|
|
71
|
+
: answer(await text({
|
|
72
|
+
message: "Folder name for the project",
|
|
73
|
+
placeholder: "my-tavora-module",
|
|
74
|
+
defaultValue: "my-tavora-module",
|
|
75
|
+
validate: (value) => (value && /[\\/:*?"<>|]/.test(value) ? "a folder name, without \\ / : * ? \" < > |" : undefined),
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
folder ??= emptyHere ? "." : "my-tavora-module";
|
|
48
79
|
const defaults = defaultsFor(folder);
|
|
49
|
-
const name = values.name ??
|
|
50
|
-
|
|
51
|
-
|
|
80
|
+
const name = values.name ??
|
|
81
|
+
(interactive
|
|
82
|
+
? answer(await text({ message: "Module name", placeholder: defaults.name, defaultValue: defaults.name, validate: (value) => (value ? (nameProblem(value) ?? undefined) : undefined) }))
|
|
83
|
+
: defaults.name);
|
|
84
|
+
const id = values.id ??
|
|
85
|
+
(interactive
|
|
86
|
+
? answer(await text({
|
|
87
|
+
message: "Module id (publisher.module-name)",
|
|
88
|
+
placeholder: defaults.id,
|
|
89
|
+
defaultValue: defaults.id,
|
|
90
|
+
validate: (value) => (value ? (idProblem(value) ?? undefined) : undefined),
|
|
91
|
+
}))
|
|
92
|
+
: defaults.id);
|
|
93
|
+
const template = (values.template ??
|
|
94
|
+
(interactive
|
|
95
|
+
? answer(await select({ message: "Template", options: TEMPLATES.map((value) => ({ value, label: TEMPLATE_LABELS[value] })), initialValue: "vanilla" }))
|
|
96
|
+
: "vanilla"));
|
|
52
97
|
const manager = packageManager();
|
|
53
98
|
await createModule({ dir: folder, id, name, template, packageManager: manager });
|
|
54
99
|
const run = manager === "npm" ? "npm run" : manager;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
100
|
+
const project = path.resolve(folder);
|
|
101
|
+
const steps = [
|
|
102
|
+
...(folder === "." ? [] : [`cd ${folder}`]),
|
|
103
|
+
`${manager} install`,
|
|
104
|
+
`${run} dev # builds, then rebuilds on every change: leave it running`,
|
|
105
|
+
"",
|
|
106
|
+
"Then in Tavora: Settings > Development > Add a development folder…",
|
|
107
|
+
`and pick ${project}`,
|
|
108
|
+
...(folder === "." ? [] : [`(or ${here}, to load every module project you keep in it)`]),
|
|
109
|
+
];
|
|
110
|
+
if (interactive) {
|
|
111
|
+
note(steps.join("\n"), "Next");
|
|
112
|
+
outro(`Made ${name} (${id}). The README says how to share it and show your name on it.`);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
console.log(`\nMade ${name} (${id}) in ${project}.\n\nNext:\n${steps.map((line) => (line ? ` ${line}` : "")).join("\n")}\n`);
|
|
116
|
+
console.log("The README says how to share the module and show your name on it.");
|
|
117
|
+
}
|
|
62
118
|
return 0;
|
|
63
119
|
}
|
|
64
120
|
catch (error) {
|
|
121
|
+
if (error instanceof Cancelled) {
|
|
122
|
+
cancel("Nothing was made.");
|
|
123
|
+
return 1;
|
|
124
|
+
}
|
|
65
125
|
if (error instanceof CreateError) {
|
|
66
126
|
console.error(`create-module: ${error.message}`);
|
|
67
127
|
return 1;
|
|
68
128
|
}
|
|
69
129
|
throw error;
|
|
70
130
|
}
|
|
71
|
-
finally {
|
|
72
|
-
prompt?.close();
|
|
73
|
-
}
|
|
74
131
|
}
|
|
75
132
|
main().then((code) => (process.exitCode = code), (error) => {
|
|
76
133
|
console.error(error);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,qHAAqH;AACrH,uDAAuD;AACvD,iGAAiG;AACjG,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.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C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9H,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;YAC/B,MAAM,CAAC,mBAAmB,CAAC,CAAC;YAC5B,OAAO,CAAC,CAAC;QACX,CAAC;QACD,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,OAAO,CAAC,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACjD,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,EACnC,CAAC,KAAc,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
|
package/dist/versions.d.ts
CHANGED
package/dist/versions.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// and the oldest Tavora that has everything that SDK offers (its MIN_TAVORA). A test keeps these
|
|
3
3
|
// equal to the packages in Tavora's repository, so a release never ships an old starter.
|
|
4
4
|
export const VERSIONS = {
|
|
5
|
-
sdk: "0.2.
|
|
5
|
+
sdk: "0.2.5",
|
|
6
6
|
pack: "0.1.0",
|
|
7
|
-
minTavora: "0.17.
|
|
7
|
+
minTavora: "0.17.19",
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=versions.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tavora/create-module",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Makes a new Tavora module project: npm create @tavora/module.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -33,11 +33,12 @@
|
|
|
33
33
|
"node": ">=22.12"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@clack/prompts": "^1.8.1",
|
|
36
37
|
"@tavora/module-schema": "^0.1.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@types/node": "^22.20.5",
|
|
40
|
-
"@tavora/sdk": "0.2.
|
|
41
|
+
"@tavora/sdk": "0.2.5"
|
|
41
42
|
},
|
|
42
43
|
"license": "MIT",
|
|
43
44
|
"scripts": {
|
|
@@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
|
|
5
5
|
// This page runs inside a Tavora panel; in a normal browser connect() fails. Build it and add this
|
|
6
|
-
// folder in Tavora (Settings >
|
|
6
|
+
// folder in Tavora (Settings > Development > Add a development folder) to see it.
|
|
7
7
|
|
|
8
8
|
/** Your texts in English and German; Tavora says which language the player uses. */
|
|
9
9
|
const TEXTS = {
|
|
@@ -9,7 +9,7 @@ A [Tavora](https://mytavora.app) module, made with `@tavora/create-module`. Tavo
|
|
|
9
9
|
{{run}} dev
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
`dev` builds the module into `dist/` and builds it again on every change. In Tavora, open **Settings >
|
|
12
|
+
`dev` builds the module into `dist/` and builds it again on every change. Leave it running. In Tavora, open **Settings > Development > Add a development folder…** and choose this folder, or the folder you keep all your module projects in. Add the module to a game with **Add module**; its panels reload by themselves after every build.
|
|
13
13
|
|
|
14
14
|
- `tavora.module.json` is the manifest: its id, name, the panel's smallest size, and what it asks the player for (websites to reach, connectors). See the [manifest reference](https://docs.mytavora.app/reference/manifest).
|
|
15
15
|
- `minTavora` is the oldest Tavora the module works with. Raise it when you use something newer from the SDK (the [changelog](https://docs.mytavora.app/reference/changelog) says which Tavora added what).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { connect, type TavoraSDK, type TavoraTheme } from "@tavora/sdk";
|
|
2
2
|
|
|
3
3
|
// This page runs inside a Tavora panel; in a normal browser connect() fails. Build it and add this
|
|
4
|
-
// folder in Tavora (Settings >
|
|
4
|
+
// folder in Tavora (Settings > Development > Add a development folder) to see it.
|
|
5
5
|
|
|
6
6
|
const status = document.querySelector<HTMLParagraphElement>("#status")!;
|
|
7
7
|
const counter = document.querySelector<HTMLButtonElement>("#counter")!;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// This page runs inside a Tavora panel; in a normal browser connect() fails. Build it and add this
|
|
3
|
-
// folder in Tavora (Settings >
|
|
3
|
+
// folder in Tavora (Settings > Development > Add a development folder) to see it.
|
|
4
4
|
import { connect, type TavoraSDK, type TavoraTheme } from "@tavora/sdk";
|
|
5
5
|
import { computed, onMounted, ref, shallowRef } from "vue";
|
|
6
6
|
|