From a538fcabad04ec47614dc2e2c3ed4f2ae9ef7531 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 17 Jun 2022 22:19:17 +0300 Subject: [PATCH 1/5] full white background for vscode custom editor --- packages/vscode-ext/src/squiggleEditor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vscode-ext/src/squiggleEditor.ts b/packages/vscode-ext/src/squiggleEditor.ts index 26358e94..11c5739c 100644 --- a/packages/vscode-ext/src/squiggleEditor.ts +++ b/packages/vscode-ext/src/squiggleEditor.ts @@ -119,8 +119,8 @@ export class SquiggleEditorProvider implements vscode.CustomTextEditorProvider { Squiggle Editor - -
+ +
`; From 387e6bae371582746dbc60b50ee08fd192eec476 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 17 Jun 2022 22:19:34 +0300 Subject: [PATCH 2/5] get rid of generated vscode readme --- packages/vscode-ext/README.md | 71 +---------------------------------- 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/packages/vscode-ext/README.md b/packages/vscode-ext/README.md index f8a2ecf1..9d89ab8d 100644 --- a/packages/vscode-ext/README.md +++ b/packages/vscode-ext/README.md @@ -1,70 +1,3 @@ -# squiggle README +# Squiggle For VS Code -This is the README for your extension "squiggle". After writing up a brief description, we recommend including the following sections. - -## Features - -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. - -For example if there is an image subfolder under your extension project workspace: - -\!\[feature X\]\(images/feature-x.png\) - -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. - -## Requirements - -If you have any requirements or dependencies, add a section describing those and how to install and configure them. - -## Extension Settings - -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: enable/disable this extension -* `myExtension.thing`: set to `blah` to do something - -## Known Issues - -Calling out known issues can help limit users opening duplicate issues against your extension. - -## Release Notes - -Users appreciate release notes as you update your extension. - -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ------------------------------------------------------------------------------------------------------------ -## Following extension guidelines - -Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. - -* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) - -## Working with Markdown - -**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux) -* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux) -* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets - -### For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** +This extension provides support for [Squiggle](https://www.squiggle-language.com/) in VS Code. From ba496eb1a1d30e4a10ae26a5cf850e4ca8c57e49 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 18 Jun 2022 11:57:52 +0300 Subject: [PATCH 3/5] package react for vscode ext; minor cleanups --- packages/vscode-ext/.gitignore | 4 +-- packages/vscode-ext/package.json | 7 +++--- packages/vscode-ext/src/squiggleEditor.ts | 30 +++++++++++++---------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/packages/vscode-ext/.gitignore b/packages/vscode-ext/.gitignore index 2d1b51da..c712b96a 100644 --- a/packages/vscode-ext/.gitignore +++ b/packages/vscode-ext/.gitignore @@ -1,3 +1,3 @@ -/media/components.css -/media/components-bundle.js +/media/vendor /out +/*.vsix diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 02305dee..a39258ed 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -30,11 +30,12 @@ }, "scripts": { "vscode:prepublish": "yarn run compile", - "compile": "tsc -p ./ && (cd ../components && yarn all) && cp ../components/dist/bundle.js media/components-bundle.js && cp ../components/dist/main.css media/components.css", + "compile:tsc": "tsc -p ./", + "compile:vendor": "(cd ../components && yarn run build) && mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js", + "compile": "yarn run compile:tsc && yarn run compile:vendor", "watch": "tsc -watch -p ./", "pretest": "yarn run compile && yarn run lint", - "lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js" + "lint": "eslint src --ext ts" }, "devDependencies": { "@types/vscode": "^1.68.0", diff --git a/packages/vscode-ext/src/squiggleEditor.ts b/packages/vscode-ext/src/squiggleEditor.ts index 11c5739c..f4fd7a8d 100644 --- a/packages/vscode-ext/src/squiggleEditor.ts +++ b/packages/vscode-ext/src/squiggleEditor.ts @@ -85,18 +85,23 @@ export class SquiggleEditorProvider implements vscode.CustomTextEditorProvider { private getHtmlForWebview(webview: vscode.Webview): string { // Local path to main script run in the webview - const bundleUri = webview.asWebviewUri( + const styleUri = webview.asWebviewUri( vscode.Uri.joinPath( this.context.extensionUri, - "media", - "components-bundle.js" + "media/vendor/components.css" ) ); - const styleUri = webview.asWebviewUri( - vscode.Uri.joinPath(this.context.extensionUri, "media", "components.css") - ); - const scriptUri = webview.asWebviewUri( - vscode.Uri.joinPath(this.context.extensionUri, "media", "wysiwyg.js") + + const scriptUris = [ + // vendor files are copied over by `yarn run compile` + "media/vendor/react.js", + "media/vendor/react-dom.js", + "media/vendor/components.js", + "media/wysiwyg.js", + ].map((script) => + webview.asWebviewUri( + vscode.Uri.joinPath(this.context.extensionUri, script) + ) ); // Use a nonce to whitelist which scripts can be run @@ -113,15 +118,14 @@ export class SquiggleEditorProvider implements vscode.CustomTextEditorProvider { --> - - - Squiggle Editor - +
- + ${scriptUris.map( + (uri) => `` + )} `; } From 77c2e51acabf942e00acdc6137a6f26cc3017bc5 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 18 Jun 2022 21:39:23 +0300 Subject: [PATCH 4/5] vscode ext 0.0.2, minor tweaks --- packages/vscode-ext/LICENSE | 22 ++++++++++++++++++++++ packages/vscode-ext/package.json | 8 +++++++- packages/vscode-ext/src/squiggleEditor.ts | 6 +++--- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 packages/vscode-ext/LICENSE diff --git a/packages/vscode-ext/LICENSE b/packages/vscode-ext/LICENSE new file mode 100644 index 00000000..fb0c468f --- /dev/null +++ b/packages/vscode-ext/LICENSE @@ -0,0 +1,22 @@ + +MIT License + +Copyright (c) 2020 Foretold + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index a39258ed..abedf5b1 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -2,7 +2,13 @@ "name": "vscode-squiggle", "displayName": "Squiggle", "description": "Squiggle language support", - "version": "0.0.1", + "license": "MIT", + "version": "0.0.2", + "publisher": "berekuk", + "repository": { + "type": "git", + "url": "git+https://github.com/quantified-uncertainty/squiggle.git" + }, "engines": { "vscode": "^1.68.0" }, diff --git a/packages/vscode-ext/src/squiggleEditor.ts b/packages/vscode-ext/src/squiggleEditor.ts index f4fd7a8d..3e3d9f2c 100644 --- a/packages/vscode-ext/src/squiggleEditor.ts +++ b/packages/vscode-ext/src/squiggleEditor.ts @@ -123,9 +123,9 @@ export class SquiggleEditorProvider implements vscode.CustomTextEditorProvider {
- ${scriptUris.map( - (uri) => `` - )} + ${scriptUris + .map((uri) => ``) + .join("")} `; } From 112eae91150ae8ced9c99ecbfaee59da1f79e441 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 18 Jun 2022 23:56:05 +0300 Subject: [PATCH 5/5] new vscode ext publisher & icon --- packages/vscode-ext/package.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index abedf5b1..a3887aae 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -3,17 +3,19 @@ "displayName": "Squiggle", "description": "Squiggle language support", "license": "MIT", - "version": "0.0.2", - "publisher": "berekuk", + "version": "0.0.3", + "publisher": "QURI", "repository": { "type": "git", "url": "git+https://github.com/quantified-uncertainty/squiggle.git" }, + "icon": "media/vendor/icon.png", "engines": { "vscode": "^1.68.0" }, "categories": [ - "Programming Languages" + "Programming Languages", + "Visualization" ], "activationEvents": [ "onCustomEditor:squiggle.wysiwyg" @@ -37,7 +39,7 @@ "scripts": { "vscode:prepublish": "yarn run compile", "compile:tsc": "tsc -p ./", - "compile:vendor": "(cd ../components && yarn run build) && mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js", + "compile:vendor": "(cd ../components && yarn run build) && mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js && cp ../website/static/img/quri-logo.png media/vendor/icon.png", "compile": "yarn run compile:tsc && yarn run compile:vendor", "watch": "tsc -watch -p ./", "pretest": "yarn run compile && yarn run lint",