@genesislcap/ts-builder 14.461.1 → 14.461.2-GENC-1346.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-wrapper-generator.d.ts","sourceRoot":"","sources":["../src/react-wrapper-generator.ts"],"names":[],"mappings":"AAyCA,KAAK,cAAc,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA6gC/F,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"react-wrapper-generator.d.ts","sourceRoot":"","sources":["../src/react-wrapper-generator.ts"],"names":[],"mappings":"AAyCA,KAAK,cAAc,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA6gC/F,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CA+ChF"}
|
|
@@ -916,9 +916,13 @@ function generateReactWrappers(cwd) {
|
|
|
916
916
|
}
|
|
917
917
|
const afterFast = yield mergeFastInheritanceFromManifest(cwd, rawEntries);
|
|
918
918
|
const entries = yield mergeFoundationInheritanceFromManifest(cwd, afterFast);
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
919
|
+
// A wrapper is worth generating for any element that has a tag name: the dts exposes the
|
|
920
|
+
// element's public members as typed props (via `PublicOf<WC>`) and the runtime wrapper binds
|
|
921
|
+
// object properties that JSX can't set as attributes. Events are layered on top when present,
|
|
922
|
+
// so they are not a precondition — prop-only elements still produce a useful, typed wrapper.
|
|
923
|
+
const hasWrappableElement = entries.some((e) => e.declaration.name && e.declaration.tagName && e.modulePath);
|
|
924
|
+
if (!hasWrappableElement) {
|
|
925
|
+
return { generated: false, reason: 'No wrappable custom elements found in manifest.' };
|
|
922
926
|
}
|
|
923
927
|
const dtsRoot = (0, node_path_1.resolve)(cwd, 'dist/dts');
|
|
924
928
|
yield (0, promises_1.mkdir)(dtsRoot, { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ts-builder",
|
|
3
3
|
"description": "Typescript builder",
|
|
4
|
-
"version": "14.461.1",
|
|
4
|
+
"version": "14.461.2-GENC-1346.1",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@custom-elements-manifest/analyzer": "^0.8.2",
|
|
20
|
-
"@genesislcap/build-kit": "14.461.1",
|
|
20
|
+
"@genesislcap/build-kit": "14.461.2-GENC-1346.1",
|
|
21
21
|
"consola": "^3.0.2",
|
|
22
22
|
"copyfiles": "^2.4.1",
|
|
23
23
|
"pkg-types": "^1.0.2"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "0729266a735c8d8d74192119552f0774c6038436"
|
|
34
34
|
}
|
|
@@ -1099,9 +1099,15 @@ export async function generateReactWrappers(cwd: string): Promise<GenerateResult
|
|
|
1099
1099
|
|
|
1100
1100
|
const afterFast = await mergeFastInheritanceFromManifest(cwd, rawEntries);
|
|
1101
1101
|
const entries = await mergeFoundationInheritanceFromManifest(cwd, afterFast);
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1102
|
+
// A wrapper is worth generating for any element that has a tag name: the dts exposes the
|
|
1103
|
+
// element's public members as typed props (via `PublicOf<WC>`) and the runtime wrapper binds
|
|
1104
|
+
// object properties that JSX can't set as attributes. Events are layered on top when present,
|
|
1105
|
+
// so they are not a precondition — prop-only elements still produce a useful, typed wrapper.
|
|
1106
|
+
const hasWrappableElement = entries.some(
|
|
1107
|
+
(e) => e.declaration.name && e.declaration.tagName && e.modulePath,
|
|
1108
|
+
);
|
|
1109
|
+
if (!hasWrappableElement) {
|
|
1110
|
+
return { generated: false, reason: 'No wrappable custom elements found in manifest.' };
|
|
1105
1111
|
}
|
|
1106
1112
|
|
|
1107
1113
|
const dtsRoot = resolve(cwd, 'dist/dts');
|