Skip to content

Commit e508acc

Browse files
authored
Merge pull request #421 from gparlakov:fix-ts2742-on-generated-files
fix(kit-headless): fix the TS2742 errors on dts generation
2 parents f6b4511 + c096650 commit e508acc

File tree

12 files changed

+53
-40
lines changed

12 files changed

+53
-40
lines changed

apps/website/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"parser": "@typescript-eslint/parser",
99
"parserOptions": {
10-
"project": ["apps/website/tsconfig.*?.json"],
10+
"project": ["apps/website/tsconfig.app.json"],
1111
"ecmaVersion": 2021,
1212
"sourceType": "module",
1313
"ecmaFeatures": {

apps/website/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default defineConfig({
99
qwikNxVite(),
1010
qwikCity(),
1111
qwikVite({
12+
tsconfigFileNames: ['tsconfig.app.json'],
1213
client: {
1314
outDir: '../../dist/apps/website/client',
1415
},

packages/kit-fluffy/vite.config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import tsconfigPaths from 'vite-tsconfig-paths';
99

1010
export default defineConfig({
1111
plugins: [
12-
macroPlugin({
13-
filter: (ident, id) => {
14-
return (
15-
id.includes('/styled-system/') &&
16-
!id.includes('/jsx') &&
17-
(id.startsWith('.') || id.startsWith('~'))
18-
);
19-
},
20-
}),
12+
// macroPlugin({
13+
// filter: (ident, id) => {
14+
// return (
15+
// id.includes('/styled-system/') &&
16+
// !id.includes('/jsx') &&
17+
// (id.startsWith('.') || id.startsWith('~'))
18+
// );
19+
// },
20+
// }),
2121
qwikNxVite(),
2222
qwikVite({
2323
vendorRoots: [join(__dirname, '../kit-headless/src')],

packages/kit-headless/src/components/tabs/tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type TabProps = {
2727
/** @deprecated Internal use only */
2828
} & QwikIntrinsicElements['button'];
2929

30-
export const preventedKeys = [
30+
const preventedKeys = [
3131
KeyCode.Home,
3232
KeyCode.End,
3333
KeyCode.PageDown,

packages/kit-headless/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ export * from './components/accordion/';
22
export * from './components/badge/badge';
33
export * from './components/button-group/button-group';
44
export * from './components/card';
5-
export * from './components/autocomplete/autocomplete-root';
6-
export * from './components/autocomplete/';
7-
export * from './components/combobox/';
5+
export * from './components/autocomplete';
6+
export * from './components/combobox';
87
export * as Carousel from './components/carousel/carousel';
98
export * from './components/carousel/use';
109
export * from './components/pagination/pagination';

packages/kit-headless/vite.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ export default defineConfig({
1515
tsconfigPaths({ root: '../../' }),
1616
dts({
1717
tsconfigPath: join(dirname(fileURLToPath(import.meta.url)), 'tsconfig.lib.json'),
18+
19+
afterDiagnostic(ds) {
20+
const nonPortableTypeErrors = ds.filter((d) => d.code === 2742);
21+
if (nonPortableTypeErrors.length > 0) {
22+
// stop the build - yes with an empty promise - that's what the func expects
23+
return Promise.reject(nonPortableTypeErrors);
24+
}
25+
26+
return;
27+
},
1828
}),
1929
],
2030
server: {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { QwikIntrinsicElements, JSXChildren } from '@builder.io/qwik';
2+
import { JSX } from '@builder.io/qwik/jsx-runtime';
23

34
export type ButtonProps = QwikIntrinsicElements['button'] & {
45
children: JSXChildren;
56
};
67

7-
export const Button = ({ children, ...props }: ButtonProps) => {
8+
export const Button = ({ children, ...props }: ButtonProps): JSX.Element => {
89
return <button {...props}>{children}</button>;
910
};
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { QwikIntrinsicElements } from '@builder.io/qwik';
1+
import { ProgressHTMLAttributes, QwikIntrinsicElements } from '@builder.io/qwik';
2+
import { JSX } from '@builder.io/qwik/jsx-runtime';
3+
export type { ProgressHTMLAttributes } from '@builder.io/qwik/core';
24

35
export type ProgressProps = QwikIntrinsicElements['progress'];
46

5-
export const Progress = (props: ProgressProps) => {
7+
export const Progress: (
8+
props: ProgressHTMLAttributes<HTMLProgressElement>,
9+
) => JSX.Element = (props) => {
610
return <progress {...props} />;
711
};
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { QwikIntrinsicElements } from '@builder.io/qwik';
1+
import { InputHTMLAttributes, QwikIntrinsicElements } from '@builder.io/qwik';
2+
import { JSX } from '@builder.io/qwik/jsx-runtime';
23

34
export type RadioProps = QwikIntrinsicElements['input'];
45

5-
export const Radio = (props: RadioProps) => <input {...props} type="radio" />;
6+
export const Radio: (props: InputHTMLAttributes<HTMLInputElement>) => JSX.Element = (
7+
props,
8+
) => <input {...props} type="radio" />;

packages/primitives/src/lib/toast/toast.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { QwikIntrinsicElements } from '@builder.io/qwik';
2+
import { JSX } from '@builder.io/qwik/jsx-runtime';
23

34
export type ToastProps = QwikIntrinsicElements['div'] & {
45
label?: string;
56
};
67

7-
export const Toast = ({ label = 'New Message', ...toastProps }: ToastProps) => {
8+
export const Toast = ({
9+
label = 'New Message',
10+
...toastProps
11+
}: ToastProps): JSX.Element => {
812
return (
913
<div {...toastProps}>
1014
<span>{label}</span>

0 commit comments

Comments
 (0)