Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
fix: vsce bundle (#211)
Browse files Browse the repository at this point in the history
- patch vsce to remove duplicate file paths
- change workspace config for vscode extension
- add vsce config to vscode extension
  • Loading branch information
hoonoh authored Jul 13, 2022
1 parent ab7c57c commit 27eed73
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
23 changes: 23 additions & 0 deletions .yarn/patches/vsce-npm-2.9.2-2695a5b64c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/out/package.js b/out/package.js
index dc59da62ec08d6422aadac1b55b8f49f3286eedd..825f14c42096257c070662a9c9412a908b7df32d 100644
--- a/out/package.js
+++ b/out/package.js
@@ -1106,7 +1106,7 @@ async function collectAllFiles(cwd, dependencies, dependencyEntryPoints) {
}
function collectFiles(cwd, dependencies, dependencyEntryPoints, ignoreFile) {
return collectAllFiles(cwd, dependencies, dependencyEntryPoints).then(files => {
- files = files.filter(f => !/\r$/m.test(f));
+ files = files.filter((f, idx, arr) => !/\r$/m.test(f) && arr.indexOf(f) === idx);
return (fs.promises
.readFile(ignoreFile ? ignoreFile : path.join(cwd, '.vscodeignore'), 'utf8')
.catch(err => err.code !== 'ENOENT' ? Promise.reject(err) : ignoreFile ? Promise.reject(err) : Promise.resolve(''))
@@ -1311,6 +1311,9 @@ exports.listFiles = listFiles;
* Lists the files included in the extension's package. Runs prepublish.
*/
async function ls(options = {}) {
+ const cwd = options.cwd || process.cwd();
+ const manifest = await readManifest(cwd);
+ util.patchOptionsWithManifest(options, manifest);
const files = await listFiles({ ...options, prepublish: true });
for (const file of files) {
console.log(`${file}`);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@
"ts-essentials": "9.1.2",
"ts-node": "10.8.1",
"typescript": "4.7.4",
"vsce": "2.9.1"
"vsce": "2.9.2"
},
"resolutions": {
"chalk": "^4.1.2"
"chalk": "^4.1.2",
"[email protected]": "patch:vsce@npm:2.9.2#.yarn/patches/vsce-npm-2.9.2-2695a5b64c.patch"
}
}
13 changes: 6 additions & 7 deletions packages/vscode-slonik-live-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
"license": "MIT",
"displayName": "Slonik Live Server",
"description": "Tests Slonik SQL template tag queries, suggests table & column names and checks query costs against live PostgreSQL database",
"private": true,
"installConfig": {
"hoistingLimits": "dependencies",
"selfReferences": false
},
"scripts": {
"release": "yarn semantic-release",
"build": "yarn dlx rimraf dist && tsc -p tsconfig.build.json",
"vscode:prepublish": "yarn dlx rimraf node_modules && yarn workspaces focus && yarn build && yarn dlx rimraf node_modules && yarn workspaces focus --production && find node_modules -maxdepth 1 && find node_modules/ts-slonik-live-server-plugin/dist/ && find node_modules/ts-slonik-live-server-plugin/node_modules -maxdepth 1"
"build": "yarn dlx rimraf dist && yarn tsc -p tsconfig.build.json",
"vscode:prepublish": "yarn build"
},
"repository": {
"type": "git",
Expand All @@ -36,6 +31,10 @@
"postgresql"
],
"main": "./dist/index.js",
"vsce": {
"yarn": false,
"dependencies": true
},
"contributes": {
"configuration": [
{
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10612,7 +10612,7 @@ __metadata:
ts-essentials: 9.1.2
ts-node: 10.8.1
typescript: 4.7.4
vsce: 2.9.1
vsce: 2.9.2
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -11861,9 +11861,9 @@ __metadata:
languageName: node
linkType: hard

"vsce@npm:2.9.1":
version: 2.9.1
resolution: "vsce@npm:2.9.1"
"vsce@npm:2.9.2, vsce@npm:^2.6.3":
version: 2.9.2
resolution: "vsce@npm:2.9.2"
dependencies:
azure-devops-node-api: ^11.0.1
chalk: ^2.4.2
Expand All @@ -11887,13 +11887,13 @@ __metadata:
yazl: ^2.2.2
bin:
vsce: vsce
checksum: c1af8d8a40139b35b23e71db4b9203ff99393754d6781dcc959df88c7d1f5f8c24c278b087f3de95e57a05e5444d93b65a0ab4b514798c8b6a396fc8a6d97afd
checksum: 856b0df5e63334020206e0ff483cc76804a44f20d9a8f995f533819401ca6875530b4b1e5dcc683fe71e4c3c0a550e178f94529fd4c08032e737e5d0ad3d2fb7
languageName: node
linkType: hard

"vsce@npm:^2.6.3":
"vsce@patch:vsce@npm:2.9.2#.yarn/patches/vsce-npm-2.9.2-2695a5b64c.patch::locator=slonik-live-server%40workspace%3A.":
version: 2.9.2
resolution: "vsce@npm:2.9.2"
resolution: "vsce@patch:vsce@npm%3A2.9.2#.yarn/patches/vsce-npm-2.9.2-2695a5b64c.patch::version=2.9.2&hash=8df074&locator=slonik-live-server%40workspace%3A."
dependencies:
azure-devops-node-api: ^11.0.1
chalk: ^2.4.2
Expand All @@ -11917,7 +11917,7 @@ __metadata:
yazl: ^2.2.2
bin:
vsce: vsce
checksum: 856b0df5e63334020206e0ff483cc76804a44f20d9a8f995f533819401ca6875530b4b1e5dcc683fe71e4c3c0a550e178f94529fd4c08032e737e5d0ad3d2fb7
checksum: ad70c03b10373045fae62cc605797fc65c88e61b38ce37f3c1f863871dfeb3631f9c3a39ae36acc2e5c7d3e15c64f574c12a490a560b3df9e0236c903af006cc
languageName: node
linkType: hard

Expand Down

0 comments on commit 27eed73

Please sign in to comment.