Skip to content

Commit e95f8e8

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/deprecate-lgtm-download
2 parents 951d0b1 + 45efca9 commit e95f8e8

File tree

100 files changed

+61214
-12605
lines changed

Some content is hidden

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

100 files changed

+61214
-12605
lines changed

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ yarn.lock merge=binary
1818
# https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitattributes.html
1919
# suggests that this might interleave lines arbitrarily, but empirically
2020
# it keeps added chunks contiguous
21-
CHANGELOG.md merge=union
21+
CHANGELOG.md merge=union
22+
23+
# Mark some JSON files containing test data as generated so they are not included
24+
# as part of diffs or language statistics.
25+
extensions/ql-vscode/src/stories/remote-queries/data/*.json linguist-generated

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: actions/setup-node@v1
2424
with:
25-
node-version: '16.13.0'
25+
node-version: '16.14.0'
2626

2727
- name: Install dependencies
2828
working-directory: extensions/ql-vscode
@@ -82,7 +82,7 @@ jobs:
8282

8383
- uses: actions/setup-node@v1
8484
with:
85-
node-version: '16.13.0'
85+
node-version: '16.14.0'
8686

8787
- name: Install dependencies
8888
working-directory: extensions/ql-vscode
@@ -139,7 +139,7 @@ jobs:
139139
strategy:
140140
matrix:
141141
os: [ubuntu-latest, windows-latest]
142-
version: ['v2.6.3', 'v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.3', 'nightly']
142+
version: ['v2.6.3', 'v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.4', 'nightly']
143143
env:
144144
CLI_VERSION: ${{ matrix.version }}
145145
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
@@ -151,7 +151,7 @@ jobs:
151151

152152
- uses: actions/setup-node@v1
153153
with:
154-
node-version: '16.13.0'
154+
node-version: '16.14.0'
155155

156156
- name: Install dependencies
157157
working-directory: extensions/ql-vscode

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: actions/setup-node@v1
2424
with:
25-
node-version: '16.13.0'
25+
node-version: '16.14.0'
2626

2727
- name: Install dependencies
2828
run: |

.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@
124124
"outFiles": [
125125
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
126126
],
127+
},
128+
{
129+
"name": "Launch Storybook",
130+
"type": "node",
131+
"request": "launch",
132+
"cwd": "${workspaceFolder}/extensions/ql-vscode",
133+
"runtimeExecutable": "npm",
134+
"runtimeArgs": ["run-script", "storybook"]
127135
}
128136
]
129137
}

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ $ vscode/scripts/code-cli.sh --install-extension dist/vscode-codeql-*.vsix # if
7777

7878
You can use VS Code to debug the extension without explicitly installing it. Just open this directory as a workspace in VS Code, and hit `F5` to start a debugging session.
7979

80+
### Storybook
81+
82+
You can use [Storybook](https://storybook.js.org/) to preview React components outside VSCode. Inside the `extensions/ql-vscode` directory, run:
83+
84+
```shell
85+
npm run storybook
86+
```
87+
88+
Your browser should automatically open to the Storybook UI. Stories live in the `src/stories` directory.
89+
90+
Alternatively, you can start Storybook inside of VSCode. There is a VSCode launch configuration for starting Storybook. It can be found in the debug view.
91+
92+
More information about Storybook can be found inside the **Overview** page once you have launched Storybook.
93+
8094
### Running the unit tests and integration tests that do not require a CLI instance
8195

8296
Unit tests and many integration tests do not require a copy of the CodeQL CLI.

extensions/ql-vscode/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Storybook requires this option to be set. See https://github.com/storybookjs/storybook/issues/18298
2+
legacy-peer-deps=true

extensions/ql-vscode/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.13.0
1+
v16.14.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { StorybookConfig } from '@storybook/core-common';
2+
3+
const config: StorybookConfig = {
4+
stories: [
5+
'../src/**/*.stories.mdx',
6+
'../src/**/*.stories.@(js|jsx|ts|tsx)'
7+
],
8+
addons: [
9+
'@storybook/addon-links',
10+
'@storybook/addon-essentials',
11+
'@storybook/addon-interactions'
12+
],
13+
framework: '@storybook/react',
14+
core: {
15+
builder: '@storybook/builder-webpack5'
16+
}
17+
};
18+
19+
module.exports = config;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { addons } from '@storybook/addons';
2+
import { themes } from '@storybook/theming';
3+
4+
addons.setConfig({
5+
theme: themes.dark,
6+
enableShortcuts: false,
7+
});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { themes } from '@storybook/theming';
2+
import { action } from '@storybook/addon-actions';
3+
4+
// Allow all stories/components to use Codicons
5+
import '@vscode/codicons/dist/codicon.css';
6+
7+
import '../src/stories/vscode-theme.css';
8+
9+
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
10+
export const parameters = {
11+
// All props starting with `on` will automatically receive an action as a prop
12+
actions: { argTypesRegex: "^on[A-Z].*" },
13+
// All props matching these names will automatically get the correct control
14+
controls: {
15+
matchers: {
16+
color: /(background|color)$/i,
17+
date: /Date$/,
18+
},
19+
},
20+
// Use a dark theme to be aligned with VSCode
21+
docs: {
22+
theme: themes.dark,
23+
},
24+
backgrounds: {
25+
default: 'dark',
26+
values: [
27+
{
28+
name: 'dark',
29+
value: '#1e1e1e',
30+
},
31+
],
32+
}
33+
};
34+
35+
(window as any).acquireVsCodeApi = () => ({
36+
postMessage: action('post-vscode-message')
37+
});

0 commit comments

Comments
 (0)