Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mscolnick committed Sep 11, 2023
0 parents commit 6899755
Show file tree
Hide file tree
Showing 25 changed files with 3,079 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:unicorn/recommended", "prettier"],
"plugins": ["@typescript-eslint"],
"ignorePatterns": ["out", "dist", "**/*.d.ts"],
"rules": {
"unicorn/prevent-abbreviations": "off",
"unicorn/no-useless-undefined": "off"
}
}
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: ⎔ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: 📥 Install dependencies
run: pnpm install

- name: 🧹 Lint
run: pnpm lint

typecheck:
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: ⎔ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: 📥 Install dependencies
run: pnpm install

- name: ʦ Typecheck
run: pnpm typecheck
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 18.x

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.cache
.DS_Store
.idea
*.log
*.tgz
*.vsix
coverage
dist
lib-cov
logs
node_modules
temp
!.vscode
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint"]
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
8 changes: 8 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.github
.gitignore
.vscode
**/.eslintrc.json
**/*.map
**/*.ts
**/tsconfig.json
src
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing

## Development

- Run `pnpm install` in the root directory to install dependencies.
- Run `pnpm dev` to start the compiler in watch mode.
- Press `F5` to open a new window with your extension loaded.

### Make changes

- Relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.
- `Ctrl+R` or `Cmd+R` on Mac will reload the extension with your changes.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 marimo <https://github.com/marimo-team/vscode-marimo>

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.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# vscode-marimo

<a href="https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/v/marimo-team.vscode-marimo.svg?color=eee&amp;label=VS%20Code%20Marketplace&logo=visual-studio-code" alt="Visual Studio Marketplace Version" /></a>

Run marimo, directly from VSCode.

## Features

- Launch marimo from VSCode, in both "edit mode" and "run mode".
- View the terminal output of marimo directly in VSCode.
- View the marimo browser window directly in VSCode or in your default browser.

## Extension Settings

You can configure the extension using the following settings:

- `marimo.browserType`: Browser to open marimo app ('system' or 'embedded', default: 'embedded')
- `marimo.port`: Default port for marimo server (default: 2718)
- `marimo.showTerminal`: Open the terminal when the server starts (default: false)
Binary file added images/marimo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"name": "vscode-marimo",
"displayName": "marimo",
"author": "marimo team",
"publisher": "marimo-team",
"description": "Run marimo in VSCode",
"packageManager": "pnpm@8.6.0",
"version": "0.1.0",
"engines": {
"vscode": "^1.80.0"
},
"private": true,
"categories": [
"Notebooks",
"Machine Learning",
"Data Science"
],
"icon": "images/marimo.png",
"activationEvents": [
"onLanguage:python",
"onCommand:vscode-marimo.stop",
"onCommand:vscode-marimo.edit",
"onCommand:vscode-marimo.run",
"onCommand:vscode-marimo.showCommands",
"onCommand:vscode-marimo.openInBrowser"
],
"repository": {
"type": "git",
"url": "https://github.com/marimo-team/vscode-marimo"
},
"bugs": {
"url": "https://github.com/marimo-team/vscode-marimo/issues"
},
"files": [
"dist",
"images"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "vscode-marimo.stop",
"category": "marimo",
"title": "Stop server"
},
{
"command": "vscode-marimo.edit",
"category": "marimo",
"title": "Start marimo server (edit)"
},
{
"command": "vscode-marimo.run",
"category": "marimo",
"title": "Start marimo server (run)"
},
{
"command": "vscode-marimo.openInBrowser",
"category": "marimo",
"title": "Open in system browser",
"icon": "$(link-external)"
},
{
"command": "vscode-marimo.showCommands",
"category": "marimo",
"title": "Show marimo commands",
"icon": "$(symbol-event)"
}
],
"menus": {
"editor/title": [
{
"when": "activeWebviewPanelId == 'marimo'",
"command": "vscode-marimo.openInBrowser",
"group": "navigation"
},
{
"when": "resourceLangId == python && marimo.isMarimoApp",
"command": "vscode-marimo.showCommands",
"group": "navigation"
}
],
"editor/title/run": [
{
"when": "resourceLangId == python && marimo.isMarimoApp",
"command": "vscode-marimo.edit",
"group": "navigation"
},
{
"when": "resourceLangId == python && marimo.isMarimoApp",
"command": "vscode-marimo.run",
"group": "navigation"
}
]
},
"configuration": {
"type": "object",
"title": "marimo",
"properties": {
"marimo.browserType": {
"type": "string",
"enum": [
"embedded",
"system"
],
"default": "embedded",
"description": "Browser to open marimo app"
},
"marimo.port": {
"type": "number",
"default": 2718,
"description": "Default port for marimo server"
},
"marimo.showTerminal": {
"type": "boolean",
"default": false,
"description": "Open the terminal when the server starts"
}
}
}
},
"scripts": {
"build": "tsup src/extension.ts --external=vscode",
"dev": "pnpm run build --watch",
"lint": "eslint src --ext ts",
"format": "prettier --write .",
"pack": "vsce package --no-dependencies",
"pretest": "pnpm run build && pnpm run lint",
"publish": "vsce publish --no-dependencies",
"release": "npx bumpp && pnpm run publish",
"test": "echo 'No tests yet...'",
"typecheck": "tsc --noEmit",
"vscode:prepublish": "pnpm run build"
},
"devDependencies": {
"@types/node": "20.6.0",
"@types/vscode": "^1.80.0",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vscode/test-electron": "^2.3.4",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 6899755

Please sign in to comment.