Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-generated-in-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: voidzero-dev/setup-vp@56918a6d0c629c55ae8b88826a7d47fda85769ee # v1.9.0
with:
node-version: 24
node-version: 26
cache: true
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: voidzero-dev/setup-vp@56918a6d0c629c55ae8b88826a7d47fda85769ee # v1.9.0
with:
node-version: 24
node-version: 26
cache: true
- run: vp check
build:
Expand All @@ -28,18 +28,31 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: voidzero-dev/setup-vp@56918a6d0c629c55ae8b88826a7d47fda85769ee # v1.9.0
with:
node-version: 24
node-version: 26
cache: true
- run: vp run build
test:
strategy:
fail-fast: false
matrix:
node: [22, 24]
os: [ubuntu-24.04-arm, macos-latest, windows-11-arm]
node: [26]
os: [ubuntu-24.04-arm, macos-latest, windows-11-arm, windows-latest]
stylelint-version: ['17']
include:
# Configuration for Node.js 24
- node: 24
os: ubuntu-24.04-arm
stylelint-version: '17'
# Configuration for Node.js 24/Windows
- node: 24
os: windows-11-arm
stylelint-version: '17'
# Configuration for Node.js 22
- node: 22
os: ubuntu-24.04-arm
stylelint-version: '17'
# Configuration for Stylelint 16
- node: 26
os: ubuntu-24.04-arm
stylelint-version: '16'
runs-on: ${{ matrix.os }}
Expand All @@ -58,14 +71,14 @@ jobs:
tsconfig.tsbuildinfo
key: test-tools-${{ runner.arch }}-${{ runner.os }}-node-${{ matrix.node }}-stylelint-${{ matrix.stylelint-version }}-${{ github.sha }}
restore-keys: test-tools-${{ runner.arch }}-${{ runner.os }}-node-${{ matrix.node }}-stylelint-${{ matrix.stylelint-version }}
- run: vp test
- run: vp test --allowOnly
env:
STYLELINT_VERSION: ${{ matrix.stylelint-version }}
vscode-test:
strategy:
fail-fast: false
matrix:
node: [22, 24]
node: [26]
os: [ubuntu-24.04-arm, macos-latest, windows-11-arm]
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: voidzero-dev/setup-vp@56918a6d0c629c55ae8b88826a7d47fda85769ee # v1.9.0
with:
node-version: 24
node-version: 26
cache: true
- run: vp run build
- name: set release variables
Expand Down
12 changes: 9 additions & 3 deletions packages/ts-plugin/e2e-test/completion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { launchTsserver, normalizeCompletionDetails, normalizeCompletionEntry }
const reactDtsPath = join(require.resolve('@types/react/package.json'), '../index.d.ts');
const tsserver = launchTsserver();

describe.each([{ namedExports: false }, { namedExports: true }])('namedExports: $namedExports', ({ namedExports }) => {
describe.each([{ namedExports: false }])('namedExports: $namedExports', ({ namedExports }) => {
describe('styles binding suggestion', () => {
test('prioritizes the CSS module corresponding to the current component file', async () => {
const { iff, getRange } = await setupFixture({
Expand Down Expand Up @@ -149,10 +149,11 @@ describe.each([{ namedExports: false }, { namedExports: true }])('namedExports:
});
});

describe('className attribute snippet', () => {
test.each([{ quotePreference: 'single' as const }, { quotePreference: 'double' as const }])(
describe.only('className attribute snippet', () => {
test.each([{ quotePreference: 'double' as const }])(
'completes as className={$$1} with quotePreference: $quotePreference',
async ({ quotePreference }) => {
console.log(quotePreference, new Date().toLocaleString(), 0);
const { iff, getRange } = await setupFixture({
'tsconfig.json': buildTSConfigJSON({
compilerOptions: { jsx: 'react-jsx', types: [reactDtsPath] },
Expand All @@ -164,7 +165,9 @@ describe.each([{ namedExports: false }, { namedExports: true }])('namedExports:
`,
'a.module.css': '',
});
console.log(quotePreference, new Date().toLocaleString(), 1);
await tsserver.sendUpdateOpen({ openFiles: [{ file: iff.paths['a.tsx'] }] });
console.log(quotePreference, new Date().toLocaleString(), 2);
await tsserver.sendConfigure({
preferences: {
includeCompletionsWithSnippetText: true,
Expand All @@ -174,16 +177,19 @@ describe.each([{ namedExports: false }, { namedExports: true }])('namedExports:
},
});

console.log(quotePreference, new Date().toLocaleString(), 3);
const res = await tsserver.sendCompletionInfo({
file: iff.paths['a.tsx'],
...getRange('a.tsx', 'className').end,
});

console.log(quotePreference, new Date().toLocaleString(), 4);
expect(
normalizeCompletionEntry(res.body?.entries.filter((entry) => entry.name === 'className') ?? []),
).toStrictEqual(
normalizeCompletionEntry([{ name: 'className', insertText: 'className={$1}', sortText: expect.anything() }]),
);
console.log(quotePreference, new Date().toLocaleString(), 5);
},
);
});
Expand Down
44 changes: 22 additions & 22 deletions packages/ts-plugin/e2e-test/refactor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,27 @@ describe('Get Applicable Refactors', () => {
});
});

describe('Get Edits For Refactor', () => {
test('emits an edit that creates a new empty CSS module file paired with the component file', async () => {
const { iff } = await setupFixture({
'tsconfig.json': buildTSConfigJSON({ compilerOptions: { jsx: 'react-jsx' } }),
'a.tsx': '',
});
await tsserver.sendUpdateOpen({ openFiles: [{ file: iff.paths['a.tsx'] }] });
// describe('Get Edits For Refactor', () => {
// test('emits an edit that creates a new empty CSS module file paired with the component file', async () => {
// const { iff } = await setupFixture({
// 'tsconfig.json': buildTSConfigJSON({ compilerOptions: { jsx: 'react-jsx' } }),
// 'a.tsx': '',
// });
// await tsserver.sendUpdateOpen({ openFiles: [{ file: iff.paths['a.tsx'] }] });

const res = await tsserver.sendGetEditsForRefactor({
refactor: createCssModuleFileRefactor.name,
action: createCssModuleFileRefactor.actions[0].name,
file: iff.paths['a.tsx'],
line: 1,
offset: 1,
});
// const res = await tsserver.sendGetEditsForRefactor({
// refactor: createCssModuleFileRefactor.name,
// action: createCssModuleFileRefactor.actions[0].name,
// file: iff.paths['a.tsx'],
// line: 1,
// offset: 1,
// });

expect(res.body?.edits).toStrictEqual([
{
fileName: iff.join('a.module.css'),
textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: '' }],
},
]);
});
});
// expect(res.body?.edits).toStrictEqual([
// {
// fileName: iff.join('a.module.css'),
// textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: '' }],
// },
// ]);
// });
// });
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default defineConfig({
},
test: {
// On GitHub Actions, the Windows runner is slow and tests may fail with the default timeout.
// Therefore, we set the timeout to 10 seconds.
testTimeout: 10_000,
// Therefore, we set the timeout to 20 seconds.
testTimeout: 20_000,
watch: false,
projects: [
{
Expand Down
Loading