@joinbankroll/create-app 0.1.0 → 0.1.2
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 +3 -0
- package/dist/index.js +24 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,9 @@ cd my-app
|
|
|
8
8
|
npm run bankroll
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
`npm create bankroll-app@latest` works too — it is a published alias that
|
|
12
|
+
forwards here, kept because it is what a developer guesses.
|
|
13
|
+
|
|
11
14
|
`npm run bankroll` raises a public tunnel and prints a QR code. Scan it and your
|
|
12
15
|
app opens inside Bankroll on your phone, which is the only place it runs — the
|
|
13
16
|
host holds the user's money, identity, and location, and refuses any origin that
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,21 @@ import { spawnSync } from "child_process";
|
|
|
5
5
|
import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "fs";
|
|
6
6
|
import { basename, resolve } from "path";
|
|
7
7
|
import { createInterface } from "readline/promises";
|
|
8
|
+
|
|
9
|
+
// src/args.ts
|
|
8
10
|
var TEMPLATE_REPO = "inplayinnovation/bankroll-starter";
|
|
9
11
|
var DEFAULT_REF = "main";
|
|
10
12
|
var DOWNLOAD_TIMEOUT_MS = 6e4;
|
|
11
13
|
var ENV_FILE = ".env.local";
|
|
12
|
-
var
|
|
14
|
+
var PUBLIC_MAINNET_RPC = "https://api.mainnet-beta.solana.com";
|
|
15
|
+
var IGNORABLE = /* @__PURE__ */ new Set([
|
|
16
|
+
".DS_Store",
|
|
17
|
+
".git",
|
|
18
|
+
".gitkeep",
|
|
19
|
+
".idea",
|
|
20
|
+
".vscode",
|
|
21
|
+
"Thumbs.db"
|
|
22
|
+
]);
|
|
13
23
|
function parse(argv) {
|
|
14
24
|
const args = { ref: DEFAULT_REF, help: false };
|
|
15
25
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -21,6 +31,8 @@ function parse(argv) {
|
|
|
21
31
|
}
|
|
22
32
|
return args;
|
|
23
33
|
}
|
|
34
|
+
|
|
35
|
+
// src/index.ts
|
|
24
36
|
function usage() {
|
|
25
37
|
console.log(`
|
|
26
38
|
Create a Built for Bankroll app.
|
|
@@ -80,6 +92,7 @@ async function main() {
|
|
|
80
92
|
created = true;
|
|
81
93
|
}
|
|
82
94
|
const name = await ask("App name", basename(target));
|
|
95
|
+
const rpc = await ask("Solana RPC", PUBLIC_MAINNET_RPC);
|
|
83
96
|
console.log(`
|
|
84
97
|
Downloading the template\u2026`);
|
|
85
98
|
try {
|
|
@@ -100,6 +113,11 @@ async function main() {
|
|
|
100
113
|
"",
|
|
101
114
|
"# Shown when someone connects the app.",
|
|
102
115
|
`BANKROLL_APP_NAME=${name}`,
|
|
116
|
+
"",
|
|
117
|
+
"# The public endpoint is rate-limited \u2014 confirming a payout against it",
|
|
118
|
+
"# takes tens of seconds. Any provider works; this is the one thing here",
|
|
119
|
+
"# worth upgrading.",
|
|
120
|
+
`SOLANA_RPC_URL=${rpc}`,
|
|
103
121
|
""
|
|
104
122
|
].join("\n")
|
|
105
123
|
);
|
|
@@ -120,17 +138,11 @@ async function main() {
|
|
|
120
138
|
is not your app comes from @joinbankroll/sdk and updates with npm update.
|
|
121
139
|
`);
|
|
122
140
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
console.error(`
|
|
141
|
+
try {
|
|
142
|
+
await main();
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error(`
|
|
128
145
|
${error instanceof Error ? error.message : String(error)}
|
|
129
146
|
`);
|
|
130
|
-
|
|
131
|
-
}
|
|
147
|
+
process.exit(1);
|
|
132
148
|
}
|
|
133
|
-
export {
|
|
134
|
-
IGNORABLE,
|
|
135
|
-
parse
|
|
136
|
-
};
|