create-pollar-app-patrickkish 0.1.4 → 0.1.7
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 +1 -1
- package/lib/copy-template.js +7 -10
- package/package.json +4 -3
- package/template/app/components/LoginPage.tsx +13 -4
- package/template/app/providers.tsx +1 -0
- package/template/gitignore +32 -0
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ The generated app includes:
|
|
|
94
94
|
- **Next.js 16** App Router, **React 19**, TypeScript, **Tailwind 4**
|
|
95
95
|
- `@pollar/core@^0.9.0` and `@pollar/react@^0.9.0`
|
|
96
96
|
- `PollarProvider` in the root layout
|
|
97
|
-
- Login via
|
|
97
|
+
- Login via Pollar's hosted modal (**Google**, **email OTP**, passkey, external wallets)
|
|
98
98
|
- Home screen actions that open SDK modals: balance, assets, send (USDC example), receive, history
|
|
99
99
|
- `.env.example`, eslint, prettier, and a README with a Deploy to Vercel button
|
|
100
100
|
|
package/lib/copy-template.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 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
|
+
// npm always strips `.gitignore` from published tarballs — ship as `gitignore` instead.
|
|
6
|
+
const GITIGNORE_TEMPLATE = "gitignore";
|
|
5
7
|
|
|
6
|
-
async function
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
await access(gitignoreDst);
|
|
11
|
-
} catch {
|
|
12
|
-
await copyFile(gitignoreSrc, gitignoreDst);
|
|
13
|
-
}
|
|
8
|
+
async function writeProjectGitignore(source, target) {
|
|
9
|
+
const content = await readFile(path.join(source, GITIGNORE_TEMPLATE), "utf8");
|
|
10
|
+
await writeFile(path.join(target, ".gitignore"), content);
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
/**
|
|
@@ -27,7 +24,7 @@ export async function copyTemplate(source, target, vars) {
|
|
|
27
24
|
},
|
|
28
25
|
});
|
|
29
26
|
|
|
30
|
-
await
|
|
27
|
+
await writeProjectGitignore(source, target);
|
|
31
28
|
|
|
32
29
|
const pkgPath = path.join(target, "package.json");
|
|
33
30
|
const pkgRaw = await readFile(pkgPath, "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pollar-app-patrickkish",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Scaffold a Next.js app with Pollar wallet pre-wired",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"packageManager": "pnpm@10.28.2",
|
|
19
19
|
"bin": {
|
|
20
|
-
"create-pollar-app-patrickkish": "
|
|
20
|
+
"create-pollar-app-patrickkish": "bin/index.js"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"README.md",
|
|
24
24
|
"LICENSE",
|
|
25
25
|
"bin",
|
|
26
26
|
"lib",
|
|
27
|
-
"template"
|
|
27
|
+
"template",
|
|
28
|
+
"template/gitignore"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"prepublishOnly": "node scripts/prepublish-check.js",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { usePollar } from "@pollar/react";
|
|
4
4
|
|
|
5
5
|
const keyConfigured =
|
|
6
6
|
!!process.env.NEXT_PUBLIC_POLLAR_API_KEY &&
|
|
7
7
|
!process.env.NEXT_PUBLIC_POLLAR_API_KEY.includes("xxxx");
|
|
8
8
|
|
|
9
9
|
export function LoginPage() {
|
|
10
|
+
const { openLoginModal } = usePollar();
|
|
11
|
+
|
|
10
12
|
return (
|
|
11
13
|
<main className="mx-auto flex w-full max-w-md flex-1 flex-col items-center justify-center gap-8 px-6 py-16 text-center">
|
|
12
14
|
<div className="flex flex-col gap-3">
|
|
@@ -17,13 +19,20 @@ export function LoginPage() {
|
|
|
17
19
|
<span className="text-brand">Pollar</span> Wallet
|
|
18
20
|
</h1>
|
|
19
21
|
<p className="text-base leading-7 text-zinc-500">
|
|
20
|
-
Log in
|
|
21
|
-
|
|
22
|
+
Log in with Google, email OTP, passkey, or an external Stellar wallet to send, receive, and
|
|
23
|
+
manage assets on testnet.
|
|
22
24
|
</p>
|
|
23
25
|
</div>
|
|
24
26
|
|
|
25
27
|
<div className="flex w-full flex-col items-center gap-3">
|
|
26
|
-
<
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
onClick={openLoginModal}
|
|
31
|
+
disabled={!keyConfigured}
|
|
32
|
+
className="flex h-12 w-full items-center justify-center rounded-xl bg-brand px-6 font-medium text-white transition-colors hover:bg-brand-dark disabled:cursor-not-allowed disabled:opacity-50"
|
|
33
|
+
>
|
|
34
|
+
Sign in with Pollar
|
|
35
|
+
</button>
|
|
27
36
|
{!keyConfigured && (
|
|
28
37
|
<p className="rounded-lg border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-900">
|
|
29
38
|
Set <code className="font-mono">NEXT_PUBLIC_POLLAR_API_KEY</code> in{" "}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
/node_modules
|
|
4
|
+
/.pnp
|
|
5
|
+
.pnp.*
|
|
6
|
+
.yarn/*
|
|
7
|
+
!.yarn/patches
|
|
8
|
+
!.yarn/plugins
|
|
9
|
+
!.yarn/releases
|
|
10
|
+
!.yarn/versions
|
|
11
|
+
|
|
12
|
+
# next.js
|
|
13
|
+
/.next/
|
|
14
|
+
/out/
|
|
15
|
+
|
|
16
|
+
# env
|
|
17
|
+
.env
|
|
18
|
+
.env*.local
|
|
19
|
+
|
|
20
|
+
# misc
|
|
21
|
+
.DS_Store
|
|
22
|
+
*.pem
|
|
23
|
+
npm-debug.log*
|
|
24
|
+
yarn-debug.log*
|
|
25
|
+
yarn-error.log*
|
|
26
|
+
.pnpm-debug.log*
|
|
27
|
+
|
|
28
|
+
# typescript
|
|
29
|
+
next-env.d.ts
|
|
30
|
+
|
|
31
|
+
# vercel
|
|
32
|
+
.vercel
|