Skip to content

Commit 66cb2e2

Browse files
authored
refactor!: rewrite the vscode extension and remove the cli (for now) (#38)
* refactor!: rewrite * feat: support git in actions * feat: enable selection in action * feat: add check config command * feat: support quick action * refactor: move configuration to base command * ci: add ci and release workflows * feat: add view
1 parent 86a4a89 commit 66cb2e2

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

+2593
-4916
lines changed

.github/workflows/autofix.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: autofix.ci # needed to securely identify the workflow
33
on:
44
pull_request:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78

89
permissions:
910
contents: read

.github/workflows/ci.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,6 @@ jobs:
2727
- name: Lint files
2828
run: pnpm run lint
2929

30-
test:
31-
name: Test
32-
runs-on: ubuntu-latest
33-
34-
steps:
35-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
36-
- run: corepack enable
37-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
38-
with:
39-
node-version: 20.5
40-
cache: pnpm
41-
42-
- name: Install dependencies
43-
run: pnpm install
44-
45-
- name: Test
46-
run: pnpm run test
47-
4830
build:
4931
name: Build
5032
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,8 @@ on:
99
- 'v*'
1010

1111
jobs:
12-
release-npm:
13-
name: Release npm package
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
17-
with:
18-
fetch-depth: 0
19-
- run: corepack enable
20-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
21-
with:
22-
node-version: 20.5
23-
cache: pnpm
24-
registry-url: https://registry.npmjs.org/
25-
26-
- name: Install dependencies
27-
run: pnpm install
28-
29-
- name: Generate files
30-
run: pnpm run build
31-
32-
- run: pnpm -r publish --access public --no-git-checks
33-
env:
34-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
35-
3612
release-vscode:
37-
name: Release vscode extention
13+
name: Release Utils AI extension
3814
runs-on: ubuntu-latest
3915
steps:
4016
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
@@ -50,16 +26,13 @@ jobs:
5026
- name: Install dependencies
5127
run: pnpm install
5228

53-
- name: Generate files
54-
run: pnpm run build
55-
56-
- run: pnpm run --filter utils-ai-vscode publish
29+
- run: pnpm run publish
5730
env:
5831
VSCE_PAT: ${{secrets.VSCE_PAT}}
5932

6033
release-github:
6134
runs-on: ubuntu-latest
62-
needs: [release-npm, release-vscode]
35+
needs: [release-vscode]
6336
steps:
6437
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
6538
with:

.npmrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"request": "launch",
88
"runtimeExecutable": "${execPath}",
99
"args": [
10-
"--extensionDevelopmentPath=${workspaceFolder}/packages/utils-ai-vscode"
10+
"--extensionDevelopmentPath=${workspaceFolder}/"
1111
],
1212
"outFiles": [
13-
"${workspaceFolder}/packages/utils-ai-vscode/dist/**/*.js"
13+
"${workspaceFolder}/dist/**/*.js"
1414
],
1515
"preLaunchTask": "npm: dev"
1616
}

.vscode/settings.json

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,28 @@
11
{
2-
// Enable the ESlint flat config support
3-
"eslint.experimental.useFlatConfig": true,
42
// Disable the default formatter, use eslint instead
53
"prettier.enable": false,
64
"editor.formatOnSave": false,
5+
76
// Auto fix
87
"editor.codeActionsOnSave": {
9-
"source.fixAll": "explicit",
8+
"source.fixAll.eslint": "explicit",
109
"source.organizeImports": "never"
1110
},
11+
1212
// Silent the stylistic rules in you IDE, but still auto fix them
1313
"eslint.rules.customizations": [
14-
{
15-
"rule": "style/*",
16-
"severity": "off"
17-
},
18-
{
19-
"rule": "*-indent",
20-
"severity": "off"
21-
},
22-
{
23-
"rule": "*-spacing",
24-
"severity": "off"
25-
},
26-
{
27-
"rule": "*-spaces",
28-
"severity": "off"
29-
},
30-
{
31-
"rule": "*-order",
32-
"severity": "off"
33-
},
34-
{
35-
"rule": "*-dangle",
36-
"severity": "off"
37-
},
38-
{
39-
"rule": "*-newline",
40-
"severity": "off"
41-
},
42-
{
43-
"rule": "*quotes",
44-
"severity": "off"
45-
},
46-
{
47-
"rule": "*semi",
48-
"severity": "off"
49-
}
14+
{ "rule": "style/*", "severity": "off", "fixable": true },
15+
{ "rule": "format/*", "severity": "off", "fixable": true },
16+
{ "rule": "*-indent", "severity": "off", "fixable": true },
17+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
18+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
19+
{ "rule": "*-order", "severity": "off", "fixable": true },
20+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
21+
{ "rule": "*-newline", "severity": "off", "fixable": true },
22+
{ "rule": "*quotes", "severity": "off", "fixable": true },
23+
{ "rule": "*semi", "severity": "off", "fixable": true }
5024
],
25+
5126
// Enable eslint for all supported languages
5227
"eslint.validate": [
5328
"javascript",
@@ -59,6 +34,16 @@
5934
"markdown",
6035
"json",
6136
"jsonc",
62-
"yaml"
37+
"yaml",
38+
"toml",
39+
"xml",
40+
"gql",
41+
"graphql",
42+
"astro",
43+
"css",
44+
"less",
45+
"scss",
46+
"pcss",
47+
"postcss"
6348
]
6449
}

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"path": "packages/utils-ai-vscode",
7+
"path": ".",
88
"type": "npm",
99
"script": "dev",
1010
"isBackground": true,
@@ -13,7 +13,7 @@
1313
},
1414
"problemMatcher": [
1515
{
16-
"base": "$ts-webpack-watch",
16+
"base": "$tsc-watch",
1717
"background": {
1818
"activeOnStart": true,
1919
"beginsPattern": "Build start",

packages/utils-ai-vscode/.vscodeignore renamed to .vscodeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ vsc-extension-quickstart.md
1111
**/.eslintrc.json
1212
**/*.map
1313
**/*.ts
14+
.github/**
15+
pnpm-lock.yaml
16+
eslint.config.js

README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import antfu from '@antfu/eslint-config'
22

3-
export default antfu()
3+
export default antfu({
4+
type: 'lib',
5+
})

0 commit comments

Comments
 (0)