llm-testrunner-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/current-time.my-component.entry.cjs.js.map +1 -0
- package/dist/cjs/current-time_2.cjs.entry.js +67 -0
- package/dist/cjs/current-time_2.cjs.entry.js.map +1 -0
- package/dist/cjs/index-CCrH7f-W.js +1293 -0
- package/dist/cjs/index-CCrH7f-W.js.map +1 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/llm-testrunner-components.cjs.js +28 -0
- package/dist/cjs/llm-testrunner-components.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +13 -0
- package/dist/collection/components/my-component/current-time.js +35 -0
- package/dist/collection/components/my-component/current-time.js.map +1 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +96 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/current-time.d.ts +11 -0
- package/dist/components/current-time.js +9 -0
- package/dist/components/current-time.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +63 -0
- package/dist/components/my-component.js.map +1 -0
- package/dist/components/p-CbvWSaCI.js +53 -0
- package/dist/components/p-CbvWSaCI.js.map +1 -0
- package/dist/components/p-DnDi6fKi.js +1101 -0
- package/dist/components/p-DnDi6fKi.js.map +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/current-time.my-component.entry.js.map +1 -0
- package/dist/esm/current-time_2.entry.js +64 -0
- package/dist/esm/current-time_2.entry.js.map +1 -0
- package/dist/esm/index-0jlGA6MK.js +1287 -0
- package/dist/esm/index-0jlGA6MK.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/llm-testrunner-components.js +24 -0
- package/dist/esm/llm-testrunner-components.js.map +1 -0
- package/dist/esm/loader.js +14 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/llm-testrunner-components/current-time.my-component.entry.esm.js.map +1 -0
- package/dist/llm-testrunner-components/index.esm.js +2 -0
- package/dist/llm-testrunner-components/index.esm.js.map +1 -0
- package/dist/llm-testrunner-components/llm-testrunner-components.esm.js +2 -0
- package/dist/llm-testrunner-components/llm-testrunner-components.esm.js.map +1 -0
- package/dist/llm-testrunner-components/loader.esm.js.map +1 -0
- package/dist/llm-testrunner-components/p-0jlGA6MK.js +3 -0
- package/dist/llm-testrunner-components/p-0jlGA6MK.js.map +1 -0
- package/dist/llm-testrunner-components/p-15e5e0fe.entry.js +2 -0
- package/dist/llm-testrunner-components/p-15e5e0fe.entry.js.map +1 -0
- package/dist/llm-testrunner-components/p-DQuL1Twl.js +2 -0
- package/dist/llm-testrunner-components/p-DQuL1Twl.js.map +1 -0
- package/dist/types/components/my-component/current-time.d.ts +7 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components.d.ts +74 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1709 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# LLM TestRunner Web Components
|
|
2
|
+
|
|
3
|
+
A Stencil web component library that provides reusable components for displaying greetings and current time.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
### `<my-component>`
|
|
8
|
+
A greeting component that displays a personalized message with the current time.
|
|
9
|
+
|
|
10
|
+
**Props:**
|
|
11
|
+
- `first` (string): First name
|
|
12
|
+
- `middle` (string, optional): Middle name
|
|
13
|
+
- `last` (string): Last name
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
```html
|
|
17
|
+
<my-component first="John" middle="William" last="Doe"></my-component>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### `<current-time>`
|
|
21
|
+
A component that displays the current time and updates every second.
|
|
22
|
+
|
|
23
|
+
**Example:**
|
|
24
|
+
```html
|
|
25
|
+
<current-time></current-time>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Publishing to NPM
|
|
29
|
+
|
|
30
|
+
1. **Login to NPM:**
|
|
31
|
+
```bash
|
|
32
|
+
npm adduser
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. **Build the components:**
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. **Publish to NPM:**
|
|
41
|
+
```bash
|
|
42
|
+
npm publish --access public
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Using in React Applications
|
|
46
|
+
|
|
47
|
+
### Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install @arupmishra/llm-testrunner-components
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Integration
|
|
54
|
+
|
|
55
|
+
1. **Import and define custom elements in your React component:**
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import React, { useEffect } from 'react';
|
|
59
|
+
import { defineCustomElements } from '@arupmishra/llm-testrunner-components/loader';
|
|
60
|
+
|
|
61
|
+
// Define TypeScript types for the custom elements
|
|
62
|
+
declare global {
|
|
63
|
+
namespace JSX {
|
|
64
|
+
interface IntrinsicElements {
|
|
65
|
+
'my-component': any;
|
|
66
|
+
'current-time': any;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function App() {
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
// Define the custom elements when the component mounts
|
|
74
|
+
defineCustomElements();
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div>
|
|
79
|
+
<my-component first="John" middle="William" last="Doe"></my-component>
|
|
80
|
+
<current-time></current-time>
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. **For better TypeScript support, create type definitions:**
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
// types/stencil-components.d.ts
|
|
90
|
+
import { JSX as LocalJSX } from '@arupmishra/llm-testrunner-components';
|
|
91
|
+
import { HTMLAttributes } from 'react';
|
|
92
|
+
|
|
93
|
+
type StencilToReact<T> = {
|
|
94
|
+
[P in keyof T]?: T[P] & Omit<HTMLAttributes<Element>, 'className'> & {
|
|
95
|
+
class?: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
declare global {
|
|
100
|
+
export namespace JSX {
|
|
101
|
+
interface IntrinsicElements
|
|
102
|
+
extends StencilToReact<LocalJSX.IntrinsicElements> {}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
### Building
|
|
110
|
+
```bash
|
|
111
|
+
npm run build
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Testing
|
|
115
|
+
```bash
|
|
116
|
+
npm test
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Development Server
|
|
120
|
+
```bash
|
|
121
|
+
npm start
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Demo
|
|
125
|
+
|
|
126
|
+
A complete React demo application is available in the `../react-web-component-demo` directory showing how to integrate these web components into a React application.
|
|
127
|
+
|
|
128
|
+
To run the demo:
|
|
129
|
+
```bash
|
|
130
|
+
cd ../react-web-component-demo
|
|
131
|
+
npm start
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-globals-V2Kpy_OQ.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\nexport const globalStyles = \"\";\n"],"names":[],"mappings":";;AAAY,MAAC,aAAa,GAAG,MAAM;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current-time.my-component.entry.cjs.js","sources":["src/components/my-component/current-time.tsx","src/components/my-component/my-component.css?tag=my-component&encapsulation=shadow","src/components/my-component/my-component.tsx"],"sourcesContent":["// First, we import State from '@stencil/core'\nimport { Component, State, h } from '@stencil/core';\n\n@Component({\n tag: 'current-time',\n})\nexport class CurrentTime {\n // `timer` is not decorated with `@State()`, as\n // we do not wish to trigger a rerender when its\n // value changes\n timer: number;\n\n // `currentTime` is decorated with `@State()`,\n // as we need to trigger a rerender when its\n // value changes to show the latest time\n @State() currentTime: number = Date.now();\n\n connectedCallback() {\n // the assignment to `this.timer` will not\n // trigger a re-render\n this.timer = window.setInterval(() => {\n // the assignment to `this.currentTime`\n // will trigger a re-render\n this.currentTime = Date.now();\n }, 1000);\n }\n\n disconnectedCallback() {\n window.clearInterval(this.timer);\n }\n\n render() {\n const time = new Date(this.currentTime).toLocaleTimeString();\n\n return (\n <span>{time}</span>\n );\n }\n}",":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { format } from '../../utils/utils';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.css',\n shadow: true,\n})\nexport class MyComponent {\n /**\n * The first name\n */\n @Prop() first: string;\n\n /**\n * The middle name\n */\n @Prop() middle: string;\n\n /**\n * The last name\n */\n @Prop() last: string;\n\n private getText(): string {\n return format(this.first, this.middle, this.last);\n }\n\n render() {\n return (\n <div>\n Hello, World! I'm {this.getText()} <br />\n Current time: <current-time />\n </div>\n );\n }\n}\n"],"names":["h","format"],"mappings":";;;;;MAMa,WAAW,GAAA,MAAA;;;;;;;AAIpB,IAAA,KAAK;;;;AAKI,IAAA,WAAW,GAAW,IAAI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
8
|
+
index.registerInstance(this, hostRef);
|
|
9
|
+
}
|
|
10
|
+
// `timer` is not decorated with `@State()`, as
|
|
11
|
+
// we do not wish to trigger a rerender when its
|
|
12
|
+
// value changes
|
|
13
|
+
timer;
|
|
14
|
+
// `currentTime` is decorated with `@State()`,
|
|
15
|
+
// as we need to trigger a rerender when its
|
|
16
|
+
// value changes to show the latest time
|
|
17
|
+
currentTime = Date.now();
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
// the assignment to `this.timer` will not
|
|
20
|
+
// trigger a re-render
|
|
21
|
+
this.timer = window.setInterval(() => {
|
|
22
|
+
// the assignment to `this.currentTime`
|
|
23
|
+
// will trigger a re-render
|
|
24
|
+
this.currentTime = Date.now();
|
|
25
|
+
}, 1000);
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
window.clearInterval(this.timer);
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const time = new Date(this.currentTime).toLocaleTimeString();
|
|
32
|
+
return (index.h("span", { key: '45b0df3ce3817ac64d22582b1a45c188b61656a4' }, time));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const myComponentCss = ":host{display:block}";
|
|
37
|
+
|
|
38
|
+
const MyComponent = class {
|
|
39
|
+
constructor(hostRef) {
|
|
40
|
+
index.registerInstance(this, hostRef);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The first name
|
|
44
|
+
*/
|
|
45
|
+
first;
|
|
46
|
+
/**
|
|
47
|
+
* The middle name
|
|
48
|
+
*/
|
|
49
|
+
middle;
|
|
50
|
+
/**
|
|
51
|
+
* The last name
|
|
52
|
+
*/
|
|
53
|
+
last;
|
|
54
|
+
getText() {
|
|
55
|
+
return index$1.format(this.first, this.middle, this.last);
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (index.h("div", { key: '538552b1fa1db142ea88eb71047cd1da9fbfb224' }, "Hello, World! I'm ", this.getText(), " ", index.h("br", { key: 'f27acd01ea5f08223805a7f79b0763d45a2e70bf' }), "Current time: ", index.h("current-time", { key: '615f447c114321de1a748703672a3cf9217df591' })));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
MyComponent.style = myComponentCss;
|
|
62
|
+
|
|
63
|
+
exports.current_time = CurrentTime;
|
|
64
|
+
exports.my_component = MyComponent;
|
|
65
|
+
//# sourceMappingURL=current-time.my-component.entry.cjs.js.map
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=current-time_2.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"current-time.my-component.entry.cjs.js","mappings":";;;;;MAMa,WAAW,GAAA,MAAA;;;;;;;AAIpB,IAAA,KAAK;;;;AAKI,IAAA,WAAW,GAAW,IAAI,CAAC,GAAG,EAAE;IAEzC,iBAAiB,GAAA;;;QAGb,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAK;;;AAGjC,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE;SAChC,EAAE,IAAI,CAAC;;IAGZ,oBAAoB,GAAA;AAChB,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;;IAGpC,MAAM,GAAA;AACF,QAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,kBAAkB,EAAE;AAE5D,QAAA,QACIA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAO,IAAI,CAAQ;;;;ACnC/B,MAAM,cAAc,GAAG,sBAAsB;;MCQhC,WAAW,GAAA,MAAA;;;;AACtB;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,MAAM;AAEd;;AAEG;AACK,IAAA,IAAI;IAEJ,OAAO,GAAA;AACb,QAAA,OAAOC,cAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;IAGnD,MAAM,GAAA;QACJ,QACED,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,wBACqB,IAAI,CAAC,OAAO,EAAE,OAAEA,OAAM,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,oBAC3BA,OAAgB,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CAC1B;;;;;;;;","names":["h","format"],"sources":["src/components/my-component/current-time.tsx","src/components/my-component/my-component.css?tag=my-component&encapsulation=shadow","src/components/my-component/my-component.tsx"],"sourcesContent":["// First, we import State from '@stencil/core'\nimport { Component, State, h } from '@stencil/core';\n\n@Component({\n tag: 'current-time',\n})\nexport class CurrentTime {\n // `timer` is not decorated with `@State()`, as\n // we do not wish to trigger a rerender when its\n // value changes\n timer: number;\n\n // `currentTime` is decorated with `@State()`,\n // as we need to trigger a rerender when its\n // value changes to show the latest time\n @State() currentTime: number = Date.now();\n\n connectedCallback() {\n // the assignment to `this.timer` will not\n // trigger a re-render\n this.timer = window.setInterval(() => {\n // the assignment to `this.currentTime`\n // will trigger a re-render\n this.currentTime = Date.now();\n }, 1000);\n }\n\n disconnectedCallback() {\n window.clearInterval(this.timer);\n }\n\n render() {\n const time = new Date(this.currentTime).toLocaleTimeString();\n\n return (\n <span>{time}</span>\n );\n }\n}",":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { format } from '../../utils/utils';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.css',\n shadow: true,\n})\nexport class MyComponent {\n /**\n * The first name\n */\n @Prop() first: string;\n\n /**\n * The middle name\n */\n @Prop() middle: string;\n\n /**\n * The last name\n */\n @Prop() last: string;\n\n private getText(): string {\n return format(this.first, this.middle, this.last);\n }\n\n render() {\n return (\n <div>\n Hello, World! I'm {this.getText()} <br />\n Current time: <current-time />\n </div>\n );\n }\n}\n"],"version":3}
|