gh-here 1.0.0 → 1.0.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.
@@ -0,0 +1,21 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(if [ -f scripts/lint ])",
5
+ "Bash(then scripts/lint)",
6
+ "Bash(elif [ -f script/lint ])",
7
+ "Bash(then script/lint)",
8
+ "Bash(elif [ -f package.json ])",
9
+ "Bash(then npm run lint)",
10
+ "Bash(else echo \"No linting script found\")",
11
+ "Bash(fi)",
12
+ "Bash(git checkout:*)",
13
+ "Bash(git add:*)",
14
+ "Bash(git commit:*)",
15
+ "Bash(git push:*)",
16
+ "Bash(gh pr view:*)"
17
+ ],
18
+ "deny": [],
19
+ "ask": []
20
+ }
21
+ }
package/README.md CHANGED
@@ -4,8 +4,16 @@ A local GitHub-like file browser for viewing code in your terminal. Launch it in
4
4
 
5
5
  ## Installation
6
6
 
7
+ You can run gh-here directly with npx (no installation required):
8
+
9
+ ```bash
10
+ npx gh-here
11
+ ```
12
+
13
+ Or install it globally:
14
+
7
15
  ```bash
8
- npm install -g .
16
+ npm install -g gh-here
9
17
  ```
10
18
 
11
19
  ## Usage
@@ -13,10 +21,10 @@ npm install -g .
13
21
  Navigate to any directory and run:
14
22
 
15
23
  ```bash
16
- npx gh-here # Start server on available port
17
- npx gh-here --open # Start server and open browser
18
- npx gh-here --open --browser=safari # Start server and open in Safari
19
- npx gh-here --open --browser=arc # Start server and open in Arc
24
+ gh-here # Start server on available port
25
+ gh-here --open # Start server and open browser
26
+ gh-here --open --browser=safari # Start server and open in Safari
27
+ gh-here --open --browser=arc # Start server and open in Arc
20
28
  ```
21
29
 
22
30
  The app will automatically find an available port starting from 3000 and serve your current directory with a GitHub-like interface.
package/package.json CHANGED
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "gh-here",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A local GitHub-like file browser for viewing code",
5
+ "repository": "https://github.com/corywilkerson/gh-here",
5
6
  "main": "index.js",
6
7
  "bin": {
7
8
  "gh-here": "./bin/gh-here.js"
8
9
  },
9
10
  "scripts": {
10
- "start": "node bin/gh-here.js"
11
+ "start": "node bin/gh-here.js",
12
+ "test": "echo yolo no tests yet"
11
13
  },
12
- "keywords": ["github", "file-browser", "code-viewer", "local"],
14
+ "keywords": [
15
+ "github",
16
+ "file-browser",
17
+ "code-viewer",
18
+ "local"
19
+ ],
13
20
  "author": "",
14
21
  "license": "MIT",
15
22
  "dependencies": {
@@ -18,4 +25,4 @@
18
25
  "marked": "^12.0.0",
19
26
  "@primer/octicons": "^19.8.0"
20
27
  }
21
- }
28
+ }
package/public/app.js CHANGED
@@ -35,11 +35,28 @@ document.addEventListener('DOMContentLoaded', function() {
35
35
  // Initialize
36
36
  updateFileRows();
37
37
 
38
- // Load saved theme or default to dark
39
- const savedTheme = localStorage.getItem('gh-here-theme') || 'dark';
38
+ // Detect system theme preference
39
+ const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
40
+ const systemTheme = systemPrefersDark ? 'dark' : 'light';
41
+
42
+ // Load saved theme or default to system preference
43
+ const savedTheme = localStorage.getItem('gh-here-theme') || systemTheme;
40
44
  html.setAttribute('data-theme', savedTheme);
41
45
  updateThemeIcon(savedTheme);
42
46
 
47
+ // Listen for system theme changes (only if no manual override is saved)
48
+ if (window.matchMedia) {
49
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
50
+ mediaQuery.addListener(function(e) {
51
+ // Only auto-update if user hasn't manually set a theme
52
+ if (!localStorage.getItem('gh-here-theme')) {
53
+ const newTheme = e.matches ? 'dark' : 'light';
54
+ html.setAttribute('data-theme', newTheme);
55
+ updateThemeIcon(newTheme);
56
+ }
57
+ });
58
+ }
59
+
43
60
  // Theme toggle functionality
44
61
  themeToggle.addEventListener('click', function() {
45
62
  const currentTheme = html.getAttribute('data-theme');