Skip to content

Commit 3b9190e

Browse files
Merge pull request #200 from github/ketchup/windowsDevExperience
Improve Windows Dev Experience: fix npm commands (cross-env package), fix Source Control Repos, and document all
2 parents e3d1b37 + 81b56cb commit 3b9190e

3 files changed

Lines changed: 74 additions & 31 deletions

File tree

CONTRIBUTING.md

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,90 +34,105 @@ These are one time installations required to be able to test your changes locall
3434
1. Install [Node.js](https://nodejs.org/en/download/) for your platform
3535
1. Install [VS Code](https://code.visualstudio.com/download) for your platform
3636
1. Install the dependencies. From the repository root run:
37+
3738
```bash
38-
$ npm i
39+
npm i
3940
```
4041

41-
## Making & testing changes
42+
## Dev loop & Testing changes
43+
44+
The extension is written in TypeScript and built using [webpack](https://webpack.js.org/). The dev loop steps and commands have been tested on both Mac and Windows.
45+
46+
1. Go to the Debug tab.
47+
1. Hit `Watch all & Launch Extension (workspace)` if you want to work on the main VS Code extension like the left sidebar and the UI for the extension.
48+
1. Hit `Watch & Launch Extension + language-server (workspace)` if you want to work on the language services code and want to debug and work on the hover, syntax highlighting, and other functionality within the Workflow files.
49+
* This will attach to an instance of the language server running on port `6010`
50+
1. Hit the play button (this will automatically run `npm watch` for you and monitor for changes) which will open a local version of the extension using the _extension development host_.
51+
1. Make changes.
52+
1. To get new changes, hit the refresh button in the debugger window to reload the extension in the development host. _If you don't see the changes, wait long enough for the `npm watch` terminal to rebuild and then try hitting the play button again._
53+
![image](https://github.com/github/vscode-github-actions/assets/7976517/8dbd3d75-f447-483e-b7e7-ffec3ccd7562)
54+
55+
56+
## npm commands
4257

43-
The extension is written in TypeScript and built using [webpack](https://webpack.js.org/).
58+
For the commands below make sure that you are in the `vscode-github-actions` directory of your local repo first.
59+
60+
```bash
61+
cd vscode-github-actions
62+
```
4463

4564
### Build
4665

4766
Build changes (one time):
4867

4968
```bash
50-
$ npm run build
69+
npm run build
5170
```
5271

5372
Or to watch for changes and automatically rebuild every time on save:
5473

5574
```bash
56-
$ npm run watch
75+
npm run watch
5776
```
5877

59-
### Testing changes
60-
61-
1. Open the repository in VS Code
62-
1. Run one of the debug targets:
63-
* "Watch & Launch extension" - watch extension files, compile as necessary, and run the extension using the _extension development host_
64-
* "Attach to Language-Server" - attach to an instance of the language server running on port `6010`
65-
* "Run Web Extension in VS Code" - run the [web version](https://code.visualstudio.com/api/extension-guides/web-extensions) of the extension
66-
67-
### Dev loop
68-
1. Setup `Watch all & Launch Extension` under Debug and hit the green button
69-
1. `npm run watch`
70-
1. Make change
71-
1. Hit the refresh button in the debugger window to reload the extension in the development host
72-
7378
### Running tests
7479

7580
```bash
76-
$ npm test
81+
npm test
7782
```
7883

7984
Or to watch for changes and run tests:
8085

8186
```bash
82-
$ npm run test-watch
87+
npm run test-watch
8388
```
8489

8590
### Lint
8691

8792
```bash
88-
$ npm run lint
93+
npm run lint
8994
```
9095

9196
Run linter and fix errors as possible:
9297

9398
```bash
94-
$ npm run lint-fix
99+
npm run lint-fix
95100
```
96101

97102
### Format
98103

99104
Check formatting with [prettier](https://prettier.io/):
100105

101106
```bash
102-
$ npm run format-check
107+
npm run format-check
103108
```
104109

105110
Run prettier and automatically format:
106111

107112
```bash
108-
$ npm run format
113+
npm run format
109114
```
110115

111116
### Package the extension
112117

113118
```bash
114-
$ npm run package
119+
npm run package
115120
```
116121

122+
### Run Web Extension
123+
124+
"Run Web Extension in VS Code" - run the [web version](https://code.visualstudio.com/api/extension-guides/web-extensions) of the extension
125+
126+
## VS Code Source Control Repositories
127+
128+
If you don't see `vscode-github-actions` and `languageservices`, please go to `Preferences: Open User Settings` and then search for `git.openRepositoryInParentFolders` and you can set it to `always` and it will show all of the associated repos for the Workspace.
129+
130+
![image](https://github.com/github/vscode-github-actions/assets/7976517/c03a1608-df4d-4caf-ba33-0c5eb1802100)
131+
117132
## Submitting a pull request
118133

119134
1. [Fork][fork] and clone the repository
120-
1. Configure and install the dependencies: `npm i`
135+
1. Configure and install the dependencies (in the repository root folder): `npm i`
121136
1. Create a new branch: `git checkout -b my-branch-name`
122137
1. Make your change, add tests, and make sure the tests and linter still pass
123138
1. Push to your fork and [submit a pull request][pr]
@@ -135,7 +150,6 @@ Here are a few things you can do that will increase the likelihood of your pull
135150
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
136151
- [GitHub Help](https://help.github.com)
137152

138-
139153
[bug issues]: https://github.com/github/vscode-github-actions/labels/bug
140154
[feature request issues]: https://github.com/github/vscode-github-actions/labels/enhancement
141155
[hw]: https://github.com/github/vscode-github-actions/labels/help%20wanted

package-lock.json

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@
526526
"open-in-browser": "vscode-test-web --extensionDevelopmentPath=. .",
527527
"lint": "eslint . --ext .ts",
528528
"lint-fix": "eslint . --ext .ts --fix",
529-
"format": "prettier --write '**/*.ts'",
530-
"format-check": "prettier --check '**/*.ts'",
531-
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest",
529+
"format": "prettier --write \"**/*.ts\"",
530+
"format-check": "prettier --check \"**/*.ts\"",
531+
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest",
532532
"test-watch": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --watch"
533533
},
534534
"devDependencies": {
@@ -539,6 +539,7 @@
539539
"@typescript-eslint/eslint-plugin": "^5.40.0",
540540
"@typescript-eslint/parser": "^5.40.0",
541541
"@vscode/test-web": "*",
542+
"cross-env": "^7.0.3",
542543
"eslint": "^8.25.0",
543544
"eslint-config-prettier": "^8.5.0",
544545
"eslint-plugin-prettier": "^4.2.1",

0 commit comments

Comments
 (0)