Skip to content

Bump a bunch of versions #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
set -eux
jlpm
jlpm run eslint:check
jlpm eslint:check
python -m pip install .
jupyter labextension list
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_modules/
.ipynb_checkpoints
*.tsbuildinfo
jupyterlab_blockly/labextension
untitled*
Untitled*

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
jlpm build
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
```

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

```bash
jupyter lab build --minimize=False
Expand Down
8 changes: 4 additions & 4 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ channels:

dependencies:
# runtime dependencies
- python >=3.8,<3.9.0a0
- jupyterlab >=3,<4.0.0a0
- python >=3.8,<3.12.0a0
- jupyterlab >=3.5,<4.0.0a0
# labextension build dependencies
- nodejs >=16,<17
- nodejs >=18,<19
- pip
- wheel
# additional packages for demos
# - ipywidgets
- ipywidgets
19 changes: 19 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'pydata_sphinx_theme'
html_theme_options = {
'github_url': 'https://github.com/quantstack/jupyterlab-blockly',
'use_edit_page_button': True,
'icon_links': [
{
'name': 'PyPI',
'url': 'https://pypi.org/project/jupyterlab-blockly',
'icon': 'fa-solid fa-box',
},
],
'pygment_light_style': 'github-light',
'pygment_dark_style': 'github-dark'
}
html_context = {
'github_user': 'quantstack',
'github_repo': 'jupyterlab-blockly',
'github_version': 'main',
'doc_path': 'docs',
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
3 changes: 1 addition & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
- myst-parser
- pydata-sphinx-theme
- pip:
- jupyterlite
- jupyterlite ==0.1.0b18
- jupyterlite-sphinx
- jupyterlite-xeus-lua

2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pre-commit install
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
jlpm build
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
Expand Down
28 changes: 14 additions & 14 deletions docs/other_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The JupyterLab-Blockly extension is ready to be used as a base for other projects: you can register new Blocks, Toolboxes and Generators. It is a great tool for fast prototyping.

## Creating a new JupyterLab extension
You can easily create a new JupyterLab extension by using a `cookiecutter`. You can read more documentation about `cookiecutters` [here](https://cookiecutter.readthedocs.io/en/latest/), but the process is fairly straight-forward.
You can easily create a new JupyterLab extension by using a `cookiecutter`. You can read more documentation about `cookiecutters` [here](https://cookiecutter.readthedocs.io/en/latest/), but the process is fairly straight-forward.

After running the following command:
```
Expand All @@ -20,7 +20,7 @@ Firstly you need to install and add `jupyterlab-blockly` as a dependency for you
jlpm add jupyterlab-blockly
```

Once it is part of your project, all you need to do is import `IBlocklyRegistry`, as it follows:
Once it is part of your project, all you need to do is import `IBlocklyRegistry`, as it follows:
```typescript
// src/index.ts

Expand All @@ -40,7 +40,7 @@ The `IBlocklyRegistry` offers a function `registerBlocks`, which allows you to i
*
* @argument blocks Blocks to register.
*/
registerBlocks(blocks: JSONObject[]): void {
registerBlocks(blocks: BlockDefinition[]): void {
Blockly.defineBlocksWithJsonArray(blocks);
}
```
Expand All @@ -56,7 +56,7 @@ Using the `registerToolbox` function, provided by `IBlocklyRegistry`, you can re
*
* @argument value Toolbox to register.
*/
registerToolbox(name: string, value: JSONObject): void {
registerToolbox(name: string, value: ToolboxDefinition): void {
this._toolboxes.set(name, value);
}
```
Expand Down Expand Up @@ -86,7 +86,7 @@ Lastly, `IBlocklyRegistry` offers the function `registerGenerator` which lets yo


## Example - JupyterLab-Niryo-One
The [JupyterLab-Niryo-One](https://github.com/QuantStack/jupyterlab-niryo-one/) extension was built on top of JupyterLab-Blockly and poses as the perfect example. The [Github repository](https://github.com/QuantStack/jupyterlab-niryo-one/) gives access to its entire codebase.
The [JupyterLab-Niryo-One](https://github.com/QuantStack/jupyterlab-niryo-one/) extension was built on top of JupyterLab-Blockly and poses as the perfect example. The [Github repository](https://github.com/QuantStack/jupyterlab-niryo-one/) gives access to its entire codebase.

The following code snippet showcases how to register a new toolbox, `BlocklyNiryo.Toolbox`, as `niryo`.
```typescript
Expand Down Expand Up @@ -158,7 +158,7 @@ You will need to request the `jupyterlab-blockly` package as a dependency of you
setup_args = dict(
...
install_requires=['jupyterlab-blockly>=0.1.1,<0.2']
...
...
)
```

Expand All @@ -169,14 +169,14 @@ Moreover, as we are working with deduplication of dependencies and the extension
"jupyterlab": {
"sharedPackages": {
"jupyterlab-blockly": {
"bundled": false,
"singleton": true
},
"blockly": {
"bundled": false,
"singleton": true
}
"jupyterlab-blockly": {
"bundled": false,
"singleton": true
},
"blockly": {
"bundled": false,
"singleton": true
}
}
}
```
Expand Down
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"lerna": "5.1.0",
"version": "0.2.1",
"npmClient": "yarn",
"npmClient": "jlpm",
"useWorkspaces": true
}
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@
]
},
"scripts": {
"build": "lerna run build",
"build:prod": "lerna run build:prod",
"clean": "lerna run clean",
"clean:all": "lerna run clean:all",
"build": "lerna run --stream build",
"build:prod": "lerna run --stream build:prod",
"clean": "lerna run --stream clean",
"clean:all": "lerna --stream run clean:all",
"deduplicate": "yarn-deduplicate -s fewer --fail",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"install": "lerna bootstrap",
"install:extension": "lerna run install:extension",
"install:extension": "lerna run --stream install:extension",
"lint": "jlpm prettier && jlpm eslint",
"lint:check": "jlpm prettier:check && jlpm eslint:check",
"prettier": "jlpm prettier:base --write --list-different",
"prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css}\"",
"prettier:check": "jlpm prettier:base --check",
"watch": "lerna run watch",
"watch": "lerna run --stream watch",
"postinstall": "patch-package"
},
"dependencies": {
Expand All @@ -49,10 +50,10 @@
"patch-package": "^6.4.7",
"prettier": "^2.5.1",
"postinstall-postinstall": "^2.1.0",
"typescript": "~4.5.2"
"typescript": "~4.9.5"
},
"devDependencies": {
"lerna": "5.1.0",
"yarn": "1.22.17"
"lerna": "^6.5.1",
"yarn-deduplicate": "^6.0.0"
}
}
20 changes: 11 additions & 9 deletions packages/blockly-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"url": "https://github.com/quantstack/jupyterlab-blockly.git"
},
"scripts": {
"build": "jlpm run build:lib && jlpm run build:labextension:dev",
"build:prod": "jlpm run clean && jlpm run build:lib && jlpm run build:labextension",
"build": "jlpm build:lib && jlpm build:labextension:dev",
"build:prod": "jlpm clean && jlpm build:lib && jlpm build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc",
"clean": "jlpm run clean:lib",
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf ../../jupyterlab_blockly/labextension",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"install:extension": "jlpm run build",
"clean:all": "jlpm clean:lib && jlpm clean:labextension",
"install:extension": "jlpm build",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w",
"watch:labextension": "jupyter labextension watch ."
Expand All @@ -56,10 +56,11 @@
"jupyterlab-blockly": "^0.2.1"
},
"devDependencies": {
"@jupyterlab/builder": "^3.4",
"@jupyterlab/builder": "^3.5",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"typescript": "~4.5.2"
"rimraf": "^4.4.0",
"typescript": "~4.9.5",
"source-map-loader": "^4.0.1"
},
"sideEffects": [
"style/*.css",
Expand All @@ -81,6 +82,7 @@
"bundled": true,
"singleton": true
}
}
},
"webpackConfig": "./webpack.config.js"
}
}
5 changes: 4 additions & 1 deletion packages/blockly-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"rootDir": "src"
},
"include": ["src/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
"references": [
{"path": "../blockly"}
]
}
5 changes: 5 additions & 0 deletions packages/blockly-extension/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// @ts-check

