issy 0.2.0 → 0.2.1
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/issy +15 -43
- package/package.json +4 -3
package/bin/issy
CHANGED
|
@@ -1,46 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { dirname } from 'node:path'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
existsSync,
|
|
5
|
+
mkdirSync,
|
|
6
|
+
readdirSync,
|
|
7
|
+
writeFileSync,
|
|
8
|
+
readFileSync
|
|
9
|
+
} from 'node:fs'
|
|
4
10
|
import { join, resolve } from 'node:path'
|
|
5
11
|
import { fileURLToPath } from 'node:url'
|
|
12
|
+
import updateNotifier from 'update-notifier'
|
|
6
13
|
|
|
7
14
|
const args = process.argv.slice(2)
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const here = resolve(fileURLToPath(import.meta.url), '..')
|
|
16
|
-
const pkgPath = resolve(here, '..', 'package.json')
|
|
17
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
|
|
18
|
-
const currentVersion = pkg.version
|
|
19
|
-
|
|
20
|
-
const controller = new AbortController()
|
|
21
|
-
const timeout = setTimeout(() => controller.abort(), 2000)
|
|
22
|
-
|
|
23
|
-
const res = await fetch('https://registry.npmjs.org/issy/latest', {
|
|
24
|
-
signal: controller.signal
|
|
25
|
-
})
|
|
26
|
-
clearTimeout(timeout)
|
|
27
|
-
|
|
28
|
-
if (!res.ok) return
|
|
29
|
-
|
|
30
|
-
const data = await res.json()
|
|
31
|
-
const latestVersion = data.version
|
|
32
|
-
|
|
33
|
-
if (currentVersion !== latestVersion) {
|
|
34
|
-
console.error(`\x1b[33m⚠ You're running issy v${currentVersion}, but v${latestVersion} is available.\x1b[0m`)
|
|
35
|
-
console.error(`\x1b[33m Run: npx issy@latest\x1b[0m\n`)
|
|
36
|
-
}
|
|
37
|
-
} catch {
|
|
38
|
-
// Silently ignore - network issues, timeouts, etc.
|
|
39
|
-
}
|
|
40
|
-
}
|
|
16
|
+
// Check for updates (non-blocking, cached, shows on next run)
|
|
17
|
+
const here = resolve(fileURLToPath(import.meta.url), '..')
|
|
18
|
+
const pkgPath = resolve(here, '..', 'package.json')
|
|
19
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
|
|
20
|
+
updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 }).notify() // 1 hour
|
|
41
21
|
|
|
42
|
-
// Fire off update check (non-blocking)
|
|
43
|
-
const updateCheck = checkForUpdates()
|
|
44
22
|
const cliCommands = new Set([
|
|
45
23
|
'list',
|
|
46
24
|
'search',
|
|
@@ -55,11 +33,7 @@ const cliCommands = new Set([
|
|
|
55
33
|
|
|
56
34
|
// Handle --version / -v flag
|
|
57
35
|
if (args[0] === '--version' || args[0] === '-v') {
|
|
58
|
-
const here = resolve(fileURLToPath(import.meta.url), '..')
|
|
59
|
-
const pkgPath = resolve(here, '..', 'package.json')
|
|
60
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
|
|
61
36
|
console.log(`issy v${pkg.version}`)
|
|
62
|
-
await updateCheck
|
|
63
37
|
process.exit(0)
|
|
64
38
|
}
|
|
65
39
|
|
|
@@ -141,7 +115,6 @@ if (cliCommands.has(args[0] || '')) {
|
|
|
141
115
|
process.argv = [process.argv[0], process.argv[1], ...args]
|
|
142
116
|
const cli = await import(entry)
|
|
143
117
|
await cli.ready // Wait for main() to complete before exiting
|
|
144
|
-
await updateCheck // Wait for version check to complete
|
|
145
118
|
process.exit(0)
|
|
146
119
|
}
|
|
147
120
|
|
|
@@ -158,7 +131,7 @@ if (shouldInitOnly) {
|
|
|
158
131
|
if (!existsSync(issuesDir)) {
|
|
159
132
|
mkdirSync(issuesDir, { recursive: true })
|
|
160
133
|
}
|
|
161
|
-
|
|
134
|
+
|
|
162
135
|
// Only seed with welcome issue if --seed flag is passed
|
|
163
136
|
if (shouldSeed) {
|
|
164
137
|
const hasIssues =
|
|
@@ -180,9 +153,8 @@ if (shouldInitOnly) {
|
|
|
180
153
|
writeFileSync(join(issuesDir, '0001-welcome-to-issy.md'), welcome)
|
|
181
154
|
}
|
|
182
155
|
}
|
|
183
|
-
|
|
156
|
+
|
|
184
157
|
console.log(`Initialized ${issuesDir}`)
|
|
185
|
-
await updateCheck // Wait for version check to complete
|
|
186
158
|
process.exit(0)
|
|
187
159
|
}
|
|
188
160
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "issy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "AI-native issue tracking. Markdown files in .issues/, managed by your coding assistant.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"lint": "biome check src bin"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@miketromba/issy-app": "^0.2.
|
|
38
|
-
"@miketromba/issy-core": "^0.2.
|
|
37
|
+
"@miketromba/issy-app": "^0.2.1",
|
|
38
|
+
"@miketromba/issy-core": "^0.2.1",
|
|
39
|
+
"update-notifier": "^7.3.1"
|
|
39
40
|
}
|
|
40
41
|
}
|