@decohere/create 0.0.1-dev.20261105.116 → 0.0.1-dev.20261105.119

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
@@ -6,11 +6,13 @@ Docker is required on the host. `@decohere/create` only pulls `ghcr.io/typesmith
6
6
 
7
7
  ## Usage
8
8
 
9
- `npm create` already says “create”, so the first token is the kind (`webapi`), not `create` again. The launcher forwards `decohere create webapi …` into the builder image.
9
+ `npm create` already says “create”, so the first token is the kind (`webapi`), not `create` again. `webapi` is the only kind today, so you can leave it out and give just the project's folder. The launcher forwards `decohere create webapi …` into the builder image.
10
10
 
11
11
  This run prompts for database, auth, Postman, and whether to install:
12
12
 
13
13
  ```bash
14
+ npm create @decohere@dev my-app
15
+ # or
14
16
  npm create @decohere@dev webapi -d my-app
15
17
  # or
16
18
  npx @decohere/create@dev webapi -d my-app
@@ -26,7 +28,7 @@ npm create @decohere@dev -- webapi -d my-app --database postgres/typeorm --auth
26
28
 
27
29
  Target directory is `webapi`'s optional argument or `-d` (default `.`). `npm create` treats `-d` as its own loglevel flag and forwards `my-app` as a positional — that form is supported. Extra create flags still need `--` after `npm create`.
28
30
 
29
- The first token after the package must be a command (`webapi`); a bare directory name is an unknown command.
31
+ A first token that isn't a command (`webapi`, `create`, `add`, `auth0`, `help`) or a flag is the project's folder, so a mistyped command starts a project with that name.
30
32
 
31
33
  The scaffolded Dev Container asks **y/N** (TTY only) before npm auth and optional codebase RAG MCP (semantic search). Decline or run without a TTY to skip. Credentials are written under the project `.cursor/` directory (gitignored).
32
34
 
@@ -3,25 +3,40 @@ const HOST_FLAGS_WITH_VALUE = new Set([
3
3
  "--config-file",
4
4
  "--log-level"
5
5
  ]);
6
+ const PRODUCT_COMMANDS = new Set([
7
+ "create",
8
+ "add",
9
+ "auth0",
10
+ "help"
11
+ ]);
6
12
  /**
7
13
  * Map host / npm-create argv onto the product CLI (`create webapi` / `add api`).
8
14
  * `npm create @decohere webapi` already says “create”, so we prepend `create`
9
- * rather than making users type `create create webapi`.
15
+ * rather than making users type `create create webapi`. `webapi` is the only kind
16
+ * of project, so a first word that isn't a command is the project's folder.
10
17
  */ export function toProductArgv(tokens) {
11
- if (tokens[0] === "webapi" && tokens[1] === "add") {
18
+ const [first] = tokens;
19
+ if (first === "webapi" && tokens[1] === "add") {
12
20
  return [
13
21
  "add",
14
22
  "api",
15
23
  ...tokens.slice(2)
16
24
  ];
17
25
  }
18
- if (tokens[0] === "webapi") {
26
+ if (first === "webapi") {
19
27
  return [
20
28
  "create",
21
29
  "webapi",
22
30
  ...tokens.slice(1)
23
31
  ];
24
32
  }
33
+ if (first != null && !first.startsWith("-") && !PRODUCT_COMMANDS.has(first)) {
34
+ return [
35
+ "create",
36
+ "webapi",
37
+ ...tokens
38
+ ];
39
+ }
25
40
  return tokens;
26
41
  }
27
42
  export function containerArgvFromHost(argv) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decohere/create",
3
- "version": "0.0.1-dev.20261105.116",
3
+ "version": "0.0.1-dev.20261105.119",
4
4
  "description": "Download the Decohere scaffolder image and run it (npm create @decohere)",
5
5
  "keywords": [
6
6
  "decohere",
@@ -8,7 +8,8 @@ export type LaunchPlan = {
8
8
  /**
9
9
  * Map host / npm-create argv onto the product CLI (`create webapi` / `add api`).
10
10
  * `npm create @decohere webapi` already says “create”, so we prepend `create`
11
- * rather than making users type `create create webapi`.
11
+ * rather than making users type `create create webapi`. `webapi` is the only kind
12
+ * of project, so a first word that isn't a command is the project's folder.
12
13
  */
13
14
  export declare function toProductArgv(tokens: string[]): string[];
14
15
  export declare function containerArgvFromHost(argv: string[]): string[];