Skip to content

Commit c724070

Browse files
authored
feat(ide): add Monaco and CodeMirror packages and update CI config (#440)
- Add `@dotprompt/monaco` package with Monarch grammar, completions, and hover - Add `@dotprompt/codemirror` package with Lezer-like stream parser and themes - Update Release Please config with new packages: - `@dotprompt/monaco` - `@dotprompt/codemirror` - `dotprompt-jetbrains` - `dotprompt-emacs` - `tree-sitter-dotprompt` - Add GitHub Actions workflows: - [web_editors.yml](cci:7://file:///Users/yesudeep/code/github.com/google/dotprompt/.github/workflows/web_editors.yml:0:0-0:0): Build/publish Monaco and CodeMirror - [ide_plugins.yml](cci:7://file:///Users/yesudeep/code/github.com/google/dotprompt/.github/workflows/ide_plugins.yml:0:0-0:0): Verify JetBrains, Vim, and Emacs plugins - [treesitter.yml](cci:7://file:///Users/yesudeep/code/github.com/google/dotprompt/.github/workflows/treesitter.yml:0:0-0:0): Generate and test Tree-sitter grammar
1 parent 95eeb73 commit c724070

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+10239
-212
lines changed

.genkit/traces_idx/genkit.metadata

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/ide_plugins.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: IDE Plugins
18+
19+
on:
20+
push:
21+
branches: [main]
22+
paths:
23+
- 'packages/jetbrains/**'
24+
- 'packages/vim/**'
25+
- 'packages/emacs/**'
26+
pull_request:
27+
branches: [main]
28+
paths:
29+
- 'packages/jetbrains/**'
30+
- 'packages/vim/**'
31+
- 'packages/emacs/**'
32+
workflow_dispatch:
33+
34+
jobs:
35+
jetbrains:
36+
name: JetBrains Plugin
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Setup Java
42+
uses: actions/setup-java@v4
43+
with:
44+
distribution: 'zulu'
45+
java-version: '17'
46+
47+
- name: Setup Gradle
48+
uses: gradle/actions/setup-gradle@v3
49+
50+
- name: Build Plugin
51+
working-directory: packages/jetbrains
52+
run: ./gradlew buildPlugin
53+
54+
- name: Verify Plugin
55+
working-directory: packages/jetbrains
56+
run: ./gradlew verifyPlugin
57+
58+
- name: Publish Plugin
59+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.modified, 'packages/jetbrains/src/main/resources/META-INF/plugin.xml')
60+
working-directory: packages/jetbrains
61+
run: ./gradlew publishPlugin
62+
env:
63+
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
64+
65+
vim:
66+
name: Vim/Neovim
67+
runs-on: ubuntu-latest
68+
steps:
69+
# Simple check for syntax validity
70+
- uses: actions/checkout@v4
71+
72+
- name: Check Lua syntax
73+
uses: JohnnyMorganz/stylua-action@v3
74+
with:
75+
token: ${{ secrets.GITHUB_TOKEN }}
76+
version: latest
77+
args: --check packages/vim/lua/
78+
79+
emacs:
80+
name: Emacs Mode
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Setup Emacs
86+
uses: purcell/setup-emacs@master
87+
with:
88+
version: 29.1
89+
90+
- name: Byte compile
91+
working-directory: packages/emacs
92+
run: emacs -Q -batch -L . -f batch-byte-compile dotprompt-mode.el

.github/workflows/treesitter.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: Tree-sitter
18+
19+
on:
20+
push:
21+
branches: [main]
22+
paths:
23+
- 'packages/treesitter/**'
24+
pull_request:
25+
branches: [main]
26+
paths:
27+
- 'packages/treesitter/**'
28+
workflow_dispatch:
29+
30+
jobs:
31+
test:
32+
name: Test and Build
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Setup Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '20'
41+
42+
- name: Install dependencies
43+
working-directory: packages/treesitter
44+
run: npm install
45+
46+
- name: Generate parser
47+
working-directory: packages/treesitter
48+
run: npm run generate
49+
50+
- name: Run tests
51+
working-directory: packages/treesitter
52+
run: npm run test
53+
54+
publish:
55+
name: Publish to NPM
56+
needs: test
57+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.modified, 'packages/treesitter/package.json')
58+
runs-on: ubuntu-latest
59+
permissions:
60+
contents: write
61+
id-token: write
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: Setup Node
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version: '20'
69+
registry-url: 'https://registry.npmjs.org'
70+
71+
- name: Publish
72+
working-directory: packages/treesitter
73+
run: |
74+
npm install
75+
npm run build
76+
npm publish
77+
env:
78+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/web_editors.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: Web Editor Packages
18+
19+
on:
20+
push:
21+
branches: [main]
22+
paths:
23+
- 'packages/monaco/**'
24+
- 'packages/codemirror/**'
25+
pull_request:
26+
branches: [main]
27+
paths:
28+
- 'packages/monaco/**'
29+
- 'packages/codemirror/**'
30+
workflow_dispatch:
31+
32+
jobs:
33+
test:
34+
name: Test and Build
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
package: [monaco, codemirror]
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Setup Node
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '20'
46+
47+
- name: Setup pnpm
48+
uses: pnpm/action-setup@v3
49+
with:
50+
version: 9
51+
52+
- name: Install dependencies
53+
working-directory: packages/${{ matrix.package }}
54+
run: pnpm install
55+
56+
- name: Typecheck
57+
working-directory: packages/${{ matrix.package }}
58+
run: pnpm run typecheck
59+
60+
- name: Build
61+
working-directory: packages/${{ matrix.package }}
62+
run: pnpm run build
63+
64+
publish:
65+
name: Publish to NPM
66+
needs: test
67+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
id-token: write
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Setup Node
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: '20'
79+
registry-url: 'https://registry.npmjs.org'
80+
81+
- name: Setup pnpm
82+
uses: pnpm/action-setup@v3
83+
with:
84+
version: 9
85+
86+
- name: Publish Monaco
87+
if: contains(github.event.head_commit.modified, 'packages/monaco/package.json')
88+
working-directory: packages/monaco
89+
run: |
90+
pnpm install
91+
pnpm run build
92+
pnpm publish --no-git-checks
93+
env:
94+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
95+
96+
- name: Publish CodeMirror
97+
if: contains(github.event.head_commit.modified, 'packages/codemirror/package.json')
98+
working-directory: packages/codemirror
99+
run: |
100+
pnpm install
101+
pnpm run build
102+
pnpm publish --no-git-checks
103+
env:
104+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ python/.tox
1515
python/handlebarrz/target
1616
site/
1717
target/
18+
.genkit/

