jupyterlab-basic-terminal-extension 1.0.4__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.
- jupyterlab_basic_terminal_extension-1.0.4/.claude/CLAUDE.md +83 -0
- jupyterlab_basic_terminal_extension-1.0.4/.claude/JOURNAL.md +14 -0
- jupyterlab_basic_terminal_extension-1.0.4/.copier-answers.yml +17 -0
- jupyterlab_basic_terminal_extension-1.0.4/.gitignore +128 -0
- jupyterlab_basic_terminal_extension-1.0.4/.prettierignore +6 -0
- jupyterlab_basic_terminal_extension-1.0.4/.yarnrc.yml +2 -0
- jupyterlab_basic_terminal_extension-1.0.4/CHANGELOG.md +5 -0
- jupyterlab_basic_terminal_extension-1.0.4/LICENSE +29 -0
- jupyterlab_basic_terminal_extension-1.0.4/Makefile +130 -0
- jupyterlab_basic_terminal_extension-1.0.4/PKG-INFO +98 -0
- jupyterlab_basic_terminal_extension-1.0.4/README.md +34 -0
- jupyterlab_basic_terminal_extension-1.0.4/RELEASE.md +80 -0
- jupyterlab_basic_terminal_extension-1.0.4/babel.config.js +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/conftest.py +8 -0
- jupyterlab_basic_terminal_extension-1.0.4/install.json +5 -0
- jupyterlab_basic_terminal_extension-1.0.4/jest.config.js +28 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyter-config/server-config/jupyterlab_basic_terminal_extension.json +7 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/__init__.py +36 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/_version.py +4 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/labextension/package.json +215 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/labextension/static/728.a25d41edb6143d6a757e.js +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/labextension/static/750.02aabe6e0e0039a3f480.js +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/labextension/static/remoteEntry.045071124c199f15feec.js +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/labextension/static/style.js +4 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/labextension/static/third-party-licenses.json +16 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/routes.py +108 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/tests/__init__.py +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/jupyterlab_basic_terminal_extension/tests/test_routes.py +67 -0
- jupyterlab_basic_terminal_extension-1.0.4/logs/README.md +12 -0
- jupyterlab_basic_terminal_extension-1.0.4/package-lock.json +15411 -0
- jupyterlab_basic_terminal_extension-1.0.4/package.json +210 -0
- jupyterlab_basic_terminal_extension-1.0.4/pyproject.toml +91 -0
- jupyterlab_basic_terminal_extension-1.0.4/setup.py +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/src/__tests__/jupyterlab_basic_terminal_extension.spec.ts +9 -0
- jupyterlab_basic_terminal_extension-1.0.4/src/index.ts +72 -0
- jupyterlab_basic_terminal_extension-1.0.4/src/request.ts +51 -0
- jupyterlab_basic_terminal_extension-1.0.4/style/base.css +5 -0
- jupyterlab_basic_terminal_extension-1.0.4/style/index.css +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/style/index.js +1 -0
- jupyterlab_basic_terminal_extension-1.0.4/tsconfig.json +26 -0
- jupyterlab_basic_terminal_extension-1.0.4/tsconfig.test.json +3 -0
- jupyterlab_basic_terminal_extension-1.0.4/ui-tests/README.md +167 -0
- jupyterlab_basic_terminal_extension-1.0.4/ui-tests/jupyter_server_test_config.py +12 -0
- jupyterlab_basic_terminal_extension-1.0.4/ui-tests/package.json +15 -0
- jupyterlab_basic_terminal_extension-1.0.4/ui-tests/playwright.config.js +14 -0
- jupyterlab_basic_terminal_extension-1.0.4/ui-tests/tests/jupyterlab_basic_terminal_extension.spec.ts +25 -0
- jupyterlab_basic_terminal_extension-1.0.4/ui-tests/yarn.lock +0 -0
- jupyterlab_basic_terminal_extension-1.0.4/yarn.lock +10741 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!-- @import /home/lab/workspace/.claude/CLAUDE.md -->
|
|
2
|
+
|
|
3
|
+
# Project-Specific Configuration
|
|
4
|
+
|
|
5
|
+
This file imports workspace-level configuration from `/home/lab/workspace/.claude/CLAUDE.md`.
|
|
6
|
+
All workspace rules apply. Project-specific rules below strengthen or extend them.
|
|
7
|
+
|
|
8
|
+
The workspace `/home/lab/workspace/.claude/` directory contains additional instruction files
|
|
9
|
+
(MERMAID.md, NOTEBOOK.md, DATASCIENCE.md, GIT.md, and others) referenced by CLAUDE.md.
|
|
10
|
+
Consult workspace CLAUDE.md and the .claude directory to discover all applicable standards.
|
|
11
|
+
|
|
12
|
+
## Mandatory Bans (Reinforced)
|
|
13
|
+
|
|
14
|
+
The following workspace rules are STRICTLY ENFORCED for this project:
|
|
15
|
+
|
|
16
|
+
- **No automatic git tags** - only create tags when user explicitly requests
|
|
17
|
+
- **No automatic version changes** - only modify version in package.json/pyproject.toml/etc. when user explicitly requests
|
|
18
|
+
- **No automatic publishing** - never run `make publish`, `npm publish`, `twine upload`, or similar without explicit user request
|
|
19
|
+
- **No manual package installs if Makefile exists** - use `make install` or equivalent Makefile targets, not direct `pip install`/`uv install`/`npm install`/`jlpm install`
|
|
20
|
+
- **No automatic git commits or pushes** - only when user explicitly requests
|
|
21
|
+
|
|
22
|
+
## Project Context
|
|
23
|
+
|
|
24
|
+
`jupyterlab_basic_terminal_extension` is a JupyterLab 4 extension that exposes a command for launching a utility terminal that runs without a shell. The terminal is intended for short-lived console utilities - when the utility process exits, the terminal window/tab closes automatically.
|
|
25
|
+
|
|
26
|
+
**Technology Stack**:
|
|
27
|
+
|
|
28
|
+
- JupyterLab 4 (`@jupyterlab/application`, `@jupyterlab/coreutils`, `@jupyterlab/services`)
|
|
29
|
+
- TypeScript 5 frontend (`src/`) compiled to `lib/` and bundled into `jupyterlab_basic_terminal_extension/labextension/`
|
|
30
|
+
- Python 3.10+ server extension (`jupyterlab_basic_terminal_extension/`) using `jupyter_server`
|
|
31
|
+
- Hatch + `hatch-jupyter-builder` build backend defined in `pyproject.toml`
|
|
32
|
+
- Jest for frontend unit tests, Pytest for server tests, Playwright + Galata for UI integration tests in `ui-tests/`
|
|
33
|
+
- jupyter-releaser for tagged releases via GitHub Actions
|
|
34
|
+
|
|
35
|
+
**Project Naming**:
|
|
36
|
+
|
|
37
|
+
- npm package: `jupyterlab_basic_terminal_extension`
|
|
38
|
+
- PyPI package: `jupyterlab-basic-terminal-extension` (hyphens, normalized by PyPI)
|
|
39
|
+
|
|
40
|
+
## Required Workspace Skills
|
|
41
|
+
|
|
42
|
+
The following workspace skills MUST be referenced when their domain is in scope. They live at
|
|
43
|
+
`/home/lab/workspace/.claude/skills/` (with a fallback to `/home/lab/.claude/skills/` for the
|
|
44
|
+
home-global copies). Discover via the SKILL.md frontmatter in each skill directory.
|
|
45
|
+
|
|
46
|
+
- **jupyterlab-extension** - JupyterLab extension development guidelines, testing strategy, jupyter-releaser CI/CD workflows, common caveats, TypeScript compatibility, syntax highlighting, local development patterns. MUST be consulted for any work on this extension's source, build, tests, or release pipeline.
|
|
47
|
+
- **playwright** - Browser automation for screenshots and UI verification. MUST be used when capturing screenshots for `README.md`, the `.resources/` folder, or when programmatically verifying the extension's behaviour inside a running JupyterLab instance.
|
|
48
|
+
|
|
49
|
+
## Makefile Synchronization
|
|
50
|
+
|
|
51
|
+
**MANDATORY**: At the start of every session that touches build, install, publish, or test
|
|
52
|
+
targets, compare the local `Makefile` version header against the canonical Makefile at
|
|
53
|
+
`/home/lab/workspace/private/jupyterlab/@utils/jupyterlab-extensions/Makefile`. The version
|
|
54
|
+
is declared on the first line as `# Makefile for Jupyterlab extensions version X.YY`.
|
|
55
|
+
|
|
56
|
+
- If the canonical Makefile has a higher version, update the local `Makefile` to match before doing any other build-related work
|
|
57
|
+
- Preserve any project-local additions when porting forward, but treat the canonical file as the source of truth for shared targets
|
|
58
|
+
- After updating, mention the version bump explicitly to the user (do not commit silently)
|
|
59
|
+
|
|
60
|
+
## Build and Install
|
|
61
|
+
|
|
62
|
+
**MANDATORY**: Always install via `make install`. Never run `pip install`, `jlpm install`,
|
|
63
|
+
`npm install`, or `python -m build` directly - the Makefile orchestrates the correct ordering
|
|
64
|
+
(clean -> increment_version -> dependency check -> npm/jlpm install -> prettier -> python build
|
|
65
|
+
-> pip install of the wheel). Direct invocations skip steps and produce inconsistent state.
|
|
66
|
+
|
|
67
|
+
The `build` target also runs `prettier --write` against `package.json` and `package-lock.json`,
|
|
68
|
+
so both files MUST be kept under version control and committed together whenever either changes.
|
|
69
|
+
Do not gitignore `package-lock.json` - reproducible installs depend on it.
|
|
70
|
+
|
|
71
|
+
## Journal Rules (Project-Specific)
|
|
72
|
+
|
|
73
|
+
- **APPEND ONLY**: New journal entries MUST be appended at the end of the file, never inserted between existing entries
|
|
74
|
+
- Entries maintain strict chronological order by position - the last entry in the file is always the most recent work
|
|
75
|
+
- Never reorder, move, or insert entries out of sequence
|
|
76
|
+
- The Stellars **journal plugin** is the canonical tool for this file: create via `/journal:create`, append via `/journal:update`, archive via `/journal:archive`. The `journal:journal` skill auto-triggers on any mention of "journal" and runs `journal-tools check` after every write
|
|
77
|
+
- Direct edits to `JOURNAL.md` are a last resort - prefer the plugin so modus secundis format, continuous numbering and append-only order are enforced automatically
|
|
78
|
+
|
|
79
|
+
## Strengthened Rules
|
|
80
|
+
|
|
81
|
+
- **GitHub project**: This repository is hosted on GitHub. Follow the `my-repository` skill for badge templates, naming conventions, and link-checker configuration. README badges already include GitHub Actions, npm, PyPI, pepy downloads, JupyterLab 4, KOLOMOLO, and PayPal donate
|
|
82
|
+
- **JupyterLab extension specifics**: Always follow the `jupyterlab-extension` skill for release flow (jupyter-releaser), TypeScript pinning compatible with `@jupyterlab/builder`, syntax-highlighting peer dependencies, and local development install patterns
|
|
83
|
+
- **Playwright for UI verification**: When asked to verify a feature, capture a screenshot, or reproduce a UI bug, use the `playwright` skill rather than guessing from source code
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Claude Code Journal
|
|
2
|
+
|
|
3
|
+
This journal tracks substantive work on documents, diagrams, and documentation content.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
1. **Task - Project initialization** (v0.1.0): Bootstrapped `jupyterlab_basic_terminal_extension` as a new JupyterLab 4 extension with Claude configuration, README, and initial git import<br>
|
|
8
|
+
**Result**: Project was scaffolded from the JupyterLab copier template (TypeScript frontend in `src/`, Python server extension in `jupyterlab_basic_terminal_extension/`, hatch/`hatch-jupyter-builder` build backend, Jest + Pytest + Playwright/Galata stack, jupyter-releaser CI). Replaced the inlined `.claude/CLAUDE.md` with a thin import of the workspace file plus sections for Mandatory Bans, Required Workspace Skills (`jupyterlab-extension`, `playwright`), mandatory Makefile sync against `@utils/jupyterlab-extensions/Makefile` v1.31, mandatory `make install`, and keeping both `package.json` and `package-lock.json` versioned. Rewrote `README.md` after the `jupyterlab_terminal_show_in_file_browser_extension` pattern - kept up to `## Uninstall`, added the full workspace badge set (GitHub Actions, npm, PyPI, pepy, JupyterLab 4, KOLOMOLO, PayPal) and a Features section. Ran `git init -b main` and made the initial import commit.
|
|
9
|
+
|
|
10
|
+
2. **Task - Hybrid shell-less terminal launch** (v0.6.4): Implemented the core capability - generic `basic-terminal:launch` JL command spawning a JupyterLab terminal whose pty's only process is a caller-supplied `argv`, with auto-focus on launch and auto-close on exit<br>
|
|
11
|
+
**Result**: Replaced the scaffold `HelloRouteHandler` in `jupyterlab_basic_terminal_extension/routes.py` with `LaunchTerminalHandler` (`POST /launch-terminal`), modelled on `jupyterlab_claude_code_extension/routes.py:198-253`. Backend validates `argv` as a non-empty list of non-empty strings and optional `cwd` as an existing directory, then calls `terminal_manager.create(shell_command=argv, cwd=cwd)` - terminado's per-call `shell_command` kwarg replaces the user's `$SHELL` so the pty has no surrounding bash. Returns `{terminal_name}` handling both dict-like and object-like model returns. Rewrote `src/index.ts` to register the JL command (programmatic-only, no menu/palette helper) accepting `{argv, cwd?}`, POSTing to the backend, attaching the standard JL widget via `terminal:open`, focusing it via `app.shell.activateById`, and disposing the widget on `session.disposed` or `connectionStatusChanged === 'disconnected'` so the tab closes the moment the underlying process exits. Added parametrized `test_routes.py` covering invalid_json/argv/cwd plus happy-path with and without cwd. Bumped `package.json` to `0.6.4` per explicit request. No new npm/python deps; `Makefile` already at canonical v1.31.
|
|
12
|
+
|
|
13
|
+
3. **Task - Terminal-init wait, CI hardening, first PyPI release** (v1.0.3): Server-side init waiter so TUI tools see a real pty size at launch; fixed metadata that crashed PyPI; tightened CI<br>
|
|
14
|
+
**Result**: `LaunchTerminalHandler` in `routes.py` wraps argv via `_wrap_with_init` -> `["/bin/bash","-c",_INIT_WAITER,"basic-terminal-init",*argv]`. `_INIT_WAITER` polls `stty size` up to 5s (50 x 0.1s) until rows>=20 and cols>=80, clears, then `exec "$@"` - pty's only process becomes the target so auto-close still fires. Eliminates per-caller init loops like `/opt/utils/launch-lab-utils.sh`. Fixed v0.6.5 PyPI 400: `package.json` `homepage`, `bugs.url`, `repository.url` were copier defaults that `hatch-nodejs-version` propagated into wheel `Project-URL` lines PyPI rejected; set all to the GitHub URLs. `build.yml` `check_links` ignores npm/pepy badge URLs; `check-release.yml` adds `steps_to_skip: build-changelog` and `RH_SINCE_LAST_STABLE: 'true'` so jupyter-releaser tolerates a no-prior-tag repo. Tracking `package-lock.json` + `yarn.lock`. Added as workspace submodule.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v4.5.2
|
|
3
|
+
_src_path: https://github.com/jupyterlab/extension-template
|
|
4
|
+
author_email: konrad.jelen@gmail.com
|
|
5
|
+
author_name: Stellars Henson
|
|
6
|
+
has_ai_rules: false
|
|
7
|
+
has_binder: false
|
|
8
|
+
has_settings: false
|
|
9
|
+
kind: frontend-and-server
|
|
10
|
+
labextension_name: jupyterlab_basic_terminal_extension
|
|
11
|
+
project_short_description: Jupyterlab extension to make a command that allows launching
|
|
12
|
+
a utility terminal that runs without shell. This can be used to start and show
|
|
13
|
+
console utilities, that when finished - close the terminal window / tab
|
|
14
|
+
python_name: jupyterlab_basic_terminal_extension
|
|
15
|
+
repository: ''
|
|
16
|
+
test: true
|
|
17
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
*.bundle.*
|
|
2
|
+
lib/
|
|
3
|
+
node_modules/
|
|
4
|
+
*.log
|
|
5
|
+
.eslintcache
|
|
6
|
+
.stylelintcache
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.ipynb_checkpoints
|
|
9
|
+
*.tsbuildinfo
|
|
10
|
+
jupyterlab_basic_terminal_extension/labextension
|
|
11
|
+
# Version file is handled by hatchling
|
|
12
|
+
jupyterlab_basic_terminal_extension/_version.py
|
|
13
|
+
|
|
14
|
+
# Integration tests
|
|
15
|
+
ui-tests/test-results/
|
|
16
|
+
ui-tests/playwright-report/
|
|
17
|
+
|
|
18
|
+
# Created by https://www.gitignore.io/api/python
|
|
19
|
+
# Edit at https://www.gitignore.io/?templates=python
|
|
20
|
+
|
|
21
|
+
### Python ###
|
|
22
|
+
# Virtual environments
|
|
23
|
+
.venv
|
|
24
|
+
|
|
25
|
+
# Byte-compiled / optimized / DLL files
|
|
26
|
+
__pycache__/
|
|
27
|
+
*.py[cod]
|
|
28
|
+
*$py.class
|
|
29
|
+
|
|
30
|
+
# C extensions
|
|
31
|
+
*.so
|
|
32
|
+
|
|
33
|
+
# Distribution / packaging
|
|
34
|
+
.Python
|
|
35
|
+
build/
|
|
36
|
+
develop-eggs/
|
|
37
|
+
dist/
|
|
38
|
+
downloads/
|
|
39
|
+
eggs/
|
|
40
|
+
.eggs/
|
|
41
|
+
lib/
|
|
42
|
+
lib64/
|
|
43
|
+
parts/
|
|
44
|
+
sdist/
|
|
45
|
+
var/
|
|
46
|
+
wheels/
|
|
47
|
+
pip-wheel-metadata/
|
|
48
|
+
share/python-wheels/
|
|
49
|
+
.installed.cfg
|
|
50
|
+
*.egg
|
|
51
|
+
MANIFEST
|
|
52
|
+
|
|
53
|
+
# PyInstaller
|
|
54
|
+
# Usually these files are written by a python script from a template
|
|
55
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
56
|
+
*.manifest
|
|
57
|
+
*.spec
|
|
58
|
+
|
|
59
|
+
# Installer logs
|
|
60
|
+
pip-log.txt
|
|
61
|
+
pip-delete-this-directory.txt
|
|
62
|
+
|
|
63
|
+
# Unit test / coverage reports
|
|
64
|
+
htmlcov/
|
|
65
|
+
.tox/
|
|
66
|
+
.nox/
|
|
67
|
+
.coverage
|
|
68
|
+
.coverage.*
|
|
69
|
+
.cache
|
|
70
|
+
nosetests.xml
|
|
71
|
+
coverage/
|
|
72
|
+
coverage.xml
|
|
73
|
+
*.cover
|
|
74
|
+
.hypothesis/
|
|
75
|
+
.pytest_cache/
|
|
76
|
+
|
|
77
|
+
# Translations
|
|
78
|
+
*.mo
|
|
79
|
+
*.pot
|
|
80
|
+
|
|
81
|
+
# Scrapy stuff:
|
|
82
|
+
.scrapy
|
|
83
|
+
|
|
84
|
+
# Sphinx documentation
|
|
85
|
+
docs/_build/
|
|
86
|
+
|
|
87
|
+
# PyBuilder
|
|
88
|
+
target/
|
|
89
|
+
|
|
90
|
+
# pyenv
|
|
91
|
+
.python-version
|
|
92
|
+
|
|
93
|
+
# celery beat schedule file
|
|
94
|
+
celerybeat-schedule
|
|
95
|
+
|
|
96
|
+
# SageMath parsed files
|
|
97
|
+
*.sage.py
|
|
98
|
+
|
|
99
|
+
# Spyder project settings
|
|
100
|
+
.spyderproject
|
|
101
|
+
.spyproject
|
|
102
|
+
|
|
103
|
+
# Rope project settings
|
|
104
|
+
.ropeproject
|
|
105
|
+
|
|
106
|
+
# Mr Developer
|
|
107
|
+
.mr.developer.cfg
|
|
108
|
+
.project
|
|
109
|
+
.pydevproject
|
|
110
|
+
|
|
111
|
+
# mkdocs documentation
|
|
112
|
+
/site
|
|
113
|
+
|
|
114
|
+
# mypy
|
|
115
|
+
.mypy_cache/
|
|
116
|
+
.dmypy.json
|
|
117
|
+
dmypy.json
|
|
118
|
+
|
|
119
|
+
# Pyre type checker
|
|
120
|
+
.pyre/
|
|
121
|
+
|
|
122
|
+
# End of https://www.gitignore.io/api/python
|
|
123
|
+
|
|
124
|
+
# OSX files
|
|
125
|
+
.DS_Store
|
|
126
|
+
|
|
127
|
+
# Yarn cache
|
|
128
|
+
.yarn/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Stellars Henson
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Makefile for Jupyterlab extensions version 1.31
|
|
2
|
+
# changelog:
|
|
3
|
+
# 1.31 - mrproper now removes ui-tests/node_modules (Playwright browser binaries)
|
|
4
|
+
# 1.30 - check twine in check_dependencies, ensure publish doesn't fail on missing twine
|
|
5
|
+
# 1.29 - replace yarn with jlpm, add prettier format, auto-commit and push after publish
|
|
6
|
+
# 1.28 - initial versioned Makefile
|
|
7
|
+
# author: Stellars Henson <konrad.jelen@gmail.com>
|
|
8
|
+
# License: MIT Open Source License
|
|
9
|
+
|
|
10
|
+
.PHONY: build install clean uninstall publish dependencies mrproper increment_version install_dependencies check_dependencies upgrade help test
|
|
11
|
+
.DEFAULT_GOAL := help
|
|
12
|
+
|
|
13
|
+
# Read current version from package.json (only if node is available)
|
|
14
|
+
VERSION := $(shell command -v node >/dev/null 2>&1 && node -p "require('./package.json').version" || echo "0.0.0")
|
|
15
|
+
|
|
16
|
+
## increment project version
|
|
17
|
+
increment_version:
|
|
18
|
+
@echo "Current version: $(VERSION)"
|
|
19
|
+
@bash -c 'CURRENT_VERSION=$(VERSION); \
|
|
20
|
+
IFS="." read -r major minor patch <<< "$$CURRENT_VERSION"; \
|
|
21
|
+
NEW_PATCH=$$((patch + 1)); \
|
|
22
|
+
NEW_VERSION="$$major.$$minor.$$NEW_PATCH"; \
|
|
23
|
+
echo "New version: $$NEW_VERSION"; \
|
|
24
|
+
sed -i "s/\"version\": \"$$CURRENT_VERSION\"/\"version\": \"$$NEW_VERSION\"/" package.json; '
|
|
25
|
+
|
|
26
|
+
## build packages
|
|
27
|
+
build: clean increment_version check_dependencies
|
|
28
|
+
npm install
|
|
29
|
+
jlpm install
|
|
30
|
+
npx prettier --write package-lock.json package.json
|
|
31
|
+
python -m build
|
|
32
|
+
|
|
33
|
+
## install package
|
|
34
|
+
install: build
|
|
35
|
+
pip install dist/*.whl --force-reinstall
|
|
36
|
+
|
|
37
|
+
## run tests
|
|
38
|
+
test: check_dependencies
|
|
39
|
+
jlpm test
|
|
40
|
+
|
|
41
|
+
## clean builds and installables
|
|
42
|
+
clean: uninstall check_dependencies
|
|
43
|
+
@command -v npm >/dev/null 2>&1 && npm run clean || true
|
|
44
|
+
@command -v npm >/dev/null 2>&1 && npm run clean:labextension || true
|
|
45
|
+
rm -rf dist lib || true
|
|
46
|
+
|
|
47
|
+
## uninstall package
|
|
48
|
+
uninstall: check_dependencies
|
|
49
|
+
pip uninstall -y dist/*.whl 2>/dev/null || true
|
|
50
|
+
|
|
51
|
+
## check if required dependencies are installed
|
|
52
|
+
check_dependencies:
|
|
53
|
+
@echo "Checking dependencies..."
|
|
54
|
+
@MISSING=""; \
|
|
55
|
+
command -v node >/dev/null 2>&1 || MISSING="$$MISSING node"; \
|
|
56
|
+
command -v npm >/dev/null 2>&1 || MISSING="$$MISSING npm"; \
|
|
57
|
+
python -m twine --version >/dev/null 2>&1 || MISSING="$$MISSING twine"; \
|
|
58
|
+
if [ -n "$$MISSING" ]; then \
|
|
59
|
+
echo "Missing dependencies:$$MISSING"; \
|
|
60
|
+
echo "Installing missing dependencies..."; \
|
|
61
|
+
$(MAKE) install_dependencies; \
|
|
62
|
+
else \
|
|
63
|
+
echo "All dependencies are installed."; \
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
## publish package to public repository
|
|
67
|
+
publish: check_dependencies install
|
|
68
|
+
npm publish --access public
|
|
69
|
+
python -m twine upload dist/*
|
|
70
|
+
git add package.json package-lock.json
|
|
71
|
+
git commit -m "chore: post-publish $$(node -p "require('./package.json').version") package metadata"
|
|
72
|
+
git push
|
|
73
|
+
|
|
74
|
+
## install all required build dependencies
|
|
75
|
+
install_dependencies:
|
|
76
|
+
pip install nodeenv twine
|
|
77
|
+
nodeenv --node=lts --prebuilt -p
|
|
78
|
+
npm install -g yarn rimraf
|
|
79
|
+
|
|
80
|
+
## upgrade all npm and yarn dependencies
|
|
81
|
+
upgrade: check_dependencies
|
|
82
|
+
jlpm up
|
|
83
|
+
|
|
84
|
+
## cleanup all build and metabuild artefacts
|
|
85
|
+
mrproper: clean uninstall
|
|
86
|
+
rm -rf node_modules .yarn ui-tests/node_modules || true
|
|
87
|
+
|
|
88
|
+
## prints the list of available commands
|
|
89
|
+
help:
|
|
90
|
+
@echo ""
|
|
91
|
+
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
|
|
92
|
+
@sed -n -e "/^## / { \
|
|
93
|
+
h; \
|
|
94
|
+
s/.*//; \
|
|
95
|
+
:doc" \
|
|
96
|
+
-e "H; \
|
|
97
|
+
n; \
|
|
98
|
+
s/^## //; \
|
|
99
|
+
t doc" \
|
|
100
|
+
-e "s/:.*//; \
|
|
101
|
+
G; \
|
|
102
|
+
s/\\n## /---/; \
|
|
103
|
+
s/\\n/ /g; \
|
|
104
|
+
p; \
|
|
105
|
+
}" ${MAKEFILE_LIST} \
|
|
106
|
+
| LC_ALL='C' sort --ignore-case \
|
|
107
|
+
| awk -F '---' \
|
|
108
|
+
-v ncol=$$(tput cols) \
|
|
109
|
+
-v indent=19 \
|
|
110
|
+
-v col_on="$$(tput setaf 6)" \
|
|
111
|
+
-v col_off="$$(tput sgr0)" \
|
|
112
|
+
'{ \
|
|
113
|
+
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
|
|
114
|
+
n = split($$2, words, " "); \
|
|
115
|
+
line_length = ncol - indent; \
|
|
116
|
+
for (i = 1; i <= n; i++) { \
|
|
117
|
+
line_length -= length(words[i]) + 1; \
|
|
118
|
+
if (line_length <= 0) { \
|
|
119
|
+
line_length = ncol - indent - length(words[i]) - 1; \
|
|
120
|
+
printf "\n%*s ", -indent, " "; \
|
|
121
|
+
} \
|
|
122
|
+
printf "%s ", words[i]; \
|
|
123
|
+
} \
|
|
124
|
+
printf "\n"; \
|
|
125
|
+
}'
|
|
126
|
+
@echo ""
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# EOF
|
|
130
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jupyterlab_basic_terminal_extension
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Jupyterlab extension to make a command that allows launching a utility terminal that runs without shell. This can be used to start and show console utilities, that when finished - close the terminal window / tab
|
|
5
|
+
Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_basic_terminal_extension
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_basic_terminal_extension/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_basic_terminal_extension.git
|
|
8
|
+
Author-email: Stellars Henson <konrad.jelen@gmail.com>
|
|
9
|
+
License: BSD 3-Clause License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026, Stellars Henson
|
|
12
|
+
All rights reserved.
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without
|
|
15
|
+
modification, are permitted provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
18
|
+
list of conditions and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
|
22
|
+
and/or other materials provided with the distribution.
|
|
23
|
+
|
|
24
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
25
|
+
contributors may be used to endorse or promote products derived from
|
|
26
|
+
this software without specific prior written permission.
|
|
27
|
+
|
|
28
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
29
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
30
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
31
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
32
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
33
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
34
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
35
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
36
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
37
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
38
|
+
License-File: LICENSE
|
|
39
|
+
Keywords: jupyter,jupyterlab,jupyterlab-extension
|
|
40
|
+
Classifier: Framework :: Jupyter
|
|
41
|
+
Classifier: Framework :: Jupyter :: JupyterLab
|
|
42
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: 4
|
|
43
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
|
|
44
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
|
|
45
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
46
|
+
Classifier: Programming Language :: Python
|
|
47
|
+
Classifier: Programming Language :: Python :: 3
|
|
48
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
49
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
51
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
52
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
53
|
+
Requires-Python: >=3.10
|
|
54
|
+
Requires-Dist: jupyter-server<3,>=2.4.0
|
|
55
|
+
Provides-Extra: dev
|
|
56
|
+
Requires-Dist: jupyterlab>=4; extra == 'dev'
|
|
57
|
+
Provides-Extra: test
|
|
58
|
+
Requires-Dist: coverage; extra == 'test'
|
|
59
|
+
Requires-Dist: pytest; extra == 'test'
|
|
60
|
+
Requires-Dist: pytest-asyncio; extra == 'test'
|
|
61
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
62
|
+
Requires-Dist: pytest-jupyter[server]>=0.6.0; extra == 'test'
|
|
63
|
+
Description-Content-Type: text/markdown
|
|
64
|
+
|
|
65
|
+
# jupyterlab_basic_terminal_extension
|
|
66
|
+
|
|
67
|
+
[](https://github.com/stellarshenson/jupyterlab_basic_terminal_extension/actions/workflows/build.yml)
|
|
68
|
+
[](https://www.npmjs.com/package/jupyterlab_basic_terminal_extension)
|
|
69
|
+
[](https://pypi.org/project/jupyterlab-basic-terminal-extension/)
|
|
70
|
+
[](https://pepy.tech/project/jupyterlab-basic-terminal-extension)
|
|
71
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
72
|
+
[](https://kolomolo.com)
|
|
73
|
+
[](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)
|
|
74
|
+
|
|
75
|
+
Launch a utility terminal in JupyterLab that runs without a shell. Perfect for spawning short-lived console utilities that close their tab automatically when the underlying process exits, instead of leaving behind an idle shell prompt.
|
|
76
|
+
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
- **Shell-less terminal command** - Adds a JupyterLab command that opens a terminal bound directly to a utility process, with no surrounding shell
|
|
80
|
+
- **Auto-close on exit** - Terminal tab closes as soon as the utility process finishes, keeping the workspace tidy
|
|
81
|
+
- **Server extension companion** - Python `jupyter_server` extension exposes the route used by the frontend to spawn the process
|
|
82
|
+
- **JupyterLab 4 native** - Built against `@jupyterlab/application` 4.x and ships as a prebuilt federated extension
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
Requires JupyterLab 4.0.0 or higher.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install jupyterlab_basic_terminal_extension
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Uninstall
|
|
93
|
+
|
|
94
|
+
To remove the extension, execute:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip uninstall jupyterlab_basic_terminal_extension
|
|
98
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# jupyterlab_basic_terminal_extension
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stellarshenson/jupyterlab_basic_terminal_extension/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/jupyterlab_basic_terminal_extension)
|
|
5
|
+
[](https://pypi.org/project/jupyterlab-basic-terminal-extension/)
|
|
6
|
+
[](https://pepy.tech/project/jupyterlab-basic-terminal-extension)
|
|
7
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
8
|
+
[](https://kolomolo.com)
|
|
9
|
+
[](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)
|
|
10
|
+
|
|
11
|
+
Launch a utility terminal in JupyterLab that runs without a shell. Perfect for spawning short-lived console utilities that close their tab automatically when the underlying process exits, instead of leaving behind an idle shell prompt.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Shell-less terminal command** - Adds a JupyterLab command that opens a terminal bound directly to a utility process, with no surrounding shell
|
|
16
|
+
- **Auto-close on exit** - Terminal tab closes as soon as the utility process finishes, keeping the workspace tidy
|
|
17
|
+
- **Server extension companion** - Python `jupyter_server` extension exposes the route used by the frontend to spawn the process
|
|
18
|
+
- **JupyterLab 4 native** - Built against `@jupyterlab/application` 4.x and ships as a prebuilt federated extension
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Requires JupyterLab 4.0.0 or higher.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install jupyterlab_basic_terminal_extension
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Uninstall
|
|
29
|
+
|
|
30
|
+
To remove the extension, execute:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip uninstall jupyterlab_basic_terminal_extension
|
|
34
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Making a new release of jupyterlab_basic_terminal_extension
|
|
2
|
+
|
|
3
|
+
The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
|
|
4
|
+
|
|
5
|
+
## Manual release
|
|
6
|
+
|
|
7
|
+
### Python package
|
|
8
|
+
|
|
9
|
+
This extension can be distributed as Python packages. All of the Python
|
|
10
|
+
packaging instructions are in the `pyproject.toml` file to wrap your extension in a
|
|
11
|
+
Python package. Before generating a package, you first need to install some tools:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install build twine hatch
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Bump the version using `hatch`. By default this will create a tag.
|
|
18
|
+
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
hatch version <new-version>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Make sure to clean up all the development files before building the package:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
jlpm clean:all
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
You could also clean up the local git repository:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clean -dfX
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
python -m build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> `python setup.py sdist bdist_wheel` is deprecated and will not work for this package.
|
|
43
|
+
|
|
44
|
+
Then to upload the package to PyPI, do:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
twine upload dist/*
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### NPM package
|
|
51
|
+
|
|
52
|
+
To publish the frontend part of the extension as a NPM package, do:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm login
|
|
56
|
+
npm publish --access public
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Automated releases with the Jupyter Releaser
|
|
60
|
+
|
|
61
|
+
The extension repository should already be compatible with the Jupyter Releaser. But
|
|
62
|
+
the GitHub repository and the package managers need to be properly set up. Please
|
|
63
|
+
follow the instructions of the Jupyter Releaser [checklist](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo.html).
|
|
64
|
+
|
|
65
|
+
Here is a summary of the steps to cut a new release:
|
|
66
|
+
|
|
67
|
+
- Go to the Actions panel
|
|
68
|
+
- Run the "Step 1: Prep Release" workflow
|
|
69
|
+
- Check the draft changelog
|
|
70
|
+
- Run the "Step 2: Publish Release" workflow
|
|
71
|
+
|
|
72
|
+
> [!NOTE]
|
|
73
|
+
> Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
|
|
74
|
+
> for more information.
|
|
75
|
+
|
|
76
|
+
## Publishing to `conda-forge`
|
|
77
|
+
|
|
78
|
+
If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html
|
|
79
|
+
|
|
80
|
+
Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@jupyterlab/testutils/lib/babel.config');
|