Skip to content

Commit 3152247

Browse files
Remove Jupyter and Notebook2 and bump to version 2.0.0 (#457)
* feat: remove jupyter and notebook * fix: build * fix: build * fix: build * fix: build * fix: build * fix: build * chore: remove 2 * lint * docs: readme * fix: patches * fix: build * Automatic application of license header * fix: build * fix: build * fix: storybook * fix: build * Automatic application of license header * nextjs * nextjs * Automatic application of license header * fix: build * fix: build --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 032b71e commit 3152247

File tree

188 files changed

+3580
-4489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+3580
-4489
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -32,47 +32,3 @@ jobs:
3232
- name: Run the build
3333
run: |
3434
npm run build
35-
36-
storybook-test:
37-
name: Test Storybook Stories and Docs
38-
runs-on: ubuntu-latest
39-
timeout-minutes: 30
40-
41-
steps:
42-
- name: Checkout
43-
uses: actions/checkout@v4
44-
45-
- name: Setup Node
46-
uses: actions/setup-node@v4
47-
with:
48-
node-version: '22'
49-
50-
- name: Install Dependencies
51-
run: npm install
52-
53-
- name: Build all packages
54-
run: npm run build
55-
56-
- name: Install Playwright
57-
run: npx playwright install chromium --with-deps
58-
working-directory: storybook
59-
60-
- name: Build Storybook
61-
run: npm run build:storybook
62-
working-directory: storybook
63-
64-
- name: Serve Storybook and run all tests
65-
run: |
66-
npx serve -l 6006 storybook-static &
67-
npx wait-on http://localhost:6006 --timeout 30000
68-
npm run test:all:ci
69-
working-directory: storybook
70-
71-
- name: Upload test results
72-
if: failure()
73-
uses: actions/upload-artifact@v4
74-
with:
75-
name: storybook-test-results
76-
path: |
77-
storybook/test-results/
78-
storybook/html-report/

.github/workflows/storybook.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Storybook
2+
3+
on:
4+
push:
5+
branches: 'main'
6+
pull_request:
7+
branches: '*'
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
storybook-build-run:
15+
name: Build Storybook Stories
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 30
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
28+
- name: Install Dependencies
29+
run: npm install
30+
31+
- name: Build all packages
32+
run: npm run build
33+
34+
- name: Install Playwright
35+
run: npx playwright install chromium --with-deps
36+
working-directory: storybook
37+
38+
- name: Build Storybook
39+
run: npm run build:storybook
40+
working-directory: storybook
41+
42+
- name: Serve Storybook and run all tests
43+
run: |
44+
npx serve -l 6006 storybook-static &
45+
npx wait-on http://localhost:6006 --timeout 30000
46+
npm run test:all:ci
47+
working-directory: storybook
48+
49+
- name: Upload test results
50+
if: failure()
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: storybook-build-run-results
54+
path: |
55+
storybook/test-results/
56+
storybook/html-report/

.licenserc.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ header:
3232
- 'dev/notebooks/example1.dash'
3333
- 'dev/notebooks/subfolder-2/untitled.txt'
3434
- 'examples/cra/public/robots.txt'
35-
- '**/LICENSE.txt'
36-
- '**/*.nblink'
3735
- 'docs/docs'
3836
- 'packages/lexical/src/ui/PrettierButton.tsx_tmp'
3937
- 'packages/react/third-party-license.txt'
40-
- 'patches/'
41-
- '**/robots.txt'
4238
- '.husky/_/applypatch-msg'
4339
- '.husky/_/commit-msg'
4440
- '.husky/_/h'
@@ -55,6 +51,10 @@ header:
5551
- '.husky/_/pre-rebase'
5652
- '.husky/_/prepare-commit-msg'
5753
- '.husky/pre-commit'
54+
- '**/LICENSE.txt'
55+
- '**/robots.txt'
56+
- '**/*.nblink'
57+
- '**/*.patch'
5858
- '**/*.disabled'
5959
- '**/*.lexical'
6060

docs/src/theme/ReactLiveScope/index.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ const Cell = (props: any) => {
1616
{() => {
1717
// Keep the import via require in the BrowserOnly code block.
1818
const {
19-
Jupyter,
20-
} = require('@datalayer/jupyter-react/lib/jupyter/Jupyter');
19+
JupyterReactTheme,
20+
} = require('@datalayer/jupyter-react/lib/theme/JupyterReactTheme');
2121
const {
2222
Cell,
2323
} = require('@datalayer/jupyter-react/lib/components/cell/Cell');
2424
return (
2525
<>
26-
<Jupyter
27-
jupyterServerUrl="https://oss.datalayer.run/api/jupyter-server"
28-
jupyterServerToken="60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6"
29-
disableCssLoading={true}
30-
starDefaultKernel
31-
skeleton={<ContentLoader />}
26+
<JupyterReactTheme
27+
// jupyterServerUrl="https://oss.datalayer.run/api/jupyter-server"
28+
// jupyterServerToken="60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6"
29+
// disableCssLoading={true}
30+
// starDefaultKernel
31+
// skeleton={<ContentLoader />}
3232
>
3333
<Cell {...props} />
34-
</Jupyter>
34+
</JupyterReactTheme>
3535
</>
3636
);
3737
}}

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = tseslint.config(
2727
'gulpfile.js',
2828
'packages/*/entries.js',
2929
'packages/*/vite.config.ts',
30+
'storybook/.storybook/*.ts',
3031
],
3132
},
3233
},

