Conversation
|
(for a sense of scale, this diff is +196 loc, -3116 loc excluding the shrinkwrap/lock files) |
aeisenberg
left a comment
There was a problem hiding this comment.
At some point, we should move the extension out of the extensions/ql folder to the top level. Is there any reason not to do this?
We can wait for a different PR since this one is so large.
|
absolutely; that seems like the immediate next step. I only postponed it because this is plenty big and it seemed less deeply consequential (although it requires changing some relative paths in a few files iirc) |
| "isDefault": true | ||
| }, | ||
| "command": "node common/scripts/install-run-rush.js build --verbose", | ||
| "command": "npx gulp buildWithoutPackage --verbose", |
There was a problem hiding this comment.
I dont think we need npx here. We can assume users have already run npm run build -- buildWithoutPackage --verbose before running in vs code. So, just do the same, but remove npx. You may need to add a full path here, so ${workspaceRoot}/extensions/ql-vscode/node_modules/.bin/gulp.
There was a problem hiding this comment.
I sort of like npx as a terse idiom here, but I don't mind being more explicit if you think it's better to avoid the magic of npx auto-downloading packages. I'm pretty sure we already need to be in the correct cwd to have gulp work, so a path relative to extensions/ql-vscode should work.
There was a problem hiding this comment.
My concern with npx is with versioning. I've had situations before where people ran into different behaviour because npx had installed different versions. If we are running from the node_modules directory, this won't happen.
| run: node common/scripts/install-run-rush.js build | ||
| run: | | ||
| cd extensions/ql-vscode | ||
| gulp |
There was a problem hiding this comment.
Can we change this to npm run build? This will ensure $PATH is correct.
There was a problem hiding this comment.
Sure, and I agree with similar comments below that confining any call to gulp into the package.json scripts is generally a better approach.
| run: node common/scripts/install-run-rush.js build | ||
| run: | | ||
| cd extensions/ql-vscode | ||
| gulp |
| run: node common/scripts/install-run-rush.js build --release | ||
| run: | | ||
| cd extensions/ql-vscode | ||
| gulp --release |
There was a problem hiding this comment.
Can we add a npm run release:build script?
There was a problem hiding this comment.
Or, npm run build -- --release should work.
| '--out', path.resolve(deployedPackage.distPath, '..', `${deployedPackage.name}-${deployedPackage.version}.vsix`) | ||
| ]; | ||
| const proc = child_process.spawn('vsce', args, { | ||
| const proc = childProcess.spawn('npx', ['vsce'].concat(args), { |
There was a problem hiding this comment.
I'd like to avoid npx and use the package-installed version of vsce.
| "format-staged": "lint-staged" | ||
| }, | ||
| "dependencies": { | ||
| "@types/semver": "~7.2.0", |
There was a problem hiding this comment.
Can you move this to devDependencies?
There was a problem hiding this comment.
Oops, good catch.
| @@ -1,3 +1,32 @@ | |||
| { | |||
| "extends": "./node_modules/typescript-config/extension.tsconfig.json" | |||
| "$schema": "http://json.schemastore.org/tsconfig", | |||
There was a problem hiding this comment.
Is this line important?
There was a problem hiding this comment.
I don't presently know of anything that requires it but it occurred in other tsconfig files in the previous state of this repo, and it seemed like fine documentation. I have no overwhelmingly strong opinion about including or eliminating it.
There was a problem hiding this comment.
I'm fine with keeping it. I've just never seen it explicitly before. I think vscode adds it automatically, but other tools may not.
|
NIce. |
|
Still need to fix |
This PR is a proposal for how to fulfill #498. All build configuration is moved into
extensions/ql-vscodeand now only one buildable module exists, so we don't use rush anymore. The Actions workflow files call gulp directly. Building the package withvsceseems to removedevDependenciesjust fine by itself, so we no longer have to do any traversal of our dependencies, just copynode_modulesto thedistdirectory and letvscedo its thing.In fact, the only reason we have to create a distribution directory and copy anything at all is because we fiddle with the version number in
package.json. But this seems fine --- it lets us have exact control over which files go in the package. But maybevscepays attention to the"files"section inpackage.json, I haven't checked that.