@l4yercak3/cli 1.0.3 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l4yercak3/cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Icing on the L4yercak3 - The sweet finishing touch for your Layer Cake integration",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -123,10 +123,14 @@ async function handleLogin() {
123
123
  // Check if already logged in
124
124
  if (configManager.isLoggedIn()) {
125
125
  const session = configManager.getSession();
126
- console.log(chalk.yellow(' ⚠️ You are already logged in'));
127
- console.log(chalk.gray(` Email: ${session.email}`));
128
- console.log(chalk.gray(` Session expires: ${new Date(session.expiresAt).toLocaleString()}`));
129
- console.log(chalk.gray('\n Run "l4yercak3 logout" to log out first\n'));
126
+ console.log(chalk.green(' You are already logged in'));
127
+ if (session.email) {
128
+ console.log(chalk.gray(` Email: ${session.email}`));
129
+ }
130
+ console.log(chalk.gray(` Session expires: ${new Date(session.expiresAt).toLocaleString()}\n`));
131
+
132
+ // Still offer the setup wizard
133
+ await promptSetupWizard();
130
134
  return;
131
135
  }
132
136
 
@@ -77,7 +77,7 @@ describe('Login Command', () => {
77
77
  });
78
78
 
79
79
  describe('handler - already logged in', () => {
80
- it('shows warning when already logged in', async () => {
80
+ it('shows success message when already logged in', async () => {
81
81
  configManager.isLoggedIn.mockReturnValue(true);
82
82
  configManager.getSession.mockReturnValue({
83
83
  email: 'user@example.com',
@@ -91,7 +91,7 @@ describe('Login Command', () => {
91
91
  expect(open).not.toHaveBeenCalled();
92
92
  });
93
93
 
94
- it('suggests logout when already logged in', async () => {
94
+ it('shows session info and offers setup wizard when already logged in', async () => {
95
95
  configManager.isLoggedIn.mockReturnValue(true);
96
96
  configManager.getSession.mockReturnValue({
97
97
  email: 'user@example.com',
@@ -100,7 +100,8 @@ describe('Login Command', () => {
100
100
 
101
101
  await loginCommand.handler();
102
102
 
103
- expect(consoleOutput.some((line) => line.includes('logout'))).toBe(true);
103
+ // Should show "What's Next" since we're not in a project (mocked)
104
+ expect(consoleOutput.some((line) => line.includes("What's Next"))).toBe(true);
104
105
  });
105
106
  });
106
107