Skip to content

Commit dd48ea3

Browse files
committed
2.6.5
- update changelog - fixes publish commands to work with yarn v4
1 parent 867e06a commit dd48ea3

8 files changed

+89
-13
lines changed

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.18

.vscodeignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ babel.config.js
2121
coverage
2222
jest.config.js
2323
TASKS.md
24+
temp

CHANGELOG.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [2.6.4](https://github.com/willofindie/vscode-cssvar/compare/v2.6.3...2.6.4) - 2023-10-12
7+
## [2.6.5](https://github.com/willofindie/vscode-cssvar/compare/v2.6.4..v2.6.5) - 2025-01-14
8+
### Features
9+
- upgrade dependencies
10+
- use yarn v4
11+
### Fixes
12+
- [#119](https://github.com/willofindie/vscode-cssvar/issues/119) replace ext notification with logger
13+
14+
15+
## [2.6.4](https://github.com/willofindie/vscode-cssvar/compare/v2.6.3...v2.6.4) - 2023-10-12
816
### Fixes
9-
- #110(https://github.com/willofindie/vscode-cssvar/issues/110) Failed to parse CSS variable with @layer declaration
17+
- [#110](https://github.com/willofindie/vscode-cssvar/issues/110) Failed to parse CSS variable with @layer declaration
1018

1119

1220
## [2.6.3](https://github.com/willofindie/vscode-cssvar/compare/v2.6.2...v2.6.3) - 2023-07-02

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,33 @@ If the generated content is copied to clipboard we can use that content to modif
2929

3030
Once we are satisfied with the updated CHANGELOG, we can commit the changes and create a new release on Github
3131

32+
> Note we can either create a tag ourself manually or release the previous commit using github and create a tag
33+
> remotely and then creating this changelog with the remote tag.
34+
35+
Follow up commands (not necessary)
36+
```sh
37+
yarn version patch
38+
# Commit changes
39+
git tag -a v2.6.5
40+
git push origin main --follow-tags
41+
```
42+
3243
**`src/scripts/publish.js`**
3344

3445
Publishing our release to VSCode/OVSX extension marketplaces.
3546
We need the private tokens for both these marketplaces for this command to work.
47+
48+
Before running this script the following steps are necessary:
49+
- [Learn how to publish extension on VSCode marketplace](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)
50+
- [Publishing Extension on OVSX Marketplace](https://github.com/eclipse/openvsx/wiki/Publishing-Extensions)
51+
- Install following CLI tools: `vsce` and `ovsx`
52+
3653
Running this script will than auto publish our changes to both these marketplaces.
54+
55+
```sh
56+
vsce login {publisher} # Required
57+
OVSX_KEY={token} ./src/scripts/publish.js
58+
```
59+
60+
The above command requires everything to be packaged into a single script using `esbuild`, since I am using `yarn` v4 (berry) and `vsce` has issues with yarn v2+
61+
Ref: https://github.com/microsoft/vscode-vsce/issues/517

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"typescript"
2121
],
2222
"description": "Intellisense support for CSS Variables",
23-
"version": "2.6.4",
23+
"version": "2.6.5",
2424
"publisher": "phoenisx",
2525
"license": "MIT",
2626
"homepage": "https://github.com/willofindie/vscode-cssvar",
@@ -33,7 +33,7 @@
3333
},
3434
"icon": "img/icon.png",
3535
"engines": {
36-
"vscode": "^1.53.0"
36+
"vscode": "^1.93.0"
3737
},
3838
"categories": [
3939
"Other"
@@ -417,7 +417,8 @@
417417
"lint": "eslint src",
418418
"lint:fix": "eslint src --fix",
419419
"test": "concurrently \"tsc --project ./tsconfig.json --noEmit\" \"jest\"",
420-
"jest": "jest"
420+
"jest": "jest",
421+
"list": "src/scripts/yarn-berry-list.js"
421422
},
422423
"devDependencies": {
423424
"@babel/core": "^7.25.2",

src/scripts/create-changelog.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ const processCommitMsg = (/** @type {string[]} */ msgTokens) => {
4747
return token
4848
.trim()
4949
.replace(
50-
/(\[?#(\d+)\]?)/,
51-
"$1(https://github.com/willofindie/vscode-cssvar/issues/$2)"
50+
/\[?(#(\d+))\]?/,
51+
"[$1](https://github.com/willofindie/vscode-cssvar/issues/$2)"
5252
);
5353
});
5454
};
5555

5656
(async () => {
5757
try {
5858
const log = await gitLog();
59-
const [, releaseTag] = compareString.split("...");
59+
const [, releaseTag] = compareString.split(/\.\.\.?/);
6060
const filtered = log
6161
.split("\n")
6262
.filter(line => /\d{4}-\d{2}-\d{2}/.test(line))
@@ -102,9 +102,7 @@ const processCommitMsg = (/** @type {string[]} */ msgTokens) => {
102102
}
103103
}
104104
console.log(
105-
`## [${releaseTag.substring(
106-
1
107-
)}](https://github.com/willofindie/vscode-cssvar/compare/${compareString}) - ${lastReleaseDate}`
105+
`## [${releaseTag}](https://github.com/willofindie/vscode-cssvar/compare/${compareString}) - ${lastReleaseDate}`
108106
);
109107
if (changelogs.feature.length > 0) {
110108
console.log("### Features");

src/scripts/publish.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ Promise.all([spawnAsync("yarn", "test"), spawnAsync("yarn", "build")])
2424
.then(([c1, c2]) => {
2525
console.log("Results: ", c1, c2);
2626
return Promise.allSettled([
27-
spawnAsync("vsce", "publish"),
28-
spawnAsync("ovsx", "publish", "-p", process.env.OVSX_KEY),
27+
// spawnAsync("vsce", "publish", "--no-dependencies"),
28+
spawnAsync(
29+
"ovsx",
30+
"publish",
31+
"-p",
32+
process.env.OVSX_KEY,
33+
"--no-dependencies"
34+
),
2935
]);
3036
})
3137
.catch(reason => {

src/scripts/yarn-berry-list.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
/* eslint-disable no-undef */
3+
/* eslint-disable @typescript-eslint/no-require-imports */
4+
5+
const { spawn } = require("node:child_process");
6+
7+
async function yarnV2List() {
8+
return new Promise((res, rej) => {
9+
const contents = [];
10+
/** @type {import("node:child_process").ChildProcessWithoutNullStreams} */
11+
const git = spawn("yarn", ["info", "--recursive --json"]);
12+
git.stdout.on("data", function (buf) {
13+
contents.push(buf.toString());
14+
});
15+
16+
git.stderr.on("data", data => {
17+
rej(new Error(data.toString()));
18+
});
19+
20+
git.on("close", code => {
21+
if (code !== 0) {
22+
rej(new Error(`Exited with ${code}: Failed to complete git shortlog`));
23+
}
24+
res(contents.join(""));
25+
});
26+
});
27+
}
28+
29+
(async () => {
30+
try {
31+
const log = await yarnV2List();
32+
console.log(log);
33+
} catch (e) {
34+
console.error(e);
35+
}
36+
})();

0 commit comments

Comments
 (0)