jupyterlab-file-browser-sorting-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_file_browser_sorting_extension-1.0.4/.claude/CLAUDE.md +27 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/.claude/JOURNAL.md +26 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/.claude/settings.local.json +19 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/.copier-answers.yml +16 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/.gitignore +128 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/.prettierignore +6 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/.yarnrc.yml +2 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/CHANGELOG.md +5 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/LICENSE +29 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/Makefile +122 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/PKG-INFO +115 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/README.md +61 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/RELEASE.md +80 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/babel.config.js +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/install.json +5 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jest.config.js +28 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/__init__.py +16 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/_version.py +4 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/package.json +205 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/schemas/jupyterlab_file_browser_sorting_extension/package.json.orig +200 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/schemas/jupyterlab_file_browser_sorting_extension/plugin.json +15 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/static/509.d49070e8e552c63b6066.js +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/static/728.a6ed362485715e83fa87.js +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/static/remoteEntry.cff74e4e454752921002.js +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/static/style.js +4 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/jupyterlab_file_browser_sorting_extension/labextension/static/third-party-licenses.json +16 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/package-lock.json +13081 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/package.json +200 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/pyproject.toml +76 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/schema/plugin.json +15 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/setup.py +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/src/__tests__/jupyterlab_file_browser_sorting_extension.spec.ts +9 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/src/index.ts +274 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/style/base.css +5 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/style/index.css +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/style/index.js +1 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/tsconfig.json +26 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/tsconfig.test.json +3 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/ui-tests/README.md +167 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/ui-tests/jupyter_server_test_config.py +12 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/ui-tests/package.json +15 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/ui-tests/playwright.config.js +14 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/ui-tests/tests/jupyterlab_file_browser_sorting_extension.spec.ts +37 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/ui-tests/yarn.lock +0 -0
- jupyterlab_file_browser_sorting_extension-1.0.4/yarn.lock +11070 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Import workspace-level CLAUDE.md configuration -->
|
|
2
|
+
<!-- See /home/lab/workspace/.claude/CLAUDE.md for complete rules -->
|
|
3
|
+
|
|
4
|
+
# Project-Specific Configuration
|
|
5
|
+
|
|
6
|
+
This file extends workspace-level configuration with project-specific rules.
|
|
7
|
+
|
|
8
|
+
## Project Context
|
|
9
|
+
|
|
10
|
+
JupyterLab extension providing file browser sorting capabilities including case-sensitive sorting options.
|
|
11
|
+
|
|
12
|
+
**Technology Stack**:
|
|
13
|
+
|
|
14
|
+
- TypeScript for frontend extension code
|
|
15
|
+
- JupyterLab 4.x extension API
|
|
16
|
+
- Python packaging with `pyproject.toml` and `hatch`
|
|
17
|
+
|
|
18
|
+
**Package Names**:
|
|
19
|
+
|
|
20
|
+
- npm: `jupyterlab_file_browser_sorting_extension`
|
|
21
|
+
- PyPI: `jupyterlab-file-browser-sorting-extension`
|
|
22
|
+
- GitHub: `stellarshenson/jupyterlab_file_browser_sorting_extension`
|
|
23
|
+
|
|
24
|
+
**Build and Install**:
|
|
25
|
+
|
|
26
|
+
- Always use `make install` to build and install the extension
|
|
27
|
+
- Always commit both `package.json` and `package-lock.json` together
|
|
@@ -0,0 +1,26 @@
|
|
|
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.4.2): Created new JupyterLab extension `jupyterlab_file_browser_sorting_extension` using copier template<br>
|
|
8
|
+
**Result**: Initialized extension project with TypeScript frontend, Python packaging via `pyproject.toml`, GitHub Actions workflows for build/publish/release, Jest unit tests, Playwright integration tests, and Makefile for standardized build commands. Extension provides file browser sorting capabilities including case-sensitive sorting. Created `.claude/CLAUDE.md` with project-specific configuration importing workspace-level rules. Updated `README.md` with standard GitHub badges (build status, npm, PyPI, downloads, JupyterLab 4, KOLOMOLO branding) and brief feature description. Project requires JupyterLab >= 4.0.0.
|
|
9
|
+
|
|
10
|
+
2. **Task - LC_COLLATE=C sorting implementation** (v0.4.2): Implemented ASCIIbetical sorting for JupyterLab file browser<br>
|
|
11
|
+
**Result**: Researched JupyterLab 4.x file browser internals - the `DirListing` class in `@jupyterlab/filebrowser` handles sorting via private `_sortedItems` array populated by `Private.sort()` function using `localeCompare` with `sensitivity: 'base'` (case-insensitive). Implemented monkey-patching approach in `src/index.ts` that overrides `DirListing.sort()` method to use custom `cLocaleCompare()` function implementing LC_COLLATE=C ordering: dot files first, then numbers (0-9), uppercase (A-Z), underscore, lowercase (a-z). Added dependencies `@jupyterlab/filebrowser` and `@jupyterlab/settingregistry` to `package.json`. Extension hooks into `IFileBrowserFactory.tracker` to patch both existing and newly created file browsers. Respects JupyterLab's `sortNotebooksFirst` setting and maintains directory-first ordering. Updated README with LC_COLLATE=C explanation and example sort order.
|
|
12
|
+
|
|
13
|
+
3. **Task - Menu toggle for sorting mode** (v0.4.2): Added context menu toggle for Unix-style sorting<br>
|
|
14
|
+
**Result**: Created `schema/plugin.json` with `useCLocaleSorting` boolean setting (default: true) for persistent configuration. Added `schemaDir` reference to `package.json` jupyterlab section. Registered toggle command `filebrowser:toggle-unix-sorting` with `isToggleable: true` that updates setting via `ISettingRegistry`. Added command to file browser context menu with selector `.jp-DirListing-content` at rank 10.5 (near "Sort Notebooks Above Files"). Refactored `sortItems()` function to accept `useCLocale` parameter and switch between `cLocaleCompare()` and standard `localeCompare()` based on setting. Added `resortAllBrowsers()` function that triggers re-sort on all patched browsers when settings change. Updated README with usage instructions for the context menu toggle.
|
|
15
|
+
|
|
16
|
+
4. **Task - Fix DirListing property access** (v0.4.10): Fixed critical bug where sorting toggle had no effect<br>
|
|
17
|
+
**Result**: Investigated JupyterLab source to find correct property name for accessing DirListing from FileBrowser. The `browser.d.ts` type declarations revealed that the property is `protected listing: DirListing` (not `_listing` as initially assumed). Changed two occurrences in `src/index.ts` from `(browser as any)._listing` to `(browser as any).listing` - in both `resortAllBrowsers()` function and `patchFileBrowser()` function. This fix enables the extension to properly patch the DirListing's sort method and apply custom LC_COLLATE=C sorting when the setting is toggled.
|
|
18
|
+
|
|
19
|
+
5. **Task - Complete LC_COLLATE=C sorting extension** (v1.0.2): Finalized working Unix-style file browser sorting extension<br>
|
|
20
|
+
**Result**: Completed fully functional JupyterLab 4.x extension implementing LC*COLLATE=C (ASCIIbetical) sorting for the file browser. The extension monkey-patches `DirListing.sort()` method via `IFileBrowserFactory.tracker` to intercept sorting operations. Core sorting implemented in `cLocaleCompare()` function that compares strings character-by-character using ASCII code values, producing sort order: `.` (46) -> `0-9` (48-57) -> `A-Z` (65-90) -> `*`(95) ->`a-z`(97-122). This matches Unix`LC_COLLATE=C ls`behavior where dotfiles appear first, uppercase precedes lowercase, and special characters sort by ASCII value. The`sortItems()`function maintains JupyterLab's directory-first convention and respects the`sortNotebooksFirst`setting from`@jupyterlab/filebrowser-extension:browser`. Extension provides persistent `useCLocaleSorting`boolean setting in`schema/plugin.json`(default: true) stored via`ISettingRegistry`. Added toggleable context menu command `filebrowser:toggle-unix-sorting`labeled "Unix Style Sorting" with selectors`.jp-DirListing-item`and`.jp-DirListing`at rank 100 (bottom of menu). Settings changes trigger`resortAllBrowsers()`which iterates all tracked FileBrowser widgets and re-applies sorting. The`patchListing()`function hooks into`model.refreshed`signal to automatically re-sort when directory contents change. Key fix during development: FileBrowser exposes DirListing via protected`listing`property (not private`\_listing`), requiring access via `(browser as any).listing`. Removed all debug console.log statements for production release. Extension built with TypeScript strict mode, uses `skipLibCheck: true`to handle lib0 type compatibility issues, and pins lib0 to 0.2.97 via resolutions. Final artefacts:`src/index.ts`(261 lines),`schema/plugin.json`(15 lines), standard JupyterLab extension packaging with`pyproject.toml`and`package.json`.
|
|
21
|
+
|
|
22
|
+
6. **Task - Fix sortedItems getter override** (v1.0.3): Fixed dotfiles appearing in wrong position despite correct sorting logic<br>
|
|
23
|
+
**Result**: Discovered that setting `_sortedItems` private field was insufficient because JupyterLab's DirListing uses a `sortedItems` getter that may recalculate the sorted array internally, bypassing our custom sorted data. Fixed by using `Object.defineProperty()` to override the `sortedItems` getter on the listing instance, returning our custom sorted array stored in closure variable `customSortedItems`. The patched `sort()` method now updates both `customSortedItems` (for the getter) and `_sortedItems` (for compatibility). Simplified `resortListing()` to delegate to the patched `listing.sort()` method instead of duplicating sorting logic. This ensures that regardless of whether JupyterLab accesses sorted items via the getter or private field, our LC_COLLATE=C sorted order is used consistently.
|
|
24
|
+
|
|
25
|
+
7. **Task - GitHub CI/CD workflows** (v1.0.3): Added complete GitHub Actions CI/CD pipeline<br>
|
|
26
|
+
**Result**: Copied and adapted workflow files from `jupyterlab_fit_image_size_extension` reference project. Added `build.yml` implementing full CI pipeline: linting with eslint/prettier, Jest unit tests, extension build verification via `jupyter labextension list`, isolated installation test without Node.js, Playwright integration tests with browser caching, and link checking with ignore patterns for badge URLs. Added `check-release.yml` for release validation using jupyter_releaser. Added `prep-release.yml` and `publish-release.yml` for automated release workflow with GitHub App token support and NPM publishing. Added `enforce-label.yml` for PR triage label enforcement. Added `update-integration-tests.yml` for updating Playwright snapshots via PR comments. Ran `jlpm run lint` to format all TypeScript and markdown files with prettier and eslint. All workflow files reference correct extension name `jupyterlab_file_browser_sorting_extension` and PyPI name `jupyterlab-file-browser-sorting-extension`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(git init:*)",
|
|
5
|
+
"Bash(git add:*)",
|
|
6
|
+
"Bash(grep:*)",
|
|
7
|
+
"Bash(find:*)",
|
|
8
|
+
"Bash(ls:*)",
|
|
9
|
+
"Bash(make install:*)",
|
|
10
|
+
"Bash(git commit:*)",
|
|
11
|
+
"Bash(git tag:*)",
|
|
12
|
+
"Bash(git remote add:*)",
|
|
13
|
+
"Bash(git branch:*)",
|
|
14
|
+
"Bash(git push:*)",
|
|
15
|
+
"Bash(jlpm run lint:*)",
|
|
16
|
+
"Bash(make upgrade:*)"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v4.5.1
|
|
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
|
|
10
|
+
labextension_name: jupyterlab_file_browser_sorting_extension
|
|
11
|
+
project_short_description: Jupyterlab extension to help with sorting of the files
|
|
12
|
+
in file browser (i.e. case sensitive sorting)
|
|
13
|
+
python_name: jupyterlab_file_browser_sorting_extension
|
|
14
|
+
repository: ''
|
|
15
|
+
test: true
|
|
16
|
+
|
|
@@ -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_file_browser_sorting_extension/labextension
|
|
11
|
+
# Version file is handled by hatchling
|
|
12
|
+
jupyterlab_file_browser_sorting_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) 2025, 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,122 @@
|
|
|
1
|
+
# Makefile for Jupyterlab extensions version 1.27
|
|
2
|
+
# author: Stellars Henson <konrad.jelen@gmail.com>
|
|
3
|
+
# License: MIT Open Source License
|
|
4
|
+
|
|
5
|
+
.PHONY: build install clean uninstall publish dependencies mrproper increment_version install_dependencies check_dependencies upgrade help test
|
|
6
|
+
.DEFAULT_GOAL := help
|
|
7
|
+
|
|
8
|
+
# Read current version from package.json (only if node is available)
|
|
9
|
+
VERSION := $(shell command -v node >/dev/null 2>&1 && node -p "require('./package.json').version" || echo "0.0.0")
|
|
10
|
+
|
|
11
|
+
## increment project version
|
|
12
|
+
increment_version:
|
|
13
|
+
@echo "Current version: $(VERSION)"
|
|
14
|
+
@bash -c 'CURRENT_VERSION=$(VERSION); \
|
|
15
|
+
IFS="." read -r major minor patch <<< "$$CURRENT_VERSION"; \
|
|
16
|
+
NEW_PATCH=$$((patch + 1)); \
|
|
17
|
+
NEW_VERSION="$$major.$$minor.$$NEW_PATCH"; \
|
|
18
|
+
echo "New version: $$NEW_VERSION"; \
|
|
19
|
+
sed -i "s/\"version\": \"$$CURRENT_VERSION\"/\"version\": \"$$NEW_VERSION\"/" package.json; '
|
|
20
|
+
|
|
21
|
+
## build packages
|
|
22
|
+
build: clean increment_version check_dependencies
|
|
23
|
+
npm install
|
|
24
|
+
yarn install
|
|
25
|
+
python -m build
|
|
26
|
+
|
|
27
|
+
## install package
|
|
28
|
+
install: build
|
|
29
|
+
pip install dist/*.whl --force-reinstall
|
|
30
|
+
|
|
31
|
+
## run tests
|
|
32
|
+
test: check_dependencies
|
|
33
|
+
jlpm test
|
|
34
|
+
|
|
35
|
+
## clean builds and installables
|
|
36
|
+
clean: uninstall check_dependencies
|
|
37
|
+
@command -v npm >/dev/null 2>&1 && npm run clean || true
|
|
38
|
+
@command -v npm >/dev/null 2>&1 && npm run clean:labextension || true
|
|
39
|
+
rm -rf dist lib || true
|
|
40
|
+
|
|
41
|
+
## uninstall package
|
|
42
|
+
uninstall: check_dependencies
|
|
43
|
+
pip uninstall -y dist/*.whl 2>/dev/null || true
|
|
44
|
+
|
|
45
|
+
## check if required dependencies are installed
|
|
46
|
+
check_dependencies:
|
|
47
|
+
@echo "Checking dependencies..."
|
|
48
|
+
@MISSING=""; \
|
|
49
|
+
command -v node >/dev/null 2>&1 || MISSING="$$MISSING node"; \
|
|
50
|
+
command -v npm >/dev/null 2>&1 || MISSING="$$MISSING npm"; \
|
|
51
|
+
command -v yarn >/dev/null 2>&1 || MISSING="$$MISSING yarn"; \
|
|
52
|
+
command -v twine >/dev/null 2>&1 || MISSING="$$MISSING twine"; \
|
|
53
|
+
if [ -n "$$MISSING" ]; then \
|
|
54
|
+
echo "Missing dependencies:$$MISSING"; \
|
|
55
|
+
echo "Installing missing dependencies..."; \
|
|
56
|
+
$(MAKE) install_dependencies; \
|
|
57
|
+
else \
|
|
58
|
+
echo "All dependencies are installed."; \
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
## publish package to public repository
|
|
62
|
+
publish: check_dependencies install
|
|
63
|
+
npm publish --access public
|
|
64
|
+
twine upload dist/*
|
|
65
|
+
|
|
66
|
+
## install all required build dependencies
|
|
67
|
+
install_dependencies:
|
|
68
|
+
conda install -y nodejs yarn --update-all
|
|
69
|
+
pip install twine
|
|
70
|
+
npm install rimraf
|
|
71
|
+
|
|
72
|
+
## upgrade all npm and yarn dependencies
|
|
73
|
+
upgrade: check_dependencies
|
|
74
|
+
jlpm up
|
|
75
|
+
|
|
76
|
+
## cleanup all build and metabuild artefacts
|
|
77
|
+
mrproper: clean uninstall
|
|
78
|
+
rm -rf node_modules .yarn || true
|
|
79
|
+
|
|
80
|
+
## prints the list of available commands
|
|
81
|
+
help:
|
|
82
|
+
@echo ""
|
|
83
|
+
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
|
|
84
|
+
@sed -n -e "/^## / { \
|
|
85
|
+
h; \
|
|
86
|
+
s/.*//; \
|
|
87
|
+
:doc" \
|
|
88
|
+
-e "H; \
|
|
89
|
+
n; \
|
|
90
|
+
s/^## //; \
|
|
91
|
+
t doc" \
|
|
92
|
+
-e "s/:.*//; \
|
|
93
|
+
G; \
|
|
94
|
+
s/\\n## /---/; \
|
|
95
|
+
s/\\n/ /g; \
|
|
96
|
+
p; \
|
|
97
|
+
}" ${MAKEFILE_LIST} \
|
|
98
|
+
| LC_ALL='C' sort --ignore-case \
|
|
99
|
+
| awk -F '---' \
|
|
100
|
+
-v ncol=$$(tput cols) \
|
|
101
|
+
-v indent=19 \
|
|
102
|
+
-v col_on="$$(tput setaf 6)" \
|
|
103
|
+
-v col_off="$$(tput sgr0)" \
|
|
104
|
+
'{ \
|
|
105
|
+
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
|
|
106
|
+
n = split($$2, words, " "); \
|
|
107
|
+
line_length = ncol - indent; \
|
|
108
|
+
for (i = 1; i <= n; i++) { \
|
|
109
|
+
line_length -= length(words[i]) + 1; \
|
|
110
|
+
if (line_length <= 0) { \
|
|
111
|
+
line_length = ncol - indent - length(words[i]) - 1; \
|
|
112
|
+
printf "\n%*s ", -indent, " "; \
|
|
113
|
+
} \
|
|
114
|
+
printf "%s ", words[i]; \
|
|
115
|
+
} \
|
|
116
|
+
printf "\n"; \
|
|
117
|
+
}'
|
|
118
|
+
@echo ""
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# EOF
|
|
122
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jupyterlab_file_browser_sorting_extension
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Jupyterlab extension to help with sorting of the files in file browser (i.e. case sensitive sorting)
|
|
5
|
+
Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_file_browser_sorting_extension
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_file_browser_sorting_extension/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_file_browser_sorting_extension.git
|
|
8
|
+
Author-email: Stellars Henson <konrad.jelen@gmail.com>
|
|
9
|
+
License: BSD 3-Clause License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2025, 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
|
+
Requires-Python: >=3.10
|
|
53
|
+
Description-Content-Type: text/markdown
|
|
54
|
+
|
|
55
|
+
# jupyterlab_file_browser_sorting_extension
|
|
56
|
+
|
|
57
|
+
[](https://github.com/stellarshenson/jupyterlab_file_browser_sorting_extension/actions/workflows/build.yml)
|
|
58
|
+
[](https://www.npmjs.com/package/jupyterlab_file_browser_sorting_extension)
|
|
59
|
+
[](https://pypi.org/project/jupyterlab-file-browser-sorting-extension/)
|
|
60
|
+
[](https://pepy.tech/project/jupyterlab-file-browser-sorting-extension)
|
|
61
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
62
|
+
[](https://kolomolo.com)
|
|
63
|
+
|
|
64
|
+
JupyterLab extension that implements LC_COLLATE=C (ASCIIbetical) sorting for the file browser.
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- **LC_COLLATE=C sorting** - Standard Unix sorting order used by `ls` with C locale
|
|
69
|
+
- **Dot files first** - Hidden files (starting with `.`) appear before other files
|
|
70
|
+
- **Uppercase before lowercase** - Capital letters (A-Z) sort before lowercase (a-z)
|
|
71
|
+
- **ASCII order** - Characters sorted by their ASCII code values
|
|
72
|
+
- **Toggle via context menu** - Right-click in the file browser to enable/disable
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
Right-click anywhere in the file browser content area and select **"Use Unix-Style Sorting (LC_COLLATE=C)"** to toggle the sorting mode. The setting is persisted across sessions.
|
|
77
|
+
|
|
78
|
+
When enabled, the extension sorts files using the standard Unix C locale collation sequence:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
. (dot) -> 0-9 -> A-Z -> _ (underscore) -> a-z
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Example sort order:**
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
.hidden
|
|
88
|
+
.profile
|
|
89
|
+
123file
|
|
90
|
+
ABC
|
|
91
|
+
Makefile
|
|
92
|
+
README
|
|
93
|
+
_config
|
|
94
|
+
abc
|
|
95
|
+
readme
|
|
96
|
+
zebra
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This matches the behavior of `LC_COLLATE=C ls` on Unix systems.
|
|
100
|
+
|
|
101
|
+
## Requirements
|
|
102
|
+
|
|
103
|
+
- JupyterLab >= 4.0.0
|
|
104
|
+
|
|
105
|
+
## Installation
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pip install jupyterlab_file_browser_sorting_extension
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Uninstall
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pip uninstall jupyterlab_file_browser_sorting_extension
|
|
115
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# jupyterlab_file_browser_sorting_extension
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stellarshenson/jupyterlab_file_browser_sorting_extension/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/jupyterlab_file_browser_sorting_extension)
|
|
5
|
+
[](https://pypi.org/project/jupyterlab-file-browser-sorting-extension/)
|
|
6
|
+
[](https://pepy.tech/project/jupyterlab-file-browser-sorting-extension)
|
|
7
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
8
|
+
[](https://kolomolo.com)
|
|
9
|
+
|
|
10
|
+
JupyterLab extension that implements LC_COLLATE=C (ASCIIbetical) sorting for the file browser.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **LC_COLLATE=C sorting** - Standard Unix sorting order used by `ls` with C locale
|
|
15
|
+
- **Dot files first** - Hidden files (starting with `.`) appear before other files
|
|
16
|
+
- **Uppercase before lowercase** - Capital letters (A-Z) sort before lowercase (a-z)
|
|
17
|
+
- **ASCII order** - Characters sorted by their ASCII code values
|
|
18
|
+
- **Toggle via context menu** - Right-click in the file browser to enable/disable
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Right-click anywhere in the file browser content area and select **"Use Unix-Style Sorting (LC_COLLATE=C)"** to toggle the sorting mode. The setting is persisted across sessions.
|
|
23
|
+
|
|
24
|
+
When enabled, the extension sorts files using the standard Unix C locale collation sequence:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
. (dot) -> 0-9 -> A-Z -> _ (underscore) -> a-z
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Example sort order:**
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
.hidden
|
|
34
|
+
.profile
|
|
35
|
+
123file
|
|
36
|
+
ABC
|
|
37
|
+
Makefile
|
|
38
|
+
README
|
|
39
|
+
_config
|
|
40
|
+
abc
|
|
41
|
+
readme
|
|
42
|
+
zebra
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This matches the behavior of `LC_COLLATE=C ls` on Unix systems.
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
- JupyterLab >= 4.0.0
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install jupyterlab_file_browser_sorting_extension
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Uninstall
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip uninstall jupyterlab_file_browser_sorting_extension
|
|
61
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Making a new release of jupyterlab_file_browser_sorting_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');
|