Skip to content

Commit

Permalink
fix: formatting YAML properties and exporting a cjs build (#12)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Farnabaz <farnabaz@gmail.com>
  • Loading branch information
adamdehaven and farnabaz authored Feb 10, 2025
1 parent 6d36df2 commit 4863ab0
Show file tree
Hide file tree
Showing 48 changed files with 1,349 additions and 530 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm i -g --force corepack && corepack enable
- run: pnpm install
- run: pnpm lint
- run: pnpm build
- run: pnpm test
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ const editor = monaco.editor.create(el, {
})
```

## VS Code Extension

The exported `formatter` and `getDocumentFoldingRanges` functions are also utilized in [@nuxtlabs/vscode-mdc](https://github.com/nuxtlabs/vscode-mdc) to provide the functionality to the [MDC VS Code extension](https://marketplace.visualstudio.com/items?itemName=Nuxt.mdc).

## 💻 Development

- Clone repository
Expand Down
21 changes: 21 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineBuildConfig } from 'unbuild'

// https://github.com/unjs/unbuild?tab=readme-ov-file#configuration
export default defineBuildConfig({
name: '@nuxtlabs/monarch-mdc',
// Each separate plugin's entry file should be listed here
entries: [
'./src/index',
],
externals: [
'monaco-editor-core',
],
// Generates .d.ts declaration file(s)
declaration: true,
// Clean the output directory before building
clean: true,
rollup: {
// Export as CommonJS module, primarily for accessing the formatter in @nuxtlabs/vscode-mdc
emitCJS: true,
},
})
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.4.0",
"license": "MIT",
"description": "Integrate MDC syntax with Monaco Editor",
"main": "./dist/index.mjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
Expand All @@ -21,6 +21,8 @@
"@nuxt/eslint-config": "^0.7.5",
"@vitest/ui": "^2.1.8",
"eslint": "^9.17.0",
"execa": "^9.5.2",
"mdclint": "^0.0.2",
"monaco-editor-core": "^0.52.2",
"release-it": "^18.1.1",
"unbuild": "^3.2.0",
Expand All @@ -41,14 +43,5 @@
"npm": {
"publish": false
}
},
"build": {
"entries": [
"./src/index"
],
"externals": [
"monaco-editor-core"
],
"declaration": true
}
}
Loading

0 comments on commit 4863ab0

Please sign in to comment.