@componentonce/compiler-esbuild 0.1.0-beta.0 → 0.1.0-beta.1
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/README.md +103 -15
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +171 -0
- package/dist/cli.js.map +1 -0
- package/dist/compiler.d.ts +141 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +296 -0
- package/dist/compiler.js.map +1 -0
- package/dist/index.d.ts +2 -136
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -289
- package/dist/index.js.map +1 -1
- package/dist/package.d.ts +88 -0
- package/dist/package.d.ts.map +1 -0
- package/dist/package.js +229 -0
- package/dist/package.js.map +1 -0
- package/examples/react-card.tsx +31 -0
- package/package.json +22 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createReactRequirement,
|
|
3
|
+
defineReactComponent,
|
|
4
|
+
} from "@componentonce/react";
|
|
5
|
+
|
|
6
|
+
interface CardProps {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface HostContext {
|
|
11
|
+
readonly formatAmount: (value: number) => string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface CardPayload {
|
|
15
|
+
readonly amount: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A component module only exports a normal ComponentOnce definition.
|
|
20
|
+
* The CLI/compiler discovers this manifest once at trusted build time and stores it in the package.
|
|
21
|
+
*/
|
|
22
|
+
export const definition = defineReactComponent<CardProps, HostContext, CardPayload>({
|
|
23
|
+
manifest: {
|
|
24
|
+
id: "example/amount-card",
|
|
25
|
+
version: "1.0.0",
|
|
26
|
+
requirements: [createReactRequirement("19.3.0")],
|
|
27
|
+
},
|
|
28
|
+
component({ props, context, payload }) {
|
|
29
|
+
return <strong>{props.label}: {context.formatAmount(payload.amount)}</strong>;
|
|
30
|
+
},
|
|
31
|
+
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@componentonce/compiler-esbuild",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
+
"examples",
|
|
7
8
|
"README.md"
|
|
8
9
|
],
|
|
9
10
|
"exports": {
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
17
|
"esbuild": "^0.27.0",
|
|
17
|
-
"@componentonce/core": "0.1.0-beta.
|
|
18
|
+
"@componentonce/core": "0.1.0-beta.1"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@types/node": "^24.10.0",
|
|
@@ -31,6 +32,25 @@
|
|
|
31
32
|
"access": "public",
|
|
32
33
|
"tag": "beta"
|
|
33
34
|
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"componentonce": "./dist/cli.js"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": ">=18",
|
|
40
|
+
"@componentonce/dom": "0.1.0-beta.1",
|
|
41
|
+
"@componentonce/react": "0.1.0-beta.1"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"@componentonce/dom": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"@componentonce/react": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"react": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
34
54
|
"scripts": {
|
|
35
55
|
"build": "tsc -p tsconfig.json",
|
|
36
56
|
"check": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json",
|