Skip to content

Commit

Permalink
Attempt to fix build error due to too many files open (#4198)
Browse files Browse the repository at this point in the history
This PR moves the IPyWidgets renderer into its own little package so
that it has its own `node_modules` separate from the
`positron-ipywidgets` extension, then adds those `node_modules` to the
extension's `.vscodeignore` file which should stop them from being
copied over during the build.

This fixes `yarn gulp compile-extensions-build` for me locally, which
currently errors on main.
  • Loading branch information
seeM authored Jul 31, 2024
1 parent 3604ed6 commit cae4905
Show file tree
Hide file tree
Showing 11 changed files with 665 additions and 732 deletions.
1 change: 0 additions & 1 deletion extensions/positron-ipywidgets/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions extensions/positron-ipywidgets/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
renderer/node_modules/**
4 changes: 2 additions & 2 deletions extensions/positron-ipywidgets/esbuild-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// @ts-check
const path = require('path');

const srcDir = path.join(__dirname, 'renderer');
const outDir = path.join(__dirname, 'renderer-out');
const srcDir = path.join(__dirname, 'renderer/src');
const outDir = path.join(__dirname, 'renderer/dist');

require('../esbuild-webview-common').run({
entryPoints: [
Expand Down
21 changes: 5 additions & 16 deletions extensions/positron-ipywidgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,16 @@
"mimeTypes": [
"application/vnd.jupyter.widget-view+json"
],
"entrypoint": "./renderer-out/index.js",
"entrypoint": "./renderer/dist/index.js",
"requiresMessaging": "always"
}
]
},
"scripts": {
"vscode:prepublish": "yarn build-renderer",
"build-renderer": "node ./esbuild-renderer"
"build-renderer": "node ./esbuild-renderer",
"postinstall": "yarn install --cwd renderer"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@jupyter-widgets/base": "^6.0.7",
"@jupyter-widgets/base-manager": "^1.0.8",
"@jupyter-widgets/controls": "^5.0.8",
"@jupyter-widgets/output": "^6.0.7",
"@jupyterlab/services": "^7.2.3",
"@lumino/coreutils": "^2.1.2",
"@lumino/widgets": "^2.3.2"
},
"devDependencies": {
"@types/vscode-webview": "^1.57.5",
"typescript": "^5.4.5"
}
"dependencies": {},
"devDependencies": {}
}
19 changes: 19 additions & 0 deletions extensions/positron-ipywidgets/renderer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "positron-ipywidgets-renderer",
"description": "Positron IPyWidgets Notebook Renderer",
"version": "0.0.1",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@jupyter-widgets/base": "^6.0.7",
"@jupyter-widgets/base-manager": "^1.0.8",
"@jupyter-widgets/controls": "^5.0.8",
"@jupyter-widgets/output": "^6.0.7",
"@jupyterlab/services": "^7.2.3",
"@lumino/coreutils": "^2.1.2",
"@lumino/widgets": "^2.3.2"
},
"devDependencies": {
"@types/vscode-webview": "^1.57.5",
"typescript": "^5.4.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as base from '@jupyter-widgets/base';
import { JSONObject, JSONValue, UUID } from '@lumino/coreutils';
import { Disposable } from 'vscode-notebook-renderer/events';
import type * as WebviewMessage from '../../../src/vs/workbench/services/languageRuntime/common/positronIPyWidgetsWebviewMessages';
import type * as WebviewMessage from '../../../../src/vs/workbench/services/languageRuntime/common/positronIPyWidgetsWebviewMessages';
import { KernelMessage } from '@jupyterlab/services';
import { Messaging } from './messaging';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as base from '@jupyter-widgets/base';
import { ManagerBase } from '@jupyter-widgets/base-manager';
import { JSONObject } from '@lumino/coreutils';
import * as LuminoWidget from '@lumino/widgets';
import type * as WebviewMessage from '../../../src/vs/workbench/services/languageRuntime/common/positronIPyWidgetsWebviewMessages';
import type * as WebviewMessage from '../../../../src/vs/workbench/services/languageRuntime/common/positronIPyWidgetsWebviewMessages';
import { Disposable } from 'vscode-notebook-renderer/events';
import { Messaging } from './messaging';
import { Comm } from './comm';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { RendererContext } from 'vscode-notebook-renderer';
import { Disposable } from 'vscode-notebook-renderer/events';
import { FromWebviewMessage, ToWebviewMessage } from '../../../src/vs/workbench/services/languageRuntime/common/positronIPyWidgetsWebviewMessages';
import { FromWebviewMessage, ToWebviewMessage } from '../../../../src/vs/workbench/services/languageRuntime/common/positronIPyWidgetsWebviewMessages';

/**
* Typed messaging interface between the preload script and the main thread Positron IPyWidgets service.
Expand Down
Loading

0 comments on commit cae4905

Please sign in to comment.