Merge pull request 'Fix/#42 add hot reload in storybook for stencil' (#43) from fix/#42-add-hot-reload-in-storybook-for-stencil into dev
CI / lint-and-format (push) Successful in 36s
CI / changeset-check (push) Successful in 34s
CI / unit-tests (push) Successful in 43s
CI / component-tests (push) Successful in 32s
CI / lint-and-format (pull_request) Successful in 36s
CI / changeset-check (pull_request) Successful in 29s
CI / unit-tests (pull_request) Successful in 37s
CI / component-tests (pull_request) Successful in 32s

Reviewed-on: #43
This commit was merged in pull request #43.
This commit is contained in:
2026-10-05 17:03:42 +00:00
12 changed files with 127 additions and 110 deletions
+1 -2
View File
@@ -2,6 +2,5 @@
"singleQuote": true, "singleQuote": true,
"semi": true, "semi": true,
"trailingComma": "es5", "trailingComma": "es5",
"printWidth": 100, "printWidth": 100
"bracketSameLine": true
} }
+1
View File
@@ -93,6 +93,7 @@ pnpm install
| `pnpm run format` | Run the formatter to automatically fix code style issues | | `pnpm run format` | Run the formatter to automatically fix code style issues |
| `pnpm run test:browser` | Run browser tests (only works inside the `packages/luna-charts` directory) | | `pnpm run test:browser` | Run browser tests (only works inside the `packages/luna-charts` directory) |
| `pnpm run storybook` | Start the storybook documentation | | `pnpm run storybook` | Start the storybook documentation |
| `pnpm run stencil:dev` | Runs the Stencil development server with live-reloading for the `luna-charts package inside the monorepo. |
Component and browser tests run inside Docker (`docker-compose.test.yaml`), based on the same `Dockerfile.test` used to build the image CI tests against, to guarantee a reproducible browser environment — you don't need Playwright browsers installed locally. Locally this image is built on demand; in CI a prebuilt version of the same image is pulled directly (see [ADR-0002](./docs/src/content/docs/architecture/adr/000200-technology-stack.mdx) and the [Technology Architecture](./docs/src/content/docs/architecture/adm/technology-architecture.mdx#66-test-execution-environment) doc for details). Component and browser tests run inside Docker (`docker-compose.test.yaml`), based on the same `Dockerfile.test` used to build the image CI tests against, to guarantee a reproducible browser environment — you don't need Playwright browsers installed locally. Locally this image is built on demand; in CI a prebuilt version of the same image is pulled directly (see [ADR-0002](./docs/src/content/docs/architecture/adr/000200-technology-stack.mdx) and the [Technology Architecture](./docs/src/content/docs/architecture/adm/technology-architecture.mdx#66-test-execution-environment) doc for details).
+1
View File
@@ -6,6 +6,7 @@
"scripts": { "scripts": {
"docs": "pnpm --filter docs run dev", "docs": "pnpm --filter docs run dev",
"lint": "pnpm --filter luna-charts run lint", "lint": "pnpm --filter luna-charts run lint",
"stencil:dev": "pnpm --filter luna-charts exec stencil build --watch",
"format": "prettier --write .", "format": "prettier --write .",
"format:check": "pnpm --filter luna-charts run format:check", "format:check": "pnpm --filter luna-charts run format:check",
"changeset": "changeset", "changeset": "changeset",
-1
View File
@@ -1,7 +1,6 @@
{ {
"arrowParens": "avoid", "arrowParens": "avoid",
"bracketSpacing": true, "bracketSpacing": true,
"jsxBracketSameLine": false,
"jsxSingleQuote": false, "jsxSingleQuote": false,
"quoteProps": "consistent", "quoteProps": "consistent",
"printWidth": 180, "printWidth": 180,
+31 -69
View File
@@ -1,94 +1,45 @@
{ {
"timestamp": "2026-08-01T23:02:04", "timestamp": "2026-10-05T16:30:03",
"compiler": { "compiler": {
"name": "@stencil/core", "name": "@stencil/core",
"version": "4.43.5", "version": "4.44.2",
"typescriptVersion": "5.8.3" "typescriptVersion": "5.8.3"
}, },
"components": [ "components": [
{ {
"filePath": "src/components/my-component/my-component.tsx", "filePath": "src/components/charts/bar-chart/bar-chart.tsx",
"encapsulation": "shadow", "encapsulation": "shadow",
"tag": "my-component", "tag": "bar-chart",
"readme": "# my-component\n\n\n", "readme": "# bar-chart\n\n\n",
"docs": "", "docs": "",
"docsTags": [], "docsTags": [],
"usage": {}, "usage": {},
"props": [ "props": [
{ {
"name": "first", "name": "title",
"type": "string | undefined", "type": "string",
"complexType": { "complexType": {
"original": "string", "original": "string",
"resolved": "string | undefined", "resolved": "string",
"references": {} "references": {}
}, },
"mutable": false, "mutable": false,
"attr": "first", "attr": "title",
"reflectToAttr": false, "reflectToAttr": false,
"docs": "The first name", "docs": "",
"docsTags": [], "docsTags": [
{
"name": "default",
"text": "'Hello World'"
}
],
"default": "'Hello World'",
"values": [ "values": [
{ {
"type": "string" "type": "string"
},
{
"type": "undefined"
} }
], ],
"optional": true, "optional": false,
"required": false,
"getter": false,
"setter": false
},
{
"name": "last",
"type": "string | undefined",
"complexType": {
"original": "string",
"resolved": "string | undefined",
"references": {}
},
"mutable": false,
"attr": "last",
"reflectToAttr": false,
"docs": "The last name",
"docsTags": [],
"values": [
{
"type": "string"
},
{
"type": "undefined"
}
],
"optional": true,
"required": false,
"getter": false,
"setter": false
},
{
"name": "middle",
"type": "string | undefined",
"complexType": {
"original": "string",
"resolved": "string | undefined",
"references": {}
},
"mutable": false,
"attr": "middle",
"reflectToAttr": false,
"docs": "The middle name",
"docsTags": [],
"values": [
{
"type": "string"
},
{
"type": "undefined"
}
],
"optional": true,
"required": false, "required": false,
"getter": false, "getter": false,
"setter": false "setter": false
@@ -98,7 +49,12 @@
"events": [], "events": [],
"listeners": [], "listeners": [],
"styles": [], "styles": [],
"slots": [], "slots": [
{
"name": "",
"docs": "The default slot"
}
],
"parts": [], "parts": [],
"states": [], "states": [],
"dependents": [], "dependents": [],
@@ -106,5 +62,11 @@
"dependencyGraph": {} "dependencyGraph": {}
} }
], ],
"typeLibrary": {} "typeLibrary": {
"src/types/index.ts::ChartInfo": {
"declaration": "export interface ChartInfo {\n title: string;\n description: string; \n sourceUrl: string; \n}",
"docstring": "",
"path": "src/types/index.ts"
}
}
} }
+17 -35
View File
@@ -5,64 +5,46 @@
*/ */
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal'; import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
export namespace Components { export namespace Components {
interface MyComponent { interface BarChart {
/** /**
* The first name * @default 'Hello World'
*/ */
first?: string; title: string;
/**
* The last name
*/
last?: string;
/**
* The middle name
*/
middle?: string;
} }
} }
declare global { declare global {
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {} interface HTMLBarChartElement extends Components.BarChart, HTMLStencilElement {}
var HTMLMyComponentElement: { var HTMLBarChartElement: {
prototype: HTMLMyComponentElement; prototype: HTMLBarChartElement;
new (): HTMLMyComponentElement; new (): HTMLBarChartElement;
}; };
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
'my-component': HTMLMyComponentElement; 'bar-chart': HTMLBarChartElement;
} }
} }
declare namespace LocalJSX { declare namespace LocalJSX {
interface MyComponent { interface BarChart {
/** /**
* The first name * @default 'Hello World'
*/ */
first?: string; title?: string;
/**
* The last name
*/
last?: string;
/**
* The middle name
*/
middle?: string;
} }
interface MyComponentAttributes { interface BarChartAttributes {
first: string; title: string;
middle: string;
last: string;
} }
interface IntrinsicElements { interface IntrinsicElements {
'my-component': Omit<MyComponent, keyof MyComponentAttributes> & { [K in keyof MyComponent & keyof MyComponentAttributes]?: MyComponent[K] } & { 'bar-chart': Omit<BarChart, keyof BarChartAttributes> & { [K in keyof BarChart & keyof BarChartAttributes]?: BarChart[K] } & {
[K in keyof MyComponent & keyof MyComponentAttributes as `attr:${K}`]?: MyComponentAttributes[K]; [K in keyof BarChart & keyof BarChartAttributes as `attr:${K}`]?: BarChartAttributes[K];
} & { [K in keyof MyComponent & keyof MyComponentAttributes as `prop:${K}`]?: MyComponent[K] }; } & { [K in keyof BarChart & keyof BarChartAttributes as `prop:${K}`]?: BarChart[K] };
} }
} }
export { LocalJSX as JSX }; export { LocalJSX as JSX };
declare module '@stencil/core' { declare module '@stencil/core' {
export namespace JSX { export namespace JSX {
interface IntrinsicElements { interface IntrinsicElements {
'my-component': LocalJSX.IntrinsicElements['my-component'] & JSXBase.HTMLAttributes<HTMLMyComponentElement>; 'bar-chart': LocalJSX.IntrinsicElements['bar-chart'] & JSXBase.HTMLAttributes<HTMLBarChartElement>;
} }
} }
} }
@@ -0,0 +1,3 @@
:host {
display: block;
}
@@ -0,0 +1,24 @@
import type { Meta, StoryObj } from '@stencil/storybook-plugin';
import { h } from '@stencil/core';
import { BarChart } from './bar-chart';
const meta: Meta<BarChart> = {
title: 'BarChart',
component: BarChart,
parameters: {
layout: 'centered',
},
};
export default meta;
type Story = StoryObj<BarChart>;
export const Primary: Story = {
args: {},
render: () => <bar-chart title="test" />,
};
export const Secondary: Story = {
args: {},
};
@@ -0,0 +1,18 @@
import { Component, Host, Prop, h } from '@stencil/core';
@Component({
tag: 'bar-chart',
styleUrl: 'bar-chart.css',
shadow: true,
})
export class BarChart {
@Prop() title: string = 'Hello World';
render() {
return (
<Host>
<slot>{this.title}</slot>
</Host>
);
}
}
@@ -0,0 +1,12 @@
import { newE2EPage } from '@stencil/core/testing';
import { describe, expect, it } from 'vitest';
describe('bar-chart', () => {
it('renders', async () => {
const page = await newE2EPage();
await page.setContent('<bar-chart></bar-chart>');
const element = await page.find('bar-chart');
expect(element).toHaveClass('hydrated');
});
});
@@ -0,0 +1,19 @@
import { newSpecPage } from '@stencil/core/testing';
import { BarChart } from '../bar-chart';
import { describe, expect, it } from 'vitest';
describe('bar-chart', () => {
it('renders', async () => {
const page = await newSpecPage({
components: [BarChart],
html: `<bar-chart></bar-chart>`,
});
expect(page.root).toEqualHtml(`
<bar-chart>
<mock:shadow-root>
<slot></slot>
</mock:shadow-root>
</bar-chart>
`);
});
});
-3
View File
@@ -12,9 +12,6 @@ export const config: Config = {
customElementsExportBehavior: 'auto-define-custom-elements', customElementsExportBehavior: 'auto-define-custom-elements',
externalRuntime: false, externalRuntime: false,
}, },
{
type: 'docs-readme',
},
{ {
type: 'www', type: 'www',
serviceWorker: null, // disable service workers serviceWorker: null, // disable service workers