Skip to content

Commit 1544477

Browse files
committed
fix(core): generate valid standalone framework declarations
Signed-off-by: John Yanarella <jyanarella@nvidia.com>
1 parent d6e9957 commit 1544477

7 files changed

Lines changed: 317 additions & 28 deletions

File tree

‎projects/core/.stub/vue.d.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** Minimal Vue surface required to validate generated declaration types. */
2+
declare module 'vue'{
3+
exporttypeDefineComponent<Props>=new()=>{$props: Props};
4+
}

‎projects/core/package.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"build": "wireit",
3838
"build:icons": "wireit",
3939
"test": "wireit",
40+
"test:types": "wireit",
4041
"test:watch": "wireit",
4142
"test:axe": "wireit",
4243
"test:ssr": "wireit",
@@ -991,6 +992,7 @@
991992
"lint",
992993
"build",
993994
"publint",
995+
"test:types",
994996
"test:axe",
995997
"test:ssr",
996998
"test:coverage",
@@ -1021,6 +1023,7 @@
10211023
"command": "NODE_ENV=production ELEMENTS_BUILD=true vite build",
10221024
"clean": "if-file-deleted",
10231025
"files": [
1026+
"../forms/src/mixins/**/*.ts",
10241027
"../styles/dist/**/*.css",
10251028
"../themes/dist/**/*.css",
10261029
"../forms/dist/**/*.js",
@@ -1098,6 +1101,22 @@
10981101
"NODE_ENV": "production"
10991102
}
11001103
},
1104+
"test:types": {
1105+
"command": "tsc --project tsconfig.types.json",
1106+
"files": [
1107+
".stub/vue.d.ts",
1108+
"dist/custom-elements-jsx.d.ts",
1109+
"dist/custom-elements-vue.d.ts",
1110+
"tsconfig.types.json"
1111+
],
1112+
"output": [],
1113+
"dependencies": [
1114+
{
1115+
"script": "build",
1116+
"cascade": false
1117+
}
1118+
]
1119+
},
11011120
"test:coverage": {
11021121
"command": "vitest run --coverage",
11031122
"files": [

‎projects/core/src/menu/menu.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe(Menu.metadata.tag, () => {
3838

3939
it('should navigate between items with ArrowDown key',async()=>{
4040
awaitelementIsStable(element);
41-
constitems=element.items;
41+
constitems=element.querySelectorAll('nve-menu-item');
4242
items[0].focus();
4343
expect(items[0].matches(':focus')).toBe(true);
4444

@@ -49,7 +49,7 @@ describe(Menu.metadata.tag, () => {
4949

5050
it('should navigate between items with ArrowUp key',async()=>{
5151
awaitelementIsStable(element);
52-
constitems=element.items;
52+
constitems=element.querySelectorAll('nve-menu-item');
5353
items[1].focus();
5454
expect(items[1].matches(':focus')).toBe(true);
5555

@@ -60,7 +60,7 @@ describe(Menu.metadata.tag, () => {
6060

6161
it('should skip disabled items during keyboard navigation',async()=>{
6262
awaitelementIsStable(element);
63-
constitems=element.items;
63+
constitems=element.querySelectorAll('nve-menu-item');
6464
items[1].disabled=true;
6565
awaitelementIsStable(element);
6666

‎projects/core/src/menu/menu.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Menu extends LitElement {
5555
/** @private */
5656
declare_internals: ElementInternals;
5757

58-
@queryAssignedElements()items!: MenuItem[];
58+
@queryAssignedElements()privateitems!: MenuItem[];
5959

6060
#scrollRAF: number|null=null;
6161

‎projects/core/src/pagination/pagination.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class Pagination extends FormControlMixin<typeof LitElement, number>(LitE
5656
/**
5757
* The array of custom step-size.
5858
*/
59-
@property({type: Array})stepSizes=[10,20,50,100];
59+
@property({type: Array})stepSizes: number[]=[10,20,50,100];
6060

6161
/**
6262
* The total number of items.

‎projects/core/tsconfig.types.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
4+
"module": "ESNext",
5+
"moduleResolution": "Bundler",
6+
"noEmit": true,
7+
"skipLibCheck": false,
8+
"strict": true,
9+
"target": "ES2022",
10+
"types": []
11+
},
12+
"files": [".stub/vue.d.ts", "dist/custom-elements-jsx.d.ts", "dist/custom-elements-vue.d.ts"]
13+
}

0 commit comments

Comments
 (0)