astrowidget 0.1.0__tar.gz
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.
- astrowidget-0.1.0/.claude/commands/clean-branches.md +52 -0
- astrowidget-0.1.0/.claude/commands/commit.md +57 -0
- astrowidget-0.1.0/.claude/commands/create-issue.md +62 -0
- astrowidget-0.1.0/.claude/commands/create-pr.md +56 -0
- astrowidget-0.1.0/.claude/commands/docs.md +107 -0
- astrowidget-0.1.0/.claude/commands/merge-pr.md +51 -0
- astrowidget-0.1.0/.claude/commands/push.md +25 -0
- astrowidget-0.1.0/.claude/commands/release.md +132 -0
- astrowidget-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +90 -0
- astrowidget-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
- astrowidget-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +59 -0
- astrowidget-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +16 -0
- astrowidget-0.1.0/.github/dependabot.yml +10 -0
- astrowidget-0.1.0/.github/release.yml +23 -0
- astrowidget-0.1.0/.github/workflows/publish.yml +50 -0
- astrowidget-0.1.0/.gitignore +211 -0
- astrowidget-0.1.0/.readthedocs.yaml +13 -0
- astrowidget-0.1.0/.zenodo.json +29 -0
- astrowidget-0.1.0/CODE_OF_CONDUCT.md +128 -0
- astrowidget-0.1.0/CONTRIBUTING.md +118 -0
- astrowidget-0.1.0/LICENSE +28 -0
- astrowidget-0.1.0/PKG-INFO +309 -0
- astrowidget-0.1.0/README.md +270 -0
- astrowidget-0.1.0/docs/api/data-io.md +115 -0
- astrowidget-0.1.0/docs/api/sky-viewer.md +81 -0
- astrowidget-0.1.0/docs/api/sky-widget.md +120 -0
- astrowidget-0.1.0/docs/architecture/data-pipeline.md +124 -0
- astrowidget-0.1.0/docs/architecture/decisions.md +45 -0
- astrowidget-0.1.0/docs/architecture/overview.md +115 -0
- astrowidget-0.1.0/docs/architecture/webgl-renderer.md +116 -0
- astrowidget-0.1.0/docs/guides/getting-started.md +135 -0
- astrowidget-0.1.0/docs/guides/hips-backgrounds.md +82 -0
- astrowidget-0.1.0/docs/guides/ovro-lwa.md +117 -0
- astrowidget-0.1.0/docs/index.md +52 -0
- astrowidget-0.1.0/docs/requirements.txt +3 -0
- astrowidget-0.1.0/js/colormap.js +151 -0
- astrowidget-0.1.0/js/inline_widget.js +763 -0
- astrowidget-0.1.0/js/interaction.js +147 -0
- astrowidget-0.1.0/js/projection.js +157 -0
- astrowidget-0.1.0/js/renderer.js +300 -0
- astrowidget-0.1.0/js/widget.js +159 -0
- astrowidget-0.1.0/mkdocs.yml +64 -0
- astrowidget-0.1.0/package-lock.json +1634 -0
- astrowidget-0.1.0/package.json +18 -0
- astrowidget-0.1.0/pixi.lock +5264 -0
- astrowidget-0.1.0/pyproject.toml +100 -0
- astrowidget-0.1.0/src/astrowidget/__init__.py +22 -0
- astrowidget-0.1.0/src/astrowidget/cube.py +119 -0
- astrowidget-0.1.0/src/astrowidget/io.py +133 -0
- astrowidget-0.1.0/src/astrowidget/static/widget.js +6592 -0
- astrowidget-0.1.0/src/astrowidget/static/widget.js.map +1 -0
- astrowidget-0.1.0/src/astrowidget/viewer.py +243 -0
- astrowidget-0.1.0/src/astrowidget/wcs.py +73 -0
- astrowidget-0.1.0/src/astrowidget/widget.py +341 -0
- astrowidget-0.1.0/tests/__init__.py +0 -0
- astrowidget-0.1.0/tests/fixtures/projection_vectors.json +269 -0
- astrowidget-0.1.0/tests/generate_test_vectors.py +161 -0
- astrowidget-0.1.0/tests/js/projection.test.js +120 -0
- astrowidget-0.1.0/tests/test_background.py +82 -0
- astrowidget-0.1.0/tests/test_controls.py +143 -0
- astrowidget-0.1.0/tests/test_cube.py +134 -0
- astrowidget-0.1.0/tests/test_io.py +134 -0
- astrowidget-0.1.0/tests/test_viewer.py +104 -0
- astrowidget-0.1.0/tests/test_widget.py +166 -0
- astrowidget-0.1.0/vite.config.js +18 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Clean up local and remote git branches.
|
|
2
|
+
|
|
3
|
+
## Arguments
|
|
4
|
+
|
|
5
|
+
$ARGUMENTS — optional: "all", "stale", "merged", or a specific branch name. If
|
|
6
|
+
omitted, prompt the user.
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
1. Run these commands in parallel to gather branch information:
|
|
11
|
+
- `git branch` (local branches)
|
|
12
|
+
- `git branch -r` (remote branches, exclude HEAD)
|
|
13
|
+
- `git branch --merged main` (branches merged into main)
|
|
14
|
+
- `git for-each-ref --sort=-committerdate --format='%(refname:short) %(committerdate:relative) %(upstream:track)' refs/heads/`
|
|
15
|
+
(local branches with age and tracking status)
|
|
16
|
+
|
|
17
|
+
2. Categorize each branch (excluding `main` and `feedback-screenshots`):
|
|
18
|
+
|
|
19
|
+
| Category | Definition |
|
|
20
|
+
| ------------------- | ----------------------------------------------------------------- |
|
|
21
|
+
| **Merged** | Branch is in `git branch --merged main` output |
|
|
22
|
+
| **Stale** | Last commit is older than 30 days |
|
|
23
|
+
| **Orphaned remote** | Remote branch exists but no local branch tracks it |
|
|
24
|
+
| **Orphaned local** | Local branch exists but remote is gone (`[gone]` tracking status) |
|
|
25
|
+
| **Active** | Has recent commits and is not merged |
|
|
26
|
+
|
|
27
|
+
3. If `$ARGUMENTS` is empty or unclear:
|
|
28
|
+
- Display a summary table of all branches grouped by category with branch
|
|
29
|
+
name, last commit age, and local/remote status
|
|
30
|
+
- Ask the user which categories to clean: merged, stale, orphaned, or all
|
|
31
|
+
- Wait for the user's response before proceeding
|
|
32
|
+
|
|
33
|
+
4. If `$ARGUMENTS` specifies a category or "all":
|
|
34
|
+
- Show the list of branches that will be deleted
|
|
35
|
+
- Ask for confirmation before proceeding
|
|
36
|
+
|
|
37
|
+
5. Delete branches:
|
|
38
|
+
- Local branches: `git branch -d <name>` (safe delete, merged only) or
|
|
39
|
+
`git branch -D <name>` (if user confirms force delete for unmerged)
|
|
40
|
+
- Remote branches: `git push origin --delete <name>`
|
|
41
|
+
- Run `git fetch --prune` after remote deletions
|
|
42
|
+
|
|
43
|
+
6. Confirm results: show what was deleted and what remains.
|
|
44
|
+
|
|
45
|
+
## Rules
|
|
46
|
+
|
|
47
|
+
- NEVER delete `main`, `master`, or `feedback-screenshots` branches
|
|
48
|
+
- NEVER force-delete (`-D`) without explicit user confirmation
|
|
49
|
+
- Always show what will be deleted before doing it
|
|
50
|
+
- If a branch has unmerged commits, warn the user and ask before force-deleting
|
|
51
|
+
- Run `git fetch --prune` at the end to clean up stale remote refs
|
|
52
|
+
- If there are no branches to clean, say so and exit
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Commit staged and unstaged changes to the current branch.
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
1. Run `git status` (never use `-uall`) and `git diff --stat` to see all
|
|
6
|
+
changes.
|
|
7
|
+
2. Run `git log --oneline -5` to see the commit message style for this repo.
|
|
8
|
+
3. Analyze ALL changes (staged + unstaged) and determine:
|
|
9
|
+
- The conventional commit type: `feat`, `fix`, `refactor`, `docs`, `chore`,
|
|
10
|
+
`style`, `test`, `perf`, `ci`, `build`
|
|
11
|
+
- An optional scope in parentheses based on what area changed (e.g.,
|
|
12
|
+
`marketing`, `platform`, `developer`, `billing`, `db`, `auth`, `worker`,
|
|
13
|
+
`ui`, `tokens`)
|
|
14
|
+
- A concise imperative description of WHY, not WHAT
|
|
15
|
+
4. Do NOT commit files that likely contain secrets (`.env`, `.env.local`,
|
|
16
|
+
credentials, API keys). Warn if any are staged.
|
|
17
|
+
5. Do NOT commit `.DS_Store` files.
|
|
18
|
+
6. Stage relevant untracked files by name (never use `git add -A` or
|
|
19
|
+
`git add .`).
|
|
20
|
+
7. Create the commit using this format:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
git commit -m "$(cat <<'EOF'
|
|
24
|
+
type(scope): short imperative description
|
|
25
|
+
|
|
26
|
+
Optional body explaining the why, not the what.
|
|
27
|
+
Multi-line is fine for complex changes.
|
|
28
|
+
EOF
|
|
29
|
+
)"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
8. Run `git status` after to verify success.
|
|
33
|
+
9. If a pre-commit hook fails, fix the issue and create a NEW commit (never
|
|
34
|
+
amend).
|
|
35
|
+
|
|
36
|
+
## Conventional Commit Types
|
|
37
|
+
|
|
38
|
+
| Type | When to use |
|
|
39
|
+
| ---------- | ------------------------------------------------------- |
|
|
40
|
+
| `feat` | New feature or capability |
|
|
41
|
+
| `fix` | Bug fix |
|
|
42
|
+
| `refactor` | Code change that neither fixes a bug nor adds a feature |
|
|
43
|
+
| `docs` | Documentation only |
|
|
44
|
+
| `chore` | Maintenance, deps, config |
|
|
45
|
+
| `style` | Formatting, whitespace (not CSS) |
|
|
46
|
+
| `test` | Adding or updating tests |
|
|
47
|
+
| `perf` | Performance improvement |
|
|
48
|
+
| `ci` | CI/CD changes |
|
|
49
|
+
| `build` | Build system or tooling |
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Keep the first line under 72 characters
|
|
54
|
+
- Use imperative mood ("add" not "added", "fix" not "fixed")
|
|
55
|
+
- Scope is optional but preferred when changes are localized
|
|
56
|
+
- Never skip hooks (`--no-verify`)
|
|
57
|
+
- Never amend unless explicitly asked
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Create a GitHub issue for tracking work.
|
|
2
|
+
|
|
3
|
+
## Arguments
|
|
4
|
+
|
|
5
|
+
$ARGUMENTS — a description of the issue to create
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
1. Based on `$ARGUMENTS`, determine:
|
|
10
|
+
- **Type**: `feat`, `fix`, `refactor`, `docs`, `chore`, `perf`, `ci`,
|
|
11
|
+
`build`, `test`
|
|
12
|
+
- **Scope**: the area of the codebase affected (e.g., `marketing`,
|
|
13
|
+
`platform`, `developer`, `billing`, `db`, `auth`, `worker`, `ui`, `tokens`,
|
|
14
|
+
`infra`)
|
|
15
|
+
- **Title**: conventional commit format:
|
|
16
|
+
`type(scope): short imperative description`
|
|
17
|
+
|
|
18
|
+
2. Draft a structured issue body with relevant sections:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
gh issue create --title "type(scope): description" --body "$(cat <<'EOF'
|
|
22
|
+
## Summary
|
|
23
|
+
|
|
24
|
+
<1-2 sentences describing the problem or feature>
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
<bulleted list of specific requirements or acceptance criteria>
|
|
29
|
+
- [ ] Requirement 1
|
|
30
|
+
- [ ] Requirement 2
|
|
31
|
+
|
|
32
|
+
## Context
|
|
33
|
+
|
|
34
|
+
<any relevant context, links, or background — omit if not needed>
|
|
35
|
+
|
|
36
|
+
## Implementation Notes
|
|
37
|
+
|
|
38
|
+
<optional technical direction or constraints — omit if not needed>
|
|
39
|
+
EOF
|
|
40
|
+
)"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. Return the issue URL and number to the user.
|
|
44
|
+
|
|
45
|
+
## Title Convention
|
|
46
|
+
|
|
47
|
+
| Type | Example |
|
|
48
|
+
| ----------------- | ------------------------------------------------------------------- |
|
|
49
|
+
| `feat(marketing)` | `feat(marketing): add testimonial carousel to landing page` |
|
|
50
|
+
| `fix(auth)` | `fix(auth): resolve PKCE exchange failure on second localhost port` |
|
|
51
|
+
| `refactor(db)` | `refactor(db): normalize ingredient tables to reduce duplication` |
|
|
52
|
+
| `docs(guides)` | `docs(guides): add Stripe webhook deployment checklist` |
|
|
53
|
+
| `chore(deps)` | `chore(deps): upgrade React to 19.3` |
|
|
54
|
+
|
|
55
|
+
## Rules
|
|
56
|
+
|
|
57
|
+
- Title must use conventional commit format: `type(scope): description`
|
|
58
|
+
- Keep title under 70 characters
|
|
59
|
+
- Use imperative mood ("add" not "adds", "fix" not "fixes")
|
|
60
|
+
- Requirements section should have checkboxes for trackable items
|
|
61
|
+
- Omit sections that aren't relevant (don't pad with empty sections)
|
|
62
|
+
- If `$ARGUMENTS` is vague, ask clarifying questions before creating
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Create a pull request for the current branch.
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
1. Run these commands in parallel to understand the current state:
|
|
6
|
+
- `git status` (never use `-uall`)
|
|
7
|
+
- `git diff --stat` (check for uncommitted changes)
|
|
8
|
+
- `git branch --show-current` (current branch)
|
|
9
|
+
- `git log --oneline main..HEAD` (all commits being PR'd)
|
|
10
|
+
- `git diff main...HEAD --stat` (full diff summary against main)
|
|
11
|
+
|
|
12
|
+
2. If there are uncommitted changes, ask whether to commit first.
|
|
13
|
+
|
|
14
|
+
3. If the branch hasn't been pushed, push with `git push -u origin <branch>`.
|
|
15
|
+
|
|
16
|
+
4. Analyze ALL commits in the branch (not just the latest) to draft:
|
|
17
|
+
- **Title**: Use conventional commit format: `type(scope): short description`
|
|
18
|
+
(under 70 chars)
|
|
19
|
+
- **Body**: Structured summary with test plan
|
|
20
|
+
|
|
21
|
+
5. Create the PR:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
gh pr create --title "type(scope): description" --body "$(cat <<'EOF'
|
|
25
|
+
## Summary
|
|
26
|
+
<1-3 bullet points covering what changed and why>
|
|
27
|
+
|
|
28
|
+
## Changes
|
|
29
|
+
<bulleted list of specific changes, grouped by area if needed>
|
|
30
|
+
|
|
31
|
+
## Test plan
|
|
32
|
+
- [ ] <specific testable checklist items>
|
|
33
|
+
EOF
|
|
34
|
+
)"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
6. If there's a related issue, add `Closes #N` in the body.
|
|
38
|
+
7. Return the PR URL to the user.
|
|
39
|
+
|
|
40
|
+
## Title Convention
|
|
41
|
+
|
|
42
|
+
Use the same conventional commit types as /commit:
|
|
43
|
+
|
|
44
|
+
- `feat(scope):` for new features
|
|
45
|
+
- `fix(scope):` for bug fixes
|
|
46
|
+
- `refactor(scope):` for restructuring
|
|
47
|
+
- `docs(scope):` for documentation
|
|
48
|
+
- `chore(scope):` for maintenance
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
|
|
52
|
+
- Keep title under 70 characters
|
|
53
|
+
- Always include a test plan with specific checkboxes
|
|
54
|
+
- Never create a PR from `main` to `main`
|
|
55
|
+
- If the branch name contains a hint (e.g., `feat/`, `fix/`), use that as the
|
|
56
|
+
commit type
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Write comprehensive documentation for recent work in this session.
|
|
2
|
+
|
|
3
|
+
Arguments: $ARGUMENTS (optional — topic, section, or "all" to regenerate
|
|
4
|
+
broadly)
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
|
|
8
|
+
1. **Gather context** — Run these in parallel to understand what changed:
|
|
9
|
+
- `git log --oneline -20` (recent commits)
|
|
10
|
+
- `git diff main...HEAD --stat` (if on a feature branch)
|
|
11
|
+
- `git log --oneline --since="8 hours ago"` (today's work)
|
|
12
|
+
- Review any open plans in `docs/plans/`
|
|
13
|
+
- Read `docs/index.md` and `mkdocs.yml` for existing structure
|
|
14
|
+
|
|
15
|
+
2. **Determine scope** — Based on the argument and recent changes, decide which
|
|
16
|
+
docs need writing or updating:
|
|
17
|
+
- If argument is a specific topic (e.g., "queues", "auth", "notifications"),
|
|
18
|
+
focus there
|
|
19
|
+
- If argument is a section (e.g., "architecture", "database", "guides"),
|
|
20
|
+
update that section
|
|
21
|
+
- If argument is "all" or empty, document everything from the current session
|
|
22
|
+
- Always check existing docs first — update rather than duplicate
|
|
23
|
+
|
|
24
|
+
3. **Write documentation** covering these categories as relevant:
|
|
25
|
+
|
|
26
|
+
### Technical Details
|
|
27
|
+
- What was built, changed, or fixed
|
|
28
|
+
- API contracts, database schema changes, new RPC functions
|
|
29
|
+
- Configuration changes, environment variables, dependencies added
|
|
30
|
+
- Code patterns introduced or modified
|
|
31
|
+
|
|
32
|
+
### Technical Architecture
|
|
33
|
+
- System design and component relationships
|
|
34
|
+
- Data flow diagrams (use Mermaid syntax)
|
|
35
|
+
- Integration points between services (workers, platform, database)
|
|
36
|
+
- Infrastructure decisions (Cloudflare, Neon, WorkOS, Stripe, etc.)
|
|
37
|
+
|
|
38
|
+
### Session Learnings
|
|
39
|
+
- Decisions made and their rationale (ADR-style: Decision / Why / Result)
|
|
40
|
+
- Technical issues encountered and how they were resolved
|
|
41
|
+
- Trade-offs considered and which path was chosen
|
|
42
|
+
- Gotchas, edge cases, or surprising behavior discovered
|
|
43
|
+
- Things that didn't work and why
|
|
44
|
+
|
|
45
|
+
4. **Place documentation correctly:**
|
|
46
|
+
- New architecture docs → `docs/architecture/`
|
|
47
|
+
- Database changes → `docs/database/`
|
|
48
|
+
- Frontend changes → `docs/frontend/`
|
|
49
|
+
- How-to content → `docs/guides/`
|
|
50
|
+
- Implementation plans → `docs/plans/` (named `YYYY-MM-DD-topic.md`)
|
|
51
|
+
- Session learnings → `docs/guides/architecture-decisions.md` (append new
|
|
52
|
+
entries at top of relevant section)
|
|
53
|
+
- Script documentation → `docs/scripts/`
|
|
54
|
+
|
|
55
|
+
5. **Update mkdocs.yml nav** — If you created a new file, add it to the `nav:`
|
|
56
|
+
section in `mkdocs.yml` under the correct heading. Match existing indentation
|
|
57
|
+
and naming style.
|
|
58
|
+
|
|
59
|
+
6. **Update docs/index.md** — If the new doc is significant, add a link in the
|
|
60
|
+
Documentation section of `docs/index.md` with a one-line description.
|
|
61
|
+
|
|
62
|
+
7. **Verify** — Run `pixi run docs-build` to confirm MkDocs builds without
|
|
63
|
+
errors.
|
|
64
|
+
|
|
65
|
+
8. **Report** — Show the user:
|
|
66
|
+
- Files created or updated (with paths)
|
|
67
|
+
- New nav entries added
|
|
68
|
+
- Build status (pass/fail)
|
|
69
|
+
|
|
70
|
+
## Documentation Style
|
|
71
|
+
|
|
72
|
+
- Use MkDocs Material features: admonitions (`!!! note`, `!!! warning`,
|
|
73
|
+
`!!! tip`), tabs, Mermaid diagrams, code blocks with language tags
|
|
74
|
+
- Start every doc with a level-1 heading and a 1-2 sentence summary
|
|
75
|
+
- Use tables for structured data (configs, env vars, field mappings)
|
|
76
|
+
- Keep headings hierarchical (h1 → h2 → h3, never skip levels)
|
|
77
|
+
- Use imperative voice for guides ("Run the migration", not "You should run the
|
|
78
|
+
migration")
|
|
79
|
+
- Architecture decisions follow the pattern:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
### YYYY-MM-DD: Decision Title (Status)
|
|
83
|
+
|
|
84
|
+
- **Decision:** What was decided
|
|
85
|
+
- **Why:** The reasoning and constraints
|
|
86
|
+
- **Result:** What was implemented and any notable outcomes
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Mermaid Diagram Conventions
|
|
90
|
+
|
|
91
|
+
- Use `graph TD` for top-down architecture diagrams
|
|
92
|
+
- Use `sequenceDiagram` for request/response flows
|
|
93
|
+
- Use `erDiagram` for database relationships
|
|
94
|
+
- Keep diagrams focused — split complex systems into multiple diagrams
|
|
95
|
+
- Label edges with the protocol or mechanism (e.g., `-->|JWT|`, `-->|REST|`,
|
|
96
|
+
`-->|Queue|`)
|
|
97
|
+
|
|
98
|
+
## Rules
|
|
99
|
+
|
|
100
|
+
- Never delete existing documentation — update or extend it
|
|
101
|
+
- Always read existing docs before writing to avoid duplication
|
|
102
|
+
- Every new doc must appear in `mkdocs.yml` nav
|
|
103
|
+
- Date-stamp architecture decisions and plans
|
|
104
|
+
- Use relative links between docs (e.g., `../guides/getting-started.md`)
|
|
105
|
+
- Build must pass before considering the task done
|
|
106
|
+
- If `pixi run docs-build` fails, fix the issue (usually a nav mismatch or
|
|
107
|
+
broken link)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Merge a pull request and clean up branches.
|
|
2
|
+
|
|
3
|
+
## Arguments
|
|
4
|
+
|
|
5
|
+
$ARGUMENTS — PR number or URL (optional, defaults to current branch's PR)
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
1. Determine the PR:
|
|
10
|
+
- If `$ARGUMENTS` is provided, use it as the PR number or URL
|
|
11
|
+
- If not, find the PR for the current branch:
|
|
12
|
+
`gh pr view --json number,title,state,headRefName`
|
|
13
|
+
|
|
14
|
+
2. Check PR status:
|
|
15
|
+
- `gh pr view <number> --json state,mergeable,mergeStateStatus,statusCheckRollup,title,headRefName`
|
|
16
|
+
- If checks are failing, warn the user and ask whether to proceed
|
|
17
|
+
- If there are merge conflicts, tell the user and stop
|
|
18
|
+
|
|
19
|
+
3. Check for local uncommitted changes:
|
|
20
|
+
- `git status`
|
|
21
|
+
- If there are unstaged changes, stash them before proceeding: `git stash`
|
|
22
|
+
|
|
23
|
+
4. Merge the PR:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
gh pr merge <number> --squash --delete-branch
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use `--squash` by default (consistent with this repo's history).
|
|
30
|
+
|
|
31
|
+
5. Clean up locally:
|
|
32
|
+
- Switch to main if not already: `git checkout main`
|
|
33
|
+
- Pull the merged changes: `git pull origin main`
|
|
34
|
+
- Prune stale remote refs: `git fetch --prune`
|
|
35
|
+
- Delete the local branch if it still exists: `git branch -d <branch-name>`
|
|
36
|
+
- If changes were stashed, restore them: `git stash pop`
|
|
37
|
+
|
|
38
|
+
6. Verify cleanup:
|
|
39
|
+
- `git branch -a | grep <branch-name>` to confirm branch is gone everywhere
|
|
40
|
+
|
|
41
|
+
7. Confirm: "PR #N merged into main. Branch `<name>` deleted locally and
|
|
42
|
+
remotely."
|
|
43
|
+
|
|
44
|
+
## Rules
|
|
45
|
+
|
|
46
|
+
- Default merge strategy is `--squash` (produces clean linear history)
|
|
47
|
+
- If user asks for a merge commit, use `--merge` instead
|
|
48
|
+
- If user asks for rebase, use `--rebase` instead
|
|
49
|
+
- NEVER force-delete branches (`-D`), use `-d` which is safe
|
|
50
|
+
- Always restore stashed changes after merge
|
|
51
|
+
- If the merge fails, do NOT retry destructively — report the error
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Push the current branch to the remote repository.
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
1. Run `git status` to check:
|
|
6
|
+
- Current branch name
|
|
7
|
+
- Whether there are uncommitted changes (warn the user if so)
|
|
8
|
+
- Whether the branch tracks a remote
|
|
9
|
+
2. Run `git log --oneline origin/$(git branch --show-current)..HEAD 2>/dev/null`
|
|
10
|
+
to see unpushed commits. If the remote branch doesn't exist yet, show all
|
|
11
|
+
commits since diverging from `main`.
|
|
12
|
+
3. Show the user what will be pushed (branch name + commit list).
|
|
13
|
+
4. Push:
|
|
14
|
+
- If the branch has no upstream yet: `git push -u origin <branch-name>`
|
|
15
|
+
- If it already tracks a remote: `git push`
|
|
16
|
+
5. Confirm success.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- NEVER force push (`--force`, `-f`) unless the user explicitly asks
|
|
21
|
+
- NEVER force push to `main` or `master` — warn the user and refuse
|
|
22
|
+
- If there are uncommitted changes, ask whether to commit first (using /commit
|
|
23
|
+
conventions) or push what's already committed
|
|
24
|
+
- If push is rejected due to remote changes, suggest `git pull --rebase` and ask
|
|
25
|
+
before proceeding
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Create a versioned release that triggers PyPI publishing via trusted publisher.
|
|
2
|
+
|
|
3
|
+
## Arguments
|
|
4
|
+
|
|
5
|
+
$ARGUMENTS — version bump type: `patch`, `minor`, or `major` (optional, defaults
|
|
6
|
+
to analyzing changes)
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
1. Determine the version bump:
|
|
11
|
+
- If `$ARGUMENTS` specifies `patch`, `minor`, or `major`, use that
|
|
12
|
+
- If not specified, analyze commits since the last tag to determine:
|
|
13
|
+
- `major`: breaking changes (commits with `!` or `BREAKING CHANGE`)
|
|
14
|
+
- `minor`: new features (`feat:` commits)
|
|
15
|
+
- `patch`: fixes, refactors, docs, chores only
|
|
16
|
+
|
|
17
|
+
2. Get the current version:
|
|
18
|
+
- Check `git tag --sort=-v:refname | head -1` for the latest tag
|
|
19
|
+
- If no tags exist, start at `v0.1.0`
|
|
20
|
+
- Also check `pyproject.toml` `version` field
|
|
21
|
+
|
|
22
|
+
3. Calculate the new version following semver.
|
|
23
|
+
|
|
24
|
+
4. Verify readiness:
|
|
25
|
+
- `git status` — must be on `main` with no uncommitted changes
|
|
26
|
+
- `git pull origin main` — must be up to date
|
|
27
|
+
- Warn and stop if not on `main` or if there are uncommitted changes
|
|
28
|
+
|
|
29
|
+
5. Update the version in `pyproject.toml`:
|
|
30
|
+
- Change `version = "X.Y.Z"` to the new version
|
|
31
|
+
- Also update `__version__` in `src/astrowidget/__init__.py`
|
|
32
|
+
|
|
33
|
+
6. Ensure the JS bundle is current:
|
|
34
|
+
- Copy `js/inline_widget.js` to `src/astrowidget/static/widget.js`
|
|
35
|
+
- Verify `src/astrowidget/static/widget.js` exists
|
|
36
|
+
|
|
37
|
+
7. Run tests to verify everything works:
|
|
38
|
+
```bash
|
|
39
|
+
pixi run test-py
|
|
40
|
+
```
|
|
41
|
+
Stop if tests fail.
|
|
42
|
+
|
|
43
|
+
8. Verify the package builds:
|
|
44
|
+
```bash
|
|
45
|
+
pip install build && python -m build
|
|
46
|
+
```
|
|
47
|
+
Check that `dist/astrowidget-X.Y.Z-py3-none-any.whl` contains
|
|
48
|
+
`astrowidget/static/widget.js`.
|
|
49
|
+
|
|
50
|
+
9. Commit the version bump:
|
|
51
|
+
```bash
|
|
52
|
+
git add pyproject.toml src/astrowidget/__init__.py src/astrowidget/static/widget.js
|
|
53
|
+
git commit -m "chore(release): prepare vX.Y.Z"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
10. Create the git tag:
|
|
57
|
+
```bash
|
|
58
|
+
git tag -a vX.Y.Z -m "vX.Y.Z"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
11. Ask for confirmation before pushing.
|
|
62
|
+
|
|
63
|
+
12. Push the commit and tag:
|
|
64
|
+
```bash
|
|
65
|
+
git push origin main --follow-tags
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
13. Create a GitHub release (triggers the publish workflow):
|
|
69
|
+
```bash
|
|
70
|
+
gh release create vX.Y.Z --title "vX.Y.Z" \
|
|
71
|
+
--generate-notes \
|
|
72
|
+
--latest
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This uses `.github/release.yml` to auto-generate categorized release notes:
|
|
76
|
+
- PRs labeled `breaking` appear under **Breaking Changes**
|
|
77
|
+
- PRs labeled `enhancement` appear under **New Features**
|
|
78
|
+
- PRs labeled `bug` appear under **Bug Fixes**
|
|
79
|
+
- PRs labeled `documentation` appear under **Documentation**
|
|
80
|
+
- All other PRs appear under **Other Changes**
|
|
81
|
+
- Commits from `dependabot` and `pre-commit-ci` are excluded
|
|
82
|
+
|
|
83
|
+
The `.github/workflows/publish.yml` workflow will then automatically:
|
|
84
|
+
- Build the JS bundle and Python package
|
|
85
|
+
- Publish to PyPI via trusted publisher (OIDC)
|
|
86
|
+
|
|
87
|
+
14. Confirm: "Released vX.Y.Z — <release URL>"
|
|
88
|
+
- Remind user to check the GitHub Actions run for PyPI publish status
|
|
89
|
+
|
|
90
|
+
## Prerequisites
|
|
91
|
+
|
|
92
|
+
Before the first release, the following must be configured:
|
|
93
|
+
|
|
94
|
+
1. **PyPI**: Add a pending trusted publisher at
|
|
95
|
+
[pypi.org/manage/account/publishing](https://pypi.org/manage/account/publishing/)
|
|
96
|
+
with owner=`uw-ssec`, repo=`astrowidget`, workflow=`publish.yml`,
|
|
97
|
+
environment=`pypi`
|
|
98
|
+
|
|
99
|
+
2. **GitHub**: Create a `pypi` environment in the repo settings
|
|
100
|
+
(Settings → Environments → New environment → name it `pypi`)
|
|
101
|
+
|
|
102
|
+
## Version Guidelines
|
|
103
|
+
|
|
104
|
+
| Bump | When | Example |
|
|
105
|
+
| --------------- | ---------------------------------- | -------------------- |
|
|
106
|
+
| `patch` (0.1.X) | Bug fixes, docs, chores, refactors | `v0.1.1` → `v0.1.2` |
|
|
107
|
+
| `minor` (0.X.0) | New features, non-breaking changes | `v0.1.2` → `v0.2.0` |
|
|
108
|
+
| `major` (X.0.0) | Breaking changes, major rewrites | `v0.2.0` → `v1.0.0` |
|
|
109
|
+
|
|
110
|
+
## Release Note Labels
|
|
111
|
+
|
|
112
|
+
For the auto-generated release notes to categorize PRs correctly, apply these
|
|
113
|
+
labels to PRs before merging:
|
|
114
|
+
|
|
115
|
+
| Label | Release Notes Section |
|
|
116
|
+
|---|---|
|
|
117
|
+
| `breaking` | Breaking Changes |
|
|
118
|
+
| `enhancement` | New Features |
|
|
119
|
+
| `bug` | Bug Fixes |
|
|
120
|
+
| `documentation` | Documentation |
|
|
121
|
+
| `ignore-for-release` | Excluded from notes |
|
|
122
|
+
|
|
123
|
+
PRs without these labels appear under **Other Changes**.
|
|
124
|
+
|
|
125
|
+
## Rules
|
|
126
|
+
|
|
127
|
+
- Must be on `main` branch with no uncommitted changes
|
|
128
|
+
- All tests must pass before releasing
|
|
129
|
+
- Never create a release from a feature branch
|
|
130
|
+
- Tag format is always `vX.Y.Z` (with `v` prefix)
|
|
131
|
+
- The wheel must include `astrowidget/static/widget.js`
|
|
132
|
+
- Ask for confirmation before pushing the tag and creating the release
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in astrowidget
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to report a bug. Please fill out the sections below
|
|
9
|
+
so we can reproduce and fix the issue.
|
|
10
|
+
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: description
|
|
13
|
+
attributes:
|
|
14
|
+
label: Description
|
|
15
|
+
description: A clear and concise description of the bug.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: reproduce
|
|
21
|
+
attributes:
|
|
22
|
+
label: Steps to Reproduce
|
|
23
|
+
description: Minimal steps or code to reproduce the behavior.
|
|
24
|
+
placeholder: |
|
|
25
|
+
1. Load data with `open_dataset("...")`
|
|
26
|
+
2. Call `widget.set_dataset(ds)`
|
|
27
|
+
3. Click on the sphere
|
|
28
|
+
4. See error in browser console
|
|
29
|
+
validations:
|
|
30
|
+
required: true
|
|
31
|
+
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: expected
|
|
34
|
+
attributes:
|
|
35
|
+
label: Expected Behavior
|
|
36
|
+
description: What you expected to happen.
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
|
|
40
|
+
- type: textarea
|
|
41
|
+
id: actual
|
|
42
|
+
attributes:
|
|
43
|
+
label: Actual Behavior
|
|
44
|
+
description: What actually happened. Include error messages or screenshots if applicable.
|
|
45
|
+
validations:
|
|
46
|
+
required: true
|
|
47
|
+
|
|
48
|
+
- type: input
|
|
49
|
+
id: python-version
|
|
50
|
+
attributes:
|
|
51
|
+
label: Python Version
|
|
52
|
+
placeholder: "3.12.0"
|
|
53
|
+
validations:
|
|
54
|
+
required: true
|
|
55
|
+
|
|
56
|
+
- type: dropdown
|
|
57
|
+
id: environment
|
|
58
|
+
attributes:
|
|
59
|
+
label: Jupyter Environment
|
|
60
|
+
options:
|
|
61
|
+
- JupyterLab
|
|
62
|
+
- Jupyter Notebook (classic)
|
|
63
|
+
- VS Code
|
|
64
|
+
- Other
|
|
65
|
+
validations:
|
|
66
|
+
required: true
|
|
67
|
+
|
|
68
|
+
- type: input
|
|
69
|
+
id: browser
|
|
70
|
+
attributes:
|
|
71
|
+
label: Browser
|
|
72
|
+
placeholder: "Chrome 124, Firefox 126, Safari 17"
|
|
73
|
+
validations:
|
|
74
|
+
required: true
|
|
75
|
+
|
|
76
|
+
- type: input
|
|
77
|
+
id: os
|
|
78
|
+
attributes:
|
|
79
|
+
label: Operating System
|
|
80
|
+
placeholder: "macOS 15, Ubuntu 24.04, Windows 11"
|
|
81
|
+
validations:
|
|
82
|
+
required: false
|
|
83
|
+
|
|
84
|
+
- type: textarea
|
|
85
|
+
id: additional
|
|
86
|
+
attributes:
|
|
87
|
+
label: Additional Context
|
|
88
|
+
description: Any other context -- sample data, console logs, screenshots, etc.
|
|
89
|
+
validations:
|
|
90
|
+
required: false
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: SSEC Contributing Guidelines
|
|
4
|
+
url: https://github.com/uw-ssec/.github/blob/main/CONTRIBUTING.md
|
|
5
|
+
about: Organization-wide contribution guidelines and AI-usage policy
|
|
6
|
+
- name: Documentation
|
|
7
|
+
url: https://uw-ssec.github.io/astrowidget
|
|
8
|
+
about: Check the docs before filing -- your question may already be answered
|