@mastrojs/create-mastro 0.0.8 → 0.0.9

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 -1
  2. package/index.js +13 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@ Create a new [Mastro](https://mastrojs.github.io/) project. Usage:
2
2
 
3
3
  Deno:
4
4
 
5
- deno run -A npm:@mastrojs/create-mastro@latest
5
+ deno run --reload -A npm:@mastrojs/create-mastro
6
6
 
7
7
  Node.js
8
8
 
package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
-
3
2
  //@ts-check
4
3
 
5
4
  /**
@@ -20,10 +19,19 @@ import { Readable } from "node:stream";
20
19
 
21
20
  const userAgent = process.env.npm_config_user_agent;
22
21
 
23
- const runtime = typeof Deno === "object"
24
- ? "deno"
25
- // the usual ways to detect Bun don't appear to work in `bun create`
26
- : (userAgent?.startsWith("bun/") ? "bun" : "node");
22
+ const runtime = (() => {
23
+ if (typeof Deno === "object") {
24
+ return "deno"
25
+ } else if (userAgent?.startsWith("bun/")) {
26
+ // the usual ways to detect Bun don't appear to work in `bun create`
27
+ return "bun";
28
+ } else if (process.argv[2] === "--cloudflare") {
29
+ return "cloudflare";
30
+ } else {
31
+ return "node";
32
+ }
33
+ })();
34
+
27
35
 
28
36
  /**
29
37
  * @param {string} path
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastrojs/create-mastro",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "npm-publish": "deno check && npm publish --access public"