create-pollar-app-patrickkish 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/lib/copy-template.js +13 -1
- package/lib/create.js +2 -0
- package/package.json +11 -1
package/lib/copy-template.js
CHANGED
|
@@ -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
|
);
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pollar-app-patrickkish",
|
|
3
|
-
"version": "0.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"
|