@rhseung/ps-cli 1.3.3 → 1.4.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.
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __decorateClass = (decorators, target, key, kind) => {
28
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
29
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
30
+ if (decorator = decorators[i])
31
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
32
+ if (kind && result) __defProp(target, key, result);
33
+ return result;
34
+ };
35
+
36
+ // src/utils/language.ts
37
+ var SUPPORTED_LANGUAGES = ["python", "cpp"];
38
+ function getSupportedLanguages() {
39
+ return [...SUPPORTED_LANGUAGES];
40
+ }
41
+ function getSupportedLanguagesString() {
42
+ return SUPPORTED_LANGUAGES.join(", ");
43
+ }
44
+ var LANGUAGE_CONFIGS = {
45
+ python: {
46
+ extension: "py",
47
+ templateFile: "solution.py",
48
+ runCommand: "python3",
49
+ bojLangId: 28
50
+ // Python 3
51
+ },
52
+ cpp: {
53
+ extension: "cpp",
54
+ templateFile: "solution.cpp",
55
+ // 절대 경로로 에러를 표시해서 에디터에서 문제 디렉토리의 파일로 바로 이동할 수 있도록 함
56
+ compileCommand: "g++ -fdiagnostics-absolute-paths -o solution solution.cpp",
57
+ runCommand: "./solution",
58
+ bojLangId: 84
59
+ // C++17
60
+ }
61
+ };
62
+ function getLanguageConfig(language) {
63
+ return LANGUAGE_CONFIGS[language];
64
+ }
65
+ function detectLanguageFromFile(filename) {
66
+ const ext = filename.split(".").pop()?.toLowerCase();
67
+ if (!ext) return null;
68
+ switch (ext) {
69
+ case "py":
70
+ return "python";
71
+ case "cpp":
72
+ case "cc":
73
+ case "cxx":
74
+ return "cpp";
75
+ default:
76
+ return null;
77
+ }
78
+ }
79
+
80
+ export {
81
+ __commonJS,
82
+ __toESM,
83
+ __decorateClass,
84
+ getSupportedLanguages,
85
+ getSupportedLanguagesString,
86
+ getLanguageConfig,
87
+ detectLanguageFromFile
88
+ };