examples/lexical/src/AppNbformat.tsx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* MIT License
55
*/
66

7-
import { useState } from 'react';
7+
import { useState, useMemo } from 'react';
88
import { $getRoot } from 'lexical';
99
import styled from 'styled-components';
1010
import {
@@ -15,13 +15,15 @@ import {
1515
} from '@datalayer/jupyter-lexical';
1616
import {
1717
useNotebookStore,
18-
Jupyter,
18+
useJupyter,
19+
JupyterReactTheme,
1920
Notebook,
2021
CellSidebar,
2122
CellSidebarExtension,
2223
} from '@datalayer/jupyter-react';
23-
import { Box, Button, UnderlineNav } from '@primer/react';
24+
import { Button, UnderlineNav } from '@primer/react';
2425
import { ThreeBarsIcon } from '@primer/octicons-react';
26+
import { Box } from '@datalayer/primer-addons';
2527
import { JSONTree } from 'react-json-tree';
2628
import { INotebookContent } from '@jupyterlab/nbformat';
2729
import { INotebookModel } from '@jupyterlab/notebook';
@@ -46,11 +48,18 @@ const StyledNotebook = styled.div`
4648

4749
const Tabs = () => {
4850
const { editor } = useLexical();
51+
const { serviceManager, defaultKernel } = useJupyter({
52+
startDefaultKernel: true,
53+
});
4954
const notebookStore = useNotebookStore();
5055
const [tab, setTab] = useState<TabType>('editor');
5156
const [notebookContent, setNotebookContent] = useState<INotebookContent>(
5257
INITIAL_NBFORMAT_MODEL,
5358
);
59+
const extensions = useMemo(
60+
() => [new CellSidebarExtension({ factory: CellSidebar })],
61+
[],
62+
);
5463
const notebook = notebookStore.selectNotebook(NOTEBOOK_UID);
5564
const goToTab = (
5665
e: any,
@@ -84,21 +93,21 @@ const Tabs = () => {
8493
<UnderlineNav.Item
8594
href=""
8695
aria-current={tab === 'editor' ? 'page' : undefined}
87-
onClick={(e: any) => goToTab(e, 'editor', notebook?.model)}
96+
// onClick={(e: any) => goToTab(e, 'editor', notebook?.model)}
8897
>
8998
Editor
9099
</UnderlineNav.Item>
91100
<UnderlineNav.Item
92101
href=""
93102
aria-current={tab === 'notebook' ? 'page' : undefined}
94-
onClick={(e: any) => goToTab(e, 'notebook', notebook?.model)}
103+
// onClick={(e: any) => goToTab(e, 'notebook', notebook?.model)}
95104
>
96105
Notebook
97106
</UnderlineNav.Item>
98107
<UnderlineNav.Item
99108
href=""
100109
aria-current={tab === 'nbformat' ? 'page' : undefined}
101-
onClick={(e: any) => goToTab(e, 'nbformat', notebook?.model)}
110+
// onClick={(e: any) => goToTab(e, 'nbformat', notebook?.model)}
102111
>
103112
NbFormat
104113
</UnderlineNav.Item>
@@ -124,11 +133,15 @@ const Tabs = () => {
124133
{tab === 'notebook' && (
125134
<StyledNotebook>
126135
<Box mb={3}>
127-
<Notebook
128-
id={NOTEBOOK_UID}
129-
nbformat={notebookContent}
130-
extensions={[new CellSidebarExtension({ factory: CellSidebar })]}
131-
/>
136+
{serviceManager && defaultKernel && (
137+
<Notebook
138+
id={NOTEBOOK_UID}
139+
kernel={defaultKernel}
140+
serviceManager={serviceManager}
141+
nbformat={notebookContent}
142+
extensions={extensions}
143+
/>
144+
)}
132145
<Button
133146
onClick={(e: React.MouseEvent) => {
134147
e.preventDefault();
@@ -155,11 +168,11 @@ export function AppNbformat() {
155168
<div className="App">
156169
<h1>Jupyter UI ❤️ Lexical</h1>
157170
</div>
158-
<Jupyter startDefaultKernel>
171+
<JupyterReactTheme>
159172
<LexicalProvider>
160173
<Tabs />
161174
</LexicalProvider>
162-
</Jupyter>
175+
</JupyterReactTheme>
163176
<div className="other App">
164177
<br />
165178
<a href="https://datalayer.ai" target="_blank" rel="noreferrer">

examples/next-js/.yarnrc.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) Datalayer, Inc. https://datalayer.io
2+
# Distributed under the terms of the MIT License.
3+
4+
enableImmutableInstalls: false
5+
enableInlineBuilds: false
6+
enableTelemetry: false
7+
httpTimeout: 60000
8+
nodeLinker: node-modules
9+
npmRegistryServer: 'https://registry.yarnpkg.com'
10+
11+
# This will fix the build error with @lerna/legacy-package-management
12+
# See https://github.com/lerna/repro/pull/11
13+
packageExtensions:
14+
'@lerna/legacy-package-management@*':
15+
dependencies:
16+
'@lerna/child-process': '*'
17+
'js-yaml': '*'
18+
'rimraf': '*'
19+
peerDependencies:
20+
'nx': '*'

examples/next-js/next-env.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2021-2023 Datalayer, Inc.
3+
*
4+
* MIT License
5+
*/
6+
7+
/// <reference types="next" />
8+
/// <reference types="next/image-types/global" />
9+
10+
// NOTE: This file should not be edited
11+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

0 commit comments

Comments
 (0)