ramadan-cal 1.0.4 → 1.0.6

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": "ramadan-cal",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "🌙 A beautiful terminal Ramadan calendar with prayer times, daily progress, and Hijri date",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,7 +4,6 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } fr
4
4
  import { join } from 'path';
5
5
  import { homedir } from 'os';
6
6
  import { execSync } from 'child_process';
7
- import { createInterface } from 'readline';
8
7
 
9
8
  const home = homedir();
10
9
  const claudeDir = join(home, '.claude');
@@ -77,42 +76,17 @@ function createSkill() {
77
76
  configureClaudeMd();
78
77
  }
79
78
 
80
- function ask(question) {
81
- const rl = createInterface({ input: process.stdin, output: process.stdout });
82
- return new Promise((resolve) => {
83
- rl.question(question, (answer) => {
84
- rl.close();
85
- resolve(answer.trim().toLowerCase());
86
- });
87
- });
88
- }
89
-
90
- async function main() {
79
+ function main() {
91
80
  log('');
92
81
  log(' 🌙 Ramadan CLI installed successfully!');
93
82
  log('');
94
83
 
95
- // Non-interactive environment (CI, piped stdin) — skip prompts
96
- if (!process.stdin.isTTY) {
97
- log(' Run `npm rebuild ramadan-cal` in an interactive terminal to set up Claude Code.');
98
- log('');
99
- return;
100
- }
101
-
102
- // Step 1: Check if Claude Code is installed
103
84
  if (!isClaudeInstalled()) {
104
- log(' Claude Code not detected on your PATH.');
105
- log(' Run `npm rebuild ramadan-cal` to set up Claude Code integration later.');
106
- log('');
107
85
  log(' ➜ Run `ramadan` to get started.');
108
86
  log('');
109
87
  return;
110
88
  }
111
89
 
112
- log(' ✓ Claude Code detected');
113
- log('');
114
-
115
- // Already fully set up?
116
90
  if (isSkillInstalled() && isClaudeMdConfigured()) {
117
91
  log(' ✓ Claude Code integration already configured');
118
92
  log(' Type "ramadan" or "/ramadan" in Claude Code.');
@@ -120,45 +94,15 @@ async function main() {
120
94
  return;
121
95
  }
122
96
 
123
- // Step 2: Check if skills folder exists
124
- if (!existsSync(skillsDir)) {
125
- // Skills folder doesn't exist ask to create it
126
- const answer = await ask(' Create a Claude Code skills folder and add the ramadan skill? (y/n) ');
127
- log('');
128
- if (answer === 'y' || answer === 'yes') {
129
- createSkill();
130
- log(' ✓ Created ~/.claude/skills/ramadan/');
131
- log(' ✓ Ramadan skill added');
132
- log('');
133
- log(' Type "ramadan" or "/ramadan" in Claude Code to use it.');
134
- } else {
135
- log(' Skipped. Run `npm rebuild ramadan-cal` or type `ramadan` directly in your terminal.');
136
- }
137
- } else {
138
- // Skills folder exists — ask if they want the skill added
139
- if (isSkillInstalled()) {
140
- log(' ✓ Ramadan skill already installed');
141
- configureClaudeMd();
142
- log(' Type "ramadan" or "/ramadan" in Claude Code.');
143
- log('');
144
- return;
145
- }
146
-
147
- const answer = await ask(' Add the ramadan skill to Claude Code? (y/n) ');
148
- log('');
149
- if (answer === 'y' || answer === 'yes') {
150
- createSkill();
151
- log(' ✓ Ramadan skill added to ~/.claude/skills/');
152
- log('');
153
- log(' Type "ramadan" or "/ramadan" in Claude Code to use it.');
154
- } else {
155
- log(' Skipped. Run `npm rebuild ramadan-cal` or type `ramadan` directly in your terminal.');
156
- }
97
+ try {
98
+ createSkill();
99
+ log(' Claude Code integration configured');
100
+ log(' Type "ramadan" or "/ramadan" in Claude Code.');
101
+ } catch {
102
+ log(' ✗ Could not set up Claude Code integration automatically.');
103
+ log(' Set it up manually: https://ramadan-cal-site.onrender.com/#troubleshooting');
157
104
  }
158
-
159
105
  log('');
160
106
  }
161
107
 
162
- main().catch(() => {
163
- process.exit(0);
164
- });
108
+ main();