Skip to content

Commit

Permalink
chore: rename package to match naming style
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanChain committed Jan 14, 2024
1 parent 440a902 commit 5a14dff
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 78 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ author_name: Allan Chain
has_binder: false
has_settings: false
kind: server
labextension_name: waka-jlab
labextension_name: jupyterlab-wakatime
project_short_description: A JupyterLab WakaTime extension.
python_name: waka_jlab
repository: https://github.com/AllanChain/waka-jlab
python_name: jupyterlab_wakatime
repository: https://github.com/AllanChain/jupyterlab-wakatime
test: false

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ node_modules/
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
waka_jlab/labextension
jupyterlab_wakatime/labextension
# Version file is handled by hatchling
waka_jlab/_version.py
jupyterlab_wakatime/_version.py

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ node_modules
**/lib
**/package.json
!/package.json
waka_jlab
jupyterlab_wakatime
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# waka_jlab
# jupyterlab_wakatime

[![Github Actions Status](https://github.com/AllanChain/waka-jlab/workflows/Build/badge.svg)](https://github.com/AllanChain/waka-jlab/actions/workflows/build.yml)
[![Github Actions Status](https://github.com/AllanChain/jupyterlab-wakatime/workflows/Build/badge.svg)](https://github.com/AllanChain/jupyterlab-wakatime/actions/workflows/build.yml)
A JupyterLab WakaTime extension.

## Requirements
Expand Down Expand Up @@ -28,14 +28,14 @@ A JupyterLab WakaTime extension.

3. Execute (NOT available yet):

pip install waka_jlab
pip install jupyterlab_wakatime

## Uninstall

To remove the extension, execute:

```bash
pip uninstall waka_jlab
pip uninstall jupyterlab_wakatime
```

The following content is generated with the template:
Expand Down Expand Up @@ -70,13 +70,13 @@ The `jlpm` command is JupyterLab's pinned version of

```bash
# Clone the repo to your local environment
# Change directory to the waka_jlab directory
# Change directory to the jupyterlab_wakatime directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Server extension must be manually installed in develop mode
jupyter server extension enable waka_jlab
jupyter server extension enable jupyterlab_wakatime
# Rebuild extension Typescript source after making changes
jlpm build
```
Expand All @@ -102,13 +102,13 @@ jupyter lab build --minimize=False

```bash
# Server extension must be manually disabled in develop mode
jupyter server extension disable waka_jlab
pip uninstall waka_jlab
jupyter server extension disable jupyterlab_wakatime
pip uninstall jupyterlab_wakatime
```

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `waka-jlab` within that folder.
folder is located. Then you can remove the symlink named `jupyterlab-wakatime` within that folder.

### Packaging the extension

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Making a new release of waka_jlab
# Making a new release of jupyterlab_wakatime

The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).

Expand Down
4 changes: 2 additions & 2 deletions install.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageManager": "python",
"packageName": "waka_jlab",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package waka_jlab"
"packageName": "jupyterlab_wakatime",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_wakatime"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ServerApp": {
"jpserver_extensions": {
"waka_jlab": true
"jupyterlab_wakatime": true
}
}
}
8 changes: 4 additions & 4 deletions waka_jlab/__init__.py → jupyterlab_wakatime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
import warnings

warnings.warn("Importing 'waka_jlab' outside a proper installation.")
warnings.warn("Importing 'jupyterlab_wakatime' outside a proper installation.")
__version__ = "dev"
from .handlers import setup_handlers


def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "waka-jlab"}]
return [{"src": "labextension", "dest": "jupyterlab-wakatime"}]


def _jupyter_server_extension_points():
return [{"module": "waka_jlab"}]
return [{"module": "jupyterlab_wakatime"}]


