@root-signals/scorable-cli 0.1.1 → 0.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,OAAO,CAAC,CAoDlB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,OAAO,CAAC,CAoDlB"}
package/dist/client.js CHANGED
@@ -1,5 +1,7 @@
1
+ import { createRequire } from "node:module";
1
2
  import { getApiKey, getBaseUrl } from "./auth.js";
2
3
  import { printError, printJson } from "./output.js";
4
+ const { version } = createRequire(import.meta.url)("../package.json");
3
5
  export async function apiRequest(method, endpoint, options) {
4
6
  const apiKey = options?.apiKey ?? getApiKey();
5
7
  const baseUrl = options?.baseUrl ?? getBaseUrl();
@@ -16,7 +18,7 @@ export async function apiRequest(method, endpoint, options) {
16
18
  Authorization: `Api-Key ${apiKey}`,
17
19
  "Content-Type": "application/json",
18
20
  Accept: "application/json",
19
- "User-Agent": "scorable-cli/1.0",
21
+ "User-Agent": `scorable/${version}`,
20
22
  };
21
23
  let response;
22
24
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,IAAI,OAAO,CAUnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,IAAI,OAAO,CAUnC"}
package/dist/index.js CHANGED
@@ -1,17 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ import { realpathSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
2
4
  import { Command } from "commander";
3
5
  import { registerJudgeCommands } from "./commands/judge/index.js";
4
6
  import { registerPromptTestCommands } from "./commands/prompt-test/index.js";
5
7
  export function createCli() {
6
8
  const program = new Command()
7
- .name("scorable-cli")
9
+ .name("scorable")
8
10
  .description("A CLI tool to interact with the Scorable API")
9
11
  .exitOverride();
10
12
  registerJudgeCommands(program);
11
13
  registerPromptTestCommands(program);
12
14
  return program;
13
15
  }
14
- if (import.meta.url === `file://${process.argv[1]}`) {
16
+ if (realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1])) {
15
17
  createCli()
16
18
  .parseAsync(process.argv)
17
19
  .catch((e) => {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@root-signals/scorable-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for Scorable",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Scorable",
7
7
  "bin": {
8
- "scorable": "./dist/index.js"
8
+ "scorable": "./dist/index.js",
9
+ "scorable-cli": "./dist/index.js"
9
10
  },
10
11
  "files": [
11
12
  "dist/**/*.js",