Skip to content
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

fix(core): remove type declaration from ts file #1052

Merged
merged 1 commit into from
Jan 24, 2024
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
35 changes: 6 additions & 29 deletions packages/core/component-doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"timestamp": "",
"compiler": {
"name": "@stencil/core",
"version": "4.9.0",
"typescriptVersion": "5.2.2"
"version": "4.11.0",
"typescriptVersion": "5.3.3"
},
"components": [
{
Expand Down Expand Up @@ -11230,11 +11230,11 @@
"listeners": []
},
{
"dirPath": "src/components/my-component",
"filePath": "src/components/my-component/example-modal.tsx",
"dirPath": "src/components/playground",
"filePath": "src/components/playground/example-modal.tsx",
"fileName": "example-modal.tsx",
"readmePath": "src/components/my-component/readme.md",
"usagesDir": "src/components/my-component/usage",
"readmePath": "src/components/playground/readme.md",
"usagesDir": "src/components/playground/usage",
"tag": "ix-modal-example",
"overview": "",
"usage": {},
Expand Down Expand Up @@ -16758,29 +16758,6 @@
"passive": false
}
]
},
{
"dirPath": "src/components/my-component",
"filePath": "src/components/my-component/my-component.tsx",
"fileName": "my-component.tsx",
"readmePath": "src/components/my-component/readme.md",
"usagesDir": "src/components/my-component/usage",
"tag": "my-component",
"overview": "",
"usage": {},
"docs": "",
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependencies": [],
"dependencyGraph": {},
"props": [],
"methods": [],
"events": [],
"styles": [],
"slots": [],
"parts": [],
"listeners": []
}
],
"typeLibrary": {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"module": "dist/index.js",
"es2015": "dist/esm/index.mjs",
"es2017": "dist/esm/index.mjs",
"types": "dist/types/index.d.ts",
"types": "dist/types/interfaces.d.ts",
"collection": "dist/collection/collection-manifest.json",
"collection:main": "dist/collection/index.js",
"unpkg": "dist/siemens-ix/siemens-ix.esm.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"@floating-ui/dom": "^1.5.1",
"@stencil/core": "^4.9.0",
"@stencil/core": "^4.11.0",
"@types/luxon": "^3.3.7",
"animejs": "~3.2.1",
"hyperlist": "^1.0.0",
Expand All @@ -58,7 +58,7 @@
"@stencil-community/postcss": "^2.2.0",
"@stencil/angular-output-target": "^0.8.3",
"@stencil/react-output-target": "^0.5.3",
"@stencil/sass": "^3.0.7",
"@stencil/sass": "^3.0.8",
"@stencil/vue-output-target": "^0.8.7",
"@testing-library/dom": "^8.11.0",
"@testing-library/jest-dom": "^5.16.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/scripts/custom-elements/custom-elements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export * from '../dist/types/index';
export * from '../dist/types/interfaces';
export * from './index';
26 changes: 13 additions & 13 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,8 @@ export namespace Components {
| 'success'
| 'custom';
}
interface IxPlaygroundInternal {
}
/**
* @since 1.6.0
*/
Expand Down Expand Up @@ -2332,8 +2334,6 @@ export namespace Components {
*/
"vertical": boolean;
}
interface MyComponent {
}
}
export interface IxBlindCustomEvent<T> extends CustomEvent<T> {
detail: T;
Expand Down Expand Up @@ -3471,6 +3471,12 @@ declare global {
prototype: HTMLIxPillElement;
new (): HTMLIxPillElement;
};
interface HTMLIxPlaygroundInternalElement extends Components.IxPlaygroundInternal, HTMLStencilElement {
}
var HTMLIxPlaygroundInternalElement: {
prototype: HTMLIxPlaygroundInternalElement;
new (): HTMLIxPlaygroundInternalElement;
};
/**
* @since 1.6.0
*/
Expand Down Expand Up @@ -3821,12 +3827,6 @@ declare global {
prototype: HTMLIxWorkflowStepsElement;
new (): HTMLIxWorkflowStepsElement;
};
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {
}
var HTMLMyComponentElement: {
prototype: HTMLMyComponentElement;
new (): HTMLMyComponentElement;
};
interface HTMLElementTagNameMap {
"ix-action-card": HTMLIxActionCardElement;
"ix-application": HTMLIxApplicationElement;
Expand Down Expand Up @@ -3903,6 +3903,7 @@ declare global {
"ix-modal-loading": HTMLIxModalLoadingElement;
"ix-pagination": HTMLIxPaginationElement;
"ix-pill": HTMLIxPillElement;
"ix-playground-internal": HTMLIxPlaygroundInternalElement;
"ix-push-card": HTMLIxPushCardElement;
"ix-row": HTMLIxRowElement;
"ix-select": HTMLIxSelectElement;
Expand All @@ -3927,7 +3928,6 @@ declare global {
"ix-validation-tooltip": HTMLIxValidationTooltipElement;
"ix-workflow-step": HTMLIxWorkflowStepElement;
"ix-workflow-steps": HTMLIxWorkflowStepsElement;
"my-component": HTMLMyComponentElement;
}
}
declare namespace LocalJSX {
Expand Down Expand Up @@ -5707,6 +5707,8 @@ declare namespace LocalJSX {
| 'success'
| 'custom';
}
interface IxPlaygroundInternal {
}
/**
* @since 1.6.0
*/
Expand Down Expand Up @@ -6418,8 +6420,6 @@ declare namespace LocalJSX {
*/
"vertical"?: boolean;
}
interface MyComponent {
}
interface IntrinsicElements {
"ix-action-card": IxActionCard;
"ix-application": IxApplication;
Expand Down Expand Up @@ -6496,6 +6496,7 @@ declare namespace LocalJSX {
"ix-modal-loading": IxModalLoading;
"ix-pagination": IxPagination;
"ix-pill": IxPill;
"ix-playground-internal": IxPlaygroundInternal;
"ix-push-card": IxPushCard;
"ix-row": IxRow;
"ix-select": IxSelect;
Expand All @@ -6520,7 +6521,6 @@ declare namespace LocalJSX {
"ix-validation-tooltip": IxValidationTooltip;
"ix-workflow-step": IxWorkflowStep;
"ix-workflow-steps": IxWorkflowSteps;
"my-component": MyComponent;
}
}
export { LocalJSX as JSX };
Expand Down Expand Up @@ -6680,6 +6680,7 @@ declare module "@stencil/core" {
*/
"ix-pagination": LocalJSX.IxPagination & JSXBase.HTMLAttributes<HTMLIxPaginationElement>;
"ix-pill": LocalJSX.IxPill & JSXBase.HTMLAttributes<HTMLIxPillElement>;
"ix-playground-internal": LocalJSX.IxPlaygroundInternal & JSXBase.HTMLAttributes<HTMLIxPlaygroundInternalElement>;
/**
* @since 1.6.0
*/
Expand Down Expand Up @@ -6725,7 +6726,6 @@ declare module "@stencil/core" {
"ix-validation-tooltip": LocalJSX.IxValidationTooltip & JSXBase.HTMLAttributes<HTMLIxValidationTooltipElement>;
"ix-workflow-step": LocalJSX.IxWorkflowStep & JSXBase.HTMLAttributes<HTMLIxWorkflowStepElement>;
"ix-workflow-steps": LocalJSX.IxWorkflowSteps & JSXBase.HTMLAttributes<HTMLIxWorkflowStepsElement>;
"my-component": LocalJSX.MyComponent & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
*/
import { Component, h, Host } from '@stencil/core';

/** @internal */
@Component({
tag: 'my-component',
styleUrl: 'my-component.scss',
scoped: true,
tag: 'ix-playground-internal',
styleUrl: 'playground.scss',
shadow: true,
// Set scoped=true and shadow=false to test global styles like checkbox etc
// scoped: true,
})
export class MyComponent {
export class PlaygroundInternal {
render() {
return <Host></Host>;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
</head>

<body style="margin: 0px; height: 100vh">
<my-component />
<ix-playground-internal />
</body>
</html>
18 changes: 1 addition & 17 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type {
Components as IxIconsComponents,
JSX as IxIconsJSX,
} from '@siemens/ix-icons';
export * from './components';

export * from './components/category-filter/filter-state';
export * from './components/category-filter/input-state';
export * from './components/category-filter/logical-filter-operator';
Expand All @@ -27,15 +23,3 @@ export {
convertToRemString,
} from './components/utils/rwd.util';
export * from './components/utils/theme-switcher';

declare module './components' {
export namespace Components {
export type IxIcon = IxIconsComponents.IxIcon;
}
}

declare module './components' {
export namespace JSX {
export type IxIcon = IxIconsJSX.IxIcon;
}
}
27 changes: 27 additions & 0 deletions packages/core/src/interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* SPDX-FileCopyrightText: 2024 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type {
Components as IxIconsComponents,
JSX as IxIconsJSX,
} from '@siemens/ix-icons';

export * from './components';
export * from './index';

declare module './components' {
export namespace Components {
export type IxIcon = IxIconsComponents.IxIcon;
}
}

declare module './components' {
export namespace JSX {
export type IxIcon = IxIconsJSX.IxIcon;
}
}
11 changes: 8 additions & 3 deletions packages/core/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ export const config: Config = {
includeImportCustomElements: true,
includePolyfills: false,
includeDefineCustomElements: false,
excludeComponents: ['my-component', 'ix-icon'],
excludeComponents: ['ix-playground-internal', 'ix-icon'],
}),
angularOutputTarget({
componentCorePackage: '@siemens/ix',
directivesProxyFile: '../angular/src/components.ts',
directivesArrayFile: '../angular/src/declare-components.ts',
excludeComponents: ['my-component', 'ix-tree', 'ix-icon'],
excludeComponents: ['ix-playground-internal', 'ix-tree', 'ix-icon'],
valueAccessorConfigs: [
{
elementSelectors:
Expand All @@ -105,7 +105,12 @@ export const config: Config = {
includeImportCustomElements: true,
includePolyfills: false,
includeDefineCustomElements: false,
excludeComponents: ['my-component', 'ix-tree', 'ix-tree-item', 'ix-icon'],
excludeComponents: [
'ix-playground-internal',
'ix-tree',
'ix-tree-item',
'ix-icon',
],
}),
{
type: 'dist',
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3598,10 +3598,10 @@
resolved "https://registry.npmjs.org/@stencil/core/-/core-3.2.1.tgz#50bd07f478e04a5527a35aee61deff772b056860"
integrity sha512-Ybm4NteQBScLq3H0JML/uqo4nWjNpZw1HAAURtR5LlRm7ptzNKO5S8EnHp3m05/uyTzeh9yLpUFHY7bxGNdYLg==

"@stencil/core@^4.9.0":
version "4.9.0"
resolved "https://registry.npmjs.org/@stencil/core/-/core-4.9.0.tgz#f224813dde3a2b7f3cdccc5d39eaf777ad2d0ef2"
integrity sha512-aWSkhBmk3yPwRAkUwBbzRwmdhb8hKiQ/JMr9m5jthpBZLjtppYbzz6PN2MhSMDfRp6K93eQw5WogSEH4HHuB6w==
"@stencil/core@^4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@stencil/core/-/core-4.11.0.tgz#c9c1aed7ac7358d63ce5f6fdf5001a2d7f17259c"
integrity sha512-zsKhgIkTGo+s7IthitxR/MKiMS3Ck1yIypOdXr0aE6ofboKqe9NdffTcxZ0vel0wD2bZYOb6WfPMzuhRKk6+FA==

"@stencil/postcss@^2.1.0":
version "2.1.0"
Expand All @@ -3616,10 +3616,10 @@
resolved "https://registry.npmjs.org/@stencil/react-output-target/-/react-output-target-0.5.3.tgz#2a7186b7ba6c8721f92f4200e414b70854030d79"
integrity sha512-68jwRp35CjAcwhTJ9yFD/3n+jrHOqvEH2jreVuPVvZK+4tkhPlYlwz0d1E1RlF3jyifUSfdkWUGgXIEy8Fo3yw==

"@stencil/sass@^3.0.7":
version "3.0.7"
resolved "https://registry.npmjs.org/@stencil/sass/-/sass-3.0.7.tgz#7f8225cd0122b3c517c0f9007ed0cd98cf82ea3d"
integrity sha512-HcBjrh2CJ6aJnkOrBNSVyf1+x3FnUneYFk44rcx/jDK6Lx7R4w0dXMEsIR5MXqtROYWonZt7WtR8wsM1vcD+6w==
"@stencil/sass@^3.0.8":
version "3.0.8"
resolved "https://registry.yarnpkg.com/@stencil/sass/-/sass-3.0.8.tgz#5140382dd7cdf05cc01898f4cfae2ff066dd8afd"
integrity sha512-QJUG4Dr/b3wSizViwQXorrk1PJzxOsKkq5hSqtUHc3NNG3iomC4DQFYGeu15yNfoCDBtt4qkyHSCynsekQ8F6A==

"@stencil/vue-output-target@^0.8.7":
version "0.8.7"
Expand Down