@rhseung/ps-cli 1.2.1 → 1.3.0
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/{chunk-3TMQ74SA.js → chunk-BM3ZMA4K.js} +1 -1
- package/dist/{chunk-63CK6URL.js → chunk-CIG2LEJC.js} +1 -33
- package/dist/commands/config.js +324 -131
- package/dist/commands/fetch.js +9 -10
- package/dist/commands/init.js +98 -1295
- package/dist/commands/run.js +12 -16
- package/dist/commands/stats.js +11 -12
- package/dist/commands/submit.js +17 -36
- package/dist/commands/test.js +20 -58
- package/dist/index.js +25 -0
- package/package.json +2 -4
- package/dist/chunk-IJLJBKLK.js +0 -1689
package/dist/commands/fetch.js
CHANGED
|
@@ -9,24 +9,22 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
getProblemDirPath,
|
|
11
11
|
getProblemId
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-BM3ZMA4K.js";
|
|
13
13
|
import {
|
|
14
14
|
getLanguageConfig,
|
|
15
15
|
getSupportedLanguages,
|
|
16
16
|
getSupportedLanguagesString
|
|
17
17
|
} from "../chunk-TQXMB7XV.js";
|
|
18
|
-
import {
|
|
19
|
-
LoadingSpinner
|
|
20
|
-
} from "../chunk-IJLJBKLK.js";
|
|
21
18
|
import {
|
|
22
19
|
getAutoOpenEditor,
|
|
23
20
|
getEditor
|
|
24
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-CIG2LEJC.js";
|
|
25
22
|
import "../chunk-FYS2JH42.js";
|
|
26
23
|
|
|
27
24
|
// src/commands/fetch.tsx
|
|
28
25
|
import { useState, useEffect } from "react";
|
|
29
|
-
import { render,
|
|
26
|
+
import { render, Box as Box2 } from "ink";
|
|
27
|
+
import { StatusMessage, Alert } from "@inkjs/ui";
|
|
30
28
|
|
|
31
29
|
// src/services/scraper.ts
|
|
32
30
|
import * as cheerio from "cheerio";
|
|
@@ -431,6 +429,7 @@ function ProblemDashboard({ problem }) {
|
|
|
431
429
|
}
|
|
432
430
|
|
|
433
431
|
// src/commands/fetch.tsx
|
|
432
|
+
import { Spinner } from "@inkjs/ui";
|
|
434
433
|
import { execaCommand } from "execa";
|
|
435
434
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
436
435
|
function FetchCommand({
|
|
@@ -516,19 +515,19 @@ function FetchCommand({
|
|
|
516
515
|
}, [problemId, language, onComplete]);
|
|
517
516
|
if (status === "loading") {
|
|
518
517
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
519
|
-
/* @__PURE__ */ jsx2(
|
|
518
|
+
/* @__PURE__ */ jsx2(Spinner, { label: message }),
|
|
520
519
|
problem && /* @__PURE__ */ jsx2(ProblemDashboard, { problem })
|
|
521
520
|
] });
|
|
522
521
|
}
|
|
523
522
|
if (status === "error") {
|
|
524
|
-
return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: /* @__PURE__ */ jsxs2(
|
|
525
|
-
"\
|
|
523
|
+
return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: /* @__PURE__ */ jsxs2(Alert, { variant: "error", children: [
|
|
524
|
+
"\uC624\uB958 \uBC1C\uC0DD: ",
|
|
526
525
|
error
|
|
527
526
|
] }) });
|
|
528
527
|
}
|
|
529
528
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", width: "100%", children: [
|
|
530
529
|
problem && /* @__PURE__ */ jsx2(Box2, { alignSelf: "flex-start", children: /* @__PURE__ */ jsx2(ProblemDashboard, { problem }) }),
|
|
531
|
-
/* @__PURE__ */ jsx2(
|
|
530
|
+
/* @__PURE__ */ jsx2(StatusMessage, { variant: "success", children: message })
|
|
532
531
|
] });
|
|
533
532
|
}
|
|
534
533
|
async function fetchCommand(problemId, language) {
|