realtimex-crm 0.7.2 → 0.7.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/bin/realtimex-crm.js +41 -23
- package/package.json +1 -1
package/bin/realtimex-crm.js
CHANGED
|
@@ -58,6 +58,9 @@ async function main() {
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
if (configureNow) {
|
|
61
|
+
console.log("First, ensure you are logged in to the Supabase CLI.");
|
|
62
|
+
console.log("Run `npx supabase login` if you haven't already.");
|
|
63
|
+
|
|
61
64
|
const supabaseUrl = await input({
|
|
62
65
|
message: "Supabase URL:",
|
|
63
66
|
validate: (value) => {
|
|
@@ -69,9 +72,9 @@ async function main() {
|
|
|
69
72
|
});
|
|
70
73
|
|
|
71
74
|
const supabaseAnonKey = await input({
|
|
72
|
-
message: "Supabase
|
|
75
|
+
message: "Supabase Publishable API Key (anon key):",
|
|
73
76
|
validate: (value) => {
|
|
74
|
-
if (!value.trim()) return "Supabase
|
|
77
|
+
if (!value.trim()) return "Supabase Publishable API Key is required";
|
|
75
78
|
return true;
|
|
76
79
|
},
|
|
77
80
|
});
|
|
@@ -88,7 +91,7 @@ async function main() {
|
|
|
88
91
|
const configPath = join(tmpdir(), "realtimex-crm-config.txt");
|
|
89
92
|
const configContent = `Supabase Configuration:
|
|
90
93
|
URL: ${supabaseUrl}
|
|
91
|
-
|
|
94
|
+
Publishable API Key (anon key): ${supabaseAnonKey}
|
|
92
95
|
|
|
93
96
|
To configure the app:
|
|
94
97
|
1. Open the app in your browser
|
|
@@ -100,10 +103,12 @@ To configure the app:
|
|
|
100
103
|
|
|
101
104
|
// Helper to run supabase commands
|
|
102
105
|
const runSupabaseCommand = async (command, message) => {
|
|
103
|
-
|
|
106
|
+
const cwd = process.cwd();
|
|
107
|
+
console.log(`\n${message} (from directory: ${cwd})`);
|
|
104
108
|
const proc = spawn("npx", ["supabase", ...command], {
|
|
105
109
|
stdio: "inherit",
|
|
106
110
|
shell: true,
|
|
111
|
+
cwd: cwd,
|
|
107
112
|
});
|
|
108
113
|
|
|
109
114
|
return new Promise((resolve, reject) => {
|
|
@@ -123,30 +128,43 @@ To configure the app:
|
|
|
123
128
|
});
|
|
124
129
|
};
|
|
125
130
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (runDbPush) {
|
|
131
|
+
// Link the project
|
|
132
|
+
const projectRefMatch = supabaseUrl.match(/https:\/\/([a-zA-Z0-9_-]+)\.supabase\.co/);
|
|
133
|
+
if (projectRefMatch && projectRefMatch[1]) {
|
|
134
|
+
const projectRef = projectRefMatch[1];
|
|
132
135
|
try {
|
|
133
|
-
await runSupabaseCommand(["
|
|
134
|
-
} catch (error) {
|
|
135
|
-
console.error("Continuing without successful db push.");
|
|
136
|
-
}
|
|
137
|
-
}
|
|
136
|
+
await runSupabaseCommand(["link", "--project-ref", projectRef], `🔗 Linking to Supabase project '${projectRef}'...`);
|
|
138
137
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
const runDbPush = await confirm({
|
|
139
|
+
message: "Run `npx supabase db push` to apply migrations?",
|
|
140
|
+
default: false,
|
|
141
|
+
});
|
|
143
142
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
if (runDbPush) {
|
|
144
|
+
try {
|
|
145
|
+
await runSupabaseCommand(["db", "push"], "🚀 Running `npx supabase db push`...");
|
|
146
|
+
} catch (error) {
|
|
147
|
+
console.error("Continuing without successful db push.");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const runFunctionsDeploy = await confirm({
|
|
152
|
+
message: "Run `npx supabase functions deploy` to deploy functions?",
|
|
153
|
+
default: false,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
if (runFunctionsDeploy) {
|
|
157
|
+
try {
|
|
158
|
+
await runSupabaseCommand(["functions", "deploy"], "🚀 Running `npx supabase functions deploy`...");
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.error("Continuing without successful functions deploy.");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
147
163
|
} catch (error) {
|
|
148
|
-
console.error("
|
|
164
|
+
console.error("Could not link to Supabase project. Skipping db push and functions deploy.");
|
|
149
165
|
}
|
|
166
|
+
} else {
|
|
167
|
+
console.warn("Could not extract project reference from Supabase URL. Skipping link, db push, and functions deploy.");
|
|
150
168
|
}
|
|
151
169
|
}
|
|
152
170
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "realtimex-crm",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "RealTimeX CRM - A full-featured CRM built with React, shadcn-admin-kit, and Supabase. Fork of Atomic CRM with RealTimeX App SDK integration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|