create-astro 0.14.1 → 0.14.2

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/gradient.js CHANGED
@@ -25,14 +25,19 @@ function getGradientAnimFrames() {
25
25
  const frames = [];
26
26
  for (let start = 0; start < gradientColors.length * 2; start++) {
27
27
  const end = start + gradientColors.length - 1;
28
- frames.push(referenceGradient.slice(start, end).map((g) => chalk.bgHex(g)(" ")).join(""));
28
+ frames.push(
29
+ referenceGradient.slice(start, end).map((g) => chalk.bgHex(g)(" ")).join("")
30
+ );
29
31
  }
30
32
  return frames;
31
33
  }
32
34
  function getIntroAnimFrames() {
33
35
  const frames = [];
34
36
  for (let end = 1; end <= gradientColors.length; end++) {
35
- const leadingSpacesArr = Array.from(new Array(Math.abs(gradientColors.length - end - 1)), () => " ");
37
+ const leadingSpacesArr = Array.from(
38
+ new Array(Math.abs(gradientColors.length - end - 1)),
39
+ () => " "
40
+ );
36
41
  const gradientArr = gradientColors.slice(0, end).map((g) => chalk.bgHex(g)(" "));
37
42
  frames.push([...leadingSpacesArr, ...gradientArr].join(""));
38
43
  }
package/dist/index.js CHANGED
@@ -32,7 +32,9 @@ function mkdirp(dir) {
32
32
  function isEmpty(dirPath) {
33
33
  return !fs.existsSync(dirPath) || fs.readdirSync(dirPath).length === 0;
34
34
  }
35
- const { version } = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
35
+ const { version } = JSON.parse(
36
+ fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8")
37
+ );
36
38
  const FILES_TO_REMOVE = [".stackblitzrc", "sandbox.config.json", "CHANGELOG.md"];
37
39
  async function main() {
38
40
  var _a;
@@ -86,7 +88,7 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
86
88
  }
87
89
  const templateSpinner = await loadWithRocketGradient("Copying project files...");
88
90
  const hash = args.commit ? `#${args.commit}` : "";
89
- const templateTarget = `withastro/astro/examples/${options.template}#latest`;
91
+ const templateTarget = options.template.includes("/") ? options.template : `withastro/astro/examples/${options.template}#latest`;
90
92
  const emitter = degit(`${templateTarget}${hash}`, {
91
93
  cache: false,
92
94
  force: true,
@@ -107,22 +109,40 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
107
109
  logger.debug(err);
108
110
  console.error(red(err.message));
109
111
  if (err.message === "zlib: unexpected end of file") {
110
- console.log(yellow("This seems to be a cache related problem. Remove the folder '~/.degit/github/withastro' to fix this error."));
111
- console.log(yellow("For more information check out this issue: https://github.com/withastro/astro/issues/655"));
112
+ console.log(
113
+ yellow(
114
+ "This seems to be a cache related problem. Remove the folder '~/.degit/github/withastro' to fix this error."
115
+ )
116
+ );
117
+ console.log(
118
+ yellow(
119
+ "For more information check out this issue: https://github.com/withastro/astro/issues/655"
120
+ )
121
+ );
112
122
  }
113
123
  if (err.code === "MISSING_REF") {
114
- console.log(yellow("This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com)."));
115
- console.log(yellow("If you do have 'git' installed, please run this command with the --verbose flag and file a new issue with the command output here: https://github.com/withastro/astro/issues"));
124
+ console.log(
125
+ yellow(
126
+ "This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com)."
127
+ )
128
+ );
129
+ console.log(
130
+ yellow(
131
+ "If you do have 'git' installed, please run this command with the --verbose flag and file a new issue with the command output here: https://github.com/withastro/astro/issues"
132
+ )
133
+ );
116
134
  }
117
135
  templateSpinner.fail();
118
136
  process.exit(1);
119
137
  }
120
- await Promise.all(FILES_TO_REMOVE.map(async (file) => {
121
- const fileLoc = path.resolve(path.join(cwd, file));
122
- if (fs.existsSync(fileLoc)) {
123
- return fs.promises.rm(fileLoc, {});
124
- }
125
- }));
138
+ await Promise.all(
139
+ FILES_TO_REMOVE.map(async (file) => {
140
+ const fileLoc = path.resolve(path.join(cwd, file));
141
+ if (fs.existsSync(fileLoc)) {
142
+ return fs.promises.rm(fileLoc, {});
143
+ }
144
+ })
145
+ );
126
146
  }
127
147
  templateSpinner.text = green("Template copied!");
128
148
  templateSpinner.succeed();
@@ -142,7 +162,9 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
142
162
  var _a2;
143
163
  (_a2 = installExec.stdout) == null ? void 0 : _a2.on("data", function(data) {
144
164
  installSpinner.text = `${rocketAscii} ${installingPackagesMsg}
145
- ${bold(`[${pkgManager}]`)} ${data}`;
165
+ ${bold(
166
+ `[${pkgManager}]`
167
+ )} ${data}`;
146
168
  });
147
169
  installExec.on("error", (error) => reject(error));
148
170
  installExec.on("close", () => resolve());
@@ -173,9 +195,17 @@ ${bgCyan(black(" Next steps "))}
173
195
  `);
174
196
  let projectDir = path.relative(process.cwd(), cwd);
175
197
  const devCmd = pkgManager === "npm" ? "npm run dev" : `${pkgManager} dev`;
176
- await logAndWait(`You can now ${bold(cyan("cd"))} into the ${bold(cyan(projectDir))} project directory.`);
177
- await logAndWait(`Run ${bold(cyan(devCmd))} to start the Astro dev server. ${bold(cyan("CTRL-C"))} to close.`);
178
- await logAndWait(`Add frameworks like ${bold(cyan("react"))} and ${bold(cyan("tailwind"))} to your project using ${bold(cyan("astro add"))}`);
198
+ await logAndWait(
199
+ `You can now ${bold(cyan("cd"))} into the ${bold(cyan(projectDir))} project directory.`
200
+ );
201
+ await logAndWait(
202
+ `Run ${bold(cyan(devCmd))} to start the Astro dev server. ${bold(cyan("CTRL-C"))} to close.`
203
+ );
204
+ await logAndWait(
205
+ `Add frameworks like ${bold(cyan("react"))} and ${bold(
206
+ cyan("tailwind")
207
+ )} to your project using ${bold(cyan("astro add"))}`
208
+ );
179
209
  await logAndWait("");
180
210
  await logAndWait(`Stuck? Come join us at ${bold(cyan("https://astro.build/chat"))}`, 1e3);
181
211
  await logAndWait(dim("Good luck out there, astronaut."));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",