Skip to content

Commit 45c643e

Browse files
authored
Merge branch 'main' into michalbaumgartner/blu-5090-update-vscode-extension-to-use-toolkit-v1
2 parents 0548883 + 5e8dd8d commit 45c643e

15 files changed

+571
-21
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,31 @@ jobs:
190190
- name: Run spell check
191191
run: npm run spell-check
192192

193+
package-lock-drift-check:
194+
name: Package Lock Drift Check
195+
runs-on: ubuntu-latest
196+
timeout-minutes: 5
197+
steps:
198+
- name: Checkout
199+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
200+
201+
- name: Setup Node.js
202+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
203+
with:
204+
cache: 'npm'
205+
node-version-file: '.nvmrc'
206+
registry-url: 'https://npm.pkg.github.com'
207+
scope: '@deepnote'
208+
209+
- name: Install dependencies
210+
run: npm install
211+
env:
212+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213+
214+
- name: Check package lock drift
215+
run: |
216+
git diff --exit-code HEAD
217+
193218
audit-prod:
194219
name: Audit - Production
195220
runs-on: ubuntu-latest

package-lock.json

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vscode-deepnote",
33
"displayName": "Deepnote",
4-
"version": "0.2.0",
4+
"version": "0.3.0",
55
"description": "Deepnote notebook support.",
66
"publisher": "Deepnote",
77
"author": {
@@ -99,6 +99,12 @@
9999
"category": "Deepnote",
100100
"icon": "$(plug)"
101101
},
102+
{
103+
"command": "deepnote.openInDeepnote",
104+
"title": "Open in Deepnote",
105+
"category": "Deepnote",
106+
"icon": "$(globe)"
107+
},
102108
{
103109
"command": "deepnote.newProject",
104110
"title": "New project",
@@ -767,6 +773,11 @@
767773
"when": "editorFocus && editorLangId == python && jupyter.hascodecells && !notebookEditorFocused && isWorkspaceTrusted",
768774
"command": "jupyter.exportfileasnotebook",
769775
"group": "Jupyter3@2"
776+
},
777+
{
778+
"when": "resourceExtname == .deepnote",
779+
"command": "deepnote.openInDeepnote",
780+
"group": "navigation"
770781
}
771782
],
772783
"editor.interactiveWindow.context": [
@@ -1437,6 +1448,18 @@
14371448
"type": "object",
14381449
"title": "Deepnote",
14391450
"properties": {
1451+
"deepnote.domain": {
1452+
"type": "string",
1453+
"default": "deepnote.com",
1454+
"description": "Deepnote domain (e.g., 'deepnote.com' or 'ra-18838.deepnote-staging.com')",
1455+
"scope": "application"
1456+
},
1457+
"deepnote.disableSSLVerification": {
1458+
"type": "boolean",
1459+
"default": false,
1460+
"description": "Disable SSL certificate verification (for development only)",
1461+
"scope": "application"
1462+
},
14401463
"jupyter.experiments.enabled": {
14411464
"type": "boolean",
14421465
"default": true,

src/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,5 @@ export interface ICommandNameArgumentTypeMapping {
198198
[DSCommands.AddInputDateRangeBlock]: [];
199199
[DSCommands.AddInputFileBlock]: [];
200200
[DSCommands.AddButtonBlock]: [];
201+
[DSCommands.OpenInDeepnote]: [];
201202
}

src/notebooks/deepnote/blocks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ project:
4545
type: 'code'
4646
content: "df = pd.DataFrame({'a': [1, 2, 3]})\ndf"
4747
sortingKey: '001'
48-
blockGroup: 'default-group'
48+
blockGroup: 'uuid-v4'
4949
executionCount: 1
5050
metadata:
5151
table_state_spec: '{"pageSize": 25, "pageIndex": 0}'
@@ -150,7 +150,7 @@ Example of a cell after pocket conversion:
150150
__deepnotePocket: {
151151
type: 'code',
152152
sortingKey: '001',
153-
blockGroup: 'default-group',
153+
blockGroup: 'uuid-v4',
154154
executionCount: 1
155155
}
156156
},
@@ -472,7 +472,7 @@ blocks:
472472
type: 'big-number'
473473
content: ''
474474
sortingKey: '001'
475-
blockGroup: 'default-group'
475+
blockGroup: 'uuid-v4'
476476
metadata:
477477
deepnote_big_number_title: 'Customers'
478478
deepnote_big_number_value: 'customers'
@@ -517,7 +517,7 @@ When opened in VS Code, the block becomes a cell with JSON content showing the c
517517
__deepnotePocket: {
518518
type: 'big-number',
519519
sortingKey: '001',
520-
blockGroup: 'default-group'
520+
blockGroup: 'uuid-v4'
521521
}
522522
}
523523
}