def _load_jupyter_server_extension(server_app):
Expand All @@ -28,5 +28,5 @@ def _load_jupyter_server_extension(server_app):
JupyterLab application instance
"""
setup_handlers(server_app.web_app)
name = "waka_jlab"
name = "jupyterlab_wakatime"
server_app.log.info(f"Registered {name} server extension")
2 changes: 1 addition & 1 deletion waka_jlab/handlers.py → jupyterlab_wakatime/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ def setup_handlers(web_app):

host_pattern = ".*$"
base_url = web_app.settings["base_url"]
route_pattern = url_path_join(base_url, "waka-jlab", "heartbeat")
route_pattern = url_path_join(base_url, "jupyterlab-wakatime", "heartbeat")
handlers = [(route_pattern, RouteHandler)]
web_app.add_handlers(host_pattern, handlers)
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "waka-jlab",
"name": "jupyterlab-wakatime",
"version": "0.1.2",
"description": "A JupyterLab WakaTime extension.",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/AllanChain/waka-jlab",
"homepage": "https://github.com/AllanChain/jupyterlab-wakatime",
"bugs": {
"url": "https://github.com/AllanChain/waka-jlab/issues"
"url": "https://github.com/AllanChain/jupyterlab-wakatime/issues"
},
"license": "BSD-3-Clause",
"author": {
Expand All @@ -25,7 +25,7 @@
"style": "style/index.css",
"repository": {
"type": "git",
"url": "https://github.com/AllanChain/waka-jlab.git"
"url": "https://github.com/AllanChain/jupyterlab-wakatime.git"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
Expand All @@ -37,7 +37,7 @@
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
"clean:labextension": "rimraf waka_jlab/labextension waka_jlab/_version.py",
"clean:labextension": "rimraf jupyterlab_wakatime/labextension jupyterlab_wakatime/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --cache --ext .ts,.tsx",
Expand Down Expand Up @@ -99,12 +99,12 @@
"pip"
],
"base": {
"name": "waka_jlab"
"name": "jupyterlab_wakatime"
}
}
},
"extension": true,
"outputDir": "waka_jlab/labextension"
"outputDir": "jupyterlab_wakatime/labextension"
},
"eslintIgnore": [
"node_modules",
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0
build-backend = "hatchling.build"

[project]
name = "waka_jlab"
name = "jupyterlab_wakatime"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
Expand Down Expand Up @@ -34,25 +34,25 @@ source = "nodejs"
fields = ["description", "authors", "urls"]

[tool.hatch.build.targets.sdist]
artifacts = ["waka_jlab/labextension"]
artifacts = ["jupyterlab_wakatime/labextension"]
exclude = [".github", "binder"]

[tool.hatch.build.targets.wheel.shared-data]
"waka_jlab/labextension" = "share/jupyter/labextensions/waka-jlab"
"install.json" = "share/jupyter/labextensions/waka-jlab/install.json"
"jupyterlab_wakatime/labextension" = "share/jupyter/labextensions/jupyterlab-wakatime"
"install.json" = "share/jupyter/labextensions/jupyterlab-wakatime/install.json"
"jupyter-config/server-config" = "etc/jupyter/jupyter_server_config.d"

[tool.hatch.build.hooks.version]
path = "waka_jlab/_version.py"
path = "jupyterlab_wakatime/_version.py"

[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.5"]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
"waka_jlab/labextension/static/style.js",
"waka_jlab/labextension/package.json",
"jupyterlab_wakatime/labextension/static/style.js",
"jupyterlab_wakatime/labextension/package.json",
]
skip-if-exists = ["waka_jlab/labextension/static/style.js"]
skip-if-exists = ["jupyterlab_wakatime/labextension/static/style.js"]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
Expand All @@ -62,7 +62,7 @@ npm = ["jlpm"]
build_cmd = "install:extension"
npm = ["jlpm"]
source_dir = "src"
build_dir = "waka_jlab/labextension"
build_dir = "jupyterlab_wakatime/labextension"

[tool.jupyter-releaser.options]
version_cmd = "hatch version"
Expand Down
2 changes: 1 addition & 1 deletion src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function requestAPI<T>(
const settings = ServerConnection.makeSettings()
const requestUrl = URLExt.join(
settings.baseUrl,
'waka-jlab', // API Namespace
'jupyterlab-wakatime', // API Namespace
endPoint
)

Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { INotebookTracker } from '@jupyterlab/notebook'
import { beatHeart } from './watch'

/**
* Initialization data for the waka-jlab extension.
* Initialization data for the jupyterlab-wakatime extension.
*/
const plugin: JupyterFrontEndPlugin<void> = {
id: 'waka-jlab:plugin',
id: 'jupyterlab-wakatime:plugin',
description: 'A JupyterLab WakaTime extension.',
autoStart: true,
requires: [INotebookTracker],
activate: (app: JupyterFrontEnd, notebooks: INotebookTracker) => {
console.log('JupyterLab extension waka-jlab is activated!')
console.log('JupyterLab extension jupyterlab-wakatime is activated!')
notebooks.widgetAdded.connect((_, notebook) => {
const filepath = notebook.sessionContext.path
notebook.content.model?.contentChanged.connect(() => {
Expand Down
68 changes: 34 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3869,6 +3869,40 @@ __metadata:
languageName: node
linkType: hard

"jupyterlab-wakatime@workspace:.":
version: 0.0.0-use.local
resolution: "jupyterlab-wakatime@workspace:."
dependencies:
"@jupyterlab/application": ^4.0.0
"@jupyterlab/builder": ^4.0.0
"@jupyterlab/coreutils": ^6.0.0
"@jupyterlab/notebook": ^4.0.10
"@jupyterlab/services": ^7.0.0
"@types/json-schema": ^7.0.11
"@types/react": ^18.0.26
"@types/react-addons-linked-state-mixin": ^0.14.22
"@typescript-eslint/eslint-plugin": ^6.1.0
"@typescript-eslint/parser": ^6.1.0
css-loader: ^6.7.1
eslint: ^8.36.0
eslint-config-prettier: ^8.8.0
eslint-plugin-prettier: ^5.0.0
mkdirp: ^1.0.3
npm-run-all: ^4.1.5
prettier: ^3.0.0
rimraf: ^5.0.1
source-map-loader: ^1.0.2
style-loader: ^3.3.1
stylelint: ^15.10.1
stylelint-config-recommended: ^13.0.0
stylelint-config-standard: ^34.0.0
stylelint-csstree-validator: ^3.0.0
stylelint-prettier: ^4.0.0
typescript: ~5.0.2
yjs: ^13.5.0
languageName: unknown
linkType: soft

"keyv@npm:^4.5.3":
version: 4.5.4
resolution: "keyv@npm:4.5.4"
Expand Down Expand Up @@ -5919,40 +5953,6 @@ __metadata:
languageName: node
linkType: hard

"waka-jlab@workspace:.":
version: 0.0.0-use.local
resolution: "waka-jlab@workspace:."
dependencies:
"@jupyterlab/application": ^4.0.0
"@jupyterlab/builder": ^4.0.0
"@jupyterlab/coreutils": ^6.0.0
"@jupyterlab/notebook": ^4.0.10
"@jupyterlab/services": ^7.0.0
"@types/json-schema": ^7.0.11
"@types/react": ^18.0.26
"@types/react-addons-linked-state-mixin": ^0.14.22
"@typescript-eslint/eslint-plugin": ^6.1.0
"@typescript-eslint/parser": ^6.1.0
css-loader: ^6.7.1
eslint: ^8.36.0
eslint-config-prettier: ^8.8.0
eslint-plugin-prettier: ^5.0.0
mkdirp: ^1.0.3
npm-run-all: ^4.1.5
prettier: ^3.0.0
rimraf: ^5.0.1
source-map-loader: ^1.0.2
style-loader: ^3.3.1
stylelint: ^15.10.1
stylelint-config-recommended: ^13.0.0
stylelint-config-standard: ^34.0.0
stylelint-csstree-validator: ^3.0.0
stylelint-prettier: ^4.0.0
typescript: ~5.0.2
yjs: ^13.5.0
languageName: unknown
linkType: soft

"watchpack@npm:^2.4.0":
version: 2.4.0
resolution: "watchpack@npm:2.4.0"
Expand Down

0 comments on commit 5a14dff

Please sign in to comment.