@rankcli/cli 0.0.2 → 0.0.4

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/index.js CHANGED
@@ -289,9 +289,36 @@ var import_chalk = __toESM(require("chalk"));
289
289
  // src/lib/config.ts
290
290
  var import_conf = __toESM(require("conf"));
291
291
  var import_supabase_js = require("@supabase/supabase-js");
292
- var SUPABASE_URL = process.env.RANKCLI_SUPABASE_URL || process.env.VITE_SUPABASE_URL || "https://uisqfyeasobjjrgurwnb.supabase.co";
293
- var SUPABASE_ANON_KEY = process.env.RANKCLI_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpc3FmeWVhc29iampyZ3Vyd25iIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgwMDc3NjIsImV4cCI6MjA2MzU4Mzc2Mn0.r-GaAqD-OwAKMyH8w7qpAj6P7w52cAPTsb8JfMZmtJE";
294
- var WEB_APP_URL = process.env.RANKCLI_WEB_URL || "http://localhost:3005";
292
+ var INJECTED_CONFIG = {"supabaseUrl":"https://bspljbxwbjiqueeyzyat.supabase.co","supabaseAnonKey":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJzcGxqYnh3YmppcXVlZXl6eWF0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkyNzQ1NTksImV4cCI6MjA4NDg1MDU1OX0.7gprxM2gT9cZ99sjZURLltrln78dEnwyFFKYpTzBaUU","webAppUrl":"https://rankcli.dev"};
293
+ function getSupabaseUrl() {
294
+ const url = process.env.RANKCLI_SUPABASE_URL || process.env.VITE_SUPABASE_URL || INJECTED_CONFIG?.supabaseUrl;
295
+ if (!url) {
296
+ throw new Error(
297
+ "Supabase URL not configured. Set RANKCLI_SUPABASE_URL environment variable.\nSee: https://rankcli.dev/docs/cli-setup"
298
+ );
299
+ }
300
+ return url;
301
+ }
302
+ function getSupabaseAnonKey() {
303
+ const key = process.env.RANKCLI_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY || INJECTED_CONFIG?.supabaseAnonKey;
304
+ if (!key) {
305
+ throw new Error(
306
+ "Supabase anon key not configured. Set RANKCLI_SUPABASE_ANON_KEY environment variable.\nSee: https://rankcli.dev/docs/cli-setup"
307
+ );
308
+ }
309
+ return key;
310
+ }
311
+ var _supabaseUrl = null;
312
+ var _supabaseAnonKey = null;
313
+ var SUPABASE_URL = (() => {
314
+ if (!_supabaseUrl) _supabaseUrl = getSupabaseUrl();
315
+ return _supabaseUrl;
316
+ })();
317
+ var SUPABASE_ANON_KEY = (() => {
318
+ if (!_supabaseAnonKey) _supabaseAnonKey = getSupabaseAnonKey();
319
+ return _supabaseAnonKey;
320
+ })();
321
+ var WEB_APP_URL = process.env.RANKCLI_WEB_URL || INJECTED_CONFIG?.webAppUrl || "https://rankcli.dev";
295
322
  var API_URL = process.env.RANKCLI_API_URL || SUPABASE_URL;
296
323
  var config = new import_conf.default({
297
324
  projectName: "rankcli",
@@ -1856,9 +1883,12 @@ async function fetchAndSaveSubscription() {
1856
1883
  }
1857
1884
  }
1858
1885
 
1886
+ // src/version.ts
1887
+ var VERSION = "0.0.4";
1888
+
1859
1889
  // src/index.ts
1860
1890
  var program = new import_commander.Command();
1861
- program.name("rankcli").description("RankCLI - Ship code, get ranked. SEO meets CI/CD.").version("0.0.1");
1891
+ program.name("rankcli").description("RankCLI - Ship code, get ranked. SEO meets CI/CD.").version(VERSION);
1862
1892
  program.command("login").description("Log in to your RankCLI account").option("-e, --email <email>", "Email address").option("-b, --browser", "Open browser for login").option("-t, --token <apiKey>", "API key for non-interactive authentication").action(login);
1863
1893
  program.command("logout").description("Log out of your RankCLI account").action(logout);
1864
1894
  program.command("whoami").description("Show current logged in user").action(whoami);
package/dist/index.mjs CHANGED
@@ -267,9 +267,36 @@ import chalk from "chalk";
267
267
  // src/lib/config.ts
268
268
  import Conf from "conf";
269
269
  import { createClient } from "@supabase/supabase-js";
270
- var SUPABASE_URL = process.env.RANKCLI_SUPABASE_URL || process.env.VITE_SUPABASE_URL || "https://uisqfyeasobjjrgurwnb.supabase.co";
271
- var SUPABASE_ANON_KEY = process.env.RANKCLI_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpc3FmeWVhc29iampyZ3Vyd25iIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgwMDc3NjIsImV4cCI6MjA2MzU4Mzc2Mn0.r-GaAqD-OwAKMyH8w7qpAj6P7w52cAPTsb8JfMZmtJE";
272
- var WEB_APP_URL = process.env.RANKCLI_WEB_URL || "http://localhost:3005";
270
+ const INJECTED_CONFIG = {"supabaseUrl":"https://bspljbxwbjiqueeyzyat.supabase.co","supabaseAnonKey":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJzcGxqYnh3YmppcXVlZXl6eWF0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkyNzQ1NTksImV4cCI6MjA4NDg1MDU1OX0.7gprxM2gT9cZ99sjZURLltrln78dEnwyFFKYpTzBaUU","webAppUrl":"https://rankcli.dev"};
271
+ function getSupabaseUrl() {
272
+ const url = process.env.RANKCLI_SUPABASE_URL || process.env.VITE_SUPABASE_URL || INJECTED_CONFIG?.supabaseUrl;
273
+ if (!url) {
274
+ throw new Error(
275
+ "Supabase URL not configured. Set RANKCLI_SUPABASE_URL environment variable.\nSee: https://rankcli.dev/docs/cli-setup"
276
+ );
277
+ }
278
+ return url;
279
+ }
280
+ function getSupabaseAnonKey() {
281
+ const key = process.env.RANKCLI_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY || INJECTED_CONFIG?.supabaseAnonKey;
282
+ if (!key) {
283
+ throw new Error(
284
+ "Supabase anon key not configured. Set RANKCLI_SUPABASE_ANON_KEY environment variable.\nSee: https://rankcli.dev/docs/cli-setup"
285
+ );
286
+ }
287
+ return key;
288
+ }
289
+ var _supabaseUrl = null;
290
+ var _supabaseAnonKey = null;
291
+ var SUPABASE_URL = (() => {
292
+ if (!_supabaseUrl) _supabaseUrl = getSupabaseUrl();
293
+ return _supabaseUrl;
294
+ })();
295
+ var SUPABASE_ANON_KEY = (() => {
296
+ if (!_supabaseAnonKey) _supabaseAnonKey = getSupabaseAnonKey();
297
+ return _supabaseAnonKey;
298
+ })();
299
+ var WEB_APP_URL = process.env.RANKCLI_WEB_URL || INJECTED_CONFIG?.webAppUrl || "https://rankcli.dev";
273
300
  var API_URL = process.env.RANKCLI_API_URL || SUPABASE_URL;
274
301
  var config = new Conf({
275
302
  projectName: "rankcli",
@@ -1868,9 +1895,12 @@ async function fetchAndSaveSubscription() {
1868
1895
  }
1869
1896
  }
1870
1897
 
1898
+ // src/version.ts
1899
+ var VERSION = "0.0.4";
1900
+
1871
1901
  // src/index.ts
1872
1902
  var program = new Command();
1873
- program.name("rankcli").description("RankCLI - Ship code, get ranked. SEO meets CI/CD.").version("0.0.1");
1903
+ program.name("rankcli").description("RankCLI - Ship code, get ranked. SEO meets CI/CD.").version(VERSION);
1874
1904
  program.command("login").description("Log in to your RankCLI account").option("-e, --email <email>", "Email address").option("-b, --browser", "Open browser for login").option("-t, --token <apiKey>", "API key for non-interactive authentication").action(login);
1875
1905
  program.command("logout").description("Log out of your RankCLI account").action(logout);
1876
1906
  program.command("whoami").description("Show current logged in user").action(whoami);
@@ -103,6 +103,12 @@ function createExecutionContext(jsCode) {
103
103
  // URL parsing
104
104
  URL,
105
105
  URLSearchParams,
106
+ // Node.js globals needed by bundled dependencies (e.g., cheerio)
107
+ Buffer,
108
+ process: { env: {} },
109
+ // TextEncoder/TextDecoder for string handling
110
+ TextEncoder,
111
+ TextDecoder,
106
112
  // The RankCLI namespace will be populated by the code
107
113
  RankCLI: {},
108
114
  // Global reference
@@ -67,6 +67,12 @@ function createExecutionContext(jsCode) {
67
67
  // URL parsing
68
68
  URL,
69
69
  URLSearchParams,
70
+ // Node.js globals needed by bundled dependencies (e.g., cheerio)
71
+ Buffer,
72
+ process: { env: {} },
73
+ // TextEncoder/TextDecoder for string handling
74
+ TextEncoder,
75
+ TextDecoder,
70
76
  // The RankCLI namespace will be populated by the code
71
77
  RankCLI: {},
72
78
  // Global reference
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rankcli/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "RankCLI - Ship code, get ranked. SEO meets CI/CD.",
5
5
  "homepage": "https://rankcli.dev",
6
6
  "main": "dist/index.js",
@@ -30,15 +30,18 @@
30
30
  "scripts": {
31
31
  "dev": "tsx watch src/index.ts",
32
32
  "build": "npm run build:checks && npm run build:wasm && npm run build:js",
33
- "build:js": "tsup src/index.ts src/wasm-engine.ts --format cjs,esm --dts",
33
+ "build:js": "npm run update-version && tsup src/index.ts src/wasm-engine.ts --format cjs,esm --dts",
34
34
  "build:checks": "cd ../agent-runtime && pnpm build:wasm",
35
35
  "build:wasm": "cd native && wasm-pack build --target nodejs --release && cp -r pkg ../wasm",
36
36
  "build:wasm:dev": "cd native && wasm-pack build --target nodejs --dev && mkdir -p ../wasm && cp -r pkg/* ../wasm/",
37
37
  "prebuild:wasm": "mkdir -p wasm",
38
+ "inject-config": "node scripts/inject-config.js",
39
+ "prepublishOnly": "npm run build && npm run inject-config",
38
40
  "start": "node dist/index.js",
39
41
  "lint": "eslint src/",
40
42
  "test": "vitest run --passWithNoTests",
41
- "test:wasm": "node test-wasm.js"
43
+ "test:wasm": "node test-wasm.js",
44
+ "update-version": "node scripts/update-version.js"
42
45
  },
43
46
  "dependencies": {
44
47
  "@rankcli/agent-runtime": "^0.0.1",
Binary file