Skip to content

Commit

Permalink
✨ Publish as a module to the npm registry (#71)
Browse files Browse the repository at this point in the history
* ✨ Add `files` and `main` fields to `package.json`

* ✨ Publish to NPM registry from GitHub Actions

* 📝 Document node module usage
  • Loading branch information
carloscuesta committed Jan 9, 2024
1 parent e2870b5 commit ea5a026
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
env:
VSCODE_PAT: ${{ secrets.VSCODE_TOKEN }}
run: npm run publish -- --pat=${{ env.VSCODE_PAT }}
- name: Publish package to NPM 🚀
env:
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
npm publish
- name: Get branch names 🌳
id: branch-name
uses: tj-actions/branch-names@v8
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,29 @@
1. Open _Command Palette_ > _Install Extensions_
2. Search for `sprinkles-theme` and install

### Module

You can also install the theme as a node module:

```bash
npm install sprinkles-vscode
```

## Usage

### VSCode

1. Open _Command Palette_ > _Preferences: Color Theme_
2. Select `Sprinkles` from the dropdown

### Module

You can import the theme anywhere by installing it as a dependency:

```js
import dark from "sprinkles-vscode/themes/sprinkles-dark.json";
```

## Screenshots

### Dark
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"theme": "dark"
},
"icon": "images/icon.png",
"files": [
"themes"
],
"contributes": {
"themes": [
{
Expand Down

0 comments on commit ea5a026

Please sign in to comment.