create-astro 3.1.5 → 3.1.6

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 (2) hide show
  1. package/dist/index.js +10 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -368,7 +368,7 @@ function printHelp({
368
368
  if (headline) {
369
369
  message.push(
370
370
  linebreak(),
371
- `${title(commandName)} ${color.green(`v${"3.1.5"}`)} ${headline}`
371
+ `${title(commandName)} ${color.green(`v${"3.1.6"}`)} ${headline}`
372
372
  );
373
373
  }
374
374
  if (usage) {
@@ -788,10 +788,16 @@ var FILES_TO_UPDATE = {
788
788
  );
789
789
  })
790
790
  };
791
- async function copyTemplate(tmpl, ctx) {
792
- const ref = ctx.ref || "latest";
791
+ function getTemplateTarget(tmpl, ref = "latest") {
793
792
  const isThirdParty = tmpl.includes("/");
794
- const templateTarget = isThirdParty ? tmpl : `github:withastro/astro/examples/${tmpl}#${ref}`;
793
+ if (isThirdParty)
794
+ return tmpl;
795
+ if (tmpl === "starlight")
796
+ return `withastro/starlight/examples/basics`;
797
+ return `github:withastro/astro/examples/${tmpl}#${ref}`;
798
+ }
799
+ async function copyTemplate(tmpl, ctx) {
800
+ const templateTarget = getTemplateTarget(tmpl, ctx.ref);
795
801
  if (!ctx.dryRun) {
796
802
  try {
797
803
  await downloadTemplate(templateTarget, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",