create-docus 4.0.0-beta.12 → 4.0.0-beta.14
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/main.mjs +14 -3
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -15,12 +15,23 @@ function createCLI(opts) {
|
|
|
15
15
|
description: "Project directory",
|
|
16
16
|
required: false,
|
|
17
17
|
default: "docs"
|
|
18
|
+
},
|
|
19
|
+
template: {
|
|
20
|
+
type: "string",
|
|
21
|
+
alias: "t",
|
|
22
|
+
description: "Template to use (default, i18n)",
|
|
23
|
+
required: false,
|
|
24
|
+
default: "default"
|
|
18
25
|
}
|
|
19
26
|
},
|
|
20
|
-
async setup(
|
|
21
|
-
const dir = resolve(args.dir);
|
|
27
|
+
async setup(context) {
|
|
28
|
+
const dir = resolve(context.args.dir);
|
|
29
|
+
const template = context.args.template;
|
|
30
|
+
if (!["i18n", "default"].includes(template)) {
|
|
31
|
+
throw new Error("Invalid template");
|
|
32
|
+
}
|
|
22
33
|
const { runCommand } = await import("nuxi");
|
|
23
|
-
await runCommand("init", [dir, "-t",
|
|
34
|
+
await runCommand("init", [dir, "-t", `gh:nuxtlabs/docus/.starters/${template}`]);
|
|
24
35
|
}
|
|
25
36
|
});
|
|
26
37
|
return {
|
package/package.json
CHANGED