module.exports = /** @type { import('webpack').Configuration } */ ({
devtool: 'source-map'
});
13 changes: 6 additions & 7 deletions packages/blockly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@
},
"scripts": {
"build": "tsc -b",
"build:prod": "jlpm run build",
"build:prod": "jlpm build",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"clean:all": "jlpm run clean",
"install:extension": "jlpm run build",
"watch": "tsc -b --watch"
"clean:all": "jlpm clean",
"install:extension": "jlpm build"
},
"dependencies": {
"@jupyterlab/apputils": "^3.4",
Expand All @@ -50,13 +49,13 @@
"@lumino/messaging": "^1.10.0",
"@lumino/signaling": "^1.10.0",
"@lumino/widgets": "^1.30.0",
"blockly": "^7.20211209.2",
"blockly": "^9.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "~4.5.2"
"rimraf": "^4.4.0",
"typescript": "~4.9.5"
},
"sideEffects": [
"style/*.css",
Expand Down
5 changes: 2 additions & 3 deletions packages/blockly/src/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ISessionContext, showErrorMessage } from '@jupyterlab/apputils';
import { CodeCell, CodeCellModel } from '@jupyterlab/cells';

import { Message } from '@lumino/messaging';
import { PartialJSONValue } from '@lumino/coreutils';
import { SplitLayout, SplitPanel, Widget } from '@lumino/widgets';
import { IIterator, ArrayIterator } from '@lumino/algorithm';
import { Signal } from '@lumino/signaling';
Expand Down Expand Up @@ -58,13 +57,13 @@ export class BlocklyLayout extends SplitLayout {
this._manager.changed.connect(this._onManagerChanged, this);
}

get workspace(): PartialJSONValue {
get workspace(): Blockly.Workspace {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return Blockly.serialization.workspaces.save(this._workspace);
}

set workspace(workspace: PartialJSONValue) {
set workspace(workspace: Blockly.Workspace) {
const data = workspace === null ? { variables: [] } : workspace;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand Down
4 changes: 2 additions & 2 deletions packages/blockly/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { KernelSpec, KernelConnection } from '@jupyterlab/services';
import { IChangedArgs } from '@jupyterlab/coreutils';

import { ISignal, Signal } from '@lumino/signaling';
import { JSONObject } from '@lumino/coreutils';

import * as Blockly from 'blockly';

import { BlocklyRegistry } from './registry';
import { ToolboxDefinition } from 'blockly/core/utils/toolbox';

/**
* BlocklyManager the manager for each document
Expand Down Expand Up @@ -46,7 +46,7 @@ export class BlocklyManager {
/**
* Returns the selected toolbox.
*/
get toolbox(): JSONObject {
get toolbox(): ToolboxDefinition {
return this._registry.toolboxes.get(this._toolbox);
}

Expand Down
Loading