@by-association-only/cli 4.0.0 → 4.0.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/dist/index.cjs +53 -18
- package/dist/index.js +60 -17
- package/dist/index.js.map +8 -8
- package/package.json +2 -2
- package/src/index.ts +0 -14
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun @bun-cjs
|
|
3
|
+
(function(exports, require, module, __filename, __dirname) {var import_node_module = require("node:module");
|
|
2
4
|
var __create = Object.create;
|
|
3
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __defProp = Object.defineProperty;
|
|
@@ -18,9 +20,13 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
20
|
|
|
19
21
|
// packages/cli/src/commands/create.ts
|
|
20
22
|
var fs = __toESM(require("node:fs"));
|
|
21
|
-
var import_prompts2 = require("@clack/prompts");
|
|
22
23
|
var path = __toESM(require("node:path"));
|
|
24
|
+
var import_prompts2 = require("@clack/prompts");
|
|
23
25
|
var import_octokit = require("octokit");
|
|
26
|
+
var import_picocolors = __toESM(require("picocolors"));
|
|
27
|
+
|
|
28
|
+
// packages/cli/src/constants.ts
|
|
29
|
+
var APP_REFERENCE_NAME = "Unisian";
|
|
24
30
|
|
|
25
31
|
// packages/cli/src/utils.ts
|
|
26
32
|
var PACKAGE_RUNNER_COMMAND = "bunx";
|
|
@@ -29,14 +35,9 @@ var GITHUB_INFO = {
|
|
|
29
35
|
templateRepository: "unisian"
|
|
30
36
|
};
|
|
31
37
|
|
|
32
|
-
// packages/cli/src/wrangler.ts
|
|
33
|
-
var import_prompts = require("@clack/prompts");
|
|
34
|
-
|
|
35
|
-
// packages/cli/src/constants.ts
|
|
36
|
-
var APP_REFERENCE_NAME = "Unisian";
|
|
37
|
-
|
|
38
38
|
// packages/cli/src/wrangler.ts
|
|
39
39
|
var import_promises = require("node:fs/promises");
|
|
40
|
+
var import_prompts = require("@clack/prompts");
|
|
40
41
|
async function runWranglerCommand(command, cwd) {
|
|
41
42
|
const child = Bun.spawn([PACKAGE_RUNNER_COMMAND, "wrangler@latest", ...command], {
|
|
42
43
|
stdin: "pipe",
|
|
@@ -74,7 +75,9 @@ async function ensureWranglerAuthenticated() {
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
async function wranglerLogin() {
|
|
77
|
-
const child = Bun.spawn([PACKAGE_RUNNER_COMMAND, "wrangler", "login"], {
|
|
78
|
+
const child = Bun.spawn([PACKAGE_RUNNER_COMMAND, "wrangler", "login"], {
|
|
79
|
+
stdin: "inherit"
|
|
80
|
+
});
|
|
78
81
|
const code = await child.exited;
|
|
79
82
|
return await new Promise((resolve, reject) => {
|
|
80
83
|
if (code === 0) {
|
|
@@ -116,7 +119,14 @@ async function createD1Database(name, cwd) {
|
|
|
116
119
|
}
|
|
117
120
|
async function createKVNamespace(name, cwd) {
|
|
118
121
|
try {
|
|
119
|
-
await runWranglerCommand([
|
|
122
|
+
await runWranglerCommand([
|
|
123
|
+
"kv",
|
|
124
|
+
"namespace",
|
|
125
|
+
"create",
|
|
126
|
+
name,
|
|
127
|
+
"--binding=BUCKET",
|
|
128
|
+
"--update-config=true"
|
|
129
|
+
], cwd);
|
|
120
130
|
return {
|
|
121
131
|
success: true,
|
|
122
132
|
message: `✅ KV Namespace: ${name} created!`
|
|
@@ -130,7 +140,14 @@ async function createKVNamespace(name, cwd) {
|
|
|
130
140
|
}
|
|
131
141
|
async function createR2Bucket(name, cwd) {
|
|
132
142
|
try {
|
|
133
|
-
await runWranglerCommand([
|
|
143
|
+
await runWranglerCommand([
|
|
144
|
+
"r2",
|
|
145
|
+
"bucket",
|
|
146
|
+
"create",
|
|
147
|
+
name,
|
|
148
|
+
"--binding=BUCKET",
|
|
149
|
+
"--update-config=true"
|
|
150
|
+
], cwd);
|
|
134
151
|
return {
|
|
135
152
|
success: true,
|
|
136
153
|
message: `✅ KV Namespace: ${name} created!`
|
|
@@ -144,7 +161,6 @@ async function createR2Bucket(name, cwd) {
|
|
|
144
161
|
}
|
|
145
162
|
|
|
146
163
|
// packages/cli/src/commands/create.ts
|
|
147
|
-
var import_picocolors = __toESM(require("picocolors"));
|
|
148
164
|
async function create() {
|
|
149
165
|
const initialContext = await initializeContext();
|
|
150
166
|
const context = await validateEnvironment(initialContext);
|
|
@@ -166,11 +182,17 @@ async function initializeContext() {
|
|
|
166
182
|
message: "What is the name of your project?",
|
|
167
183
|
placeholder: `my-${APP_REFERENCE_NAME.toLowerCase()}-project`,
|
|
168
184
|
validate: (value) => {
|
|
185
|
+
if (typeof value === "undefined")
|
|
186
|
+
return `You must provide a value`;
|
|
169
187
|
if (!value.match(/^[a-z0-9-]+$/)) {
|
|
170
188
|
return `Invalid app name: ${value}. App names can only contain lowercase letters, numbers, and dashes.`;
|
|
171
189
|
}
|
|
172
190
|
}
|
|
173
191
|
});
|
|
192
|
+
if (import_prompts2.isCancel(appName)) {
|
|
193
|
+
import_prompts2.outro(import_picocolors.default.red("An app name is required to continue"));
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
174
196
|
const repoName = `${String(appName)}-app`;
|
|
175
197
|
const localPath = `./${repoName}`;
|
|
176
198
|
if (fs.existsSync(localPath)) {
|
|
@@ -216,7 +238,9 @@ async function testGithubAccessTokenIsValid(accessToken) {
|
|
|
216
238
|
const octokit = new import_octokit.Octokit({
|
|
217
239
|
auth: accessToken
|
|
218
240
|
});
|
|
219
|
-
const {
|
|
241
|
+
const {
|
|
242
|
+
data: { login }
|
|
243
|
+
} = await octokit.rest.users.getAuthenticated();
|
|
220
244
|
return login;
|
|
221
245
|
}
|
|
222
246
|
async function createGithubRepository(context) {
|
|
@@ -262,7 +286,12 @@ async function cloneGithubRepository(context) {
|
|
|
262
286
|
process.exit(0);
|
|
263
287
|
}
|
|
264
288
|
async function provisionCloudflareResources(context) {
|
|
265
|
-
import_prompts2.note([
|
|
289
|
+
import_prompts2.note([
|
|
290
|
+
"Creating the following Cloudflare resources:",
|
|
291
|
+
"- KV",
|
|
292
|
+
"- D1",
|
|
293
|
+
"- R2 Bucket"
|
|
294
|
+
].join(`
|
|
266
295
|
`));
|
|
267
296
|
context.spinner.start(`Creating Cloudflare resources`);
|
|
268
297
|
const wranglerConfig = {
|
|
@@ -332,9 +361,15 @@ async function cleanup(context) {
|
|
|
332
361
|
}
|
|
333
362
|
|
|
334
363
|
// packages/cli/src/index.ts
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
364
|
+
var args = Bun.argv.slice(2);
|
|
365
|
+
var [command, subcommand] = args;
|
|
366
|
+
if (command === "create" && subcommand === "app") {
|
|
367
|
+
create().catch(console.error);
|
|
368
|
+
} else {
|
|
369
|
+
console.error("Unknown command. Usage: bao create app");
|
|
370
|
+
process.exit(1);
|
|
371
|
+
}
|
|
372
|
+
})
|
|
338
373
|
|
|
339
|
-
//# debugId=
|
|
374
|
+
//# debugId=7EFE8FC3B5F0979E64756E2164756E21
|
|
340
375
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
|
|
1
4
|
// packages/cli/src/commands/create.ts
|
|
2
5
|
import * as fs from "node:fs";
|
|
3
|
-
import { intro, log, note, outro, spinner, text } from "@clack/prompts";
|
|
4
6
|
import * as path from "node:path";
|
|
7
|
+
import {
|
|
8
|
+
intro,
|
|
9
|
+
isCancel as isCancel2,
|
|
10
|
+
log,
|
|
11
|
+
note,
|
|
12
|
+
outro,
|
|
13
|
+
spinner,
|
|
14
|
+
text
|
|
15
|
+
} from "@clack/prompts";
|
|
5
16
|
import { Octokit } from "octokit";
|
|
17
|
+
import color from "picocolors";
|
|
18
|
+
|
|
19
|
+
// packages/cli/src/constants.ts
|
|
20
|
+
var APP_REFERENCE_NAME = "Unisian";
|
|
6
21
|
|
|
7
22
|
// packages/cli/src/utils.ts
|
|
8
23
|
var PACKAGE_RUNNER_COMMAND = "bunx";
|
|
@@ -11,14 +26,9 @@ var GITHUB_INFO = {
|
|
|
11
26
|
templateRepository: "unisian"
|
|
12
27
|
};
|
|
13
28
|
|
|
14
|
-
// packages/cli/src/wrangler.ts
|
|
15
|
-
import { cancel, confirm, isCancel } from "@clack/prompts";
|
|
16
|
-
|
|
17
|
-
// packages/cli/src/constants.ts
|
|
18
|
-
var APP_REFERENCE_NAME = "Unisian";
|
|
19
|
-
|
|
20
29
|
// packages/cli/src/wrangler.ts
|
|
21
30
|
import { readFile, writeFile } from "node:fs/promises";
|
|
31
|
+
import { cancel, confirm, isCancel } from "@clack/prompts";
|
|
22
32
|
async function runWranglerCommand(command, cwd) {
|
|
23
33
|
const child = Bun.spawn([PACKAGE_RUNNER_COMMAND, "wrangler@latest", ...command], {
|
|
24
34
|
stdin: "pipe",
|
|
@@ -56,7 +66,9 @@ async function ensureWranglerAuthenticated() {
|
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
async function wranglerLogin() {
|
|
59
|
-
const child = Bun.spawn([PACKAGE_RUNNER_COMMAND, "wrangler", "login"], {
|
|
69
|
+
const child = Bun.spawn([PACKAGE_RUNNER_COMMAND, "wrangler", "login"], {
|
|
70
|
+
stdin: "inherit"
|
|
71
|
+
});
|
|
60
72
|
const code = await child.exited;
|
|
61
73
|
return await new Promise((resolve, reject) => {
|
|
62
74
|
if (code === 0) {
|
|
@@ -98,7 +110,14 @@ async function createD1Database(name, cwd) {
|
|
|
98
110
|
}
|
|
99
111
|
async function createKVNamespace(name, cwd) {
|
|
100
112
|
try {
|
|
101
|
-
await runWranglerCommand([
|
|
113
|
+
await runWranglerCommand([
|
|
114
|
+
"kv",
|
|
115
|
+
"namespace",
|
|
116
|
+
"create",
|
|
117
|
+
name,
|
|
118
|
+
"--binding=BUCKET",
|
|
119
|
+
"--update-config=true"
|
|
120
|
+
], cwd);
|
|
102
121
|
return {
|
|
103
122
|
success: true,
|
|
104
123
|
message: `✅ KV Namespace: ${name} created!`
|
|
@@ -112,7 +131,14 @@ async function createKVNamespace(name, cwd) {
|
|
|
112
131
|
}
|
|
113
132
|
async function createR2Bucket(name, cwd) {
|
|
114
133
|
try {
|
|
115
|
-
await runWranglerCommand([
|
|
134
|
+
await runWranglerCommand([
|
|
135
|
+
"r2",
|
|
136
|
+
"bucket",
|
|
137
|
+
"create",
|
|
138
|
+
name,
|
|
139
|
+
"--binding=BUCKET",
|
|
140
|
+
"--update-config=true"
|
|
141
|
+
], cwd);
|
|
116
142
|
return {
|
|
117
143
|
success: true,
|
|
118
144
|
message: `✅ KV Namespace: ${name} created!`
|
|
@@ -126,7 +152,6 @@ async function createR2Bucket(name, cwd) {
|
|
|
126
152
|
}
|
|
127
153
|
|
|
128
154
|
// packages/cli/src/commands/create.ts
|
|
129
|
-
import color from "picocolors";
|
|
130
155
|
async function create() {
|
|
131
156
|
const initialContext = await initializeContext();
|
|
132
157
|
const context = await validateEnvironment(initialContext);
|
|
@@ -148,11 +173,17 @@ async function initializeContext() {
|
|
|
148
173
|
message: "What is the name of your project?",
|
|
149
174
|
placeholder: `my-${APP_REFERENCE_NAME.toLowerCase()}-project`,
|
|
150
175
|
validate: (value) => {
|
|
176
|
+
if (typeof value === "undefined")
|
|
177
|
+
return `You must provide a value`;
|
|
151
178
|
if (!value.match(/^[a-z0-9-]+$/)) {
|
|
152
179
|
return `Invalid app name: ${value}. App names can only contain lowercase letters, numbers, and dashes.`;
|
|
153
180
|
}
|
|
154
181
|
}
|
|
155
182
|
});
|
|
183
|
+
if (isCancel2(appName)) {
|
|
184
|
+
outro(color.red("An app name is required to continue"));
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}
|
|
156
187
|
const repoName = `${String(appName)}-app`;
|
|
157
188
|
const localPath = `./${repoName}`;
|
|
158
189
|
if (fs.existsSync(localPath)) {
|
|
@@ -198,7 +229,9 @@ async function testGithubAccessTokenIsValid(accessToken) {
|
|
|
198
229
|
const octokit = new Octokit({
|
|
199
230
|
auth: accessToken
|
|
200
231
|
});
|
|
201
|
-
const {
|
|
232
|
+
const {
|
|
233
|
+
data: { login }
|
|
234
|
+
} = await octokit.rest.users.getAuthenticated();
|
|
202
235
|
return login;
|
|
203
236
|
}
|
|
204
237
|
async function createGithubRepository(context) {
|
|
@@ -244,7 +277,12 @@ async function cloneGithubRepository(context) {
|
|
|
244
277
|
process.exit(0);
|
|
245
278
|
}
|
|
246
279
|
async function provisionCloudflareResources(context) {
|
|
247
|
-
note([
|
|
280
|
+
note([
|
|
281
|
+
"Creating the following Cloudflare resources:",
|
|
282
|
+
"- KV",
|
|
283
|
+
"- D1",
|
|
284
|
+
"- R2 Bucket"
|
|
285
|
+
].join(`
|
|
248
286
|
`));
|
|
249
287
|
context.spinner.start(`Creating Cloudflare resources`);
|
|
250
288
|
const wranglerConfig = {
|
|
@@ -314,9 +352,14 @@ async function cleanup(context) {
|
|
|
314
352
|
}
|
|
315
353
|
|
|
316
354
|
// packages/cli/src/index.ts
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
355
|
+
var args = Bun.argv.slice(2);
|
|
356
|
+
var [command, subcommand] = args;
|
|
357
|
+
if (command === "create" && subcommand === "app") {
|
|
358
|
+
create().catch(console.error);
|
|
359
|
+
} else {
|
|
360
|
+
console.error("Unknown command. Usage: bao create app");
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
320
363
|
|
|
321
|
-
//# debugId=
|
|
364
|
+
//# debugId=CECAE99CFFFDD7C164756E2164756E21
|
|
322
365
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["packages/cli/src/commands/create.ts", "packages/cli/src/
|
|
3
|
+
"sources": ["packages/cli/src/commands/create.ts", "packages/cli/src/constants.ts", "packages/cli/src/utils.ts", "packages/cli/src/wrangler.ts", "packages/cli/src/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import * as fs from
|
|
6
|
-
"export const
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
5
|
+
"import * as fs from 'node:fs'\nimport * as path from 'node:path'\nimport {\n\tintro,\n\tisCancel,\n\tlog,\n\tnote,\n\toutro,\n\tspinner,\n\ttext,\n} from '@clack/prompts'\nimport { Octokit } from 'octokit'\nimport color from 'picocolors'\nimport { APP_REFERENCE_NAME } from '../constants'\nimport type { PartialCreateContext, ValidatedCreateContext } from '../types'\nimport { GITHUB_INFO } from '../utils'\nimport {\n\tcreateD1Database,\n\tcreateKVNamespace,\n\tcreateR2Bucket,\n\tensureWranglerSessionExists,\n\ttype ResourceProvisionResult,\n\twriteWranglerConfig,\n} from '../wrangler'\n\nexport async function create(): Promise<void> {\n\tconst initialContext = await initializeContext()\n\n\tconst context = await validateEnvironment(initialContext)\n\n\tawait createGithubRepository(context)\n\tawait cloneGithubRepository(context)\n\tawait provisionCloudflareResources(context)\n\tawait cleanup(context)\n\n\tnote(\n\t\t[\n\t\t\t`1. cd ${context.localPath}`,\n\t\t\t'2. shopify app config link',\n\t\t\t'3. bun run dev',\n\t\t].join(`\\n`),\n\t\t`${color.bgYellow(color.black('Next steps.'))}`,\n\t)\n\n\toutro(\n\t\t`Go and build something ${color.underline(color.italic(color.yellow('stupendous')))}.`,\n\t)\n}\n\nasync function initializeContext(): Promise<PartialCreateContext> {\n\tintro(`Setting up a new BAO ${APP_REFERENCE_NAME} project`)\n\n\tconst appName = await text({\n\t\tmessage: 'What is the name of your project?',\n\t\tplaceholder: `my-${APP_REFERENCE_NAME.toLowerCase()}-project`,\n\t\tvalidate: (value) => {\n\t\t\tif (typeof value === 'undefined') return `You must provide a value`\n\n\t\t\tif (!value.match(/^[a-z0-9-]+$/)) {\n\t\t\t\treturn `Invalid app name: ${value}. App names can only contain lowercase letters, numbers, and dashes.`\n\t\t\t}\n\t\t},\n\t})\n\n\tif (isCancel(appName)) {\n\t\toutro(color.red('An app name is required to continue'))\n\n\t\tprocess.exit(1)\n\t}\n\n\tconst repoName = `${String(appName)}-app`\n\tconst localPath = `./${repoName}`\n\n\tif (fs.existsSync(localPath)) {\n\t\tlog.error(`Unable to continue as ${localPath} already exists`)\n\n\t\tprocess.exit(0)\n\t}\n\n\tconst s = spinner()\n\n\treturn {\n\t\tappName: String(appName),\n\t\trepoName,\n\t\tlocalPath,\n\t\tspinner: s,\n\t}\n}\n\nasync function validateEnvironment(\n\tinitialContext: PartialCreateContext,\n): Promise<ValidatedCreateContext> {\n\tinitialContext.spinner.start(\n\t\t'Welcome! Checking to make sure your environment is set up correctly.',\n\t)\n\n\tconst hasEnvironmentAccessToken =\n\t\ttypeof process.env.GITHUB_TOKEN !== 'undefined' &&\n\t\tprocess.env.GITHUB_TOKEN.trim() !== ''\n\n\tif (!hasEnvironmentAccessToken) {\n\t\tlog.warning(\n\t\t\t`Unable to find a GITHUB_TOKEN environment variable. Please go to https://github.com/settings/tokens/new and create an access token to be able to use the CLI.`,\n\t\t)\n\t}\n\n\tconst githubAccessToken =\n\t\tprocess.env.GITHUB_TOKEN ||\n\t\t(await text({\n\t\t\tmessage: 'Access token',\n\t\t}))\n\n\ttry {\n\t\tawait testGithubAccessTokenIsValid(String(githubAccessToken))\n\t} catch (error: any) {\n\t\tlog.error(`Invalid access token: ${error.message}`)\n\n\t\tprocess.exit(0)\n\t}\n\n\tawait ensureWranglerSessionExists(initialContext.spinner)\n\n\tinitialContext.spinner.stop('Validated environment')\n\n\tnote(\n\t\t'Before using R2, Queues, and Durable objects,\\n' +\n\t\t\t\"make sure you've enabled them in the Cloudflare Dashboard.\\n\" +\n\t\t\t'https://dash.cloudflare.com/\\n' +\n\t\t\t'Otherwise, the following commands might fail! 😬',\n\t\t'👋 Heads-up:',\n\t)\n\n\treturn {\n\t\t...initialContext,\n\t\tgithubPersonalAccessToken: String(githubAccessToken),\n\t\tcloudflare: {},\n\t}\n}\n\nasync function testGithubAccessTokenIsValid(\n\taccessToken: string,\n): Promise<string> {\n\tconst octokit = new Octokit({\n\t\tauth: accessToken,\n\t})\n\n\tconst {\n\t\tdata: { login },\n\t} = await octokit.rest.users.getAuthenticated()\n\n\treturn login\n}\n\nasync function createGithubRepository(\n\tcontext: ValidatedCreateContext,\n): Promise<void> {\n\tcontext.spinner.start(`Creating GitHub Repository ${context.repoName}`)\n\n\tconst octokit = new Octokit({\n\t\tauth: context.githubPersonalAccessToken,\n\t})\n\n\ttry {\n\t\tconst appRepo = await octokit.rest.repos.createUsingTemplate({\n\t\t\ttemplate_owner: GITHUB_INFO.organization,\n\t\t\ttemplate_repo: GITHUB_INFO.templateRepository,\n\t\t\towner: GITHUB_INFO.organization,\n\t\t\tname: context.repoName,\n\t\t\tprivate: true,\n\t\t})\n\n\t\tcontext.repoHttpUrl = appRepo.data.html_url\n\t\tcontext.repoSshUrl = appRepo.data.ssh_url\n\t} catch (error: any) {\n\t\tlog.error(`Unable to create Github Repository ${context.repoName}`)\n\t\tlog.error(error)\n\n\t\tprocess.exit(0)\n\t}\n\n\tcontext.spinner.stop('Github repository created! ⭐')\n}\n\nasync function cloneGithubRepository(context: ValidatedCreateContext) {\n\tif (typeof context.repoSshUrl === 'undefined') {\n\t\tlog.error(\n\t\t\t`Unable to clone Github repository ${context.repoName} as can't find the .git URL`,\n\t\t)\n\n\t\tprocess.exit(0)\n\t}\n\n\tcontext.spinner.start(`Cloning ${context.repoName} from GitHub`)\n\n\tawait new Promise((resolve) => setTimeout(resolve, 5000))\n\n\tconst child = Bun.spawn(\n\t\t['git', 'clone', context.repoSshUrl, context.localPath],\n\t\t{\n\t\t\tstderr: 'ignore',\n\t\t\tstdout: 'ignore',\n\t\t},\n\t)\n\n\tawait child.exited\n\n\tif (fs.existsSync(context.localPath)) {\n\t\tcontext.spinner.stop(\n\t\t\t`Successfully cloned repository to ${context.localPath}`,\n\t\t)\n\n\t\treturn\n\t}\n\n\tcontext.spinner.stop()\n\tlog.error(`Unable to clone repository`)\n\n\tprocess.exit(0)\n}\n\nasync function provisionCloudflareResources(context: ValidatedCreateContext) {\n\tnote(\n\t\t[\n\t\t\t'Creating the following Cloudflare resources:',\n\t\t\t'- KV',\n\t\t\t'- D1',\n\t\t\t'- R2 Bucket',\n\t\t].join(`\\n`),\n\t)\n\n\tcontext.spinner.start(`Creating Cloudflare resources`)\n\n\tconst wranglerConfig = {\n\t\t$schema: 'node_modules/wrangler/config-schema.json',\n\t\tname: context.appName,\n\t\tcompatibility_date: '2025-09-21',\n\t\tcompatibility_flags: ['nodejs_compat'],\n\t\tmain: '@tanstack/react-start/server-entry',\n\t\tdev: {\n\t\t\tip: '0.0.0.0',\n\t\t\tport: 8647,\n\t\t},\n\t\tupload_source_maps: true,\n\t\tplacement: {\n\t\t\tmode: 'smart',\n\t\t},\n\t\tobservability: {\n\t\t\tenabled: true,\n\t\t},\n\t}\n\n\tawait writeWranglerConfig(\n\t\t`${context.localPath}/wrangler.json`,\n\t\twranglerConfig,\n\t)\n\n\tconst results: ResourceProvisionResult[] = []\n\n\tcontext.spinner.message(`Creating KV namespace`)\n\tresults.push(await createKVNamespace(context.appName, context.localPath))\n\n\tcontext.spinner.message(`Creating D1 database`)\n\tresults.push(await createD1Database(context.appName, context.localPath))\n\n\tcontext.spinner.message(`Creating R2 bucket`)\n\tresults.push(await createR2Bucket(context.appName, context.localPath))\n\n\tfor (const result of results) {\n\t\tif (!result.success) {\n\t\t\tlog.error(result.message)\n\n\t\t\tprocess.exit(0)\n\t\t}\n\t}\n\n\tcontext.spinner.stop('Cloudflare resources created and wrangler.json updated')\n\n\tconst allResults = results.map((r) => r.message)\n\n\tnote(allResults.join(`\\n`), \"Here's what we did:\")\n}\n\nasync function cleanup(context: ValidatedCreateContext) {\n\tcontext.spinner.start('Removing unnecessary files from the template')\n\n\tnote('Removing default shopify.app.toml', '🧹 Cleaning up')\n\n\tfs.unlinkSync(path.join(context.localPath, 'shopify.app.toml'))\n\n\tnote('Removing default shopify.app.production.toml', '🧹 Cleaning up')\n\n\tfs.unlinkSync(path.join(context.localPath, 'shopify.app.production.toml'))\n\n\tcontext.spinner.message('Installing packages')\n\n\tconst packageInstall = Bun.spawn(['bun', 'install'], {\n\t\tstderr: 'ignore',\n\t\tstdout: 'ignore',\n\t\tcwd: context.localPath,\n\t})\n\tawait packageInstall.exited\n\n\tcontext.spinner.message('Finalising app setup')\n\n\tconst gitAdd = Bun.spawn(['git', 'add', '.'], {\n\t\tstderr: 'ignore',\n\t\tstdout: 'ignore',\n\t\tcwd: context.localPath,\n\t})\n\tawait gitAdd.exited\n\n\tconst gitCommit = Bun.spawn(['git', 'commit', '-m', 'App setup'], {\n\t\tstderr: 'ignore',\n\t\tstdout: 'ignore',\n\t\tcwd: context.localPath,\n\t})\n\tawait gitCommit.exited\n\n\tcontext.spinner.stop()\n}\n",
|
|
6
|
+
"export const APP_REFERENCE_NAME = 'Unisian'\n",
|
|
7
|
+
"export const PACKAGE_RUNNER_COMMAND = 'bunx'\n\nexport const GITHUB_INFO = {\n\torganization: 'baoagency',\n\ttemplateRepository: 'unisian',\n} as const\n",
|
|
8
|
+
"import { readFile, writeFile } from 'node:fs/promises'\nimport { cancel, confirm, isCancel, type spinner } from '@clack/prompts'\nimport { APP_REFERENCE_NAME } from './constants'\nimport { PACKAGE_RUNNER_COMMAND } from './utils'\n\nexport async function runWranglerCommand(\n\tcommand: string[],\n\tcwd?: string,\n): Promise<{\n\tcode: number\n\tstdout: string\n\tstderr: string\n}> {\n\tconst child = Bun.spawn(\n\t\t[PACKAGE_RUNNER_COMMAND, 'wrangler@latest', ...command],\n\t\t{\n\t\t\tstdin: 'pipe',\n\t\t\tstderr: 'pipe',\n\t\t\tcwd,\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\tCLOUDFLARE_ACCOUNT_ID: '824c12820335788e8daf77dba7e7891e',\n\t\t\t},\n\t\t},\n\t)\n\n\tconst stdout = await new Response(child.stdout).text()\n\tconst stderr = await new Response(child.stderr).text()\n\tconst code = await child.exited\n\n\treturn new Promise((resolve, reject) => {\n\t\tif (code === 0) {\n\t\t\tresolve({\n\t\t\t\tcode,\n\t\t\t\tstdout,\n\t\t\t\tstderr,\n\t\t\t})\n\t\t}\n\n\t\treject({\n\t\t\tcode,\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t})\n\t})\n}\n\nexport async function ensureWranglerAuthenticated(): Promise<boolean> {\n\ttry {\n\t\tconst result = await runWranglerCommand(['whoami'])\n\n\t\treturn !result.stdout.includes('You are not authenticated')\n\t} catch {\n\t\t// Some older versions of Wrangler return a non-zero exit code when\n\t\t// you're not logged in.\n\t\treturn false\n\t}\n}\n\nexport async function wranglerLogin(): Promise<void> {\n\tconst child = Bun.spawn([PACKAGE_RUNNER_COMMAND, 'wrangler', 'login'], {\n\t\tstdin: 'inherit',\n\t})\n\tconst code = await child.exited\n\n\treturn await new Promise((resolve, reject) => {\n\t\tif (code === 0) {\n\t\t\tresolve()\n\t\t}\n\n\t\treject()\n\t})\n}\n\nexport async function ensureWranglerSessionExists(\n\ts: ReturnType<typeof spinner>,\n): Promise<void> {\n\ts.message(\n\t\t'Checking to make sure you have the Wrangler CLI installed and authenticated...',\n\t)\n\n\tif (!(await ensureWranglerAuthenticated())) {\n\t\ts.stop(\"Hmm. Looks like you're not logged in yet.\")\n\n\t\tconst wantsToLogIn = await confirm({\n\t\t\tmessage: `You need to be logged into wrangler to setup a ${APP_REFERENCE_NAME} app. Log in now?`,\n\t\t})\n\n\t\tif (isCancel(wantsToLogIn) || !wantsToLogIn) {\n\t\t\tcancel(\n\t\t\t\t`You need to be logged into wrangler to be able to setup a ${APP_REFERENCE_NAME} app.`,\n\t\t\t)\n\n\t\t\tprocess.exit(0)\n\t\t}\n\n\t\tawait wranglerLogin()\n\t}\n}\n\nexport async function getCurrentWranglerConfig(\n\tlocation: string,\n): Promise<Record<string, any>> {\n\treturn JSON.parse(await readFile(location, 'utf-8'))\n}\n\nexport async function writeWranglerConfig(\n\tlocation: string,\n\tconfig: Record<string, any>,\n): Promise<void> {\n\treturn await writeFile(location, JSON.stringify(config, null, 2))\n}\n\nexport type ResourceProvisionResult = {\n\tsuccess: boolean\n\tmessage: string\n}\n\nexport async function createD1Database(\n\tname: string,\n\tcwd?: string,\n): Promise<ResourceProvisionResult> {\n\ttry {\n\t\tawait runWranglerCommand(\n\t\t\t['d1', 'create', name, '--binding=DB', '--update-config=true'],\n\t\t\tcwd,\n\t\t)\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tmessage: `✅ D1 Database: ${name} created!`,\n\t\t}\n\t} catch (error: any) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tmessage: `❌ D1 Database: ${error.stderr || error.stdout || error.message}`,\n\t\t}\n\t}\n}\n\nexport async function createKVNamespace(\n\tname: string,\n\tcwd?: string,\n): Promise<ResourceProvisionResult> {\n\ttry {\n\t\tawait runWranglerCommand(\n\t\t\t[\n\t\t\t\t'kv',\n\t\t\t\t'namespace',\n\t\t\t\t'create',\n\t\t\t\tname,\n\t\t\t\t'--binding=BUCKET',\n\t\t\t\t'--update-config=true',\n\t\t\t],\n\t\t\tcwd,\n\t\t)\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tmessage: `✅ KV Namespace: ${name} created!`,\n\t\t}\n\t} catch (error: any) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tmessage: `❌ KV Namespace: ${error.stderr || error.stdout || error.message}`,\n\t\t}\n\t}\n}\n\nexport async function createR2Bucket(\n\tname: string,\n\tcwd?: string,\n): Promise<ResourceProvisionResult> {\n\ttry {\n\t\tawait runWranglerCommand(\n\t\t\t[\n\t\t\t\t'r2',\n\t\t\t\t'bucket',\n\t\t\t\t'create',\n\t\t\t\tname,\n\t\t\t\t'--binding=BUCKET',\n\t\t\t\t'--update-config=true',\n\t\t\t],\n\t\t\tcwd,\n\t\t)\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tmessage: `✅ KV Namespace: ${name} created!`,\n\t\t}\n\t} catch (error: any) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tmessage: `❌ KV Namespace: ${error.stderr || error.stdout || error.message}`,\n\t\t}\n\t}\n}\n",
|
|
9
|
+
"#!/usr/bin/env bun\n\nimport { create } from './commands/create'\n\nconst args = Bun.argv.slice(2)\nconst [command, subcommand] = args\n\nif (command === 'create' && subcommand === 'app') {\n\tcreate().catch(console.error)\n} else {\n\tconsole.error('Unknown command. Usage: bao create app')\n\n\tprocess.exit(1)\n}\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": "
|
|
12
|
-
"debugId": "
|
|
11
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAoB,IAApB;AACsB,IAAtB;AASO,IARP;AASwB,IAAxB;AACkB,IAAlB;;;ACZO,IAAM,qBAAqB;;;ACA3B,IAAM,yBAAyB;AAE/B,IAAM,cAAc;AAAA,EAC1B,cAAc;AAAA,EACd,oBAAoB;AACrB;;;ACLoC,IAApC;AACwD,IAAxD;AAIA,eAAsB,kBAAkB,CACvC,SACA,KAKE;AAAA,EACF,MAAM,QAAQ,IAAI,MACjB,CAAC,wBAAwB,mBAAmB,GAAG,OAAO,GACtD;AAAA,IACC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA,KAAK;AAAA,SACD,QAAQ;AAAA,MACX,uBAAuB;AAAA,IACxB;AAAA,EACD,CACD;AAAA,EAEA,MAAM,SAAS,MAAM,IAAI,SAAS,MAAM,MAAM,EAAE,KAAK;AAAA,EACrD,MAAM,SAAS,MAAM,IAAI,SAAS,MAAM,MAAM,EAAE,KAAK;AAAA,EACrD,MAAM,OAAO,MAAM,MAAM;AAAA,EAEzB,OAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAAA,IACvC,IAAI,SAAS,GAAG;AAAA,MACf,QAAQ;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IAEA,OAAO;AAAA,MACN;AAAA,MACA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ACR,QAAQ;AAAA,IACR,KAAK,QAAQ;AAAA,EACd,CAAC;AAAA,EACD,MAAM,eAAe;AAAA,EAErB,QAAQ,QAAQ,QAAQ,sBAAsB;AAAA,EAE9C,MAAM,SAAS,IAAI,MAAM,CAAC,OAAO,OAAO,GAAG,GAAG;AAAA,IAC7C,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,KAAK,QAAQ;AAAA,EACd,CAAC;AAAA,EACD,MAAM,OAAO;AAAA,EAEb,MAAM,YAAY,IAAI,MAAM,CAAC,OAAO,UAAU,MAAM,WAAW,GAAG;AAAA,IACjE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,KAAK,QAAQ;AAAA,EACd,CAAC;AAAA,EACD,MAAM,UAAU;AAAA,EAEhB,QAAQ,QAAQ,KAAK;AAAA;;;AI1TtB,IAAM,OAAO,IAAI,KAAK,MAAM,CAAC;AAC7B,KAAO,SAAS,cAAc;AAE9B,IAAI,YAAY,YAAY,eAAe,OAAO;AAAA,EACjD,OAAO,EAAE,MAAM,QAAQ,KAAK;AAC7B,EAAO;AAAA,EACN,QAAQ,MAAM,wCAAwC;AAAA,EAEtD,QAAQ,KAAK,CAAC;AAAA;",
|
|
12
|
+
"debugId": "7EFE8FC3B5F0979E64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@by-association-only/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"module": "./dist/index.js",
|
|
9
9
|
"main": "./dist/index.cjs",
|
|
10
10
|
"bin": {
|
|
11
|
-
"bao": "./
|
|
11
|
+
"bao": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
package/src/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { create } from './commands/create'
|
|
4
|
-
|
|
5
|
-
const args = Bun.argv.slice(2)
|
|
6
|
-
const [command, subcommand] = args
|
|
7
|
-
|
|
8
|
-
if (command === 'create' && subcommand === 'app') {
|
|
9
|
-
create().catch(console.error)
|
|
10
|
-
} else {
|
|
11
|
-
console.error('Unknown command. Usage: bao create app')
|
|
12
|
-
|
|
13
|
-
process.exit(1)
|
|
14
|
-
}
|