Skip to content

CLI now defaults to tailwind 3 #1105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
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
5 changes: 5 additions & 0 deletions .changeset/stale-dingos-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'qwik-ui': patch
---

FIX: cli now works but defaults to tailwind 3 installation. Support for Tailwind 4 is coming
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node_version: [18, 20, 21, 22]
node_version: [18, 20, 22]

steps:
- uses: actions/checkout@v3
Expand Down
77 changes: 0 additions & 77 deletions packages/cli-e2e/src/cli.smoke.spec.skip.ts

This file was deleted.

75 changes: 75 additions & 0 deletions packages/cli-e2e/src/cli.smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { execSync } from 'child_process';
import { existsSync, mkdirSync, rmSync } from 'fs';
import { join } from 'path';

describe('Qwik UI CLI Smoke test', () => {
let projectDirectory: string;
let tempDirectory: string;

beforeAll(() => {
const { projectDirectory: projDir, tempDir } = createTestQwikProject();

projectDirectory = projDir;
tempDirectory = tempDir;
});

afterAll(() => {
// Cleanup the test project
rmSync(tempDirectory, {
recursive: true,
force: true,
});
});

it('should be installed and add the button file', () => {
execSync(
'npx -y qwik-ui@e2e init --e2e --projectRoot ./ --uiComponentsPath "src/components/ui" --rootCssPath "src/global.css" --installTailwind --style "simple" --components=button',
{
cwd: projectDirectory,
env: process.env,
stdio: 'inherit',
},
);
execSync('npx -y qwik-ui@e2e add button', {
cwd: projectDirectory,
env: process.env,
stdio: 'inherit',
});
const buttonIsInTheRightPlace = existsSync(
join(projectDirectory, 'src/components/ui/button/button.tsx'),
);
expect(buttonIsInTheRightPlace).toBeTruthy();
});
});

/**
* Creates a test project
* @returns The directory where the test project was created
*/
function createTestQwikProject() {
const projectName = 'test-qwik-project';
const tempDir = join('/tmp', 'tmp-qwik-ui-cli-e2e');

// Ensure projectDirectory is empty
rmSync(tempDir, {
recursive: true,
force: true,
});
mkdirSync(tempDir, {
recursive: true,
});

execSync(`pnpm create qwik@latest empty ${projectName}`, {
cwd: tempDir,
stdio: 'inherit',
env: process.env,
});
console.log(`Created test project in "${tempDir}"`);

const projectDirectory = join(tempDir, projectName);

return {
projectDirectory,
tempDir,
};
}
2 changes: 1 addition & 1 deletion packages/cli/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ async function handleInit() {

if (installTailwind) {
execSync(
`${getPackageManagerCommand().exec} qwik add tailwind --skipConfirmation=true --projectDir=${config.projectRoot}`,
`${getPackageManagerCommand().exec} qwik add tailwind-v3 --skipConfirmation=true --projectDir=${config.projectRoot}`,
{
stdio: 'inherit',
cwd: config.projectRoot,
Expand Down