@razorwind/vsce
v0.0.37
Published
Razorwind Visual Studio Code Extension plugin that creates theming extensions from design tokens.
Maintainers
Readme
💨 Razorwind is a unified set of tools that make creating design systems a breeze.
[!IMPORTANT] This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
Razorwind - Visual Studio Code Extension Plugin
Razorwind - Visual Studio Code Extension is a package that can create themeing extensions from design tokens.
Installing
Using pnpm:
pnpm add -D @razorwind/vscenpm install -D @razorwind/vsceyarn add -D @razorwind/vsceUsage
import { defineConfig } from "@razorwind/core";
import vsce, { flattenTokens } from "@razorwind/vsce";
export default defineConfig({
plugins: [
vsce({
name: "my-theme",
publisher: "acme",
displayName: "My Theme",
mapTheme: tokens => {
const flat = flattenTokens(tokens);
const color = (path: string) =>
flat.find(t => t.path === path)?.cssValue ?? "#000000";
return [
{
name: "my-theme-dark",
displayName: "My Theme Dark",
type: "dark",
colors: {
"editor.background": color("color.bg"),
"editor.foreground": color("color.fg")
}
}
];
}
})
]
});Generated package (under vscode-extension/ by default):
themes/*.json— VS Code theme documents frommapThemepackage.json— Marketplace manifest +contributes.themes+ package/publish scripts.vscodeignore,README.mdscripts/— pierre-style helpers (buildVsCodePackage,publishVsce,publishOvsx,vsixPackageShim)
Options
| Option | Default | Description |
| ---------------- | --------------------- | -------------------------------------------------------------------- |
| name | (required) | Unscoped Marketplace extension id |
| publisher | (required) | Marketplace publisher id |
| mapTheme | (required) | (tokens) => theme, theme array, or theme record |
| outputPath | "vscode-extension" | Output directory for the extension package |
| displayName | title-cased name | Marketplace display name |
| version | "0.0.1" | Extension version (no prerelease tags) |
| includeScripts | true | Emit pierre-style scripts/ + package.json script entries |
| extensionName | name | Unscoped name used by the VSIX shim when packaging |
mapTheme return shapes: a single VsCodeTheme, an array, or a Record<string, VsCodeTheme>. Theme type is light | dark | hc | hcLight (maps to uiTheme in contributes.themes).
Package scripts (when includeScripts is enabled):
| Script | Purpose |
| --------------- | -------------------------------------------- |
| package-vsix | Build a VSIX via @vscode/vsce |
| publish-vsce | Publish to VS Marketplace (VSCE_PAT) |
| publish-ovsx | Publish to Open VSX (OVSX_PAT) |
See pierre theme scripts for the packaging shim pattern.
Development
Building
Run nx build vsce to build the library.
Running unit tests
Run nx test vsce to execute the unit tests via Vitest.
Storm Workspaces
Storm workspaces are built using Nx, a set of extensible dev tools for monorepos, which helps you develop like Google, Facebook, and Microsoft. Building on top of Nx, the Open System provides a set of tools and patterns that help you scale your monorepo to many teams while keeping the codebase maintainable.
Roadmap
See the open issues for a list of proposed features (and known issues).
- Top Feature Requests (Add your votes using the 👍 reaction)
- Top Bugs (Add your votes using the 👍 reaction)
- Newest Bugs
Support
Reach out to the maintainer at one of the following places:
License
This project is licensed under the Apache License 2.0. Feel free to edit and distribute this template as you like.
See LICENSE for more information.
Changelog
This project adheres to Semantic Versioning. Every release, along with the migration instructions, is documented in the CHANGELOG file
Contributing
First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please try to create bug reports that are:
- Reproducible. Include steps to reproduce the problem.
- Specific. Include as much detail as possible: which version, what environment, etc.
- Unique. Do not duplicate existing opened issues.
- Scoped to a Single Bug. One bug per report.
Please adhere to this project's code of conduct.
You can use markdownlint-cli to check for common markdown style inconsistency.
Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Storm Software is an open source software development organization and creator of Acidic, StormStack and StormCloud.
Our mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
Join us on Discord to chat with the team, receive release notifications, ask questions, and get involved.
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our website or join our Slack channel!
