Skip to content

Commit 92565fb

Browse files
authored
Initial commit
0 parents  commit 92565fb

77 files changed

Lines changed: 8331 additions & 0 deletions

File tree

Some content is hidden

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

.clj-kondo/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:lint-as {e2e.macros/deftest-async clojure.test/deftest}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:lint-as {babashka.fs/with-temp-dir clojure.core/let}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{:lint-as {promesa.core/-> clojure.core/->
2+
promesa.core/->> clojure.core/->>
3+
promesa.core/as-> clojure.core/as->
4+
promesa.core/let clojure.core/let
5+
promesa.core/plet clojure.core/let
6+
promesa.core/loop clojure.core/loop
7+
promesa.core/recur clojure.core/recur
8+
promesa.core/with-redefs clojure.core/with-redefs
9+
promesa.core/doseq clojure.core/doseq}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
{:hooks
3+
{:analyze-call {org.httpkit.server/with-channel httpkit.with-channel/with-channel}}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(ns httpkit.with-channel
2+
(:require [clj-kondo.hooks-api :as api]))
3+
4+
(defn with-channel [{node :node}]
5+
(let [[request channel & body] (rest (:children node))]
6+
(when-not (and request channel) (throw (ex-info "No request or channel provided" {})))
7+
(when-not (api/token-node? channel) (throw (ex-info "Missing channel argument" {})))
8+
(let [new-node
9+
(api/list-node
10+
(list*
11+
(api/token-node 'let)
12+
(api/vector-node [channel (api/vector-node [])])
13+
request
14+
body))]
15+
16+
{:node new-node})))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{:lint-as
2+
{rewrite-clj.zip/subedit-> clojure.core/->
3+
rewrite-clj.zip/subedit->> clojure.core/->>
4+
rewrite-clj.zip/edit-> clojure.core/->
5+
rewrite-clj.zip/edit->> clojure.core/->>}}

.cljfmt.edn

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{:remove-surrounding-whitespace? true
2+
:remove-trailing-whitespace? true
3+
:remove-consecutive-blank-lines? false
4+
:insert-missing-whitespace? true
5+
:remove-multiple-non-indenting-spaces? false}

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [PEZ]
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Build and test
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
pull_request:
7+
branches:
8+
- 'master'
9+
workflow_call:
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '22'
23+
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Prepare java
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'zulu'
31+
java-version: '21'
32+
33+
- name: Install clojure tools
34+
uses: DeLaGuardo/setup-clojure@12.5
35+
with:
36+
cli: latest
37+
bb: latest
38+
39+
- name: Cache clojure/java dependencies
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.m2/repository
44+
~/.gitlibs
45+
~/.deps.clj
46+
key: ${{ runner.os }}-clojure-${{ hashFiles('**/*.edn') }}
47+
restore-keys: |
48+
${{ runner.os }}-clojure-
49+
50+
- name: Install node dependencies
51+
run: npm install
52+
53+
- name: Cache npm
54+
uses: actions/cache@v4
55+
with:
56+
path: ~/.npm
57+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
58+
restore-keys: |
59+
${{ runner.os }}-npm-
60+
61+
- name: Build Pre-release VSIX
62+
if: startsWith(github.ref, 'refs/heads/')
63+
run: bb package-pre-release ${GITHUB_REF#refs/heads/}
64+
65+
- name: Build Release VSIX
66+
if: startsWith(github.ref, 'refs/tags/v')
67+
shell: bash
68+
run: |
69+
set -x
70+
npm run package
71+
72+
- name: Get VSIX File Name
73+
id: get-vsix-name
74+
shell: bash
75+
run: echo "VSIX_NAME=$(ls *.vsix)" >> $GITHUB_ENV
76+
77+
- name: Upload VSIX Artifact
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: ${{ runner.os }}-${{ env.VSIX_NAME }}
81+
path: ${{ env.VSIX_NAME }}
82+
83+
- name: Upload Test Artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: ${{ runner.os }}-extension-tests
87+
path: out/extension-tests.js
88+
89+
test:
90+
strategy:
91+
matrix:
92+
os: [ubuntu-latest, windows-latest, macos-latest]
93+
runs-on: ${{ matrix.os }}
94+
needs: build
95+
steps:
96+
- name: Download Test Artifact
97+
uses: actions/download-artifact@v4
98+
with:
99+
name: ${{ runner.os }}-extension-tests
100+
pattern: out/extension-tests.js
101+
merge-multiple: true
102+
path: out/
103+
104+
- name: Run Tests
105+
run: node out/extension-tests.js
106+
107+
e2e-test:
108+
strategy:
109+
matrix:
110+
os: [ubuntu-latest, windows-latest, macos-latest]
111+
runs-on: ${{ matrix.os }}
112+
needs: build
113+
steps:
114+
- name: Checkout
115+
uses: actions/checkout@v4
116+
117+
- name: Download VSIX Artifact
118+
uses: actions/download-artifact@v4
119+
with:
120+
path: .
121+
pattern: '${{ runner.os }}-*.vsix'
122+
merge-multiple: true
123+
124+
- name: Get VSIX File Name
125+
id: get-vsix-name
126+
shell: bash
127+
run: echo "VSIX_NAME=$(ls *.vsix)" >> $GITHUB_ENV
128+
129+
- name: Setup Node.js
130+
uses: actions/setup-node@v4
131+
with:
132+
node-version: '22'
133+
134+
- name: Cache npm
135+
uses: actions/cache@v4
136+
with:
137+
path: ~/.npm
138+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
139+
restore-keys: |
140+
${{ runner.os }}-npm-
141+
142+
- name: Install node dependencies
143+
run: npm install
144+
145+
- name: Setup Babashka
146+
uses: DeLaGuardo/setup-clojure@12.5
147+
with:
148+
bb: latest
149+
150+
- name: Run E2E Tests Unix
151+
if: runner.os != 'Windows'
152+
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
153+
with:
154+
run: bb run-e2e-tests-vsix ${{ env.VSIX_NAME }}
155+
156+
- name: Run E2E Tests Windows
157+
if: runner.os == 'Windows'
158+
shell: bash
159+
run: bb run-e2e-tests-vsix ${{ env.VSIX_NAME }}
160+
161+
lint:
162+
runs-on: ubuntu-latest
163+
needs: build
164+
steps:
165+
- name: Checkout
166+
uses: actions/checkout@v4
167+
168+
- name: Install clojure tools
169+
uses: DeLaGuardo/setup-clojure@12.5
170+
with:
171+
clj-kondo: latest
172+
173+
- name: Linting that sparks joy
174+
run: |
175+
clj-kondo --version
176+
clj-kondo --lint src test --fail-level warning
177+
178+
check-format:
179+
runs-on: ubuntu-latest
180+
needs: build
181+
steps:
182+
- name: Checkout
183+
uses: actions/checkout@v4
184+
185+
- name: Install clojure tools
186+
uses: DeLaGuardo/setup-clojure@12.5
187+
with:
188+
cljfmt: latest
189+
190+
- name: Check formatting
191+
run: |
192+
cljfmt --version
193+
cljfmt check

.github/workflows/release.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Release VSIX
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
test:
10+
uses: ./.github/workflows/build-and-test.yml
11+
12+
github-release:
13+
needs:
14+
- test
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Download VSIX Artifact
23+
uses: actions/download-artifact@v4
24+
with:
25+
path: /tmp
26+
pattern: '*.vsix'
27+
merge-multiple: true
28+
29+
- name: Install clojure tools
30+
uses: DeLaGuardo/setup-clojure@12.5
31+
with:
32+
cli: latest
33+
bb: latest
34+
35+
- name: Cache clojure/java dependencies
36+
uses: actions/cache@v4
37+
with:
38+
path: |
39+
~/.m2/repository
40+
~/.gitlibs
41+
~/.deps.clj
42+
key: ${{ runner.os }}-clojure-${{ hashFiles('**/*.edn') }}
43+
restore-keys: |
44+
${{ runner.os }}-clojure-
45+
46+
- name: Write release notes
47+
run: |
48+
bb ci:release-notes ${{ github.ref_name }} > /tmp/release-notes.md
49+
50+
- name: Github Release
51+
uses: ncipollo/release-action@v1
52+
with:
53+
bodyFile: /tmp/release-notes.md
54+
artifacts: "/tmp/*.vsix"
55+
56+
publish-to-marketplace:
57+
runs-on: ubuntu-latest
58+
needs: github-release
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: '22'
67+
68+
- name: Cache npm
69+
uses: actions/cache@v4
70+
with:
71+
path: ~/.npm
72+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
73+
restore-keys: |
74+
${{ runner.os }}-npm-
75+
76+
- name: Install node dependencies
77+
run: npm install
78+
79+
- name: Download VSIX Artifact
80+
uses: actions/download-artifact@v4
81+
with:
82+
path: /tmp
83+
pattern: '*.vsix'
84+
merge-multiple: true
85+
86+
- name: Publish to VS Code Marketplace
87+
run: | # TODO: Actually publish to the marketplace. For now, only verify that the personal access token will work
88+
npx vsce verify-pat --pat ${{ secrets.MARKETPLACE_PAT }}
89+
echo npx vsce publish --packagePath /tmp/*.vsix --pat ${{ secrets.MARKETPLACE_PAT }} --githubBranch master
90+
91+
publish-to-open-vsx:
92+
runs-on: ubuntu-latest
93+
needs: github-release
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@v4
97+
98+
- name: Setup Node.js
99+
uses: actions/setup-node@v4
100+
with:
101+
node-version: '22'
102+
103+
- name: Cache npm
104+
uses: actions/cache@v4
105+
with:
106+
path: ~/.npm
107+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
108+
restore-keys: |
109+
${{ runner.os }}-npm-
110+
111+
- name: Install node dependencies
112+
run: npm install
113+
114+
- name: Download VSIX Artifact
115+
uses: actions/download-artifact@v4
116+
with:
117+
path: /tmp
118+
pattern: '*.vsix'
119+
merge-multiple: true
120+
121+
- name: Publish to Open VSX
122+
run: | # TODO: Actually publish to open-vsx. For now, only verify that the personal access token will work
123+
npx ovsx verify-pat --pat ${{ secrets.OPEN_VSX_PAT }}
124+
echo npx ovsx publish /tmp/*.vsix --pat ${{ secrets.OPEN_VSX_PAT }}
125+
126+
bump-version:
127+
runs-on: ubuntu-latest
128+
needs: publish-to-marketplace
129+
permissions:
130+
contents: write
131+
steps:
132+
- name: Checkout
133+
uses: actions/checkout@v4
134+
with:
135+
fetch-depth: 0
136+
137+
- name: Get Source Branch
138+
id: source-branch
139+
run: echo "BUMP_BRANCH=$(git name-rev --name-only --exclude=tags/* HEAD)" >> $GITHUB_ENV
140+
141+
- name: Setup Babashka
142+
uses: DeLaGuardo/setup-clojure@12.5
143+
with:
144+
bb: latest
145+
146+
- name: Bump Version
147+
env:
148+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149+
run: bb ci:bump-version-and-push ${{ env.BUMP_BRANCH}} "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" "${{ github.actor }}" --force

0 commit comments

Comments
 (0)