bitcompass 0.1.0 → 0.1.1

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,10 +1,15 @@
1
1
  import { createClient } from '@supabase/supabase-js';
2
2
  import { loadConfig, loadCredentials } from '../auth/config.js';
3
+ import { DEFAULT_SUPABASE_ANON_KEY, DEFAULT_SUPABASE_URL } from '../auth/defaults.js';
3
4
  export const getSupabaseClient = () => {
4
5
  const config = loadConfig();
5
6
  const creds = loadCredentials();
6
- const url = config.supabaseUrl ?? process.env.BITCOMPASS_SUPABASE_URL;
7
- const key = config.supabaseAnonKey ?? process.env.BITCOMPASS_SUPABASE_ANON_KEY;
7
+ const url = config.supabaseUrl ??
8
+ process.env.BITCOMPASS_SUPABASE_URL ??
9
+ DEFAULT_SUPABASE_URL;
10
+ const key = config.supabaseAnonKey ??
11
+ process.env.BITCOMPASS_SUPABASE_ANON_KEY ??
12
+ DEFAULT_SUPABASE_ANON_KEY;
8
13
  if (!url || !key) {
9
14
  return null;
10
15
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Default Supabase connection for the Company Compass BitCompass CLI.
3
+ * Used when config file and env vars are not set.
4
+ */
5
+ export declare const DEFAULT_SUPABASE_URL = "https://uikzqfzqgqegatmfhhsz.supabase.co";
6
+ export declare const DEFAULT_SUPABASE_ANON_KEY = "sb_publishable_Q_68F2rTNKd8h_2j-UcLOQ_Gq7pTjQC";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Default Supabase connection for the Company Compass BitCompass CLI.
3
+ * Used when config file and env vars are not set.
4
+ */
5
+ export const DEFAULT_SUPABASE_URL = 'https://uikzqfzqgqegatmfhhsz.supabase.co';
6
+ export const DEFAULT_SUPABASE_ANON_KEY = 'sb_publishable_Q_68F2rTNKd8h_2j-UcLOQ_Gq7pTjQC';
@@ -4,6 +4,7 @@ import { createServer } from 'http';
4
4
  import open from 'open';
5
5
  import ora from 'ora';
6
6
  import { getTokenFilePath, loadConfig, saveCredentials } from '../auth/config.js';
7
+ import { DEFAULT_SUPABASE_ANON_KEY, DEFAULT_SUPABASE_URL } from '../auth/defaults.js';
7
8
  const CALLBACK_PORT = 38473;
8
9
  const createInMemoryStorage = () => {
9
10
  const store = new Map();
@@ -19,8 +20,12 @@ const createInMemoryStorage = () => {
19
20
  };
20
21
  export const runLogin = async () => {
21
22
  const config = loadConfig();
22
- const url = config.supabaseUrl ?? process.env.BITCOMPASS_SUPABASE_URL;
23
- const anonKey = config.supabaseAnonKey ?? process.env.BITCOMPASS_SUPABASE_ANON_KEY;
23
+ const url = config.supabaseUrl ??
24
+ process.env.BITCOMPASS_SUPABASE_URL ??
25
+ DEFAULT_SUPABASE_URL;
26
+ const anonKey = config.supabaseAnonKey ??
27
+ process.env.BITCOMPASS_SUPABASE_ANON_KEY ??
28
+ DEFAULT_SUPABASE_ANON_KEY;
24
29
  if (!url || !anonKey) {
25
30
  console.error(chalk.red('Supabase not configured. Set supabaseUrl and supabaseAnonKey:\n bitcompass config set supabaseUrl https://YOUR_PROJECT.supabase.co\n bitcompass config set supabaseAnonKey YOUR_ANON_KEY\nOr set BITCOMPASS_SUPABASE_URL and BITCOMPASS_SUPABASE_ANON_KEY.'));
26
31
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitcompass",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "BitCompass CLI - rules, solutions, and MCP server",
5
5
  "type": "module",
6
6
  "bin": { "bitcompass": "./dist/index.js" },