hackmate-cli 1.0.0
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 +420 -0
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +14 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +172 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ComingSoon.d.ts +7 -0
- package/dist/commands/ComingSoon.d.ts.map +1 -0
- package/dist/commands/ComingSoon.js +4 -0
- package/dist/commands/ComingSoon.js.map +1 -0
- package/dist/commands/Config.d.ts +8 -0
- package/dist/commands/Config.d.ts.map +1 -0
- package/dist/commands/Config.js +42 -0
- package/dist/commands/Config.js.map +1 -0
- package/dist/commands/DataExport.d.ts +2 -0
- package/dist/commands/DataExport.d.ts.map +1 -0
- package/dist/commands/DataExport.js +49 -0
- package/dist/commands/DataExport.js.map +1 -0
- package/dist/commands/Discover.d.ts +2 -0
- package/dist/commands/Discover.d.ts.map +1 -0
- package/dist/commands/Discover.js +93 -0
- package/dist/commands/Discover.js.map +1 -0
- package/dist/commands/MatchList.d.ts +2 -0
- package/dist/commands/MatchList.d.ts.map +1 -0
- package/dist/commands/MatchList.js +118 -0
- package/dist/commands/MatchList.js.map +1 -0
- package/dist/commands/Presence.d.ts +7 -0
- package/dist/commands/Presence.d.ts.map +1 -0
- package/dist/commands/Presence.js +52 -0
- package/dist/commands/Presence.js.map +1 -0
- package/dist/commands/Privacy.d.ts +2 -0
- package/dist/commands/Privacy.d.ts.map +1 -0
- package/dist/commands/Privacy.js +38 -0
- package/dist/commands/Privacy.js.map +1 -0
- package/dist/commands/Settings.d.ts +2 -0
- package/dist/commands/Settings.d.ts.map +1 -0
- package/dist/commands/Settings.js +38 -0
- package/dist/commands/Settings.js.map +1 -0
- package/dist/commands/Stats.d.ts +2 -0
- package/dist/commands/Stats.d.ts.map +1 -0
- package/dist/commands/Stats.js +38 -0
- package/dist/commands/Stats.js.map +1 -0
- package/dist/commands/admin/admin.logic.d.ts +12 -0
- package/dist/commands/admin/admin.logic.d.ts.map +1 -0
- package/dist/commands/admin/admin.logic.js +41 -0
- package/dist/commands/admin/admin.logic.js.map +1 -0
- package/dist/commands/admin/admin.screen.d.ts +10 -0
- package/dist/commands/admin/admin.screen.d.ts.map +1 -0
- package/dist/commands/admin/admin.screen.js +19 -0
- package/dist/commands/admin/admin.screen.js.map +1 -0
- package/dist/commands/admin/index.d.ts +8 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +8 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/auth/Logout.d.ts +2 -0
- package/dist/commands/auth/Logout.d.ts.map +1 -0
- package/dist/commands/auth/Logout.js +15 -0
- package/dist/commands/auth/Logout.js.map +1 -0
- package/dist/commands/auth/Verify.d.ts +2 -0
- package/dist/commands/auth/Verify.d.ts.map +1 -0
- package/dist/commands/auth/Verify.js +16 -0
- package/dist/commands/auth/Verify.js.map +1 -0
- package/dist/commands/auth/auth.logic.d.ts +31 -0
- package/dist/commands/auth/auth.logic.d.ts.map +1 -0
- package/dist/commands/auth/auth.logic.js +147 -0
- package/dist/commands/auth/auth.logic.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +17 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.screen.d.ts +15 -0
- package/dist/commands/auth/login.screen.d.ts.map +1 -0
- package/dist/commands/auth/login.screen.js +10 -0
- package/dist/commands/auth/login.screen.js.map +1 -0
- package/dist/commands/auth/signup.screen.d.ts +23 -0
- package/dist/commands/auth/signup.screen.d.ts.map +1 -0
- package/dist/commands/auth/signup.screen.js +13 -0
- package/dist/commands/auth/signup.screen.js.map +1 -0
- package/dist/commands/auth/verify.logic.d.ts +11 -0
- package/dist/commands/auth/verify.logic.d.ts.map +1 -0
- package/dist/commands/auth/verify.logic.js +56 -0
- package/dist/commands/auth/verify.logic.js.map +1 -0
- package/dist/commands/chat/ChatList.d.ts +2 -0
- package/dist/commands/chat/ChatList.d.ts.map +1 -0
- package/dist/commands/chat/ChatList.js +63 -0
- package/dist/commands/chat/ChatList.js.map +1 -0
- package/dist/commands/chat/chat.logic.d.ts +15 -0
- package/dist/commands/chat/chat.logic.d.ts.map +1 -0
- package/dist/commands/chat/chat.logic.js +139 -0
- package/dist/commands/chat/chat.logic.js.map +1 -0
- package/dist/commands/chat/chat.screen.d.ts +12 -0
- package/dist/commands/chat/chat.screen.d.ts.map +1 -0
- package/dist/commands/chat/chat.screen.js +12 -0
- package/dist/commands/chat/chat.screen.js.map +1 -0
- package/dist/commands/chat/index.d.ts +8 -0
- package/dist/commands/chat/index.d.ts.map +1 -0
- package/dist/commands/chat/index.js +9 -0
- package/dist/commands/chat/index.js.map +1 -0
- package/dist/commands/group/group.logic.d.ts +26 -0
- package/dist/commands/group/group.logic.d.ts.map +1 -0
- package/dist/commands/group/group.logic.js +73 -0
- package/dist/commands/group/group.logic.js.map +1 -0
- package/dist/commands/group/group.screen.d.ts +19 -0
- package/dist/commands/group/group.screen.d.ts.map +1 -0
- package/dist/commands/group/group.screen.js +22 -0
- package/dist/commands/group/group.screen.js.map +1 -0
- package/dist/commands/group/index.d.ts +9 -0
- package/dist/commands/group/index.d.ts.map +1 -0
- package/dist/commands/group/index.js +8 -0
- package/dist/commands/group/index.js.map +1 -0
- package/dist/commands/network/index.d.ts +8 -0
- package/dist/commands/network/index.d.ts.map +1 -0
- package/dist/commands/network/index.js +8 -0
- package/dist/commands/network/index.js.map +1 -0
- package/dist/commands/network/network.logic.d.ts +12 -0
- package/dist/commands/network/network.logic.d.ts.map +1 -0
- package/dist/commands/network/network.logic.js +69 -0
- package/dist/commands/network/network.logic.js.map +1 -0
- package/dist/commands/network/network.screen.d.ts +10 -0
- package/dist/commands/network/network.screen.d.ts.map +1 -0
- package/dist/commands/network/network.screen.js +17 -0
- package/dist/commands/network/network.screen.js.map +1 -0
- package/dist/commands/notification/index.d.ts +7 -0
- package/dist/commands/notification/index.d.ts.map +1 -0
- package/dist/commands/notification/index.js +8 -0
- package/dist/commands/notification/index.js.map +1 -0
- package/dist/commands/notification/notification.logic.d.ts +11 -0
- package/dist/commands/notification/notification.logic.d.ts.map +1 -0
- package/dist/commands/notification/notification.logic.js +33 -0
- package/dist/commands/notification/notification.logic.js.map +1 -0
- package/dist/commands/notification/notification.screen.d.ts +10 -0
- package/dist/commands/notification/notification.screen.d.ts.map +1 -0
- package/dist/commands/notification/notification.screen.js +13 -0
- package/dist/commands/notification/notification.screen.js.map +1 -0
- package/dist/commands/profile/index.d.ts +6 -0
- package/dist/commands/profile/index.d.ts.map +1 -0
- package/dist/commands/profile/index.js +14 -0
- package/dist/commands/profile/index.js.map +1 -0
- package/dist/commands/profile/profile-edit.screen.d.ts +12 -0
- package/dist/commands/profile/profile-edit.screen.d.ts.map +1 -0
- package/dist/commands/profile/profile-edit.screen.js +66 -0
- package/dist/commands/profile/profile-edit.screen.js.map +1 -0
- package/dist/commands/profile/profile-view.screen.d.ts +10 -0
- package/dist/commands/profile/profile-view.screen.d.ts.map +1 -0
- package/dist/commands/profile/profile-view.screen.js +12 -0
- package/dist/commands/profile/profile-view.screen.js.map +1 -0
- package/dist/commands/profile/profile.logic.d.ts +42 -0
- package/dist/commands/profile/profile.logic.d.ts.map +1 -0
- package/dist/commands/profile/profile.logic.js +74 -0
- package/dist/commands/profile/profile.logic.js.map +1 -0
- package/dist/commands/project/index.d.ts +9 -0
- package/dist/commands/project/index.d.ts.map +1 -0
- package/dist/commands/project/index.js +8 -0
- package/dist/commands/project/index.js.map +1 -0
- package/dist/commands/project/project.logic.d.ts +29 -0
- package/dist/commands/project/project.logic.d.ts.map +1 -0
- package/dist/commands/project/project.logic.js +92 -0
- package/dist/commands/project/project.logic.js.map +1 -0
- package/dist/commands/project/project.screen.d.ts +22 -0
- package/dist/commands/project/project.screen.d.ts.map +1 -0
- package/dist/commands/project/project.screen.js +27 -0
- package/dist/commands/project/project.screen.js.map +1 -0
- package/dist/commands/stubs/index.d.ts +9 -0
- package/dist/commands/stubs/index.d.ts.map +1 -0
- package/dist/commands/stubs/index.js +24 -0
- package/dist/commands/stubs/index.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/context/AuthContext.d.ts +18 -0
- package/dist/context/AuthContext.d.ts.map +1 -0
- package/dist/context/AuthContext.js +49 -0
- package/dist/context/AuthContext.js.map +1 -0
- package/dist/context/SocketContext.d.ts +12 -0
- package/dist/context/SocketContext.d.ts.map +1 -0
- package/dist/context/SocketContext.js +44 -0
- package/dist/context/SocketContext.js.map +1 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +9 -0
- package/dist/context/index.js.map +1 -0
- package/dist/features/admin/components/admin.screen.d.ts +10 -0
- package/dist/features/admin/components/admin.screen.d.ts.map +1 -0
- package/dist/features/admin/components/admin.screen.js +19 -0
- package/dist/features/admin/components/admin.screen.js.map +1 -0
- package/dist/features/admin/components/index.d.ts +8 -0
- package/dist/features/admin/components/index.d.ts.map +1 -0
- package/dist/features/admin/components/index.js +8 -0
- package/dist/features/admin/components/index.js.map +1 -0
- package/dist/features/admin/hooks/useAdmin.d.ts +12 -0
- package/dist/features/admin/hooks/useAdmin.d.ts.map +1 -0
- package/dist/features/admin/hooks/useAdmin.js +46 -0
- package/dist/features/admin/hooks/useAdmin.js.map +1 -0
- package/dist/features/admin/index.d.ts +3 -0
- package/dist/features/admin/index.d.ts.map +1 -0
- package/dist/features/admin/index.js +3 -0
- package/dist/features/admin/index.js.map +1 -0
- package/dist/features/chat/components/ChatList.d.ts +2 -0
- package/dist/features/chat/components/ChatList.d.ts.map +1 -0
- package/dist/features/chat/components/ChatList.js +63 -0
- package/dist/features/chat/components/ChatList.js.map +1 -0
- package/dist/features/chat/components/chat.screen.d.ts +12 -0
- package/dist/features/chat/components/chat.screen.d.ts.map +1 -0
- package/dist/features/chat/components/chat.screen.js +12 -0
- package/dist/features/chat/components/chat.screen.js.map +1 -0
- package/dist/features/chat/components/index.d.ts +9 -0
- package/dist/features/chat/components/index.d.ts.map +1 -0
- package/dist/features/chat/components/index.js +9 -0
- package/dist/features/chat/components/index.js.map +1 -0
- package/dist/features/chat/hooks/useChat.d.ts +15 -0
- package/dist/features/chat/hooks/useChat.d.ts.map +1 -0
- package/dist/features/chat/hooks/useChat.js +150 -0
- package/dist/features/chat/hooks/useChat.js.map +1 -0
- package/dist/features/chat/index.d.ts +4 -0
- package/dist/features/chat/index.d.ts.map +1 -0
- package/dist/features/chat/index.js +4 -0
- package/dist/features/chat/index.js.map +1 -0
- package/dist/features/group/components/group.screen.d.ts +19 -0
- package/dist/features/group/components/group.screen.d.ts.map +1 -0
- package/dist/features/group/components/group.screen.js +22 -0
- package/dist/features/group/components/group.screen.js.map +1 -0
- package/dist/features/group/components/index.d.ts +9 -0
- package/dist/features/group/components/index.d.ts.map +1 -0
- package/dist/features/group/components/index.js +8 -0
- package/dist/features/group/components/index.js.map +1 -0
- package/dist/features/group/hooks/useGroup.d.ts +26 -0
- package/dist/features/group/hooks/useGroup.d.ts.map +1 -0
- package/dist/features/group/hooks/useGroup.js +78 -0
- package/dist/features/group/hooks/useGroup.js.map +1 -0
- package/dist/features/group/index.d.ts +3 -0
- package/dist/features/group/index.d.ts.map +1 -0
- package/dist/features/group/index.js +3 -0
- package/dist/features/group/index.js.map +1 -0
- package/dist/features/network/components/UnfriendByUsername.d.ts +7 -0
- package/dist/features/network/components/UnfriendByUsername.d.ts.map +1 -0
- package/dist/features/network/components/UnfriendByUsername.js +40 -0
- package/dist/features/network/components/UnfriendByUsername.js.map +1 -0
- package/dist/features/network/components/index.d.ts +8 -0
- package/dist/features/network/components/index.d.ts.map +1 -0
- package/dist/features/network/components/index.js +9 -0
- package/dist/features/network/components/index.js.map +1 -0
- package/dist/features/network/components/network.screen.d.ts +10 -0
- package/dist/features/network/components/network.screen.d.ts.map +1 -0
- package/dist/features/network/components/network.screen.js +17 -0
- package/dist/features/network/components/network.screen.js.map +1 -0
- package/dist/features/network/hooks/useNetwork.d.ts +12 -0
- package/dist/features/network/hooks/useNetwork.d.ts.map +1 -0
- package/dist/features/network/hooks/useNetwork.js +74 -0
- package/dist/features/network/hooks/useNetwork.js.map +1 -0
- package/dist/features/network/hooks/useUnfriend.d.ts +7 -0
- package/dist/features/network/hooks/useUnfriend.d.ts.map +1 -0
- package/dist/features/network/hooks/useUnfriend.js +24 -0
- package/dist/features/network/hooks/useUnfriend.js.map +1 -0
- package/dist/features/network/index.d.ts +4 -0
- package/dist/features/network/index.d.ts.map +1 -0
- package/dist/features/network/index.js +4 -0
- package/dist/features/network/index.js.map +1 -0
- package/dist/features/notification/components/index.d.ts +7 -0
- package/dist/features/notification/components/index.d.ts.map +1 -0
- package/dist/features/notification/components/index.js +8 -0
- package/dist/features/notification/components/index.js.map +1 -0
- package/dist/features/notification/components/notification.screen.d.ts +10 -0
- package/dist/features/notification/components/notification.screen.d.ts.map +1 -0
- package/dist/features/notification/components/notification.screen.js +13 -0
- package/dist/features/notification/components/notification.screen.js.map +1 -0
- package/dist/features/notification/hooks/useNotification.d.ts +11 -0
- package/dist/features/notification/hooks/useNotification.d.ts.map +1 -0
- package/dist/features/notification/hooks/useNotification.js +38 -0
- package/dist/features/notification/hooks/useNotification.js.map +1 -0
- package/dist/features/notification/index.d.ts +3 -0
- package/dist/features/notification/index.d.ts.map +1 -0
- package/dist/features/notification/index.js +3 -0
- package/dist/features/notification/index.js.map +1 -0
- package/dist/features/profile/components/index.d.ts +6 -0
- package/dist/features/profile/components/index.d.ts.map +1 -0
- package/dist/features/profile/components/index.js +13 -0
- package/dist/features/profile/components/index.js.map +1 -0
- package/dist/features/profile/components/profile-edit.screen.d.ts +14 -0
- package/dist/features/profile/components/profile-edit.screen.d.ts.map +1 -0
- package/dist/features/profile/components/profile-edit.screen.js +182 -0
- package/dist/features/profile/components/profile-edit.screen.js.map +1 -0
- package/dist/features/profile/components/profile-view.screen.d.ts +10 -0
- package/dist/features/profile/components/profile-view.screen.d.ts.map +1 -0
- package/dist/features/profile/components/profile-view.screen.js +13 -0
- package/dist/features/profile/components/profile-view.screen.js.map +1 -0
- package/dist/features/profile/hooks/useProfile.d.ts +17 -0
- package/dist/features/profile/hooks/useProfile.d.ts.map +1 -0
- package/dist/features/profile/hooks/useProfile.js +148 -0
- package/dist/features/profile/hooks/useProfile.js.map +1 -0
- package/dist/features/profile/index.d.ts +3 -0
- package/dist/features/profile/index.d.ts.map +1 -0
- package/dist/features/profile/index.js +3 -0
- package/dist/features/profile/index.js.map +1 -0
- package/dist/features/project/components/index.d.ts +9 -0
- package/dist/features/project/components/index.d.ts.map +1 -0
- package/dist/features/project/components/index.js +8 -0
- package/dist/features/project/components/index.js.map +1 -0
- package/dist/features/project/components/project.screen.d.ts +22 -0
- package/dist/features/project/components/project.screen.d.ts.map +1 -0
- package/dist/features/project/components/project.screen.js +27 -0
- package/dist/features/project/components/project.screen.js.map +1 -0
- package/dist/features/project/hooks/useProject.d.ts +29 -0
- package/dist/features/project/hooks/useProject.d.ts.map +1 -0
- package/dist/features/project/hooks/useProject.js +97 -0
- package/dist/features/project/hooks/useProject.js.map +1 -0
- package/dist/features/project/index.d.ts +3 -0
- package/dist/features/project/index.d.ts.map +1 -0
- package/dist/features/project/index.js +3 -0
- package/dist/features/project/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useApp, useInput } from 'ink';
|
|
3
|
+
import api from '../../../api.js';
|
|
4
|
+
import { useAuth } from '../../../context/index.js';
|
|
5
|
+
export const useProfileViewLogic = (targetUsername) => {
|
|
6
|
+
const { exit } = useApp();
|
|
7
|
+
const { user, isAuthenticated, isLoading: authLoading } = useAuth();
|
|
8
|
+
const [profile, setProfile] = useState(null);
|
|
9
|
+
const [loading, setLoading] = useState(true);
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
useInput((input, key) => {
|
|
12
|
+
if (key.escape) {
|
|
13
|
+
exit();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (authLoading)
|
|
18
|
+
return;
|
|
19
|
+
const fetchProfile = async () => {
|
|
20
|
+
if (!targetUsername && !isAuthenticated) {
|
|
21
|
+
setError('Please login first using "hackmate auth login"');
|
|
22
|
+
setLoading(false);
|
|
23
|
+
setTimeout(() => exit(), 100);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const endpoint = targetUsername ? `/profile/${targetUsername}` : '/profile';
|
|
28
|
+
const { data } = await api.get(endpoint);
|
|
29
|
+
setProfile(data);
|
|
30
|
+
// Removed auto-exit to keep view open
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
let msg = err.response?.data?.message || 'Failed to fetch profile';
|
|
34
|
+
if (msg.includes('No Authorization')) {
|
|
35
|
+
msg = 'Please login first using "hackmate auth login"';
|
|
36
|
+
}
|
|
37
|
+
setError(msg);
|
|
38
|
+
setTimeout(() => exit(), 100);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setLoading(false);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
fetchProfile();
|
|
45
|
+
}, [targetUsername, isAuthenticated, authLoading]);
|
|
46
|
+
return {
|
|
47
|
+
profile,
|
|
48
|
+
loading: loading || authLoading,
|
|
49
|
+
error,
|
|
50
|
+
user
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export const useProfileEditLogic = () => {
|
|
54
|
+
const { exit } = useApp();
|
|
55
|
+
const { isAuthenticated, isLoading: authLoading } = useAuth();
|
|
56
|
+
const [activeField, setActiveField] = useState(null);
|
|
57
|
+
const [profile, setProfile] = useState({
|
|
58
|
+
intent: 'collab',
|
|
59
|
+
bio: '',
|
|
60
|
+
stack: '',
|
|
61
|
+
location: '',
|
|
62
|
+
github: '',
|
|
63
|
+
});
|
|
64
|
+
const [loading, setLoading] = useState(false);
|
|
65
|
+
const [authError, setAuthError] = useState(null);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (authLoading)
|
|
68
|
+
return;
|
|
69
|
+
if (!isAuthenticated) {
|
|
70
|
+
setAuthError('Please login first using "hackmate auth login"');
|
|
71
|
+
setTimeout(() => exit(), 100);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const fetchProfile = async () => {
|
|
75
|
+
try {
|
|
76
|
+
const { data } = await api.get('/profile');
|
|
77
|
+
// Pre-process data for UI (arrays to strings)
|
|
78
|
+
const processed = { ...data };
|
|
79
|
+
if (Array.isArray(data.stack))
|
|
80
|
+
processed.stack = data.stack.join(', ');
|
|
81
|
+
if (Array.isArray(data.hobbies))
|
|
82
|
+
processed.hobbies = data.hobbies.join(', ');
|
|
83
|
+
if (Array.isArray(data.interests))
|
|
84
|
+
processed.interests = data.interests.join(', ');
|
|
85
|
+
if (Array.isArray(data.interestedIn))
|
|
86
|
+
processed.interestedIn = data.interestedIn.join(', ');
|
|
87
|
+
// Format Date of Birth to YYYY-MM-DD for editing
|
|
88
|
+
if (data.dateOfBirth) {
|
|
89
|
+
try {
|
|
90
|
+
processed.dateOfBirth = new Date(data.dateOfBirth).toISOString().split('T')[0];
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
processed.dateOfBirth = '';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
setProfile(processed);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
// Ignore error, start fresh or empty
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
fetchProfile();
|
|
103
|
+
}, [isAuthenticated, authLoading]);
|
|
104
|
+
const handleSubmit = async () => {
|
|
105
|
+
setLoading(true);
|
|
106
|
+
try {
|
|
107
|
+
// Transform comma-separated strings to arrays
|
|
108
|
+
const payload = {
|
|
109
|
+
...profile,
|
|
110
|
+
};
|
|
111
|
+
// Convert comma-separated strings to arrays
|
|
112
|
+
if (profile.stack && typeof profile.stack === 'string') {
|
|
113
|
+
payload.stack = profile.stack.split(',').map((s) => s.trim()).filter(Boolean);
|
|
114
|
+
}
|
|
115
|
+
if (profile.interests && typeof profile.interests === 'string') {
|
|
116
|
+
payload.interests = profile.interests.split(',').map((s) => s.trim()).filter(Boolean);
|
|
117
|
+
}
|
|
118
|
+
if (profile.hobbies && typeof profile.hobbies === 'string') {
|
|
119
|
+
payload.hobbies = profile.hobbies.split(',').map((s) => s.trim()).filter(Boolean);
|
|
120
|
+
}
|
|
121
|
+
if (profile.interestedIn && typeof profile.interestedIn === 'string') {
|
|
122
|
+
payload.interestedIn = profile.interestedIn.split(',').map((s) => s.trim()).filter(Boolean);
|
|
123
|
+
}
|
|
124
|
+
// Remove empty strings and undefined values
|
|
125
|
+
Object.keys(payload).forEach(key => {
|
|
126
|
+
if (payload[key] === '' || payload[key] === undefined) {
|
|
127
|
+
delete payload[key];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
await api.put('/profile', payload);
|
|
131
|
+
console.log('✅ Profile updated!');
|
|
132
|
+
exit();
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
console.error('❌ Update failed:', err.response?.data?.message || err.message);
|
|
136
|
+
exit();
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
activeField, setActiveField,
|
|
141
|
+
profile, setProfile,
|
|
142
|
+
loading,
|
|
143
|
+
authError,
|
|
144
|
+
handleSubmit,
|
|
145
|
+
authLoading
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=useProfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProfile.js","sourceRoot":"","sources":["../../../../src/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AAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;YAC9E,IAAI,EAAE,CAAC;QACX,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,UAAU;QACnB,OAAO;QACP,SAAS;QACT,YAAY;QACZ,WAAW;KACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/project/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,YAAY;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACzD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAG1C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useProjectLogic } from '../hooks/useProject.js';
|
|
3
|
+
import { ProjectScreen } from './project.screen.js';
|
|
4
|
+
export const Project = (props) => {
|
|
5
|
+
const logic = useProjectLogic(props);
|
|
6
|
+
return _jsx(ProjectScreen, { ...logic });
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/project/components/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;IACrD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,KAAC,aAAa,OAAK,KAAK,GAAI,CAAC;AACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ProjectScreenProps {
|
|
3
|
+
action: string;
|
|
4
|
+
data: any;
|
|
5
|
+
error: string | null;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
formStep: number;
|
|
8
|
+
setFormStep: (step: number) => void;
|
|
9
|
+
formData: {
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
skills: string;
|
|
13
|
+
};
|
|
14
|
+
setFormData: (data: any) => void;
|
|
15
|
+
message: string;
|
|
16
|
+
setMessage: (msg: string) => void;
|
|
17
|
+
handleCreateSubmit: () => void;
|
|
18
|
+
handleApplySubmit: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const ProjectScreen: React.FC<ProjectScreenProps>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=project.screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.screen.d.ts","sourceRoot":"","sources":["../../../../src/features/project/components/project.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6GtD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import TextInput from 'ink-text-input';
|
|
4
|
+
export const ProjectScreen = ({ action, data, error, loading, formStep, setFormStep, formData, setFormData, message, setMessage, handleCreateSubmit, handleApplySubmit }) => {
|
|
5
|
+
if (loading)
|
|
6
|
+
return _jsx(Text, { children: "Loading..." });
|
|
7
|
+
if (error)
|
|
8
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
9
|
+
if (action === 'list') {
|
|
10
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "magenta", children: [_jsx(Text, { bold: true, children: "\uD83D\uDD25 Open Projects" }), Array.isArray(data) && data.length === 0 && _jsx(Text, { italic: true, color: "gray", children: "No open projects." }), Array.isArray(data) && data.map((p) => (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { bold: true, color: "cyan", children: [p.title, " ", _jsxs(Text, { color: "gray", children: ["(ID: ", p._id, ")"] })] }), _jsxs(Text, { color: "green", children: ["By @", p.ownerId?.username] }), _jsxs(Text, { children: [p.description.substring(0, 100), "..."] }), _jsxs(Text, { color: "blue", children: ["Skills: ", p.skills?.join(', ')] })] }, p._id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) })] }));
|
|
11
|
+
}
|
|
12
|
+
if (action === 'view') {
|
|
13
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan", children: [_jsx(Text, { bold: true, color: "magenta", children: data.title }), _jsxs(Text, { color: "gray", children: ["Started by @", data.ownerId?.username] }), _jsx(Box, { marginY: 1, children: _jsx(Text, { children: data.description }) }), _jsxs(Text, { bold: true, children: ["Skills required: ", _jsx(Text, { color: "blue", children: data.skills?.join(', ') })] }), _jsx(Box, { marginY: 1, children: _jsx(Text, { children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }) }), _jsxs(Text, { bold: true, children: ["Applicants (", data.applicants?.length || 0, "):"] }), data.applicants?.map((a) => (_jsxs(Text, { children: ["\u2022 ", a.userId.username, " [", a.status, "] - \"", a.message, "\"", _jsxs(Text, { color: "gray", children: [" (ID: ", a.userId._id, ")"] })] }, a.userId._id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) })] }));
|
|
14
|
+
}
|
|
15
|
+
if (action === 'create') {
|
|
16
|
+
if (data?.message)
|
|
17
|
+
return _jsxs(Text, { color: "green", children: ["\u2705 ", data.message] });
|
|
18
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, children: "Create New Project" }), formStep === 0 && (_jsxs(Box, { children: [_jsx(Text, { children: "Title: " }), _jsx(TextInput, { value: formData.title, onChange: v => setFormData({ ...formData, title: v }), onSubmit: () => setFormStep(1) })] })), formStep === 1 && (_jsxs(Box, { children: [_jsx(Text, { children: "Description: " }), _jsx(TextInput, { value: formData.description, onChange: v => setFormData({ ...formData, description: v }), onSubmit: () => setFormStep(2) })] })), formStep === 2 && (_jsxs(Box, { children: [_jsx(Text, { children: "Skills (comma sep): " }), _jsx(TextInput, { value: formData.skills, onChange: v => setFormData({ ...formData, skills: v }), onSubmit: handleCreateSubmit })] })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to cancel" }) })] }));
|
|
19
|
+
}
|
|
20
|
+
if (action === 'apply') {
|
|
21
|
+
if (data?.message)
|
|
22
|
+
return _jsxs(Text, { color: "green", children: ["\u2705 ", data.message] });
|
|
23
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, children: "Apply to Project" }), _jsx(Text, { children: "Message to owner: " }), _jsx(TextInput, { value: message, onChange: setMessage, onSubmit: handleApplySubmit }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to cancel" }) })] }));
|
|
24
|
+
}
|
|
25
|
+
return _jsxs(Text, { color: "green", children: ["\u2705 ", data?.message] });
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=project.screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.screen.js","sourceRoot":"","sources":["../../../../src/features/project/components/project.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAiBvC,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EACxD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,WAAW,EACX,QAAQ,EAC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AQ,EAAE,kBAAkB,GAAI,IACzH,CACT,EACD,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,oCAA2B,GAC3C,IACJ,CACT,CAAC;IACN,CAAC;IAED,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACrB,IAAI,IAAI,EAAE,OAAO;YAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,CAAC,OAAO,IAAQ,CAAC;QACtE,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aAClC,KAAC,IAAI,IAAC,IAAI,uCAAwB,EAClC,KAAC,IAAI,qCAA0B,EAC/B,KAAC,SAAS,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,GAAI,EAChF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,oCAA2B,GAC3C,IACJ,CACT,CAAC;IACN,CAAC;IAED,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,EAAE,OAAO,IAAQ,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface UseProjectLogicProps {
|
|
2
|
+
action?: 'list' | 'create' | 'view' | 'apply' | 'accept';
|
|
3
|
+
id?: string;
|
|
4
|
+
extraArg?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const useProjectLogic: ({ action, id, extraArg }: UseProjectLogicProps) => {
|
|
7
|
+
action: "list" | "view" | "accept" | "create" | "apply";
|
|
8
|
+
data: any;
|
|
9
|
+
error: string | null;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
formStep: number;
|
|
12
|
+
setFormStep: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
13
|
+
formData: {
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
skills: string;
|
|
17
|
+
};
|
|
18
|
+
setFormData: import("react").Dispatch<import("react").SetStateAction<{
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
skills: string;
|
|
22
|
+
}>>;
|
|
23
|
+
message: string;
|
|
24
|
+
setMessage: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
25
|
+
handleCreateSubmit: () => Promise<void>;
|
|
26
|
+
handleApplySubmit: () => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=useProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProject.d.ts","sourceRoot":"","sources":["../../../../src/features/project/hooks/useProject.ts"],"names":[],"mappings":"AAKA,UAAU,oBAAoB;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACzD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,GAAI,0BAAmC,oBAAoB;;;;;;;;;;;;;;;;;;;;;CA0FtF,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useApp, useInput } from 'ink';
|
|
3
|
+
import api from '../../../api.js';
|
|
4
|
+
import { useAuth } from '../../../context/index.js';
|
|
5
|
+
export const useProjectLogic = ({ action = 'list', id, extraArg }) => {
|
|
6
|
+
const { exit } = useApp();
|
|
7
|
+
const { isAuthenticated } = useAuth();
|
|
8
|
+
const [data, setData] = useState(null);
|
|
9
|
+
const [error, setError] = useState(null);
|
|
10
|
+
const [loading, setLoading] = useState(true);
|
|
11
|
+
// Form state for create
|
|
12
|
+
const [formStep, setFormStep] = useState(0);
|
|
13
|
+
const [formData, setFormData] = useState({ title: '', description: '', skills: '' });
|
|
14
|
+
// Input state for apply message
|
|
15
|
+
const [message, setMessage] = useState('');
|
|
16
|
+
useInput((input, key) => {
|
|
17
|
+
if (key.escape) {
|
|
18
|
+
exit();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const run = async () => {
|
|
23
|
+
if (!isAuthenticated)
|
|
24
|
+
return;
|
|
25
|
+
try {
|
|
26
|
+
if (action === 'list') {
|
|
27
|
+
const res = await api.get('/project');
|
|
28
|
+
setData(res.data);
|
|
29
|
+
setLoading(false);
|
|
30
|
+
}
|
|
31
|
+
else if (action === 'view' && id) {
|
|
32
|
+
const res = await api.get(`/project/${id}`);
|
|
33
|
+
setData(res.data);
|
|
34
|
+
setLoading(false);
|
|
35
|
+
}
|
|
36
|
+
else if (action === 'accept' && id && extraArg) {
|
|
37
|
+
await api.post(`/project/${id}/accept`, { applicantId: extraArg });
|
|
38
|
+
setData({ message: 'Applicant accepted!' });
|
|
39
|
+
setLoading(false);
|
|
40
|
+
}
|
|
41
|
+
// create and apply handle their own loading via interactions
|
|
42
|
+
if (action === 'create' || action === 'apply') {
|
|
43
|
+
setLoading(false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
setError(err.response?.data?.message || err.message || 'Operation failed');
|
|
48
|
+
setLoading(false);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
run();
|
|
52
|
+
}, [action, id, extraArg, isAuthenticated]);
|
|
53
|
+
const handleCreateSubmit = async () => {
|
|
54
|
+
setLoading(true);
|
|
55
|
+
try {
|
|
56
|
+
await api.post('/project', {
|
|
57
|
+
...formData,
|
|
58
|
+
skills: formData.skills.split(',').map(s => s.trim())
|
|
59
|
+
});
|
|
60
|
+
setData({ message: 'Project created successfully!' });
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
setError(err.response?.data?.message || 'Failed to create project');
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
setLoading(false);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const handleApplySubmit = async () => {
|
|
70
|
+
setLoading(true);
|
|
71
|
+
try {
|
|
72
|
+
await api.post(`/project/${id}/apply`, { message });
|
|
73
|
+
setData({ message: 'Application sent successfully!' });
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
setError(err.response?.data?.message || 'Failed to apply');
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
setLoading(false);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return {
|
|
83
|
+
action,
|
|
84
|
+
data,
|
|
85
|
+
error,
|
|
86
|
+
loading,
|
|
87
|
+
formStep,
|
|
88
|
+
setFormStep,
|
|
89
|
+
formData,
|
|
90
|
+
setFormData,
|
|
91
|
+
message,
|
|
92
|
+
setMessage,
|
|
93
|
+
handleCreateSubmit,
|
|
94
|
+
handleApplySubmit
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=useProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProject.js","sourceRoot":"","sources":["../../../../src/features/project/hooks/useProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAQpD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACvF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC;IACtC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAM,IAAI,CAAC,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G,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,0BAA0B,CAAC,CAAC;QACxE,CAAC;gBAAS,CAAC;YACP,UAAU,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,KAAK,IAAI,EAAE;QACjC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC;YACD,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YACpD,OAAO,CAAC,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,iBAAiB,CAAC,CAAC;QAC/D,CAAC;gBAAS,CAAC;YACP,UAAU,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,MAAM;QACN,IAAI;QACJ,KAAK;QACL,OAAO;QACP,QAAQ;QACR,WAAW;QACX,QAAQ;QACR,WAAW;QACX,OAAO;QACP,UAAU;QACV,kBAAkB;QAClB,iBAAiB;KACpB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hackmate-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "HackMate CLI - Terminal-based social network for developers and hackers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"hackmate": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"postbuild": "node scripts/add-shebang.cjs",
|
|
12
|
+
"dev": "tsx watch src/cli.tsx",
|
|
13
|
+
"test": "tsx src/cli.tsx",
|
|
14
|
+
"start": "node dist/cli.js",
|
|
15
|
+
"lint": "eslint src/**/*.ts",
|
|
16
|
+
"prepublishOnly": "npm run build && npm run postbuild"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"hackmate",
|
|
20
|
+
"cli",
|
|
21
|
+
"terminal",
|
|
22
|
+
"social-network",
|
|
23
|
+
"developers",
|
|
24
|
+
"hackers"
|
|
25
|
+
],
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"axios": "^1.13.2",
|
|
37
|
+
"chalk": "^5.0.0",
|
|
38
|
+
"commander": "^12.0.0",
|
|
39
|
+
"conf": "^15.0.2",
|
|
40
|
+
"dotenv": "^17.2.3",
|
|
41
|
+
"ink": "^5.0.0",
|
|
42
|
+
"ink-select-input": "^6.2.0",
|
|
43
|
+
"ink-spinner": "^5.0.0",
|
|
44
|
+
"ink-text-input": "^6.0.0",
|
|
45
|
+
"react": "^18.0.0",
|
|
46
|
+
"socket.io-client": "^4.8.3",
|
|
47
|
+
"zod": "^3.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^20.0.0",
|
|
51
|
+
"@types/react": "^18.0.0",
|
|
52
|
+
"tsx": "^4.0.0",
|
|
53
|
+
"typescript": "^5.9.3"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=20"
|
|
57
|
+
}
|
|
58
|
+
}
|