src/notebooks/deepnote/deepnoteDataConverter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
ButtonBlockConverter
2828
} from './converters/inputConverters';
2929
import { CHART_BIG_NUMBER_MIME_TYPE } from '../../platform/deepnote/deepnoteConstants';
30+
import { generateUuid } from '../../platform/common/uuid';
3031

3132
/**
3233
* Utility class for converting between Deepnote block structures and VS Code notebook cells.
@@ -168,7 +169,7 @@ export class DeepnoteDataConverter {
168169

169170
private createFallbackBlock(cell: NotebookCellData, index: number): DeepnoteBlock {
170171
return {
171-
blockGroup: 'default-group',
172+
blockGroup: generateUuid(),
172173
id: generateBlockId(),
173174
sortingKey: generateSortingKey(index),
174175
type: cell.kind === NotebookCellKind.Code ? 'code' : 'markdown',

src/notebooks/deepnote/deepnoteExplorerView.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { IDeepnoteNotebookManager } from '../types';
88
import { DeepnoteTreeDataProvider } from './deepnoteTreeDataProvider';
99
import { type DeepnoteTreeItem, DeepnoteTreeItemType, type DeepnoteTreeItemContext } from './deepnoteTreeItem';
1010
import { generateUuid } from '../../platform/common/uuid';
11+
import { DeepnoteBlock, DeepnoteFile } from '@deepnote/blocks';
1112

1213
/**
1314
* Manages the Deepnote explorer tree view and related commands
@@ -213,10 +214,10 @@ export class DeepnoteExplorerView {
213214
const projectId = generateUuid();
214215
const notebookId = generateUuid();
215216

216-
const firstBlock = {
217+
const firstBlock: DeepnoteBlock = {
217218
blockGroup: generateUuid(),
218219
content: '',
219-
executionCount: null,
220+
executionCount: 0,
220221
id: generateUuid(),
221222
metadata: {},
222223
outputs: [],
@@ -225,9 +226,10 @@ export class DeepnoteExplorerView {
225226
version: 1
226227
};
227228

228-
const projectData = {
229-
version: 1.0,
229+
const projectData: DeepnoteFile = {
230+
version: '1.0.0',
230231
metadata: {
232+
createdAt: new Date().toISOString(),
231233
modifiedAt: new Date().toISOString()
232234
},
233235
project: {

src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ suite('DeepnoteExplorerView - Empty State Commands', () => {
265265
const yamlContent = Buffer.from(capturedContent!).toString('utf8');
266266
const projectData = yaml.load(yamlContent) as any;
267267

268-
expect(projectData.version).to.equal(1.0);
268+
expect(projectData.version).to.equal('1.0.0');
269+
expect(projectData.metadata.createdAt).to.exist;
270+
expect(projectData.metadata.modifiedAt).to.exist;
269271
expect(projectData.project.id).to.equal(projectId);
270272
expect(projectData.project.name).to.equal(projectName);
271273
expect(projectData.project.notebooks).to.have.lengthOf(1);

0 commit comments

Comments
 (0)