create-astro 1.2.0 → 1.2.1

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 (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +18 -10
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -42,6 +42,7 @@ May be provided in place of prompts
42
42
  |:-------------|:----------------------------------------------------|
43
43
  | `--template` | Specify the template name ([list][examples]) |
44
44
  | `--commit` | Specify a specific Git commit or branch to use from this repo (by default, `main` branch of this repo will be used) |
45
+ | `--fancy` | For Windows users, `--fancy` will enable full unicode support |
45
46
 
46
47
  ### Debugging
47
48
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { color, generateProjectName, label, say } from "@astrojs/cli-kit";
2
- import { random } from "@astrojs/cli-kit/utils";
2
+ import { forceUnicode, random } from "@astrojs/cli-kit/utils";
3
3
  import { assign, parse, stringify } from "comment-json";
4
4
  import { execa, execaCommand } from "execa";
5
5
  import fs from "fs";
@@ -23,8 +23,11 @@ import {
23
23
  } from "./messages.js";
24
24
  import { TEMPLATES } from "./templates.js";
25
25
  const cleanArgv = process.argv.filter((arg) => arg !== "--");
26
- const args = yargs(cleanArgv);
26
+ const args = yargs(cleanArgv, { boolean: ["fancy"] });
27
27
  prompts.override(args);
28
+ if (args.fancy) {
29
+ forceUnicode();
30
+ }
28
31
  function mkdirp(dir) {
29
32
  try {
30
33
  fs.mkdirSync(dir, { recursive: true });
@@ -75,16 +78,19 @@ async function main() {
75
78
  const [username, version] = await Promise.all([getName(), getVersion()]);
76
79
  logger.debug("Verbose logging turned on");
77
80
  if (!args.skipHouston) {
78
- await say([
81
+ await say(
79
82
  [
80
- "Welcome",
81
- "to",
82
- label("astro", color.bgGreen, color.black),
83
- color.green(`v${version}`) + ",",
84
- `${username}!`
83
+ [
84
+ "Welcome",
85
+ "to",
86
+ label("astro", color.bgGreen, color.black),
87
+ color.green(`v${version}`) + ",",
88
+ `${username}!`
89
+ ],
90
+ random(welcome)
85
91
  ],
86
- random(welcome)
87
- ]);
92
+ { hat: args.fancy ? "\u{1F3A9}" : void 0 }
93
+ );
88
94
  await banner(version);
89
95
  }
90
96
  let cwd = args["_"][2];
@@ -119,6 +125,7 @@ async function main() {
119
125
  cwd = dirResponse.directory;
120
126
  }
121
127
  if (!cwd) {
128
+ ora().info(dim("No directory provided. See you later, astronaut!"));
122
129
  process.exit(1);
123
130
  }
124
131
  const options = await prompts(
@@ -133,6 +140,7 @@ async function main() {
133
140
  { onCancel: () => ora().info(dim("Operation cancelled. See you later, astronaut!")) }
134
141
  );
135
142
  if (!options.template) {
143
+ ora().info(dim("No template provided. See you later, astronaut!"));
136
144
  process.exit(1);
137
145
  }
138
146
  let templateSpinner = await loadWithRocketGradient("Copying project files...");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "tsconfigs"
24
24
  ],
25
25
  "dependencies": {
26
- "@astrojs/cli-kit": "^0.1.0",
26
+ "@astrojs/cli-kit": "^0.1.3",
27
27
  "chalk": "^5.0.1",
28
28
  "comment-json": "^4.2.3",
29
29
  "execa": "^6.1.0",
@@ -42,7 +42,7 @@
42
42
  "@types/prompts": "^2.0.14",
43
43
  "@types/which-pm-runs": "^1.0.0",
44
44
  "@types/yargs-parser": "^21.0.0",
45
- "astro-scripts": "0.0.8",
45
+ "astro-scripts": "0.0.9",
46
46
  "chai": "^4.3.6",
47
47
  "mocha": "^9.2.2",
48
48
  "uvu": "^0.5.3"