Skip to content

Commit c04820e

Browse files
committed
Merge branch 'dev' into unit-tests
I need to update package.json and some other stuff later like esbuild script, lol
2 parents 28b5b1b + c2675a4 commit c04820e

77 files changed

Lines changed: 10960 additions & 6533 deletions

Some content is hidden

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

.github/workflows/builds.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build extension
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
paths-ignore:
8+
- ".github/"
9+
- ".vscode/"
10+
- ".husky/"
11+
- "playground/"
12+
- "docs/"
13+
- "tony/"
14+
pull_request:
15+
paths-ignore:
16+
- ".github/"
17+
- ".vscode/"
18+
- ".husky/"
19+
- "playground/"
20+
- "docs/"
21+
- "tony/"
22+
workflow_dispatch:
23+
inputs:
24+
prod:
25+
type: choice
26+
description: Whether to override to build in production mode. Use 0 for dev and 1 for prod.
27+
required: false
28+
default: "0"
29+
options: ["0", "1"]
30+
31+
jobs:
32+
build:
33+
name: Build extension
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout source repository
37+
uses: actions/checkout@v4
38+
with:
39+
ref: ${{ github.sha }}
40+
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v4.4.0
43+
with:
44+
node-version: 22.x.x
45+
cache: 'npm'
46+
cache-dependency-path: './package-lock.json'
47+
48+
- name: Cache node_modules
49+
uses: actions/cache@v4
50+
with:
51+
path: node_modules/
52+
key: neuropilot-build
53+
54+
- name: Install dependencies
55+
run: npm install
56+
57+
- name: Package extension
58+
env:
59+
NODE_ENV: ${{ inputs.prod || '0' }}
60+
run: npx @vscode/vsce package --allow-star-activation
61+
62+
- name: Upload builds
63+
uses: actions/upload-artifact@v4
64+
with:
65+
path: neuropilot-*.vsix
66+
name: NeuroPilot (Non-Production) Build ${{ github.sha }}

.github/workflows/docs.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
pull_request:
99
paths:
1010
- docs/**
11-
1211
workflow_dispatch:
12+
workflow_call:
1313

1414
permissions:
1515
contents: read
@@ -23,7 +23,7 @@ concurrency:
2323
jobs:
2424
check:
2525
name: Check docs site
26-
if: ${{ github.event_name == 'pull_request' }}
26+
if: ${{ github.event_name != 'workflow_dispatch' }}
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout repository
@@ -53,7 +53,7 @@ jobs:
5353
run: cd docs && npm run check
5454
build:
5555
name: Build docs site
56-
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
56+
if: ${{ github.event_name != 'pull_request' }}
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: Checkout repository
@@ -65,6 +65,7 @@ jobs:
6565
key: neuropilot-docs-${{ github.repository }}
6666
path: |
6767
docs/.astro
68+
docs/.cache
6869
docs/dist
6970
docs/node_modules
7071
@@ -82,11 +83,11 @@ jobs:
8283
- name: Install deps
8384
run: |
8485
cd docs
85-
npm ci
86-
86+
npm install
87+
8788
- name: Build site
8889
working-directory: ${{ github.workspace }}/docs
89-
run: npm run build
90+
run: PUBLIC_VERSION=$(npm show ./ version) npm run build
9091

9192
- name: Upload GitHub Pages Artifact
9293
uses: actions/upload-pages-artifact@2d163be3ddce01512f3eea7ac5b7023b5d643ce1 # Pinning to SHA because that thing hasn't updated in a year it seems

.github/workflows/publish.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
- 'minor'
1717
- 'patch'
1818
- 'none'
19+
update_docs:
20+
type: boolean
21+
description: 'Docs are up to date'
22+
required: true
23+
default: false
1924

2025
jobs:
2126
publish:
@@ -29,18 +34,34 @@ jobs:
2934
with:
3035
node-version: 'latest'
3136

32-
- name: Build
33-
run: |
34-
npm install
35-
npm run compile
37+
- name: Install deps
38+
run: npm install
3639

3740
- name: Configure Git
3841
run: |
3942
git config --global user.name "GitHub Actions"
4043
git config --global user.email "actions@github.com"
4144
45+
- name: Bump docs version
46+
if: ${{ inputs.update_docs }}
47+
working-directory: ${{ github.workspace }}/docs
48+
run: |
49+
npm version --no-git-tag-version ${{ inputs.version }}
50+
git add package.json package-lock.json
51+
4252
- name: Publish extension
43-
run: npx @vscode/vsce publish ${{inputs.version}} -p ${{secrets.MARKETPLACE_TOKEN}} --allow-star-activation
53+
env:
54+
NODE_ENV: 1
55+
run: npx @vscode/vsce publish ${{inputs.version}} -p ${{secrets.MARKETPLACE_TOKEN}} --allow-star-activation --no-git-tag-version
56+
57+
- name: Commit and push version change
58+
run: |
59+
new_version=$(npm show ./ version)
60+
git commit -am "$new_version"
61+
git tag -a "v$new_version" -m "$new_version"
62+
git push --follow-tags https://VSC-NeuroPilot:${{secrets.GITHUB_TOKEN}}:@github.com/VSC-NeuroPilot/neuropilot
63+
64+
- name: Rebuild docs site
65+
if: ${{ inputs.update_docs }}
66+
uses: ./.github/workflows/docs.yml
4467

45-
- name: Push version change
46-
run: git push --follow-tags https://Pasu4:${{secrets.GITHUB_TOKEN}}:@github.com/Pasu4/neuropilot

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ node_modules
1616
dist/
1717
# generated astro types
1818
.astro/
19+
.cache/
1920

2021
# logs
2122
npm-debug.log*

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
npm run types
12
npx eslint
23
cd docs && npm run check

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"recommendations": ["astro-build.astro-vscode"],
2+
"recommendations": ["astro-build.astro-vscode", "connor4312.esbuild-problem-matchers"],
33
"unwantedRecommendations": []
44
}

.vscode/launch.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"version": "0.2.0",
77
"configurations": [
88
{
9-
"name": "Run Extension",
9+
"name": "Run Desktop Extension",
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
@@ -16,9 +16,25 @@
1616
// "--disable-extensions"
1717
],
1818
"outFiles": [
19-
"${workspaceFolder}/out/**/*.js"
19+
"${workspaceFolder}/out/**/*.js",
20+
"!${workspaceFolder}/out/web/**"
2021
],
21-
"preLaunchTask": "npm: watch"
22+
"preLaunchTask": "watch:desktop"
23+
},
24+
{
25+
"name": "Run Web Extension",
26+
"type": "extensionHost",
27+
"request": "launch",
28+
"debugWebWorkerHost": true,
29+
"args": [
30+
"--extensionDevelopmentPath=${workspaceFolder}",
31+
"${workspaceFolder}/playground",
32+
"--extensionDevelopmentKind=web"
33+
],
34+
"outFiles": [
35+
"${workspaceFolder}/out/web/**/*.js"
36+
],
37+
"preLaunchTask": "watch:web"
2238
},
2339
{
2440
"name": "Extension Tests",
@@ -31,11 +47,12 @@
3147
"${workspaceFolder}/test-playground"
3248
],
3349
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
34-
"preLaunchTask": "npm: watch"
50+
"preLaunchTask": "watch:desktop"
3551
},
3652
{
37-
"command": "./docs/node_modules/.bin/astro dev",
53+
"command": "./node_modules/.bin/astro dev",
3854
"name": "Docs development server (Astro)",
55+
"cwd": "${workspaceFolder}/docs",
3956
"request": "launch",
4057
"type": "node-terminal"
4158
}

