-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to NPM workspaces * Add bun types for testing * Remove some dependencies * Cleanup code * Upgrade esbuild * Hardcode externals They’re the same between the packages except for vscode but including an external that’s not ultimately required isn’t an error. * Reorganize package json * Replace TSDX with esbuild * wip * Simplify script * Move esbuild into individual packages * Bump vsce * Fix packaging * fixup * Swap mri for minimist It’s the same API but maintained * Update lockfiles * Add logs * Bump version * Update lockfile * Add test for `extractClassNames` * fix
- Loading branch information
1 parent
3c0f17c
commit 19cb859
Showing
14 changed files
with
13,353 additions
and
71,564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,49 @@ | ||
import latestSemver from 'latest-semver' | ||
import * as fs from 'fs/promises' | ||
import assert from 'assert' | ||
import PackageJson from '@npmcli/package-json' | ||
import assert from 'node:assert' | ||
import semver from 'semver' | ||
|
||
async function bumpVersion() { | ||
let res = await fetch( | ||
'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery', | ||
{ | ||
method: 'POST', | ||
headers: { | ||
accept: 'application/json;api-version=7.2-preview.1;excludeUrls=true', | ||
'content-type': 'application/json', | ||
let res = await fetch('https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery', { | ||
method: 'POST', | ||
headers: { | ||
accept: 'application/json;api-version=7.2-preview.1;excludeUrls=true', | ||
'content-type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
assetTypes: null, | ||
flags: 2151, | ||
filters: [ | ||
{ | ||
criteria: [{ filterType: 7, value: 'bradlc.vscode-tailwindcss' }], | ||
direction: 2, | ||
pageSize: 100, | ||
pageNumber: 1, | ||
sortBy: 0, | ||
sortOrder: 0, | ||
pagingToken: null, | ||
}, | ||
body: JSON.stringify({ | ||
assetTypes: null, | ||
flags: 2151, | ||
filters: [ | ||
{ | ||
criteria: [{ filterType: 7, value: 'bradlc.vscode-tailwindcss' }], | ||
direction: 2, | ||
pageSize: 100, | ||
pageNumber: 1, | ||
sortBy: 0, | ||
sortOrder: 0, | ||
pagingToken: null, | ||
}, | ||
], | ||
}), | ||
} | ||
) | ||
let { results } = await res.json() | ||
let versions = results[0].extensions[0].versions.map(({ version }) => version) | ||
let latest = latestSemver(versions) | ||
let parts = latest.split('.') | ||
], | ||
}), | ||
}) | ||
|
||
assert(Number(parts[1]) % 2 === 1) | ||
let { results } = await res.json() | ||
|
||
let nextVersion = `${parts[0]}.${parts[1]}.${Number(parts[2]) + 1}` | ||
let pkgFilename = 'packages/vscode-tailwindcss/package.json' | ||
let pkg = JSON.parse(await fs.readFile(pkgFilename, 'utf8')) | ||
await fs.writeFile(pkgFilename, JSON.stringify({ ...pkg, version: nextVersion }, null, 2), 'utf8') | ||
} | ||
/** @type {string[]} */ | ||
let versions = results[0].extensions[0].versions.map(({ version }) => version) | ||
|
||
bumpVersion() | ||
// Determine the latest version of the extension | ||
let latest = versions | ||
.map((v) => semver.parse(v, { includePrerelease: true, loose: false })) | ||
.filter((v) => v !== null) | ||
.filter((v) => v.prerelease.length === 0) | ||
.sort((a, b) => b.compare(a) || b.compareBuild(a)) | ||
.at(0) | ||
|
||
// Require the minor version to be odd. This is done because | ||
// the VSCode Marketplace suggests using odd numbers for | ||
// pre-release builds and even ones for release builds | ||
assert(latest && latest.minor % 2 === 1) | ||
|
||
// Bump the patch version in `package.json` | ||
let nextVersion = latest.inc('patch').format() | ||
let pkg = await PackageJson.load('packages/vscode-tailwindcss/package.json') | ||
await pkg.update({ version: nextVersion }).save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.