0.4.1 • Published 12 months ago

codem v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

codem

easily embed VSCode web-standalone in projects

Installation

# npm
$ npm install -D codem

# pnpm
$ pnpm add -D codem

# yarn
$ yarn add -D codem

Quick Start

1. Create Config File

Config file can be one of the following:

  • codem.config.ts
  • codem.config.mts
  • codem.config.js
  • codem.config.mjs
  • codem.config.json
// codem.config.ts
import { defineConfig, VscodeChannel } from 'codem'

export default defineConfig({
  // Use stable or insider channel
  channel: VscodeChannel.Stable,
  
  // Specify VSCode version (optional)
  version: '1.96.1'
  
  // Or use a specific commit hash from microsoft/vscode repository (takes precedence over version)
  // commit: '123abc...',

  // The output directory for downloaded VSCode files
  output: './public/vscode'
})

2. Run CLI

npx codem

3. Use VSCode in your project

// import entry from the codem ${output}/index.js
import workbench from '/vscode/index.js'

await workbench.create(window.document.body, {
  // vscode workbench construction options
  productConfiguration: {
    nameShort: "VSCode",
    nameLong: "VSCode in My Project",
    applicationName: "vscode-in-my-project",
    dataFolderName: ".vscode-in-my-project",
    version: "1.0.0",
  },
  // ... other options
})

See Web Workbench API for more available options.

Examples

License

MIT License

0.4.1

12 months ago

0.4.0

12 months ago

0.3.0

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago