diff --git a/templates/cli/src/index.js b/templates/cli/src/index.js index 65706abc..a3da0e6f 100644 --- a/templates/cli/src/index.js +++ b/templates/cli/src/index.js @@ -43,14 +43,14 @@ async function runPrompts() { const language = await select({ message: "What language do you want to use?", choices: [ - { - name: "TypeScript", - value: "ts", - }, { name: "JavaScript", value: "js", }, + { + name: "TypeScript", + value: "ts", + }, ], loop: false, }); @@ -125,6 +125,13 @@ async function processAnswers(answers) { .pipe(dest(`${repoRoot}/packages/${destPath}`)); } + function renameExampleTemplate() { + return src(`${repoRoot}/packages/${destPath}/examples/index.html`) + .pipe(replace("{name}", answers.name)) + .pipe(replace("{globalName}", globalName)) + .pipe(dest(`${repoRoot}/packages/${destPath}/examples`)); + } + function renameDocsTemplate() { return src(`${repoRoot}/packages/${destPath}/docs/docs-template.md`) .pipe(rename(`${answers.name}.md`)) @@ -133,7 +140,8 @@ async function processAnswers(answers) { deleteSync(`${repoRoot}/packages/${destPath}/docs/docs-template.md`); }); } - series(processTemplate, renameDocsTemplate)(); + + series(processTemplate, renameExampleTemplate, renameDocsTemplate)(); } const answers = await runPrompts(); diff --git a/templates/extension-template-js/examples/index.html b/templates/extension-template-js/examples/index.html new file mode 100644 index 00000000..25d9796e --- /dev/null +++ b/templates/extension-template-js/examples/index.html @@ -0,0 +1,27 @@ + + + + {name} Extension Example + + + + + + + + + + diff --git a/templates/extension-template-js/index.js b/templates/extension-template-js/src/index.js similarity index 100% rename from templates/extension-template-js/index.js rename to templates/extension-template-js/src/index.js diff --git a/templates/extension-template-ts/examples/index.html b/templates/extension-template-ts/examples/index.html new file mode 100644 index 00000000..25d9796e --- /dev/null +++ b/templates/extension-template-ts/examples/index.html @@ -0,0 +1,27 @@ + + + + {name} Extension Example + + + + + + + + + + diff --git a/templates/plugin-template-js/examples/index.html b/templates/plugin-template-js/examples/index.html new file mode 100644 index 00000000..692f36bb --- /dev/null +++ b/templates/plugin-template-js/examples/index.html @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/plugin-template-js/index.js b/templates/plugin-template-js/src/index.js similarity index 100% rename from templates/plugin-template-js/index.js rename to templates/plugin-template-js/src/index.js diff --git a/templates/plugin-template-ts/examples/index.html b/templates/plugin-template-ts/examples/index.html new file mode 100644 index 00000000..692f36bb --- /dev/null +++ b/templates/plugin-template-ts/examples/index.html @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + \ No newline at end of file