Skip to content

Commit 4217d34

Browse files
authored
Added missing external dependencies install to the CLI init (#872)
* fixed tailwindcss-animate not being installed * added `class-variance-authority` and `@qwikest/icons` to cli init * added all packages to pkg-pr-new and moved it to CI only, removed --compact (because of errors) * fixed wrong local packages linking * made the external deps versions for the CLI automatically resolved
1 parent 5ee3e46 commit 4217d34

File tree

15 files changed

+479
-765
lines changed

15 files changed

+479
-765
lines changed

.changeset/tiny-cups-teach.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'qwik-ui': patch
3+
---
4+
5+
FIX: now installing `tailwindcss-animate`, `class-variance-authority`
6+
and `@qwikest/icons` during the cli init

.github/actions/setup/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
git config --global user.email '[email protected]'
2424
2525
- name: Setup pnpm
26-
uses: pnpm/action-setup@v2.2.4
26+
uses: pnpm/action-setup@v4
2727
with:
2828
version: 9.3.0
2929

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ jobs:
3232

3333
continuous-release:
3434
runs-on: ubuntu-latest
35-
35+
if: github.event_name == 'pull_request'
3636
steps:
3737
- uses: actions/checkout@v3
3838
- name: Setup
3939
uses: ./.github/actions/setup
4040
with:
4141
node_version: 20
42-
- run: pnpm build.headless
43-
- run: pnpx pkg-pr-new publish --compact ./dist/packages/kit-headless
42+
- run: pnpm release.prepare --parallel=false
43+
- run: pnpm dlx pkg-pr-new@^0.0.9 publish --pnpm ./dist/packages/kit-headless ./dist/packages/kit-styled ./dist/packages/cli ./dist/packages/utils
4444
env:
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN is provided automatically in any repository

.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
save-exact = true
22
auto-install-peers=true
33
dedupe-peer-dependents=true
4-
public-hoist-pattern[]=@types*
4+
public-hoist-pattern[]=@types*
5+
link-workspace-packages=true

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
"node-fetch": "3.3.2",
117117
"np": "^10.0.5",
118118
"nx": "19.2.3",
119-
"pkg-pr-new": "0.0.5",
120119
"postcss": "^8.4.38",
121120
"prettier": "^3.2.5",
122121
"prettier-plugin-tailwindcss": "^0.5.14",

packages/cli/bin/index.ts

+20-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import {
2020
} from '@nx/devkit';
2121

2222
import {
23-
ThemePrimaryColor,
24-
ThemeStyle,
2523
ThemeBorderRadius,
2624
ThemeConfig,
25+
ThemePrimaryColor,
26+
ThemeStyle,
2727
} from '@qwik-ui/utils';
2828
import { bgRgb, bold, cyan, green, red } from 'ansis';
2929
import { execSync } from 'child_process';
@@ -34,6 +34,8 @@ import {
3434
QWIK_UI_CONFIG_FILENAME,
3535
} from '../src/_shared/config-filenames';
3636

37+
import externalDeps from '../src/_shared/external-deps.json';
38+
3739
const COMMANDS = ['init', 'add'];
3840
const listOfCommands = COMMANDS.join(', ');
3941
const styledPackage = '@qwik-ui/styled';
@@ -238,7 +240,7 @@ async function handleInit() {
238240
config.primaryColor = cancelable(
239241
await select({
240242
message: cyan('Choose a primary color'),
241-
initialValue: ThemePrimaryColor.CYAN600,
243+
initialValue: ThemePrimaryColor.CYAN600 as string,
242244
options: [
243245
{
244246
label: bold`${bgRgb(220, 38, 38)` `} ${capitalizeFirstLetter('Red')} `,
@@ -311,11 +313,24 @@ async function handleInit() {
311313

312314
const packageTag = args['e2e'] ? 'e2e' : 'latest';
313315

314-
log.info(`Installing ${styledPackage}, ${headlessPackage} and ${utilsPackage}...`);
316+
const externalDepsNames = Object.keys(externalDeps).reduce(
317+
(all, dep) => `${all}, ${dep}`,
318+
'',
319+
);
320+
321+
log.info(
322+
`Installing ${styledPackage}, ${headlessPackage}, ${utilsPackage}, ${externalDepsNames}...`,
323+
);
324+
325+
const externalDepsString = Object.keys(externalDeps).reduce(
326+
(all, dep) => `${all} ${dep}@${externalDeps[dep]}`,
327+
'',
328+
);
329+
315330
execSync(
316331
`${
317332
getPackageManagerCommand().addDev
318-
} ${styledPackage}@${packageTag} ${headlessPackage}@${packageTag} ${utilsPackage}@${packageTag}`,
333+
} ${styledPackage}@${packageTag} ${headlessPackage}@${packageTag} ${utilsPackage}@${packageTag} ${externalDepsString}`,
319334
{
320335
stdio: 'inherit',
321336
},

packages/cli/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"publishConfig": {
55
"access": "public"
66
},
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/qwikifiers/qwik-ui",
10+
"directory": "packages/cli"
11+
},
712
"description": "Qwik UI Command line interface",
813
"dependencies": {
914
"@clack/prompts": "^0.7.0",

packages/cli/project.json

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"targets": {
77
"build-bin": {
88
"executor": "@nx/js:tsc",
9+
"dependsOn": ["update-external-deps-versions"],
910
"outputs": ["{options.outputPath}"],
1011
"options": {
1112
"rootDir": ".",
@@ -48,6 +49,12 @@
4849
]
4950
}
5051
},
52+
"update-external-deps-versions": {
53+
"executor": "nx:run-commands",
54+
"options": {
55+
"commands": ["pnpm dlx tsm ./tools/scripts/update-cli-deps.ts"]
56+
}
57+
},
5158
"test": {
5259
"dependsOn": ["copy-global-css"],
5360
"executor": "@nx/jest:jest",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tailwindcss-animate": "^1.0.7",
3+
"class-variance-authority": "^0.7.0",
4+
"@qwikest/icons": "^0.0.13"
5+
}

packages/cli/tsconfig.bin.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"module": "CommonJS",
77
"sourceMap": false,
88
"noEmit": false,
9+
"resolveJsonModule": true,
10+
"esModuleInterop": true,
911

1012
"outDir": "../../dist/out-tsc",
1113
"types": ["node"]

packages/cli/tsconfig.lib.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
55
"declaration": true,
6-
"types": ["node"]
6+
"types": ["node"],
7+
"resolveJsonModule": true,
8+
"esModuleInterop": true
79
},
810
"include": ["**/*.ts"],
911
"exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]

packages/kit-styled/src/templates/tailwind.config.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
join(__dirname, 'src/**/*.{js,ts,jsx,tsx,mdx}'),
99
join(__dirname, '../website/src/**/*.{js,ts,jsx,tsx,mdx}'),
1010
join(__dirname, '../../packages/kit-styled/src/**/*.{js,ts,jsx,tsx,mdx}'),
11+
join(__dirname, '../../packages/kit-headless/src/**/*.{js,ts,jsx,tsx,mdx}'),
1112
],
1213
plugins: [
1314
// PLUGIN-START

packages/utils/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export * from './cn';
22
export * from './theme/extract-between-comments';
33
export * from './theme/extract-theme-css';
4-
export * from './theme/theme-config.type';
54
export * from './theme/theme-base-color.enum';
65
export * from './theme/theme-border-radius.enum';
7-
export * from './theme/theme-primary-color.enum';
6+
export * from './theme/theme-config.type';
87
export * from './theme/theme-font.enum';
98
export * from './theme/theme-mode-enum';
9+
export * from './theme/theme-primary-color.enum';
1010
export * from './theme/theme-style.enum';

0 commit comments

Comments
 (0)