create-backtick-app 0.1.5 → 0.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # create-backtick-app
2
2
 
3
- Creates an app whose screens come from your server, with [Backtick](https://backtickjs.com). Pick React Native and you get an Expo app with a Backtick server beside it; pick React or Solid and you get a web page served by one. Each starts with a welcome screen written as a server component, a small client component, and a development setup that redraws the screen when you save.
3
+ Creates an app whose screens come from your server, with [Backtick](https://backtickjs.com): an Expo app with a Backtick server beside it, or with `--template react` or `--template solid-js`, a web page served by one. Each starts with a welcome screen written as a server component, a small client component, and a development setup that redraws the screen when you save.
4
4
 
5
5
  ## Usage
6
6
 
@@ -17,13 +17,7 @@ yarn create backtick-app
17
17
  bun create backtick-app
18
18
  ```
19
19
 
20
- It asks only what the command line didn't say:
21
-
22
- 1. What is your app named? (default `my-app`)
23
- 2. Which framework? `react-native` (an Expo app), `react` or `solid-js` (a web page)
24
- 3. Which runtime? `node` or `bun`: Bun is the default when you ran it with Bun (`bun create`), Node otherwise
25
-
26
- It then copies the template into a new directory, installs with the package manager you ran it with (npm, pnpm, Yarn or Bun), and prints the commands to start. Requires Node 22.15 or later.
20
+ It asks for a name, and nothing else: it copies the React Native template into that directory, installs with the package manager you ran it with (npm, pnpm, Yarn or Bun), and prints the commands to start. The server runs on Node, or on Bun when you ran it with Bun (`bun create`). Given the name on the command line, it asks nothing. Requires Node 22.15 or later.
27
21
 
28
22
  ## Options
29
23
 
@@ -31,13 +25,13 @@ It then copies the template into a new directory, installs with the package mana
31
25
  npx create-backtick-app@latest [name] [options]
32
26
  ```
33
27
 
34
- | Option | Description |
35
- | ----------------------- | ------------------------------------------------------------------------------- |
36
- | `name` | The directory to create, and the app's name. It must be new or empty. |
37
- | `-t, --template <name>` | `react-native`, `react` or `solid-js`. |
38
- | `-r, --runtime <name>` | What runs your Backtick server: `node` or `bun`. |
39
- | `-y, --yes` | Ask nothing: `my-app`, `react-native`, and Bun if run with Bun, Node otherwise. |
40
- | `--no-install` | Copy the files without installing dependencies. |
28
+ | Option | Description |
29
+ | ----------------------- | --------------------------------------------------------------------- |
30
+ | `name` | The directory to create, and the app's name. It must be new or empty. |
31
+ | `-t, --template <name>` | `react-native`, the default; or `react` or `solid-js`, a web page. |
32
+ | `-r, --runtime <name>` | What runs your Backtick server: `node`, the default, or `bun`. |
33
+ | `-y, --yes` | Take `my-app` as the name rather than asking. |
34
+ | `--no-install` | Copy the files without installing dependencies. |
41
35
 
42
36
  With `npm create`, pass options after `--`: `npm create backtick-app@latest my-app -- -t react`.
43
37
 
package/dist/index.js CHANGED
@@ -49,15 +49,15 @@ const RUNTIMES = {
49
49
  };
50
50
  const USAGE = `Usage: create-backtick-app [name] [options]
51
51
 
52
+ Creates a React Native app with a Backtick server beside it, on Node, or on
53
+ Bun when run with Bun.
54
+
52
55
  Options:
53
56
  -t, --template <name> The framework: ${Object.keys(TEMPLATES).join(", ")}
54
57
  -r, --runtime <name> The server's runtime: ${Object.keys(RUNTIMES).join(", ")}
55
- -y, --yes Use the defaults for anything not given
58
+ -y, --yes Take my-app as the name rather than asking
56
59
  --no-install Skip installing packages
57
- -h, --help Show this help
58
-
59
- Asks for what isn't given, in a terminal; elsewhere, uses the defaults:
60
- my-app, react-native, and node (bun when run with bun).`;
60
+ -h, --help Show this help`;
61
61
  let parsed;
62
62
  try {
63
63
  parsed = parseArgs({
@@ -103,41 +103,24 @@ if (values.runtime !== undefined && !(values.runtime in RUNTIMES)) {
103
103
  const manager = (process.env.npm_config_user_agent ?? "npm").split("/")[0];
104
104
  const run = ["npm", "pnpm", "yarn", "bun"].includes(manager) ? manager : "npm";
105
105
  const suggestedRuntime = run === "bun" ? "bun" : "node";
106
- // Asked only what the command line didn't say, and only in a terminal: an
107
- // agent or a CI script can't answer, so it gets the defaults, as `--yes` does.
108
- const ask = process.stdin.isTTY === true && !values.yes;
106
+ // The name is the one question, asked when none was given, and only in a
107
+ // terminal: an agent or a CI script can't answer, so it gets `my-app`, as
108
+ // `--yes` does. The framework and the runtime have defaults, and flags for
109
+ // the rest, as create-expo-app does: a name on the command line is a project
110
+ // with no questions.
111
+ const ask = positionals[0] === undefined && process.stdin.isTTY === true && !values.yes;
109
112
  const answers = await prompts([
110
113
  {
111
- type: positionals[0] !== undefined || !ask ? null : "text",
114
+ type: ask ? "text" : null,
112
115
  name: "name",
113
116
  message: "What is your app named?",
114
117
  initial: "my-app",
115
118
  },
116
- {
117
- type: values.template !== undefined || !ask ? null : "select",
118
- name: "template",
119
- message: "Which framework?",
120
- choices: Object.entries(TEMPLATES).map(([value, template]) => ({
121
- title: template.title,
122
- description: template.description,
123
- value,
124
- })),
125
- },
126
- {
127
- type: values.runtime !== undefined || !ask ? null : "select",
128
- name: "runtime",
129
- message: "Which runtime?",
130
- choices: Object.entries(RUNTIMES).map(([value, runtime]) => ({
131
- title: runtime.title,
132
- value,
133
- })),
134
- initial: Object.keys(RUNTIMES).indexOf(suggestedRuntime),
135
- },
136
119
  ], { onCancel: () => process.exit(1) });
137
120
  const name = positionals[0] ?? answers.name ?? "my-app";
138
- const templateName = values.template ?? answers.template ?? "react-native";
121
+ const templateName = values.template ?? "react-native";
139
122
  const template = TEMPLATES[templateName];
140
- const runtimeName = values.runtime ?? answers.runtime ?? suggestedRuntime;
123
+ const runtimeName = values.runtime ?? suggestedRuntime;
141
124
  const target = path.resolve(name);
142
125
  const slug = path.basename(target);
143
126
  if (existsSync(target) && readdirSync(target).length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-backtick-app",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Creates a Backtick app: React Native, React or Solid, with screens from your server on Node or Bun",
5
5
  "keywords": [
6
6
  "backtick",
@@ -11,15 +11,15 @@
11
11
  "format:check": "prettier --check --ignore-unknown ."
12
12
  },
13
13
  "dependencies": {
14
- "@backtickjs/bundler": "^0.1.5",
15
- "@backtickjs/core": "^0.1.5",
16
- "@backtickjs/node-plugin": "^0.1.5",
14
+ "@backtickjs/bundler": "^0.1.6",
15
+ "@backtickjs/core": "^0.1.6",
16
+ "@backtickjs/node-plugin": "^0.1.6",
17
17
  "@backtickjs/react": "^19.2.3",
18
18
  "typescript": "^6.0.3"
19
19
  },
20
20
  "devDependencies": {
21
- "@backtickjs/prettier-plugin": "^0.1.5",
22
- "@backtickjs/tsc": "^0.1.5",
21
+ "@backtickjs/prettier-plugin": "^0.1.6",
22
+ "@backtickjs/tsc": "^0.1.6",
23
23
  "@types/node": "^25.9.1",
24
24
  "prettier": "^3.6.2"
25
25
  },
@@ -15,12 +15,12 @@
15
15
  "format:check": "prettier --check --ignore-unknown ."
16
16
  },
17
17
  "dependencies": {
18
- "@backtickjs/bundler": "^0.1.5",
19
- "@backtickjs/core": "^0.1.5",
20
- "@backtickjs/node-plugin": "^0.1.5",
18
+ "@backtickjs/bundler": "^0.1.6",
19
+ "@backtickjs/core": "^0.1.6",
20
+ "@backtickjs/node-plugin": "^0.1.6",
21
21
  "@backtickjs/react": "^19.2.3",
22
22
  "@backtickjs/react-native": "^0.86.3",
23
- "@backtickjs/react-native-client": "^0.1.5",
23
+ "@backtickjs/react-native-client": "^0.1.6",
24
24
  "expo": "~57.0.26",
25
25
  "expo-constants": "~57.0.20",
26
26
  "expo-status-bar": "~57.0.1",
@@ -31,8 +31,8 @@
31
31
  "typescript": "^6.0.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@backtickjs/prettier-plugin": "^0.1.5",
35
- "@backtickjs/tsc": "^0.1.5",
34
+ "@backtickjs/prettier-plugin": "^0.1.6",
35
+ "@backtickjs/tsc": "^0.1.6",
36
36
  "@testing-library/react": "^16.3.3",
37
37
  "@types/node": "^25.9.1",
38
38
  "@types/react": "19.2.18",
@@ -11,15 +11,15 @@
11
11
  "format:check": "prettier --check --ignore-unknown ."
12
12
  },
13
13
  "dependencies": {
14
- "@backtickjs/bundler": "^0.1.5",
15
- "@backtickjs/core": "^0.1.5",
16
- "@backtickjs/node-plugin": "^0.1.5",
14
+ "@backtickjs/bundler": "^0.1.6",
15
+ "@backtickjs/core": "^0.1.6",
16
+ "@backtickjs/node-plugin": "^0.1.6",
17
17
  "@backtickjs/solid-js": "^1.9.14",
18
18
  "typescript": "^6.0.3"
19
19
  },
20
20
  "devDependencies": {
21
- "@backtickjs/prettier-plugin": "^0.1.5",
22
- "@backtickjs/tsc": "^0.1.5",
21
+ "@backtickjs/prettier-plugin": "^0.1.6",
22
+ "@backtickjs/tsc": "^0.1.6",
23
23
  "@types/node": "^25.9.1",
24
24
  "prettier": "^3.6.2"
25
25
  },