.release-please-config.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,53 @@
143143
"draft": false,
144144
"prerelease": false,
145145
"path": "packages/emacs"
146+
},
147+
"packages/monaco": {
148+
"release-type": "node",
149+
"package-name": "@dotprompt/monaco",
150+
"changelog-path": "CHANGELOG.md",
151+
"bump-minor-pre-major": true,
152+
"bump-patch-for-minor-pre-major": true,
153+
"draft": false,
154+
"prerelease": false,
155+
"path": "packages/monaco"
156+
},
157+
"packages/codemirror": {
158+
"release-type": "node",
159+
"package-name": "@dotprompt/codemirror",
160+
"changelog-path": "CHANGELOG.md",
161+
"bump-minor-pre-major": true,
162+
"bump-patch-for-minor-pre-major": true,
163+
"draft": false,
164+
"prerelease": false,
165+
"path": "packages/codemirror"
166+
},
167+
"packages/jetbrains": {
168+
"release-type": "simple",
169+
"package-name": "dotprompt-jetbrains",
170+
"changelog-path": "CHANGELOG.md",
171+
"bump-minor-pre-major": true,
172+
"bump-patch-for-minor-pre-major": true,
173+
"draft": false,
174+
"prerelease": false,
175+
"path": "packages/jetbrains",
176+
"extra-files": [
177+
{
178+
"type": "xml",
179+
"path": "src/main/resources/META-INF/plugin.xml",
180+
"jsonpath": "idea-plugin.change-notes"
181+
}
182+
]
183+
},
184+
"packages/treesitter": {
185+
"release-type": "node",
186+
"package-name": "tree-sitter-dotprompt",
187+
"changelog-path": "CHANGELOG.md",
188+
"bump-minor-pre-major": true,
189+
"bump-patch-for-minor-pre-major": true,
190+
"draft": false,
191+
"prerelease": false,
192+
"path": "packages/treesitter"
146193
}
147194
},
148195
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"

.release-please-manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
"rs": "0.1.0",
88
"packages/vscode": "0.0.1",
99
"packages/vim": "0.1.0",
10-
"packages/emacs": "0.1.0"
10+
"packages/emacs": "0.1.0",
11+
"packages/monaco": "0.1.0",
12+
"packages/codemirror": "0.1.0",
13+
"packages/jetbrains": "0.2.0",
14+
"packages/treesitter": "0.1.0"
1115
}

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use_repo(
3737
"com_github_goccy_go_yaml",
3838
"com_github_invopop_jsonschema",
3939
"com_github_mbleigh_raymond",
40+
"com_github_smacker_go_tree_sitter",
4041
"com_github_stretchr_testify",
4142
"com_github_wk8_go_ordered_map_v2",
4243
"org_golang_x_text",

go/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require (
1616

1717
require (
1818
github.com/mbleigh/raymond v0.0.0-20250414171441-6b3a58ab9e0a
19+
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
1920
github.com/wk8/go-ordered-map/v2 v2.1.8
2021
golang.org/x/text v0.33.0
2122
)

0 commit comments

Comments
 (0)