glimpse-cli 0.0.1 → 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/dist/cli.mjs +370 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/daemon-main.mjs +295 -0
- package/dist/daemon-main.mjs.map +1 -0
- package/dist/glimpse-adapter-COgj6E-W.mjs +34 -0
- package/dist/glimpse-adapter-COgj6E-W.mjs.map +1 -0
- package/docs/PRD.md +356 -0
- package/docs/npm-staged-trusted-publishing.md +44 -0
- package/examples/01_prompt.sh +60 -0
- package/examples/02_counter.sh +88 -0
- package/examples/02b_counter_w_state.sh +105 -0
- package/examples/03_watch.sh +75 -0
- package/package.json +43 -7
- package/README.md +0 -45
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Self-contained glimpse-cli example: file-backed watch mode.
|
|
5
|
+
# Run from the repo root with: ./examples/03_watch.sh
|
|
6
|
+
|
|
7
|
+
GLIMPSE="${GLIMPSE:-bun src/cli.ts}"
|
|
8
|
+
WINDOW_NAME="glimpse-watch-example"
|
|
9
|
+
WATCH_FILE="${WATCH_FILE:-}"
|
|
10
|
+
if [[ -n "$WATCH_FILE" ]]; then
|
|
11
|
+
WORK_DIR=""
|
|
12
|
+
HTML_FILE="$WATCH_FILE"
|
|
13
|
+
mkdir -p "$(dirname "$HTML_FILE")"
|
|
14
|
+
else
|
|
15
|
+
WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/glimpse-watch-example.XXXXXX")"
|
|
16
|
+
HTML_FILE="$WORK_DIR/watch.html"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
cleanup() {
|
|
20
|
+
$GLIMPSE close -w "$WINDOW_NAME" --force >/dev/null 2>&1 || true
|
|
21
|
+
if [[ -n "$WORK_DIR" ]]; then
|
|
22
|
+
rm -rf "$WORK_DIR"
|
|
23
|
+
fi
|
|
24
|
+
}
|
|
25
|
+
trap cleanup EXIT
|
|
26
|
+
|
|
27
|
+
render_html() {
|
|
28
|
+
local count="$1"
|
|
29
|
+
local color="$2"
|
|
30
|
+
local now
|
|
31
|
+
now="$(date '+%H:%M:%S')"
|
|
32
|
+
cat > "$HTML_FILE" <<HTML
|
|
33
|
+
<!doctype html>
|
|
34
|
+
<html lang="en">
|
|
35
|
+
<head>
|
|
36
|
+
<meta charset="utf-8" />
|
|
37
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
38
|
+
<title>Glimpse Watch Example</title>
|
|
39
|
+
<style>
|
|
40
|
+
:root { color-scheme: dark; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
|
|
41
|
+
body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, ${color}, #020617 68%); color: #f8fafc; }
|
|
42
|
+
main { width: min(390px, calc(100vw - 32px)); padding: 28px; border: 1px solid rgba(148, 163, 184, .35); border-radius: 24px; background: rgba(15, 23, 42, .78); box-shadow: 0 24px 80px rgba(0, 0, 0, .45); text-align: center; }
|
|
43
|
+
h1 { margin: 0 0 8px; font-size: 20px; }
|
|
44
|
+
output { display: block; margin: 20px 0; font-size: 72px; font-weight: 850; line-height: 1; letter-spacing: -0.06em; }
|
|
45
|
+
p { margin: 8px 0 0; color: #cbd5e1; line-height: 1.45; }
|
|
46
|
+
code { color: #a5b4fc; }
|
|
47
|
+
</style>
|
|
48
|
+
</head>
|
|
49
|
+
<body>
|
|
50
|
+
<main>
|
|
51
|
+
<h1>Watch mode reload</h1>
|
|
52
|
+
<p>The shell rewrites this HTML file once per second.</p>
|
|
53
|
+
<output>${count}</output>
|
|
54
|
+
<p>Last write: <code>${now}</code></p>
|
|
55
|
+
</main>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
|
58
|
+
HTML
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
colors=("#1d4ed8" "#7c3aed" "#be123c" "#047857" "#b45309")
|
|
62
|
+
render_html 0 "${colors[0]}"
|
|
63
|
+
|
|
64
|
+
$GLIMPSE open "$HTML_FILE" --watch --name "$WINDOW_NAME" --replace --width 440 --height 420 --title "Glimpse Watch"
|
|
65
|
+
|
|
66
|
+
echo "Opened '$WINDOW_NAME' with --watch."
|
|
67
|
+
echo "Updating $HTML_FILE every second. Press Ctrl-C to stop."
|
|
68
|
+
|
|
69
|
+
count=0
|
|
70
|
+
while true; do
|
|
71
|
+
count=$((count + 1))
|
|
72
|
+
color="${colors[$((count % ${#colors[@]}))]}"
|
|
73
|
+
render_html "$count" "$color"
|
|
74
|
+
sleep 1
|
|
75
|
+
done
|
package/package.json
CHANGED
|
@@ -1,10 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glimpse-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"packageManager": "bun@1.3.14",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22.18.0",
|
|
8
|
+
"bun": ">=1.3.14"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"glimpse": "./dist/cli.mjs"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/bjesuiter/glimpse-cli.git"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md",
|
|
24
|
+
"docs",
|
|
25
|
+
"examples"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsdown",
|
|
29
|
+
"prepack": "bun run build >/dev/null",
|
|
30
|
+
"test": "bun test",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"start": "bun src/cli.ts"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"commander": "^14.0.1",
|
|
36
|
+
"evlog": "^2.18.1",
|
|
37
|
+
"glimpseui": "^0.8.1",
|
|
38
|
+
"valibot": "^1.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/bun": "latest",
|
|
42
|
+
"tsdown": "^0.22.1",
|
|
43
|
+
"typescript": "^5.9.3",
|
|
44
|
+
"unrun": "^0.3.0"
|
|
45
|
+
}
|
|
10
46
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# glimpse-cli
|
|
2
|
-
|
|
3
|
-
## ⚠️ IMPORTANT NOTICE ⚠️
|
|
4
|
-
|
|
5
|
-
**This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
|
|
6
|
-
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `glimpse-cli`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
-
|
|
16
|
-
## What is OIDC Trusted Publishing?
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|