@apps-in-toss/web-framework 3.0.0-beta.9d42c0b → 3.0.0-beta.b705d2b
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/cli.js +648 -24
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli/index.ts
|
|
4
|
-
import { Cli } from "clipanion";
|
|
4
|
+
import { Cli, Builtins } from "clipanion";
|
|
5
5
|
|
|
6
6
|
// src/cli/commands/build/index.ts
|
|
7
7
|
import * as p from "@clack/prompts";
|
|
@@ -165,21 +165,566 @@ var BuildCommand = class extends Command {
|
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
// src/cli/commands/
|
|
169
|
-
import
|
|
168
|
+
// src/cli/commands/deploy/index.ts
|
|
169
|
+
import assert from "assert";
|
|
170
|
+
import fs4 from "fs";
|
|
171
|
+
import path5 from "path";
|
|
172
|
+
import { AppsInTossBundle as AppsInTossBundle2 } from "@apps-in-toss/ait-format";
|
|
173
|
+
import * as p2 from "@clack/prompts";
|
|
170
174
|
import { Command as Command2, Option } from "clipanion";
|
|
171
175
|
|
|
176
|
+
// src/cli/utils/colors.ts
|
|
177
|
+
function wrap(open, close) {
|
|
178
|
+
return (input) => `\x1B[${open}m${input}\x1B[${close}m`;
|
|
179
|
+
}
|
|
180
|
+
var colors = {
|
|
181
|
+
cyan: wrap(36, 39),
|
|
182
|
+
green: wrap(32, 39),
|
|
183
|
+
underline: wrap(4, 24)
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// src/cli/utils/TokenStorage.ts
|
|
187
|
+
import fs2 from "fs";
|
|
188
|
+
import os from "os";
|
|
189
|
+
import path4 from "path";
|
|
190
|
+
var TokenStorage = class {
|
|
191
|
+
static get path() {
|
|
192
|
+
const home = os.homedir();
|
|
193
|
+
const dir = path4.join(home, ".ait");
|
|
194
|
+
if (!fs2.existsSync(dir)) {
|
|
195
|
+
fs2.mkdirSync(dir, { recursive: true });
|
|
196
|
+
}
|
|
197
|
+
return path4.join(dir, "credentials");
|
|
198
|
+
}
|
|
199
|
+
static read() {
|
|
200
|
+
const file = this.path;
|
|
201
|
+
if (!fs2.existsSync(file)) {
|
|
202
|
+
return {};
|
|
203
|
+
}
|
|
204
|
+
const raw = fs2.readFileSync(file, "utf8");
|
|
205
|
+
try {
|
|
206
|
+
const parsed = JSON.parse(raw);
|
|
207
|
+
if (parsed && typeof parsed === "object") {
|
|
208
|
+
return parsed;
|
|
209
|
+
}
|
|
210
|
+
} catch {
|
|
211
|
+
}
|
|
212
|
+
return {};
|
|
213
|
+
}
|
|
214
|
+
static write(map) {
|
|
215
|
+
const file = this.path;
|
|
216
|
+
const content = JSON.stringify(map, null, 2);
|
|
217
|
+
fs2.writeFileSync(file, content, { encoding: "utf8" });
|
|
218
|
+
}
|
|
219
|
+
static set(workspace, token) {
|
|
220
|
+
const creds = this.read();
|
|
221
|
+
creds[workspace] = token;
|
|
222
|
+
this.write(creds);
|
|
223
|
+
}
|
|
224
|
+
static delete(workspace) {
|
|
225
|
+
const creds = this.read();
|
|
226
|
+
if (workspace in creds) {
|
|
227
|
+
delete creds[workspace];
|
|
228
|
+
this.write(creds);
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
static get(workspace) {
|
|
234
|
+
const creds = this.read();
|
|
235
|
+
return creds[workspace];
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// src/cli/utils/upload.ts
|
|
240
|
+
import fs3 from "fs";
|
|
241
|
+
|
|
242
|
+
// src/cli/utils/constants.ts
|
|
243
|
+
var DEFAULT_API_BASE_URL = "https://apps-in-toss.toss.im/console";
|
|
244
|
+
|
|
245
|
+
// src/cli/utils/flowAsync.ts
|
|
246
|
+
function flowAsync(...funcs) {
|
|
247
|
+
return async function(...args) {
|
|
248
|
+
let result = funcs.length ? await funcs[0].apply(this, args) : args[0];
|
|
249
|
+
for (let i = 1; i < funcs.length; i++) {
|
|
250
|
+
result = await funcs[i]?.call(this, result);
|
|
251
|
+
}
|
|
252
|
+
return result;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// src/cli/utils/handleFetchResponse.ts
|
|
257
|
+
async function handleFetchResponse(response) {
|
|
258
|
+
if (!response.ok) {
|
|
259
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
260
|
+
}
|
|
261
|
+
const data = await response.clone().json();
|
|
262
|
+
if (data.resultType !== "SUCCESS") {
|
|
263
|
+
const errorCode = data?.error?.errorCode ?? "-1";
|
|
264
|
+
const errorReason = data?.error?.reason ?? "unknown";
|
|
265
|
+
throw new Error(`${errorReason} (Code: ${errorCode})`);
|
|
266
|
+
}
|
|
267
|
+
return data.success;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// src/cli/utils/withRetry.ts
|
|
271
|
+
import { setTimeout as sleep } from "timers/promises";
|
|
272
|
+
async function withRetry(fn, options = {}) {
|
|
273
|
+
const {
|
|
274
|
+
maxRetries = 60,
|
|
275
|
+
delayMs = 1e4,
|
|
276
|
+
shouldRetryOnResult,
|
|
277
|
+
shouldRetryOnError,
|
|
278
|
+
onRetry
|
|
279
|
+
} = options;
|
|
280
|
+
let attempt = 0;
|
|
281
|
+
while (attempt < maxRetries) {
|
|
282
|
+
try {
|
|
283
|
+
const result = await fn();
|
|
284
|
+
if (shouldRetryOnResult && shouldRetryOnResult(result)) {
|
|
285
|
+
onRetry?.(attempt + 1, { result });
|
|
286
|
+
await sleep(delayMs);
|
|
287
|
+
attempt++;
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
return result;
|
|
291
|
+
} catch (error) {
|
|
292
|
+
const retryable = shouldRetryOnError ? shouldRetryOnError(error) : false;
|
|
293
|
+
if (!retryable) {
|
|
294
|
+
throw error;
|
|
295
|
+
}
|
|
296
|
+
onRetry?.(attempt + 1, { error });
|
|
297
|
+
await sleep(delayMs);
|
|
298
|
+
attempt++;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
throw new Error("\uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04\uC744 \uCD08\uACFC\uD588\uC5B4\uC694.");
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// src/cli/utils/upload.ts
|
|
305
|
+
async function uploadArtifact(config) {
|
|
306
|
+
return flowAsync(
|
|
307
|
+
uploadStart(),
|
|
308
|
+
uploadArtifactToRemote(),
|
|
309
|
+
uploadComplete(),
|
|
310
|
+
checkBundleStatus()
|
|
311
|
+
)(config);
|
|
312
|
+
}
|
|
313
|
+
function uploadStart() {
|
|
314
|
+
return async (config) => {
|
|
315
|
+
const baseUrl = config.baseUrl ?? DEFAULT_API_BASE_URL;
|
|
316
|
+
const response = await fetch(
|
|
317
|
+
`${baseUrl}/api-public/v3/openapi/bundles/${config.appName}/upload-start`,
|
|
318
|
+
{
|
|
319
|
+
method: "POST",
|
|
320
|
+
headers: {
|
|
321
|
+
"Content-Type": "application/json",
|
|
322
|
+
Authorization: `Bearer ${config.apiKey}`
|
|
323
|
+
},
|
|
324
|
+
body: JSON.stringify({
|
|
325
|
+
deploymentId: config.deploymentId,
|
|
326
|
+
memo: config.memo
|
|
327
|
+
})
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
return {
|
|
331
|
+
config,
|
|
332
|
+
output: await handleFetchResponse(response)
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function uploadArtifactToRemote() {
|
|
337
|
+
return async (params) => {
|
|
338
|
+
const { config, output } = params;
|
|
339
|
+
const stat = await fs3.promises.stat(config.artifactPath);
|
|
340
|
+
const stream = fs3.createReadStream(config.artifactPath);
|
|
341
|
+
const response = await fetch(output.uploadUrl, {
|
|
342
|
+
method: "PUT",
|
|
343
|
+
headers: {
|
|
344
|
+
"Content-Type": "application/zip",
|
|
345
|
+
"Content-Length": String(stat.size)
|
|
346
|
+
},
|
|
347
|
+
// Node.js의 fetch는 ReadStream을 body로 받을 수 있으나 DOM 타입에는 없어 캐스팅합니다.
|
|
348
|
+
body: stream,
|
|
349
|
+
duplex: "half"
|
|
350
|
+
});
|
|
351
|
+
if (!response.ok) {
|
|
352
|
+
throw new Error("\uC5C5\uB85C\uB4DC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.");
|
|
353
|
+
}
|
|
354
|
+
return config;
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function uploadComplete() {
|
|
358
|
+
return async (config) => {
|
|
359
|
+
const baseUrl = config.baseUrl ?? DEFAULT_API_BASE_URL;
|
|
360
|
+
const response = await fetch(
|
|
361
|
+
`${baseUrl}/api-public/v3/openapi/bundles/${config.appName}/upload-complete`,
|
|
362
|
+
{
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers: {
|
|
365
|
+
"Content-Type": "application/json",
|
|
366
|
+
Authorization: `Bearer ${config.apiKey}`
|
|
367
|
+
},
|
|
368
|
+
body: JSON.stringify({
|
|
369
|
+
deploymentId: config.deploymentId
|
|
370
|
+
})
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
await handleFetchResponse(response);
|
|
374
|
+
return config;
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function checkBundleStatus(delayMs = 1e4, maxRetries = 10) {
|
|
378
|
+
return async (config) => {
|
|
379
|
+
const baseUrl = config.baseUrl ?? DEFAULT_API_BASE_URL;
|
|
380
|
+
function assertBuildNotFailed(config2, reviewStatus2) {
|
|
381
|
+
if (reviewStatus2 === "BUILD_FAILED") {
|
|
382
|
+
throw new Error(
|
|
383
|
+
`\uBE4C\uB4DC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uCF58\uC194\uC5D0\uC11C \uBE4C\uB4DC \uC2E4\uD328 \uC0AC\uC720\uB97C \uD655\uC778\uD574\uC8FC\uC138\uC694.(deploymentId: ${config2.deploymentId})`
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
async function pollBundleStatus() {
|
|
388
|
+
const response = await fetch(
|
|
389
|
+
`${baseUrl}/api-public/v3/openapi/bundles/${config.appName}/deployments/${config.deploymentId}`,
|
|
390
|
+
{
|
|
391
|
+
method: "GET",
|
|
392
|
+
headers: {
|
|
393
|
+
"Content-Type": "application/json",
|
|
394
|
+
Authorization: `Bearer ${config.apiKey}`
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
const { reviewStatus: reviewStatus2 } = await handleFetchResponse(response);
|
|
399
|
+
return reviewStatus2;
|
|
400
|
+
}
|
|
401
|
+
const reviewStatus = await withRetry(pollBundleStatus, {
|
|
402
|
+
maxRetries,
|
|
403
|
+
delayMs,
|
|
404
|
+
shouldRetryOnResult: (reviewStatus2) => reviewStatus2 === "BUILDING" || reviewStatus2 === "PREPARE",
|
|
405
|
+
shouldRetryOnError: () => false
|
|
406
|
+
});
|
|
407
|
+
assertBuildNotFailed(config, reviewStatus);
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// src/cli/commands/deploy/index.ts
|
|
412
|
+
var DeployCommand = class extends Command2 {
|
|
413
|
+
static paths = [["deploy"]];
|
|
414
|
+
static usage = Command2.Usage({
|
|
415
|
+
category: "Deploy",
|
|
416
|
+
description: "\uBE4C\uB4DC\uB41C .ait \uC544\uD2F0\uD329\uD2B8\uB97C \uC571\uC778\uD1A0\uC2A4\uC5D0 \uC5C5\uB85C\uB4DC(\uBC30\uD3EC)\uD569\uB2C8\uB2E4.",
|
|
417
|
+
examples: [
|
|
418
|
+
["\uAE30\uBCF8 \uC544\uD2F0\uD329\uD2B8(.ait) \uBC30\uD3EC", "apps-in-toss deploy"],
|
|
419
|
+
[
|
|
420
|
+
"\uD2B9\uC815 .ait \uD30C\uC77C \uBC30\uD3EC",
|
|
421
|
+
"apps-in-toss deploy --location ./dist/my-app.ait"
|
|
422
|
+
],
|
|
423
|
+
["\uD504\uB85C\uD544\uC5D0 \uC800\uC7A5\uB41C \uD1A0\uD070\uC73C\uB85C \uBC30\uD3EC", "apps-in-toss deploy --profile dev"],
|
|
424
|
+
[
|
|
425
|
+
"\uCD9C\uC2DC \uBA54\uBAA8\uC640 \uD568\uAED8 \uBC30\uD3EC",
|
|
426
|
+
'apps-in-toss deploy -m "\uCD9C\uC2DC \uBA54\uBAA8(\uCD5C\uB300 1000\uC790)"'
|
|
427
|
+
],
|
|
428
|
+
["\uBC30\uD3EC \uACB0\uACFC scheme\uB9CC \uCD9C\uB825", "apps-in-toss deploy --scheme-only"]
|
|
429
|
+
]
|
|
430
|
+
});
|
|
431
|
+
apiKey = Option.String("--api-key", {
|
|
432
|
+
required: false,
|
|
433
|
+
description: "\uBC30\uD3EC\uB97C \uC704\uD55C API \uD0A4\uC785\uB2C8\uB2E4. \uBA85\uC2DC\uC801\uC73C\uB85C \uC774 \uC635\uC158\uC73C\uB85C api key\uB97C \uC9C1\uC811 \uC785\uB825\uD558\uAC70\uB098, --profile \uC635\uC158\uC744 \uC0AC\uC6A9\uD574\uC11C \uD504\uB85C\uD544\uC744 \uC9C0\uC815\uD558\uBA74 \uD504\uB85C\uD544\uC5D0 \uB4F1\uB85D\uB41C api key\uB97C \uC0AC\uC6A9\uD574\uC694."
|
|
434
|
+
});
|
|
435
|
+
workspace = Option.String("--workspace", {
|
|
436
|
+
required: false,
|
|
437
|
+
description: "(deprecated) \uD1A0\uD070 \uC6CC\uD06C\uC2A4\uD398\uC774\uC2A4 \uC774\uB984\uC785\uB2C8\uB2E4. \uC774 \uC635\uC158 \uB300\uC2E0 --profile \uC635\uC158\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694."
|
|
438
|
+
});
|
|
439
|
+
profile = Option.String("--profile", {
|
|
440
|
+
required: false,
|
|
441
|
+
description: "apps-in-toss token add \uBA85\uB839\uC5B4\uB97C \uD1B5\uD574 \uB4F1\uB85D\uD55C \uD504\uB85C\uD544\uC774\uC5D0\uC694. \uD504\uB85C\uD544\uC774 \uC5C6\uC73C\uBA74 default \uD504\uB85C\uD544\uC744 \uC0AC\uC6A9\uD574\uC694."
|
|
442
|
+
});
|
|
443
|
+
baseUrl = Option.String("--base-url", {
|
|
444
|
+
description: "API Base URL",
|
|
445
|
+
required: false
|
|
446
|
+
});
|
|
447
|
+
location = Option.String("--location", {
|
|
448
|
+
description: "\uC5C5\uB85C\uB4DC\uD560 .ait \uD30C\uC77C\uC758 \uACBD\uB85C\uB97C \uBA85\uC2DC\uC801\uC73C\uB85C \uC9C0\uC815\uD574\uC694. \uAE30\uBCF8\uAC12\uC740 \uD604\uC7AC \uD328\uD0A4\uC9C0 \uB8E8\uD2B8 \uB514\uB809\uD1A0\uB9AC\uC5D0 \uC788\uB294 ait \uD30C\uC77C\uC774\uC5D0\uC694.",
|
|
449
|
+
required: false
|
|
450
|
+
});
|
|
451
|
+
schemeOnly = Option.Boolean("--scheme-only", {
|
|
452
|
+
required: false,
|
|
453
|
+
description: "\uBC30\uD3EC \uACB0\uACFC\uB97C intoss-private scheme\uB9CC \uCD9C\uB825\uD558\uB3C4\uB85D \uC124\uC815\uD574\uC694. \uAE30\uBCF8\uAC12\uC740 false\uC608\uC694."
|
|
454
|
+
});
|
|
455
|
+
memo = Option.String("-m,--memo", {
|
|
456
|
+
required: false,
|
|
457
|
+
description: "\uCD9C\uC2DC \uBA54\uBAA8\uB97C \uC785\uB825\uD574\uC694. \uCD5C\uB300 1000\uC790\uAE4C\uC9C0 \uC785\uB825\uD560 \uC218 \uC788\uC5B4\uC694."
|
|
458
|
+
});
|
|
459
|
+
async execute() {
|
|
460
|
+
const baseUrl = this.baseUrl;
|
|
461
|
+
const profile = this.profile || this.workspace || "default";
|
|
462
|
+
if (this.workspace) {
|
|
463
|
+
p2.log.warn(
|
|
464
|
+
"(deprecated) --workspace \uC635\uC158\uC740 \uC774\uC81C \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC544\uC694. \uC774 \uC635\uC158 \uB300\uC2E0 --profile \uC635\uC158\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694."
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
const apiKey = await this.getApiKey(profile);
|
|
468
|
+
if (p2.isCancel(apiKey)) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
try {
|
|
472
|
+
if (this.memo != null && this.memo.length > 1e3) {
|
|
473
|
+
throw new Error("memo\uB294 \uCD5C\uB300 1000\uC790\uAE4C\uC9C0 \uC785\uB825\uD560 \uC218 \uC788\uC5B4\uC694.");
|
|
474
|
+
}
|
|
475
|
+
const resolvedArtifactPath = this.getArtifactPath(this.location);
|
|
476
|
+
const buffer = fs4.readFileSync(resolvedArtifactPath);
|
|
477
|
+
const format = AppsInTossBundle2.detect(buffer);
|
|
478
|
+
if (format !== AppsInTossBundle2.Format.AIT) {
|
|
479
|
+
throw new Error("\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4");
|
|
480
|
+
}
|
|
481
|
+
const reader = AppsInTossBundle2.reader(buffer);
|
|
482
|
+
const appName = reader.appName;
|
|
483
|
+
const deploymentId = reader.deploymentId;
|
|
484
|
+
assert(typeof appName === "string", "ait \uD30C\uC77C\uC5D0 appName\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
485
|
+
assert(
|
|
486
|
+
typeof deploymentId === "string",
|
|
487
|
+
"ait \uD30C\uC77C\uC5D0 deploymentId\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4"
|
|
488
|
+
);
|
|
489
|
+
const colorAppName = this.decorate(appName, colors.cyan);
|
|
490
|
+
if (this.schemeOnly) {
|
|
491
|
+
await uploadArtifact({
|
|
492
|
+
artifactPath: resolvedArtifactPath,
|
|
493
|
+
appName,
|
|
494
|
+
deploymentId,
|
|
495
|
+
apiKey,
|
|
496
|
+
memo: this.memo,
|
|
497
|
+
baseUrl
|
|
498
|
+
});
|
|
499
|
+
} else {
|
|
500
|
+
await p2.tasks([
|
|
501
|
+
{
|
|
502
|
+
title: `${colorAppName} \uC571 \uBC30\uD3EC \uC911...`,
|
|
503
|
+
task: async () => {
|
|
504
|
+
await uploadArtifact({
|
|
505
|
+
artifactPath: resolvedArtifactPath,
|
|
506
|
+
appName,
|
|
507
|
+
deploymentId,
|
|
508
|
+
apiKey,
|
|
509
|
+
memo: this.memo,
|
|
510
|
+
baseUrl
|
|
511
|
+
});
|
|
512
|
+
return `${colorAppName} \uBC30\uD3EC\uAC00 \uC644\uB8CC\uB418\uC5C8\uC5B4\uC694`;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
]);
|
|
516
|
+
}
|
|
517
|
+
this.printResult(appName, deploymentId);
|
|
518
|
+
} catch (error) {
|
|
519
|
+
if (error instanceof Error) {
|
|
520
|
+
this.printError(error);
|
|
521
|
+
} else {
|
|
522
|
+
console.error(error);
|
|
523
|
+
}
|
|
524
|
+
process.exit(1);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
decorate(message, color) {
|
|
528
|
+
if (this.schemeOnly) {
|
|
529
|
+
return message;
|
|
530
|
+
}
|
|
531
|
+
return colors.underline(color(message));
|
|
532
|
+
}
|
|
533
|
+
printResult(appName, deploymentId) {
|
|
534
|
+
const result = `intoss-private://${appName}?_deploymentId=${deploymentId}`;
|
|
535
|
+
if (this.schemeOnly) {
|
|
536
|
+
this.context.stdout.write(`${result}
|
|
537
|
+
`);
|
|
538
|
+
} else {
|
|
539
|
+
p2.note(this.decorate(result, colors.green));
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
printError(error) {
|
|
543
|
+
if (this.schemeOnly) {
|
|
544
|
+
this.context.stdout.write(`${error.message}
|
|
545
|
+
`);
|
|
546
|
+
} else {
|
|
547
|
+
p2.log.error(error.message);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
async getApiKey(profile) {
|
|
551
|
+
const token = TokenStorage.get(profile) || this.apiKey;
|
|
552
|
+
if (token) {
|
|
553
|
+
return token;
|
|
554
|
+
}
|
|
555
|
+
return await p2.password({
|
|
556
|
+
message: "\uC571\uC778\uD1A0\uC2A4 \uBC30\uD3EC API \uD0A4\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694",
|
|
557
|
+
validate: (value) => {
|
|
558
|
+
if (value == null || value.length === 0) {
|
|
559
|
+
return "API \uD0A4\uB294 \uD544\uC218 \uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4.";
|
|
560
|
+
}
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
getArtifactPath(location) {
|
|
566
|
+
if (location) {
|
|
567
|
+
if (!location.endsWith(".ait")) {
|
|
568
|
+
throw new Error("\uBC30\uD3EC\uD560 \uD30C\uC77C\uC740 .ait \uD655\uC7A5\uC790\uC5EC\uC57C \uD569\uB2C8\uB2E4.");
|
|
569
|
+
}
|
|
570
|
+
return path5.resolve(location);
|
|
571
|
+
}
|
|
572
|
+
const packageRoot = getPackageRoot(process.cwd());
|
|
573
|
+
const artifactFile = fs4.readdirSync(packageRoot).find((file) => file.endsWith(".ait"));
|
|
574
|
+
if (!artifactFile) {
|
|
575
|
+
throw new Error("\uBC30\uD3EC\uD560 .ait \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
576
|
+
}
|
|
577
|
+
return path5.resolve(packageRoot, artifactFile);
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
// src/cli/commands/init/index.ts
|
|
582
|
+
import { appendFile, readFile as readFile2, writeFile as writeFile2 } from "fs/promises";
|
|
583
|
+
import { join } from "path";
|
|
584
|
+
import * as p3 from "@clack/prompts";
|
|
585
|
+
import { Command as Command3, Option as Option2 } from "clipanion";
|
|
586
|
+
|
|
587
|
+
// src/cli/utils/ensureSelect.ts
|
|
588
|
+
async function ensureSelect({
|
|
589
|
+
value,
|
|
590
|
+
prompt
|
|
591
|
+
}) {
|
|
592
|
+
if (value) {
|
|
593
|
+
return value;
|
|
594
|
+
}
|
|
595
|
+
return await prompt();
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// src/cli/utils/kebabCase.ts
|
|
599
|
+
function kebabCase(str) {
|
|
600
|
+
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").toLowerCase();
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// src/cli/utils/transformTemplate.ts
|
|
604
|
+
function transformTemplate(templateString, values) {
|
|
605
|
+
let result = templateString;
|
|
606
|
+
for (const key in values) {
|
|
607
|
+
const placeholder = `%%${key}%%`;
|
|
608
|
+
result = result.replace(new RegExp(placeholder, "g"), values[key]);
|
|
609
|
+
}
|
|
610
|
+
return result;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// src/cli/commands/init/templates.ts
|
|
614
|
+
var WEB_FRAMEWORK_CONFIG_TEMPLATE = `import { defineConfig } from '@apps-in-toss/web-framework/config';
|
|
615
|
+
|
|
616
|
+
export default defineConfig({
|
|
617
|
+
appName: '%%appName%%',
|
|
618
|
+
brand: {
|
|
619
|
+
primaryColor: '#3182F6', // \uD654\uBA74\uC5D0 \uB178\uCD9C\uB420 \uC571\uC758 \uAE30\uBCF8 \uC0C9\uC0C1\uC73C\uB85C \uBC14\uAFD4\uC8FC\uC138\uC694.
|
|
620
|
+
},
|
|
621
|
+
permissions: [],
|
|
622
|
+
webBundleDir: '%%webBundleDir%%',
|
|
623
|
+
});
|
|
624
|
+
`;
|
|
625
|
+
|
|
626
|
+
// src/cli/commands/init/index.ts
|
|
627
|
+
async function templateWebFramework({
|
|
628
|
+
appName,
|
|
629
|
+
cwd,
|
|
630
|
+
skipInput
|
|
631
|
+
}) {
|
|
632
|
+
const packageJsonPath = join(cwd, "package.json");
|
|
633
|
+
const packageJsonRaw = await readFile2(packageJsonPath, {
|
|
634
|
+
encoding: "utf-8"
|
|
635
|
+
});
|
|
636
|
+
const packageJson = JSON.parse(packageJsonRaw);
|
|
637
|
+
packageJson.scripts ??= {};
|
|
638
|
+
if (packageJson.scripts.build) {
|
|
639
|
+
packageJson.scripts.build = packageJson.scripts.build + " && ait build";
|
|
640
|
+
}
|
|
641
|
+
packageJson.scripts.deploy = "ait deploy";
|
|
642
|
+
await writeFile2(packageJsonPath, JSON.stringify(packageJson, null, 2), {
|
|
643
|
+
encoding: "utf-8"
|
|
644
|
+
});
|
|
645
|
+
p3.log.step(".gitignore \uD30C\uC77C\uC744 \uC5C5\uB370\uC774\uD2B8\uD558\uB294 \uC911...");
|
|
646
|
+
await appendFile(join(cwd, ".gitignore"), "\n*.ait\n");
|
|
647
|
+
const webBundleDir = skipInput ? "dist" : await p3.text({
|
|
648
|
+
message: "\uC6F9 \uBC88\uB4E4 \uACB0\uACFC\uBB3C\uC774 \uC704\uCE58\uD55C \uB514\uB809\uD1A0\uB9AC\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.",
|
|
649
|
+
placeholder: "dist",
|
|
650
|
+
defaultValue: "dist"
|
|
651
|
+
});
|
|
652
|
+
if (p3.isCancel(webBundleDir)) {
|
|
653
|
+
p3.cancel("\uCD08\uAE30\uD654\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4");
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
p3.log.step("apps-in-toss.config.ts \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uB294 \uC911...");
|
|
657
|
+
const config = transformTemplate(WEB_FRAMEWORK_CONFIG_TEMPLATE, {
|
|
658
|
+
appName,
|
|
659
|
+
webBundleDir
|
|
660
|
+
});
|
|
661
|
+
await writeFile2(join(cwd, "apps-in-toss.config.ts"), config, {
|
|
662
|
+
encoding: "utf-8"
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
var InitCommand = class extends Command3 {
|
|
666
|
+
static paths = [["init"]];
|
|
667
|
+
static usage = Command3.Usage({
|
|
668
|
+
category: "Setup",
|
|
669
|
+
description: "\uC571\uC778\uD1A0\uC2A4 \uC6F9 \uD504\uB808\uC784\uC6CC\uD06C \uAC1C\uBC1C/\uBC30\uD3EC \uC124\uC815\uC744 \uCD08\uAE30\uD654\uD569\uB2C8\uB2E4.",
|
|
670
|
+
examples: [
|
|
671
|
+
["\uB300\uD654\uD615\uC73C\uB85C \uCD08\uAE30\uD654", "apps-in-toss init"],
|
|
672
|
+
["\uC571 \uC774\uB984\uC744 \uC9C0\uC815\uD558\uC5EC \uCD08\uAE30\uD654", "apps-in-toss init --app-name my-miniapp"]
|
|
673
|
+
]
|
|
674
|
+
});
|
|
675
|
+
appName = Option2.String("--app-name", {
|
|
676
|
+
required: false,
|
|
677
|
+
description: "\uC571 \uC774\uB984(\uCF00\uBC25-\uCF00\uC774\uC2A4)\uC744 \uC9C0\uC815\uD574\uC694. \uC608) my-miniapp"
|
|
678
|
+
});
|
|
679
|
+
skipInput = Option2.Boolean("--skip-input", { required: false, hidden: true });
|
|
680
|
+
async execute() {
|
|
681
|
+
const cwd = getPackageRoot(process.cwd());
|
|
682
|
+
p3.intro("\u{1F680} \uC571 \uCD08\uAE30\uD654\uB97C \uC2DC\uC791\uD569\uB2C8\uB2E4");
|
|
683
|
+
const appName = await ensureSelect({
|
|
684
|
+
value: this.appName,
|
|
685
|
+
prompt: async () => p3.text({
|
|
686
|
+
message: "Enter app name",
|
|
687
|
+
validate: (value) => {
|
|
688
|
+
if (!value) {
|
|
689
|
+
return "\uC571 \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694";
|
|
690
|
+
}
|
|
691
|
+
const kebabCaseValue = kebabCase(value);
|
|
692
|
+
if (value !== kebabCaseValue) {
|
|
693
|
+
return `\uC571 \uC774\uB984\uC740 \uCF00\uBC25-\uCF00\uC774\uC2A4 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4 (\uC608\uC2DC: ${kebabCaseValue})`;
|
|
694
|
+
}
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
})
|
|
698
|
+
});
|
|
699
|
+
if (p3.isCancel(appName)) {
|
|
700
|
+
p3.cancel("\uCD08\uAE30\uD654\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4");
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
p3.log.step(`\uC571 \uC774\uB984\uC774 '${appName}'\uC73C\uB85C \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4`);
|
|
704
|
+
await templateWebFramework({
|
|
705
|
+
appName,
|
|
706
|
+
cwd,
|
|
707
|
+
skipInput: this.skipInput ?? false
|
|
708
|
+
});
|
|
709
|
+
p3.outro("\u2728 \uCD08\uAE30\uD654\uAC00 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4!");
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
// src/cli/commands/migration/index.ts
|
|
714
|
+
import * as p5 from "@clack/prompts";
|
|
715
|
+
import { Command as Command4, Option as Option3 } from "clipanion";
|
|
716
|
+
|
|
172
717
|
// src/cli/commands/migration/web-framework-v3.ts
|
|
173
|
-
import * as
|
|
718
|
+
import * as p4 from "@clack/prompts";
|
|
174
719
|
import { cosmiconfig as cosmiconfig2 } from "cosmiconfig";
|
|
175
720
|
import { TypeScriptLoader as TypeScriptLoader2 } from "cosmiconfig-typescript-loader";
|
|
176
|
-
import { readFile as
|
|
721
|
+
import { readFile as readFile3, writeFile as writeFile3 } from "fs/promises";
|
|
177
722
|
import { resolve } from "path";
|
|
178
723
|
import jscodeshift from "jscodeshift";
|
|
179
724
|
async function migrateWebFrameworkV3() {
|
|
180
725
|
const projectRoot = getPackageRoot(process.cwd());
|
|
181
|
-
|
|
182
|
-
|
|
726
|
+
p4.log.info("@apps-in-toss/web-framework V3 \uC790\uB3D9 \uB9C8\uC774\uADF8\uB808\uC774\uC158\uC744 \uC2DC\uC791\uD569\uB2C8\uB2E4.");
|
|
727
|
+
p4.log.info(
|
|
183
728
|
"\uC790\uB3D9 \uB9C8\uC774\uADF8\uB808\uC774\uC158\uC5D0 \uC2E4\uD328\uD560 \uACBD\uC6B0, \uCEE4\uBBA4\uB2C8\uD2F0\uC5D0\uC11C \uC218\uB3D9 \uB9C8\uC774\uADF8\uB808\uC774\uC158 \uAC00\uC774\uB4DC\uB97C \uCC38\uACE0\uD574\uC8FC\uC138\uC694.\nhttps://techchat-apps-in-toss.toss.im"
|
|
184
729
|
);
|
|
185
730
|
const { config: graniteConfig, filepath: graniteConfigPath } = await getGraniteConfig(projectRoot);
|
|
@@ -195,10 +740,10 @@ async function migrateWebFrameworkV3() {
|
|
|
195
740
|
graniteConfig.web.commands.dev,
|
|
196
741
|
graniteConfig.web.commands.build
|
|
197
742
|
);
|
|
198
|
-
|
|
743
|
+
p4.log.success("\uB9C8\uC774\uADF8\uB808\uC774\uC158\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
199
744
|
}
|
|
200
745
|
async function getGraniteConfig(projectRoot) {
|
|
201
|
-
|
|
746
|
+
p4.log.info("granite.config \uD30C\uC77C \uCC3E\uB294 \uC911..");
|
|
202
747
|
const result = await cosmiconfig2("granite", {
|
|
203
748
|
loaders: {
|
|
204
749
|
".ts": TypeScriptLoader2(),
|
|
@@ -215,16 +760,16 @@ async function getGraniteConfig(projectRoot) {
|
|
|
215
760
|
]
|
|
216
761
|
}).search(projectRoot);
|
|
217
762
|
if (result == null) {
|
|
218
|
-
|
|
763
|
+
p4.log.error("granite.config \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
219
764
|
process.exit(1);
|
|
220
765
|
}
|
|
221
766
|
return result;
|
|
222
767
|
}
|
|
223
768
|
async function migrateAppsInTossConfig(configPath, outputPath) {
|
|
224
|
-
|
|
225
|
-
const root = jscodeshift((await
|
|
226
|
-
root.find(jscodeshift.ObjectExpression).forEach((
|
|
227
|
-
const obj =
|
|
769
|
+
p4.log.info("granite.config\uB97C apps-in-toss.config\uB85C \uB9C8\uC774\uADF8\uB808\uC774\uC158\uD569\uB2C8\uB2E4.");
|
|
770
|
+
const root = jscodeshift((await readFile3(configPath)).toString());
|
|
771
|
+
root.find(jscodeshift.ObjectExpression).forEach((path7) => {
|
|
772
|
+
const obj = path7.value;
|
|
228
773
|
for (const prop of obj.properties) {
|
|
229
774
|
if (jscodeshift.Property.check(prop) && jscodeshift.Identifier.check(prop.key) && prop.key.name === "brand" && jscodeshift.ObjectExpression.check(prop.value)) {
|
|
230
775
|
prop.value.properties = prop.value.properties.filter(
|
|
@@ -252,39 +797,39 @@ async function migrateAppsInTossConfig(configPath, outputPath) {
|
|
|
252
797
|
return true;
|
|
253
798
|
});
|
|
254
799
|
});
|
|
255
|
-
await
|
|
256
|
-
|
|
800
|
+
await writeFile3(outputPath, root.toSource());
|
|
801
|
+
p4.log.info("apps-in-toss.config\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
257
802
|
}
|
|
258
803
|
async function migratePackageJsonScripts(packageJsonPath, dev, build) {
|
|
259
|
-
|
|
260
|
-
const packageJson = JSON.parse((await
|
|
804
|
+
p4.log.info("package.json\uC758 dev, build \uC2A4\uD06C\uB9BD\uD2B8\uB97C \uC218\uC815\uD569\uB2C8\uB2E4.");
|
|
805
|
+
const packageJson = JSON.parse((await readFile3(packageJsonPath)).toString());
|
|
261
806
|
if (packageJson.scripts == null) {
|
|
262
807
|
packageJson.scripts = {};
|
|
263
808
|
}
|
|
264
809
|
packageJson.scripts["dev"] = dev;
|
|
265
810
|
packageJson.scripts["build"] = `${build} && ait build`;
|
|
266
|
-
await
|
|
267
|
-
|
|
811
|
+
await writeFile3(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
812
|
+
p4.log.info("package.json \uC218\uC815\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
268
813
|
}
|
|
269
814
|
|
|
270
815
|
// src/cli/commands/migration/index.ts
|
|
271
816
|
var MIGRATION_TARGETS = {
|
|
272
817
|
v3: migrateWebFrameworkV3
|
|
273
818
|
};
|
|
274
|
-
var MigrationCommand = class extends
|
|
819
|
+
var MigrationCommand = class extends Command4 {
|
|
275
820
|
static paths = [["migrate"]];
|
|
276
|
-
static usage =
|
|
821
|
+
static usage = Command4.Usage({
|
|
277
822
|
category: "Migration",
|
|
278
823
|
description: "\uB9C8\uC774\uADF8\uB808\uC774\uC158\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4.",
|
|
279
824
|
examples: [["Run migration", "apps-in-toss migrate <target>"]]
|
|
280
825
|
});
|
|
281
|
-
target =
|
|
826
|
+
target = Option3.String({ required: true });
|
|
282
827
|
async execute() {
|
|
283
828
|
const target = MIGRATION_TARGETS[this.target];
|
|
284
829
|
if (target != null) {
|
|
285
830
|
await target();
|
|
286
831
|
} else {
|
|
287
|
-
|
|
832
|
+
p5.log.error(
|
|
288
833
|
[
|
|
289
834
|
"\uC798\uBABB\uB41C \uB9C8\uC774\uADF8\uB808\uC774\uC158 target \uC785\uB2C8\uB2E4. \uC544\uB798 \uC911 \uD558\uB098\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.\n",
|
|
290
835
|
...Object.keys(MIGRATION_TARGETS)
|
|
@@ -295,6 +840,79 @@ var MigrationCommand = class extends Command2 {
|
|
|
295
840
|
}
|
|
296
841
|
};
|
|
297
842
|
|
|
843
|
+
// src/cli/commands/token/index.ts
|
|
844
|
+
import * as p6 from "@clack/prompts";
|
|
845
|
+
import { Command as Command5, Option as Option4 } from "clipanion";
|
|
846
|
+
var TokenCommand = class extends Command5 {
|
|
847
|
+
static paths = [["token"]];
|
|
848
|
+
static usage = Command5.Usage({
|
|
849
|
+
category: "Auth",
|
|
850
|
+
description: "\uD1A0\uD070 \uAD00\uB828 \uD558\uC704 \uBA85\uB839\uC744 \uAD00\uB9AC\uD569\uB2C8\uB2E4.",
|
|
851
|
+
examples: [
|
|
852
|
+
["\uD1A0\uD070 \uCD94\uAC00", "apps-in-toss token add <profile?>"],
|
|
853
|
+
["\uD1A0\uD070 \uC0AD\uC81C", "apps-in-toss token remove <profile?>"]
|
|
854
|
+
]
|
|
855
|
+
});
|
|
856
|
+
async execute() {
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
var TokenAddCommand = class extends Command5 {
|
|
860
|
+
static paths = [["token", "add"]];
|
|
861
|
+
static usage = Command5.Usage({
|
|
862
|
+
category: "Auth",
|
|
863
|
+
description: "\uC2DC\uD06C\uB9BF \uD1A0\uD070\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4.",
|
|
864
|
+
examples: [
|
|
865
|
+
["\uAE30\uBCF8 \uBCC4\uCE6D\uC73C\uB85C \uD1A0\uD070 \uCD94\uAC00", "apps-in-toss token add"],
|
|
866
|
+
["\uBCC4\uCE6D\uC744 \uC9C0\uC815\uD558\uC5EC \uD1A0\uD070 \uCD94\uAC00", "apps-in-toss token add dev"]
|
|
867
|
+
]
|
|
868
|
+
});
|
|
869
|
+
profile = Option4.String({ required: false });
|
|
870
|
+
apiKey = Option4.String("--api-key", { required: false });
|
|
871
|
+
async execute() {
|
|
872
|
+
const profile = this.profile || "default";
|
|
873
|
+
const secret = this.apiKey ? this.apiKey : await p6.password({
|
|
874
|
+
message: "Enter secret token:",
|
|
875
|
+
validate: (value) => {
|
|
876
|
+
if (value == null || value.length === 0) {
|
|
877
|
+
return "\uD1A0\uD070\uC740 \uBE44\uC5B4 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.";
|
|
878
|
+
}
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
if (p6.isCancel(secret)) {
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
TokenStorage.set(profile, secret);
|
|
886
|
+
this.context.stdout.write(
|
|
887
|
+
`${profile} \uD504\uB85C\uD544\uB85C\uC758 \uC694\uCCAD\uC740 \uC774\uC81C \uBE44\uBC00 \uD1A0\uD070\uC744 \uC0AC\uC6A9\uD558\uC5EC \uC778\uC99D\uB429\uB2C8\uB2E4.
|
|
888
|
+
`
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
var TokenRemoveCommand = class extends Command5 {
|
|
893
|
+
static paths = [["token", "remove"]];
|
|
894
|
+
static usage = Command5.Usage({
|
|
895
|
+
category: "Auth",
|
|
896
|
+
description: "\uC2DC\uD06C\uB9BF \uD1A0\uD070\uC744 \uC0AD\uC81C\uD569\uB2C8\uB2E4.",
|
|
897
|
+
examples: [
|
|
898
|
+
["\uAE30\uBCF8 \uC6CC\uD06C\uC2A4\uD398\uC774\uC2A4\uC758 \uD1A0\uD070 \uC0AD\uC81C", "apps-in-toss token remove"],
|
|
899
|
+
["\uBCC4\uCE6D\uC744 \uC9C0\uC815\uD558\uC5EC \uD1A0\uD070 \uC0AD\uC81C", "apps-in-toss token remove dev"]
|
|
900
|
+
]
|
|
901
|
+
});
|
|
902
|
+
profile = Option4.String({ required: false });
|
|
903
|
+
async execute() {
|
|
904
|
+
const profile = this.profile || "default";
|
|
905
|
+
const removed = TokenStorage.delete(profile);
|
|
906
|
+
if (removed) {
|
|
907
|
+
this.context.stdout.write(`\uD1A0\uD070\uC744 \uC81C\uAC70\uD588\uC2B5\uB2C8\uB2E4: ${profile}.
|
|
908
|
+
`);
|
|
909
|
+
} else {
|
|
910
|
+
this.context.stdout.write(`\uD1A0\uD070\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${profile}.
|
|
911
|
+
`);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
|
|
298
916
|
// src/cli/index.ts
|
|
299
917
|
var cli = new Cli({
|
|
300
918
|
binaryLabel: "appsintoss",
|
|
@@ -302,5 +920,11 @@ var cli = new Cli({
|
|
|
302
920
|
enableCapture: true
|
|
303
921
|
});
|
|
304
922
|
cli.register(BuildCommand);
|
|
923
|
+
cli.register(DeployCommand);
|
|
924
|
+
cli.register(InitCommand);
|
|
305
925
|
cli.register(MigrationCommand);
|
|
926
|
+
cli.register(TokenCommand);
|
|
927
|
+
cli.register(TokenAddCommand);
|
|
928
|
+
cli.register(TokenRemoveCommand);
|
|
929
|
+
cli.register(Builtins.HelpCommand);
|
|
306
930
|
cli.runExit(process.argv.slice(2));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/web-framework",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.b705d2b",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"import": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@apps-in-toss/ait-format": "^1.0.0",
|
|
39
|
-
"@apps-in-toss/webview-bridge": "^3.0.0-beta.
|
|
39
|
+
"@apps-in-toss/webview-bridge": "^3.0.0-beta.b705d2b",
|
|
40
40
|
"@clack/prompts": "^1.3.0",
|
|
41
41
|
"clipanion": "^4.0.0-rc.4",
|
|
42
42
|
"cosmiconfig": "^9.0.1",
|