create-davepi-ui 0.1.0 → 0.2.0

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
@@ -7,7 +7,7 @@ Scaffolder for new [davepi-ui](https://github.com/projik/davepi-ui) admin projec
7
7
  ```bash
8
8
  npx create-davepi-ui my-admin --api-url http://localhost:4001
9
9
  cd my-admin
10
- pnpm dev
10
+ npm run dev
11
11
  ```
12
12
 
13
13
  ## Flags
@@ -15,14 +15,14 @@ pnpm dev
15
15
  | Flag | Default | Purpose |
16
16
  |---|---|---|
17
17
  | `--api-url <url>` | `http://localhost:4001` | davepi backend base URL written to `.env` |
18
- | `--no-install` | off | Skip post-scaffold `pnpm install` |
18
+ | `--no-install` | off | Skip post-scaffold `npm install` |
19
19
 
20
20
  ## What it does
21
21
 
22
- 1. Copies the bundled template (Vite + React Router + shadcn + `@davepi/ui-react`).
22
+ 1. Copies the bundled template (Vite + React Router + shadcn + `@davepi/ui-react`). Lock files are filtered out so the scaffolded project picks its own package manager — npm by default, matching the davepi backend.
23
23
  2. Rewrites `package.json` — pins `@davepi/ui-*` deps to the published versions matching this scaffolder, sets `private: true`, drops upstream repo metadata.
24
24
  3. Writes `.env` with `VITE_API_URL`.
25
- 4. Runs `pnpm install` (unless `--no-install`).
25
+ 4. Runs `npm install` (unless `--no-install`).
26
26
 
27
27
  ## License
28
28
 
package/bin/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * - rewrites `package.json` with the new project name + pinned
10
10
  * published versions of @davepi/ui-* (no workspace: protocol)
11
11
  * - writes `.env` carrying VITE_API_URL
12
- * - runs `pnpm install` (skip with --no-install)
12
+ * - runs `npm install` (skip with --no-install)
13
13
  * - prints the next three commands
14
14
  *
15
15
  * No `inquirer`, no progress bars — keeps the failure surface small.
@@ -58,7 +58,7 @@ function usage() {
58
58
  out('');
59
59
  out('Flags:');
60
60
  out(' --api-url <url> davepi backend base URL (default: http://localhost:4001)');
61
- out(' --no-install skip the post-scaffold `pnpm install`');
61
+ out(' --no-install skip the post-scaffold `npm install`');
62
62
  }
63
63
 
64
64
  function copyTree(src, dst, skip) {
@@ -198,16 +198,18 @@ function main() {
198
198
  rewritePackageJson(pkgPath, name, resolvePinnedVersions());
199
199
  }
200
200
 
201
- // Write a starter `.env` so the user can run `pnpm dev` immediately.
201
+ // Write a starter `.env` so the user can run `npm run dev` immediately.
202
202
  fs.writeFileSync(path.join(target, '.env'), `VITE_API_URL=${apiUrl}\n`);
203
203
 
204
204
  if (!skipInstall) {
205
205
  out('Installing dependencies…');
206
206
  // spawnSync with an argument array — no shell, no interpolation,
207
- // so the only program ever invoked is the literal `pnpm`.
208
- const r = spawnSync('pnpm', ['install'], { cwd: target, stdio: 'inherit' });
207
+ // so the only program ever invoked is the literal `npm`. npm ships
208
+ // as `.cmd` shim on Windows, hence the platform-specific name.
209
+ const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
210
+ const r = spawnSync(npmCmd, ['install'], { cwd: target, stdio: 'inherit' });
209
211
  if (r.status !== 0) {
210
- err('pnpm install failed. You can re-run it from the project directory.');
212
+ err('npm install failed. You can re-run it from the project directory.');
211
213
  }
212
214
  }
213
215
 
@@ -215,8 +217,8 @@ function main() {
215
217
  out('Done.');
216
218
  out('');
217
219
  out(` cd ${name}`);
218
- if (skipInstall) out(' pnpm install');
219
- out(' pnpm dev');
220
+ if (skipInstall) out(' npm install');
221
+ out(' npm run dev');
220
222
  out('');
221
223
  out(`Backend expected at ${apiUrl}. Edit .env to point elsewhere.`);
222
224
  }
@@ -45,6 +45,14 @@ const SKIP = new Set([
45
45
  '.astro',
46
46
  '.env',
47
47
  '.env.local',
48
+ // Skip lock files — davepi-ui itself uses pnpm because it's a
49
+ // monorepo, but the scaffolded admin is a plain Vite app that uses
50
+ // npm. Keeps the package-manager surface aligned with the davepi
51
+ // backend the user already runs via `npm install`. The scaffolded
52
+ // `npm install` writes a fresh package-lock.json.
53
+ 'pnpm-lock.yaml',
54
+ 'yarn.lock',
55
+ 'package-lock.json',
48
56
  ]);
49
57
 
50
58
  function copyTree(src, dst) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-davepi-ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Scaffolder for new davepi-ui projects. Run: npx create-davepi-ui <name> [--api-url <url>]",
5
5
  "license": "MIT",
6
6
  "author": "David Baxter <dave@unlockedequity.com>",