create-daloy 0.1.2 → 0.1.4

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
@@ -78,4 +78,5 @@ A Vercel Edge API bootstrap using `@daloyjs/core/vercel` with:
78
78
  - Zero runtime dependencies (uses only Node built-ins) for a clean supply-chain footprint.
79
79
  - Templates are copied verbatim from this package's `templates/` directory.
80
80
  - Files prefixed with `_` are renamed (`_gitignore` → `.gitignore`, `_npmrc` → `.npmrc`) to survive npm packing.
81
+ - pnpm-specific `.npmrc` hardening is kept only when you choose `pnpm`; other package managers get a clean project without unsupported config warnings.
81
82
  - The CLI never executes template scripts and never makes network calls beyond the package manager you select.
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { spawn } from "node:child_process";
6
6
  import { existsSync } from "node:fs";
7
- import { mkdir, readdir, readFile, writeFile, copyFile } from "node:fs/promises";
7
+ import { mkdir, readdir, readFile, writeFile, copyFile, rm } from "node:fs/promises";
8
8
  import { createInterface } from "node:readline/promises";
9
9
  import { stdin as input, stdout as output } from "node:process";
10
10
  import path from "node:path";
@@ -194,6 +194,13 @@ async function patchPackageJson(dir, projectName) {
194
194
  await writeFile(file, JSON.stringify(json, null, 2) + "\n", "utf8");
195
195
  }
196
196
 
197
+ async function normalizePackageManagerFiles(dir, packageManager) {
198
+ if (packageManager === "pnpm") return;
199
+ const npmrcPath = path.join(dir, ".npmrc");
200
+ if (!existsSync(npmrcPath)) return;
201
+ await rm(npmrcPath, { force: true });
202
+ }
203
+
197
204
  function run(cmd, args, cwd) {
198
205
  return new Promise((resolve) => {
199
206
  const proc = spawn(cmd, args, { cwd, stdio: "inherit", shell: process.platform === "win32" });
@@ -382,6 +389,10 @@ async function main() {
382
389
  logStep("Template copied", template);
383
390
  await patchPackageJson(targetDir, projectName);
384
391
  logStep("Package metadata written", projectName);
392
+ await normalizePackageManagerFiles(targetDir, packageManager);
393
+ if (packageManager !== "pnpm") {
394
+ logStep("Package-manager config normalized", packageManager);
395
+ }
385
396
 
386
397
  if (initGit) {
387
398
  const code = await run("git", ["init", "--quiet"], targetDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-daloy",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Scaffold a new DaloyJS project. Run with `pnpm create daloy`, `npm create daloy@latest`, `yarn create daloy`, or `bun create daloy`.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@ app.route({
31
31
  },
32
32
  handler: async () => ({
33
33
  status: 200,
34
- body: { ok: true, uptime: process.uptime() },
34
+ body: { ok: true as const, uptime: process.uptime() },
35
35
  }),
36
36
  });
37
37