ramadan-cal 1.0.5 → 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.5",
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": {
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync, openSync, createReadStream } from 'fs';
3
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from 'fs';
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,53 +76,17 @@ function createSkill() {
77
76
  configureClaudeMd();
78
77
  }
79
78
 
80
- function isTTY() {
81
- try {
82
- openSync('/dev/tty', 'r');
83
- return true;
84
- } catch {
85
- return false;
86
- }
87
- }
88
-
89
- function ask(question) {
90
- const tty = createReadStream('/dev/tty');
91
- const rl = createInterface({ input: tty, output: process.stderr });
92
- return new Promise((resolve) => {
93
- rl.question(question, (answer) => {
94
- rl.close();
95
- tty.destroy();
96
- resolve(answer.trim().toLowerCase());
97
- });
98
- });
99
- }
100
-
101
- async function main() {
79
+ function main() {
102
80
  log('');
103
81
  log(' 🌙 Ramadan CLI installed successfully!');
104
82
  log('');
105
83
 
106
- // Non-interactive environment (CI, no TTY available) — skip prompts
107
- if (!isTTY()) {
108
- log(' Run `npm rebuild ramadan-cal` in an interactive terminal to set up Claude Code.');
109
- log('');
110
- return;
111
- }
112
-
113
- // Step 1: Check if Claude Code is installed
114
84
  if (!isClaudeInstalled()) {
115
- log(' Claude Code not detected on your PATH.');
116
- log(' Run `npm rebuild ramadan-cal` to set up Claude Code integration later.');
117
- log('');
118
85
  log(' ➜ Run `ramadan` to get started.');
119
86
  log('');
120
87
  return;
121
88
  }
122
89
 
123
- log(' ✓ Claude Code detected');
124
- log('');
125
-
126
- // Already fully set up?
127
90
  if (isSkillInstalled() && isClaudeMdConfigured()) {
128
91
  log(' ✓ Claude Code integration already configured');
129
92
  log(' Type "ramadan" or "/ramadan" in Claude Code.');
@@ -131,45 +94,15 @@ async function main() {
131
94
  return;
132
95
  }
133
96
 
134
- // Step 2: Check if skills folder exists
135
- if (!existsSync(skillsDir)) {
136
- // Skills folder doesn't exist ask to create it
137
- const answer = await ask(' Create a Claude Code skills folder and add the ramadan skill? (y/n) ');
138
- log('');
139
- if (answer === 'y' || answer === 'yes') {
140
- createSkill();
141
- log(' ✓ Created ~/.claude/skills/ramadan/');
142
- log(' ✓ Ramadan skill added');
143
- log('');
144
- log(' Type "ramadan" or "/ramadan" in Claude Code to use it.');
145
- } else {
146
- log(' Skipped. Run `npm rebuild ramadan-cal` or type `ramadan` directly in your terminal.');
147
- }
148
- } else {
149
- // Skills folder exists — ask if they want the skill added
150
- if (isSkillInstalled()) {
151
- log(' ✓ Ramadan skill already installed');
152
- configureClaudeMd();
153
- log(' Type "ramadan" or "/ramadan" in Claude Code.');
154
- log('');
155
- return;
156
- }
157
-
158
- const answer = await ask(' Add the ramadan skill to Claude Code? (y/n) ');
159
- log('');
160
- if (answer === 'y' || answer === 'yes') {
161
- createSkill();
162
- log(' ✓ Ramadan skill added to ~/.claude/skills/');
163
- log('');
164
- log(' Type "ramadan" or "/ramadan" in Claude Code to use it.');
165
- } else {
166
- log(' Skipped. Run `npm rebuild ramadan-cal` or type `ramadan` directly in your terminal.');
167
- }
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');
168
104
  }
169
-
170
105
  log('');
171
106
  }
172
107
 
173
- main().catch(() => {
174
- process.exit(0);
175
- });
108
+ main();