create-pollar-app-patrickkish 0.1.1 → 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
@@ -6,9 +6,26 @@ Built for [pollar-backoffice#2](https://github.com/pollar-xyz/pollar-backoffice/
6
6
 
7
7
  ## Quick start
8
8
 
9
- Pick your package manager. Each command below scaffolds a new app, installs dependencies, and initializes git.
9
+ The issue acceptance path is **`npx`** it works for everyone regardless of which package manager you use in the generated app.
10
10
 
11
- ### pnpm (recommended)
11
+ ### npx (primary — issue #2 flow)
12
+
13
+ ```bash
14
+ npx create-pollar-app-patrickkish@latest my-pollar-app
15
+ cd my-pollar-app
16
+ # edit .env.local — set NEXT_PUBLIC_POLLAR_API_KEY=pub_testnet_...
17
+ npm run dev
18
+ ```
19
+
20
+ Non-interactive:
21
+
22
+ ```bash
23
+ npx create-pollar-app-patrickkish@latest my-pollar-app --yes --pm pnpm --network testnet
24
+ ```
25
+
26
+ Use `--pm` to pick the package manager for the **new app** (defaults to npm when invoked via npx).
27
+
28
+ ### pnpm (team preference)
12
29
 
13
30
  ```bash
14
31
  pnpm dlx create-pollar-app-patrickkish@latest my-pollar-app
@@ -25,6 +42,8 @@ pnpm dlx create-pollar-app-patrickkish@latest my-pollar-app -- --yes --pm pnpm -
25
42
 
26
43
  ### npm
27
44
 
45
+ Equivalent to npx (no `npx` prefix needed):
46
+
28
47
  ```bash
29
48
  npm create create-pollar-app-patrickkish@latest my-pollar-app
30
49
  cd my-pollar-app
@@ -1,8 +1,18 @@
1
- import { cp, readFile, writeFile } from "node:fs/promises";
1
+ import { access, copyFile, cp, readFile, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
 
4
4
  const SKIP = new Set(["node_modules", ".next", ".git"]);
5
5
 
6
+ async function ensureGitignore(source, target) {
7
+ const gitignoreSrc = path.join(source, ".gitignore");
8
+ const gitignoreDst = path.join(target, ".gitignore");
9
+ try {
10
+ await access(gitignoreDst);
11
+ } catch {
12
+ await copyFile(gitignoreSrc, gitignoreDst);
13
+ }
14
+ }
15
+
6
16
  /**
7
17
  * @param {string} source
8
18
  * @param {string} target
@@ -17,6 +27,8 @@ export async function copyTemplate(source, target, vars) {
17
27
  },
18
28
  });
19
29
 
30
+ await ensureGitignore(source, target);
31
+
20
32
  const pkgPath = path.join(target, "package.json");
21
33
  const pkgRaw = await readFile(pkgPath, "utf8");
22
34
  await writeFile(
package/lib/create.js CHANGED
@@ -107,7 +107,9 @@ export async function createApp(options) {
107
107
  console.log(`Installing dependencies with ${packageManager}…`);
108
108
  await runCommand(installCommand(packageManager), targetDir);
109
109
 
110
+ // .gitignore must exist before staging so node_modules is never committed.
110
111
  await runCommand("git add -A", targetDir);
112
+ await runCommand("git rm -r --cached -f node_modules", targetDir).catch(() => undefined);
111
113
  await runCommand('git commit -m "Initial commit from create-pollar-app-patrickkish"', targetDir).catch(
112
114
  () => undefined,
113
115
  );
@@ -11,7 +11,7 @@ export function printNextSteps(projectName, packageManager, network) {
11
11
  build: "pnpm build",
12
12
  },
13
13
  npm: {
14
- create: "npm create create-pollar-app-patrickkish@latest <name>",
14
+ create: "npx create-pollar-app-patrickkish@latest <name>",
15
15
  install: "npm install",
16
16
  dev: "npm run dev",
17
17
  build: "npm run build",
@@ -31,6 +31,8 @@ export function printNextSteps(projectName, packageManager, network) {
31
31
  };
32
32
 
33
33
  const pm = blocks[packageManager] ?? blocks.npm;
34
+ const rescaffoldFlags = `--yes --pm ${packageManager}`;
35
+ const rescaffoldSep = packageManager === "pnpm" ? " -- " : " ";
34
36
 
35
37
  console.log(`
36
38
  Success! Created ${projectName}
@@ -57,6 +59,6 @@ Package manager notes (${packageManager}):
57
59
  build: ${pm.build}
58
60
 
59
61
  To scaffold another app with ${packageManager}:
60
- ${pm.create.replace("<name>", "my-pollar-app")} -- --yes --pm ${packageManager}
62
+ ${pm.create.replace("<name>", "my-pollar-app")}${rescaffoldSep}${rescaffoldFlags}
61
63
  `);
62
64
  }
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "create-pollar-app-patrickkish",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "Scaffold a Next.js app with Pollar wallet pre-wired",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/PatrickKish1/create-pollar-app-patrickkish.git"
9
+ },
10
+ "homepage": "https://github.com/PatrickKish1/create-pollar-app-patrickkish#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/PatrickKish1/create-pollar-app-patrickkish/issues"
13
+ },
6
14
  "type": "module",
7
15
  "engines": {
8
16
  "node": ">=20"
@@ -12,6 +20,8 @@
12
20
  "create-pollar-app-patrickkish": "./bin/index.js"
13
21
  },
14
22
  "files": [
23
+ "README.md",
24
+ "LICENSE",
15
25
  "bin",
16
26
  "lib",
17
27
  "template"