Skip to content

Commit 4eecc2e

Browse files
committed
Merge branch 'main' into fix/mts-and-cts-config-file-detection
2 parents 49c3001 + 437bf3a commit 4eecc2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+6823
-8675
lines changed

.github/CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ It's never a fun experience to have your pull request declined after investing a
1313
You can build the VSIX package by running these commands in the project root.
1414

1515
```bash
16-
npm install
17-
npx run package --workspace=packages/vscode-tailwindcss
16+
pnpm install
17+
pnpx run package --workspace=packages/vscode-tailwindcss
1818
```

.github/workflows/bump-version.mjs

+20-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
import PackageJson from '@npmcli/package-json'
22
import assert from 'node:assert'
3+
import * as path from 'node:path'
4+
import { spawnSync } from 'node:child_process'
5+
import { fileURLToPath } from 'node:url'
36
import semver from 'semver'
47

5-
let res = await fetch('https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery', {
6-
method: 'POST',
7-
headers: {
8-
accept: 'application/json;api-version=7.2-preview.1;excludeUrls=true',
9-
'content-type': 'application/json',
10-
},
11-
body: JSON.stringify({
12-
assetTypes: null,
13-
flags: 2151,
14-
filters: [
15-
{
16-
criteria: [{ filterType: 7, value: 'bradlc.vscode-tailwindcss' }],
17-
direction: 2,
18-
pageSize: 100,
19-
pageNumber: 1,
20-
sortBy: 0,
21-
sortOrder: 0,
22-
pagingToken: null,
23-
},
24-
],
25-
}),
26-
})
27-
28-
let { results } = await res.json()
8+
const __dirname = fileURLToPath(new URL('.', import.meta.url))
9+
10+
// Let `vsce` get the metadata for the extension
11+
// Querying the marketplace API directly is not supported or recommended
12+
let result = spawnSync(
13+
path.resolve(__dirname, '../../packages/vscode-tailwindcss/node_modules/.bin/vsce'),
14+
['show', 'bradlc.vscode-tailwindcss', '--json'],
15+
{ encoding: 'utf8' },
16+
)
17+
18+
let metadata = JSON.parse(result.stdout)
19+
20+
if (!metadata) {
21+
console.error(result.error)
22+
throw new Error('Failed to get extension metadata')
23+
}
2924

3025
/** @type {string[]} */
31-
let versions = results[0].extensions[0].versions.map(({ version }) => version)
26+
let versions = metadata.versions.map(({ version }) => version)
3227

3328
// Determine the latest version of the extension
3429
let latest = versions

.github/workflows/manual-release.yml

+8-10
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,24 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v3
11+
- uses: pnpm/action-setup@v3
12+
with:
13+
version: ^9.6.0
1114
- uses: actions/setup-node@v3
1215
with:
1316
node-version: 18
1417
registry-url: 'https://registry.npmjs.org'
15-
- name: Cache node_modules
16-
uses: actions/cache@v3
17-
with:
18-
path: node_modules
19-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('**/package-lock.json') }}
18+
cache: 'pnpm'
2019
- name: Install dependencies
21-
run: npm install
20+
run: pnpm install
2221
- name: Run tests
2322
run: >
2423
cd packages/tailwindcss-language-server &&
25-
npm run build &&
26-
npm run test:prepare &&
27-
npm test
24+
pnpm run build &&
25+
pnpm run test
2826
- name: Publish IntelliSense
2927
env:
3028
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN }}
3129
run: >
3230
cd packages/vscode-tailwindcss &&
33-
npm run publish -- -p $VSCODE_TOKEN
31+
pnpm run publish -p $VSCODE_TOKEN

.github/workflows/pre-release.yml

+17-22
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,46 @@ name: Publish pre-release
22
concurrency: publish
33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
jobs:
77
publish:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v3
11+
- uses: pnpm/action-setup@v3
12+
with:
13+
version: ^9.6.0
1114
- uses: actions/setup-node@v3
1215
with:
1316
node-version: 18
1417
registry-url: 'https://registry.npmjs.org'
15-
- name: Cache node_modules
16-
uses: actions/cache@v3
17-
with:
18-
path: node_modules
19-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('**/package-lock.json') }}
18+
cache: 'pnpm'
2019
- name: Install dependencies
21-
run: npm install
20+
run: pnpm install
21+
- name: Build everything
22+
run: pnpm -r run build
2223
- name: Run tests
23-
run: >
24-
cd packages/tailwindcss-language-server &&
25-
npm run build &&
26-
npm run test:prepare &&
27-
npm test
24+
run: pnpm --filter ./packages/tailwindcss-language-server run test
2825
- name: Bump IntelliSense version
2926
run: >
3027
node .github/workflows/bump-version.mjs &&
3128
cat packages/vscode-tailwindcss/package.json
32-
- name: Publish IntelliSense
33-
env:
34-
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN }}
35-
run: >
36-
cd packages/vscode-tailwindcss &&
37-
npm run publish -- --pre-release -p $VSCODE_TOKEN
38-
- name: Build LSP
39-
run: npm run build --workspace=packages/tailwindcss-language-server
4029
- name: Resolve LSP version
4130
run: |
4231
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
4332
- name: 'Version LSP based on commit: 0.0.0-insiders.${{ env.SHA_SHORT }}'
4433
run: >
4534
cd packages/tailwindcss-language-server &&
46-
npm version 0.0.0-insiders.${{ env.SHA_SHORT }} --force --no-git-tag-version
35+
pnpm version 0.0.0-insiders.${{ env.SHA_SHORT }} --force --no-git-tag-version
36+
- name: Publish IntelliSense
37+
env:
38+
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN }}
39+
run: >
40+
cd packages/vscode-tailwindcss &&
41+
pnpm run publish --pre-release -p $VSCODE_TOKEN
4742
- name: Publish LSP
4843
run: >
4944
cd packages/tailwindcss-language-server &&
50-
npm publish --tag insiders --access public
45+
pnpm publish --tag insiders --access public --no-git-checks
5146
env:
5247
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.vscode/launch.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"args": ["--extensionDevelopmentPath=${workspaceRoot}/packages/vscode-tailwindcss"],
1111
"stopOnEntry": false,
1212
"sourceMaps": true,
13-
"outFiles": ["${workspaceRoot}/packages/vscode-tailwindcss/dist/**/*.js"]
14-
// "preLaunchTask": "npm: dev"
13+
"outFiles": ["${workspaceRoot}/packages/vscode-tailwindcss/dist/**/*.js"],
14+
"preLaunchTask": "npm: dev"
1515
},
1616
{
1717
"type": "node",

0 commit comments

Comments
 (0)