You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/DEVELOPMENT.md
+31-23Lines changed: 31 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ For architectural details, see [ARCHITECTURE.md](./ARCHITECTURE.md).
18
18
19
19
The extension uses a multi-step build process defined in `package.json` scripts:
20
20
21
-
1.**`npm run build:extension`**: Uses `esbuild` to bundle the main extension code (`src/extension.ts` and its direct/indirect imports) into a single file (`out/extension.js`) with a sourcemap. This significantly reduces the package size and improves load times. The `vscode` module is marked as external as it's provided by the VS Code runtime.
21
+
1.**`npm run build:extension`**: Uses `esbuild` to bundle the main extension code (`src/extension.ts` and its direct/indirect imports) into a single file (`out/extension.js`) with a sourcemap. This significantly reduces the package size and improves load times. The `vscode` module is marked as external as it's provided by the VS Code runtime. Dependencies listed in `devDependencies` (like `yaml`) should be correctly bundled.
22
22
2.**`npm run compile:tests`**: Uses the TypeScript compiler (`tsc`) based on the specific `tsconfig.tests.json` configuration. This compiles *only* the test files (`src/test/**/*.ts`) into JavaScript files within the `out/test/` directory, preserving the test file structure. This ensures test files are compiled separately from the main extension bundle and placed where the test runner expects them.
23
23
3.**`npm run build:webview`**: Navigates to the `webview-ui/` directory, installs its dependencies, and runs its build process (using Vite) to create the optimized chat interface assets in `webview-ui/dist/`.
24
24
4.**`npm run compile`**: Orchestrates the above steps, running `build:extension`, then `compile:tests`, then `build:webview`. This is the main script used for building the entire extension before testing or packaging. It ensures the main bundle is created first, followed by the separate compilation of tests, and finally the webview build.
@@ -61,36 +61,42 @@ For testing the webview UI components directly:
61
61
62
62
## Packaging and Releasing
63
63
64
-
### Packaging the Extension
64
+
### Packaging the Extension (Manual)
65
65
66
-
Run packaging commands from the project root.
66
+
While the official release packaging is handled by the GitHub workflow, you can manually package the extension for local testing or distribution using commands run from the project root.
67
67
68
-
The extension can be packaged into a `.vsix` file for distribution. There are several npm scripts available for packaging:
68
+
The available npm scripts use `vsce` (VS Code Extension Manager) and rely on the standard build (`npm run compile`):
69
69
70
-
-`npm run package` - Runs tests, then packages the extension
71
-
-`npm run package:dist` - Runs tests, then packages the extension into the `dist` directory with version number
72
-
-`npm run package:skip-tests` - Skips testsand packages the extension
70
+
-`npm run package`: Runs linting and all tests, then compiles and packages the extension into a `.vsix` file in the project root.
71
+
-`npm run package:dist`: Runs linting and all tests, then compiles and packages the extension into the `dist/` directory, naming the file `goose-vscode-[version].vsix`.
72
+
-`npm run package:skip-tests`: Skips linting and tests, compiles, and packages the extension into a `.vsix` file in the project root.
73
73
74
-
To package the extension for distribution:
74
+
Example for creating a distributable package in the `dist` folder:
75
75
76
76
```bash
77
77
npm run package:dist
78
78
```
79
79
80
-
This will create a `.vsix` file in the `dist` directory with the name `goose-vscode-[version].vsix`.
80
+
This will create a `.vsix` file in the `dist/` directory with the name `goose-vscode-[version].vsix`.
81
81
82
82
### Using the Release Script
83
83
84
-
A helper script is provided to simplify the release process:
84
+
A helper script is provided to automate the version bumping, committing, and tagging process:
85
85
86
86
```bash
87
-
./scripts/release.sh 0.1.0 # Replace with your desired version
87
+
./scripts/release.sh <new_version>
88
+
# Example: ./scripts/release.sh 0.1.0
88
89
```
89
90
90
-
This script:
91
-
1. Updates the version in `package.json`
92
-
2. Packages the extension to the `dist` directory
93
-
3. Provides instructions for creating a Git tag and pushing to GitHub
91
+
This script performs the following actions:
92
+
1. Updates the `version` in `package.json`.
93
+
2. Runs `npm install` to update `package-lock.json`.
94
+
3. Stages `package.json` and `package-lock.json`.
95
+
4. Commits the changes with the message "Bump vscode extension to v<new_version>".
96
+
5. Creates a Git tag named `vscode-v<new_version>`.
97
+
6. Prints a confirmation message and reminds you to push the commit and tag (`git push && git push --tags`).
98
+
99
+
**Note:** This script no longer handles packaging. Packaging is now done automatically by the GitHub release workflow.
94
100
95
101
### GitHub Release Workflow
96
102
@@ -114,13 +120,13 @@ Since direct commits to the main branch are restricted, follow this process for
114
120
115
121
2. Update the version in `package.json` and make any other necessary changes
116
122
```bash
117
-
./scripts/release.sh 0.1.0 #Creates the package and updates version
123
+
./scripts/release.sh 0.1.0 #Updates version, runs npm install, commits, and tags
118
124
```
119
125
120
-
3.Commit the changes:
126
+
3.Push the commit and the new tag:
121
127
```bash
122
-
git add .
123
-
git commit -m "Bump vscode extension to v0.1.0"
128
+
git push origin release/vscode-v0.1.0
129
+
# Do NOT push the tag from the feature branch
124
130
```
125
131
126
132
4. Create a pull request and get it reviewed/approved
@@ -131,13 +137,15 @@ Since direct commits to the main branch are restricted, follow this process for
131
137
git pull
132
138
```
133
139
134
-
6.Create and push the tag from the main branch:
140
+
6.Push the tag **from the main branch**:
135
141
```bash
136
-
git tag vscode-v0.1.0
137
-
git push origin vscode-v0.1.0
142
+
# Ensure you are on the main branch and it's up-to-date first!
143
+
# git checkout main
144
+
# git pull
145
+
git push origin vscode-v0.1.0 # Push the specific tag created by the script
138
146
```
139
147
140
-
This will trigger the GitHub workflow to create a release with the packaged extension.
148
+
Pushing the tag (e.g., `vscode-v0.1.0`) from the `main` branch triggers the GitHub workflow to build, package, and create a release.
141
149
142
150
The workflow can also be triggered manually from the GitHub Actions tab, where you can specify the version to release.
0 commit comments