create-astro 4.9.2 → 4.10.0

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 +11 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -446,7 +446,7 @@ function printHelp({
446
446
  if (headline) {
447
447
  message.push(
448
448
  linebreak(),
449
- `${title(commandName)} ${color.green(`v${"4.9.2"}`)} ${headline}`
449
+ `${title(commandName)} ${color.green(`v${"4.10.0"}`)} ${headline}`
450
450
  );
451
451
  }
452
452
  if (usage) {
@@ -523,7 +523,7 @@ async function getContext(argv) {
523
523
  prompt,
524
524
  packageManager,
525
525
  username: getName(),
526
- version: getVersion(packageManager, "astro", "4.16.0"),
526
+ version: getVersion(packageManager, "astro", "4.16.1"),
527
527
  skipHouston,
528
528
  fancy,
529
529
  dryRun,
@@ -900,11 +900,15 @@ var FILES_TO_UPDATE = {
900
900
  function getTemplateTarget(tmpl, ref = "latest") {
901
901
  if (tmpl.startsWith("starlight")) {
902
902
  const [, starter = "basics"] = tmpl.split("/");
903
- return `withastro/starlight/examples/${starter}`;
903
+ return `github:withastro/starlight/examples/${starter}`;
904
904
  }
905
905
  const isThirdParty = tmpl.includes("/");
906
906
  if (isThirdParty) return tmpl;
907
- return `github:withastro/astro/examples/${tmpl}#${ref}`;
907
+ if (ref === "latest") {
908
+ return `github:withastro/astro#examples/${tmpl}`;
909
+ } else {
910
+ return `github:withastro/astro/examples/${tmpl}#${ref}`;
911
+ }
908
912
  }
909
913
  async function copyTemplate(tmpl, ctx) {
910
914
  const templateTarget = getTemplateTarget(tmpl, ctx.ref);
@@ -912,7 +916,6 @@ async function copyTemplate(tmpl, ctx) {
912
916
  try {
913
917
  await downloadTemplate(templateTarget, {
914
918
  force: true,
915
- provider: "github",
916
919
  cwd: ctx.cwd,
917
920
  dir: "."
918
921
  });
@@ -1126,7 +1129,7 @@ var FILES_TO_UPDATE2 = {
1126
1129
  parsedPackageJson.dependencies ??= {};
1127
1130
  parsedPackageJson.dependencies["@astrojs/check"] = `^${astroCheckVersion}`;
1128
1131
  parsedPackageJson.dependencies.typescript = `^${typescriptVersion}`;
1129
- await writeFile(file, JSON.stringify(parsedPackageJson, null, indent), "utf-8");
1132
+ await writeFile(file, JSON.stringify(parsedPackageJson, null, indent) + "\n", "utf-8");
1130
1133
  } catch (err) {
1131
1134
  if (err && err.code === "ENOENT") return;
1132
1135
  if (err instanceof Error) throw new Error(err.message);
@@ -1140,7 +1143,7 @@ var FILES_TO_UPDATE2 = {
1140
1143
  const result = Object.assign(templateTSConfig, {
1141
1144
  extends: `astro/tsconfigs/${options.value}`
1142
1145
  });
1143
- await writeFile(file, JSON.stringify(result, null, 2));
1146
+ await writeFile(file, JSON.stringify(result, null, 2) + "\n");
1144
1147
  } else {
1145
1148
  throw new Error(
1146
1149
  "There was an error applying the requested TypeScript settings. This could be because the template's tsconfig.json is malformed"
@@ -1150,7 +1153,7 @@ var FILES_TO_UPDATE2 = {
1150
1153
  if (err && err.code === "ENOENT") {
1151
1154
  await writeFile(
1152
1155
  file,
1153
- JSON.stringify({ extends: `astro/tsconfigs/${options.value}` }, null, 2)
1156
+ JSON.stringify({ extends: `astro/tsconfigs/${options.value}` }, null, 2) + "\n"
1154
1157
  );
1155
1158
  }
1156
1159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "4.9.2",
3
+ "version": "4.10.0",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",