track-cli 3.0.0-rc3 → 3.1.0-rc1

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 CHANGED
@@ -1,3 +1,21 @@
1
1
  # Track CLI
2
2
 
3
3
  A CLI for interacting with tracks.run and running code tests on Track Test's servers
4
+
5
+ ## Installation
6
+
7
+ ### Requirements
8
+
9
+ * Node.js (v16 or higher)
10
+
11
+ ### Install from NPM
12
+
13
+ ```bash
14
+ npm install --global track-cli
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ See the documentation
20
+ * [CLI 受験の流れ (日本語)](https://help.tracks.run/ja/articles/2333039-cli-%E5%8F%97%E9%A8%93%E3%81%AE%E6%B5%81%E3%82%8C)
21
+ * [How to take exam using local IDE on Track (English)](https://help.tracks.run/ja/articles/2332950-how-to-take-exam-using-local-ide-on-track)
package/esm/_dnt.shims.js CHANGED
@@ -20,7 +20,6 @@ const dntGlobals = {
20
20
  prompt,
21
21
  };
22
22
  export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
23
- // deno-lint-ignore ban-types
24
23
  function createMergeProxy(baseObj, extObj) {
25
24
  return new Proxy(baseObj, {
26
25
  get(_target, prop, _receiver) {
@@ -6,6 +6,7 @@ import { EnvSettings, FileListType, } from "../track/types.js";
6
6
  import { OrcaClient } from "../orca/client.js";
7
7
  import { FileType } from "../orca/types.js";
8
8
  import * as colors from "../../deps/deno.land/std@0.195.0/fmt/colors.js";
9
+ const MAX_MEMORY_FOR_TEST = 512 * 1024 * 1024; // 512 MB
9
10
  export async function run(options) {
10
11
  const trackContext = await getCommonChallengeContext();
11
12
  const api = trackContext.api;
@@ -13,7 +14,7 @@ export async function run(options) {
13
14
  const codingContext = trackContext.codingContext;
14
15
  // const orcaHost = Deno.env.get("ORCA_HOST") || "track-prod-frontend.orca.run";
15
16
  // Temporary code to retrieve the Orca host. Will be able to get from CodingContext in the future.
16
- const orcaHost = await api.orcaHost();
17
+ const orcaHost = codingContext.orcaHost || await api.orcaHost();
17
18
  const token = await api.orcaToken(codingContext.urlForOrcaToken);
18
19
  const orca = new OrcaClient(orcaHost, token);
19
20
  await orca.connect();
@@ -87,6 +88,7 @@ export async function run(options) {
87
88
  files: buildRan ? [] : files,
88
89
  envVars: {},
89
90
  tarballUrls: buildRan ? [] : codingContext.tarballUrls,
91
+ memoryBytes: MAX_MEMORY_FOR_TEST,
90
92
  };
91
93
  const scoreCounter = new CountPassingLineHandler();
92
94
  const runDoneData = await orca.simpleRunCommand(runCmd, scoreCounter);
package/esm/src/main.js CHANGED
File without changes
package/esm/src/meta.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const VERSION = "3.0.0-rc3";
1
+ export declare const VERSION = "3.1.0-rc1";
2
2
  export declare const DESCRIPTION = "A CLI for interacting with tracks.run and running code tests on track's servers";
3
3
  export declare function checkUpdates(): Promise<boolean>;
package/esm/src/meta.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as colors from "../deps/deno.land/std@0.195.0/fmt/colors.js";
2
2
  // @ts-ignore: has no exported member
3
3
  import { CookieJar, fetch } from "node-fetch-cookies";
4
- export const VERSION = "3.0.0-rc3";
4
+ export const VERSION = "3.1.0-rc1";
5
5
  export const DESCRIPTION = "A CLI for interacting with tracks.run and running code tests on track's servers";
6
6
  const VERSION_RE = /^(\d+)\.(\d+)\.(\d+)(?:-?(.*))$/;
7
7
  function parseSemver(s) {
@@ -25,6 +25,7 @@ export type SimpleRunCommand = {
25
25
  files: CodeFile[];
26
26
  envVars: Record<string, string>;
27
27
  tarballUrls: string[];
28
+ memoryBytes?: number;
28
29
  };
29
30
  export type EnvVarsCommand = {
30
31
  envVars: Record<string, string>;
@@ -136,6 +136,7 @@ export interface CodingContext {
136
136
  challengeLanguage: SpokenLanguage;
137
137
  settings: ChallengeSettings;
138
138
  answers: CodingAnswers;
139
+ orcaHost?: string;
139
140
  }
140
141
  export declare const FileListType: {
141
142
  readonly All: 0;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "track": "./esm/src/main.js"
4
4
  },
5
5
  "name": "track-cli",
6
- "version": "3.0.0-rc3",
6
+ "version": "3.1.0-rc1",
7
7
  "description": "A CLI for interacting with tracks.run and running code tests on track's servers",
8
8
  "license": "MIT",
9
9
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "test": "node test_runner.js"
18
18
  },
19
19
  "dependencies": {
20
- "@hazae41/foras": "*",
20
+ "@hazae41/foras": "2.0.8",
21
21
  "eventemitter3": "5.0.1",
22
22
  "node-fetch-cookies": "2.0.4",
23
23
  "proxy-agent": "6.3.0",