.vscode/tasks.json

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"tasks": [
66
{
77
"type": "npm",
8-
"script": "watch",
8+
"script": "watch:desktop",
99
"problemMatcher": "$tsc-watch",
1010
"isBackground": true,
1111
"presentation": {
@@ -16,6 +16,82 @@
1616
"isDefault": true
1717
}
1818
},
19+
{
20+
"label": "watch:desktop",
21+
"dependsOn": [
22+
"npm: watch:desktop:tsc",
23+
"npm: watch:desktop:esbuild"
24+
],
25+
"presentation": {
26+
"reveal": "never"
27+
},
28+
"group": {
29+
"kind": "build",
30+
"isDefault": true
31+
}
32+
},
33+
{
34+
"type": "npm",
35+
"script": "watch:desktop:esbuild",
36+
"group": "build",
37+
"problemMatcher": "$esbuild-watch",
38+
"isBackground": true,
39+
"label": "npm: watch:desktop:esbuild",
40+
"presentation": {
41+
"group": "watch",
42+
"reveal": "never"
43+
}
44+
},
45+
{
46+
"type": "npm",
47+
"script": "watch:desktop:tsc",
48+
"group": "build",
49+
"problemMatcher": "$tsc-watch",
50+
"isBackground": true,
51+
"label": "npm: watch:desktop:tsc",
52+
"presentation": {
53+
"group": "watch",
54+
"reveal": "never"
55+
}
56+
},
57+
{
58+
"label": "watch:web",
59+
"dependsOn": [
60+
"npm: watch:web:tsc",
61+
"npm: watch:web:esbuild"
62+
],
63+
"presentation": {
64+
"reveal": "never"
65+
},
66+
"group": {
67+
"kind": "build",
68+
"isDefault": true
69+
}
70+
},
71+
{
72+
"type": "npm",
73+
"script": "watch:web:esbuild",
74+
"group": "build",
75+
"problemMatcher": "$esbuild-watch",
76+
"isBackground": true,
77+
"label": "npm: watch:web:esbuild",
78+
"presentation": {
79+
"group": "watch",
80+
"reveal": "never"
81+
}
82+
},
83+
{
84+
"type": "npm",
85+
"script": "watch:web:tsc",
86+
"group": "build",
87+
"problemMatcher": "$tsc-watch",
88+
"isBackground": true,
89+
"label": "npm: watch:web:tsc",
90+
"presentation": {
91+
"group": "watch",
92+
"reveal": "never"
93+
}
94+
},
1995
{
2096
"label": "Publish extension",
2197
"type": "shell",
@@ -29,7 +105,11 @@
29105
"description": "Bump which version?",
30106
"type": "pickString",
31107
"default": "patch",
32-
"options": [ "patch", "minor", "major" ]
108+
"options": [
109+
"patch",
110+
"minor",
111+
"major"
112+
]
33113
}
34114
]
35115
}

.vscodeignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ playground/**
33
.gitignore
44
eslint.config.mjs
55
tsconfig.json
6+
tsconfig.web.json
67
src/
8+
node_modules/
79
*.vsix
810

11+
# Project files
12+
project-files/
13+
14+
# Build files
15+
esbuild.{m,c,}js
16+
esbuild-configs/
17+
918
# Krita
1019
*.kra
1120
*.*~

0 commit comments

Comments
 (0)