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(atomic): fix components.d.ts output #4368

Closed
wants to merge 3 commits into from
Closed
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
13 changes: 6 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/atomic-hosted-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@coveo/bueno": "0.46.1",
"@coveo/headless": "2.80.0",
"@stencil/core": "4.20.0"
"@stencil/core": "4.15.0"
},
"devDependencies": {
"@coveo/release": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/atomic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@rollup/plugin-replace": "5.0.7",
"@stencil-community/postcss": "2.2.0",
"@stencil/angular-output-target": "0.8.4",
"@stencil/core": "4.20.0",
"@stencil/core": "4.15.0",
"@stencil/react-output-target": "0.5.3",
"@storybook/addon-a11y": "8.1.11",
"@storybook/addon-essentials": "8.1.11",
Expand Down
16 changes: 8 additions & 8 deletions packages/atomic/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, GeneratedAnswerStyle, InlineLink, InteractiveCitation, InteractiveResult, LogLevel as LogLevel1, PlatformEnvironment as PlatformEnvironment2, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
import { CategoryFacet, CommerceEngine, DateFacet, InteractiveProduct, LogLevel, NumericFacet, PlatformEnvironment, Product, ProductListing, ProductListingSummaryState, ProductTemplate, ProductTemplateCondition, RegularFacet, Search, SearchSummaryState, Summary } from "@coveo/headless/commerce";
import { CommerceBindings as Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
import { Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
import { Range } from "./components/commerce/facets/facet-number-input/atomic-commerce-facet-number-input";
import { i18n } from "i18next";
import { CommerceInitializationOptions } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
Expand All @@ -17,11 +17,11 @@ import { ItemRenderingFunction } from "./components/common/item-list/item-list-c
import { RedirectionPayload } from "./components/search/atomic-search-box/redirection-payload";
import { AriaLabelGenerator } from "./components/commerce/search-box-suggestions/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products";
import { AtomicInterface } from "./utils/initialization-utils";
import { unknown as AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
import { AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
import { AnyBindings as AnyBindings1 } from "./components/common/interface/bindings";
import { NumberInputType } from "./components/common/facets/facet-number-input/number-input-type";
import { NumericFilter, NumericFilterState, RelativeDateUnit } from "./components/common/types";
import { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, GeneratedAnswerStyle as InsightGeneratedAnswerStyle, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, UserAction as IUserAction, PlatformEnvironment as PlatformEnvironmentInsight } from "./components/insight";
import { InsightEngine, InsightFacetSortCriterion, InsightFoldedResult, InsightGeneratedAnswerStyle, InsightInteractiveResult, InsightLogLevel, InsightRangeFacetRangeAlgorithm, InsightRangeFacetSortCriterion, InsightResult, InsightResultTemplate, InsightResultTemplateCondition, IUserAction, PlatformEnvironmentInsight } from "./components/insight";
import { i18nCompatibilityVersion } from "./components/common/interface/i18n";
import { InsightInitializationOptions } from "./components/insight/atomic-insight-interface/atomic-insight-interface";
import { AtomicInsightStore } from "./components/insight/atomic-insight-interface/store";
Expand All @@ -30,15 +30,15 @@ import { Section } from "./components/common/atomic-layout-section/sections";
import { AtomicCommonStore, AtomicCommonStoreData } from "./components/common/interface/store";
import { SelectChildProductEventArgs } from "./components/commerce/product-template-components/atomic-product-children/atomic-product-children";
import { PlatformEnvironment as PlatformEnvironment1, RecommendationEngine } from "@coveo/headless/recommendation";
import { InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "./components/recommendations";
import { RecsInteractiveResult, RecsLogLevel, RecsResult, RecsResultTemplate, RecsResultTemplateCondition } from "./components/recommendations";
import { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
import { AtomicRecsStore } from "./components/recommendations/atomic-recs-interface/store";
import { Bindings as Bindings1 } from "./components/search/atomic-search-interface/atomic-search-interface";
import { AriaLabelGenerator as AriaLabelGenerator1 } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
import { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
export { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, GeneratedAnswerStyle, InlineLink, InteractiveCitation, InteractiveResult, LogLevel as LogLevel1, PlatformEnvironment as PlatformEnvironment2, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
export { CategoryFacet, CommerceEngine, DateFacet, InteractiveProduct, LogLevel, NumericFacet, PlatformEnvironment, Product, ProductListing, ProductListingSummaryState, ProductTemplate, ProductTemplateCondition, RegularFacet, Search, SearchSummaryState, Summary } from "@coveo/headless/commerce";
export { CommerceBindings as Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
export { Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
export { Range } from "./components/commerce/facets/facet-number-input/atomic-commerce-facet-number-input";
export { i18n } from "i18next";
export { CommerceInitializationOptions } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
Expand All @@ -48,11 +48,11 @@ export { ItemRenderingFunction } from "./components/common/item-list/item-list-c
export { RedirectionPayload } from "./components/search/atomic-search-box/redirection-payload";
export { AriaLabelGenerator } from "./components/commerce/search-box-suggestions/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products";
export { AtomicInterface } from "./utils/initialization-utils";
export { unknown as AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
export { AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
export { AnyBindings as AnyBindings1 } from "./components/common/interface/bindings";
export { NumberInputType } from "./components/common/facets/facet-number-input/number-input-type";
export { NumericFilter, NumericFilterState, RelativeDateUnit } from "./components/common/types";
export { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, GeneratedAnswerStyle as InsightGeneratedAnswerStyle, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, UserAction as IUserAction, PlatformEnvironment as PlatformEnvironmentInsight } from "./components/insight";
export { InsightEngine, InsightFacetSortCriterion, InsightFoldedResult, InsightGeneratedAnswerStyle, InsightInteractiveResult, InsightLogLevel, InsightRangeFacetRangeAlgorithm, InsightRangeFacetSortCriterion, InsightResult, InsightResultTemplate, InsightResultTemplateCondition, IUserAction, PlatformEnvironmentInsight } from "./components/insight";
export { i18nCompatibilityVersion } from "./components/common/interface/i18n";
export { InsightInitializationOptions } from "./components/insight/atomic-insight-interface/atomic-insight-interface";
export { AtomicInsightStore } from "./components/insight/atomic-insight-interface/store";
Expand All @@ -61,7 +61,7 @@ export { Section } from "./components/common/atomic-layout-section/sections";
export { AtomicCommonStore, AtomicCommonStoreData } from "./components/common/interface/store";
export { SelectChildProductEventArgs } from "./components/commerce/product-template-components/atomic-product-children/atomic-product-children";
export { PlatformEnvironment as PlatformEnvironment1, RecommendationEngine } from "@coveo/headless/recommendation";
export { InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "./components/recommendations";
export { RecsInteractiveResult, RecsLogLevel, RecsResult, RecsResultTemplate, RecsResultTemplateCondition } from "./components/recommendations";
export { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
export { AtomicRecsStore } from "./components/recommendations/atomic-recs-interface/store";
export { Bindings as Bindings1 } from "./components/search/atomic-search-interface/atomic-search-interface";
Expand Down
2 changes: 1 addition & 1 deletion packages/samples/stencil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@coveo/atomic": "2.78.0",
"@coveo/headless": "2.80.0",
"@stencil/core": "4.20.0",
"@stencil/core": "4.15.0",
"stencil-router-v2": "0.6.0"
},
"devDependencies": {
Expand Down
59 changes: 59 additions & 0 deletions patches/@stencil+core+4.15.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
diff --git a/node_modules/@stencil/core/compiler/stencil.js b/node_modules/@stencil/core/compiler/stencil.js
index d4ea871..4faf84b 100644
--- a/node_modules/@stencil/core/compiler/stencil.js
+++ b/node_modules/@stencil/core/compiler/stencil.js
@@ -276940,7 +276940,7 @@ const visitClassDeclaration = (config, diagnostics, typeChecker, program, classN
// We call the `handleClassFields` method which handles transforming any
// class fields, removing them from the class and adding statements to the
// class' constructor which instantiate them there instead.
- const updatedClassFields = handleClassFields(classNode, filteredMethodsAndFields, typeChecker, importAliasMap);
+ const updatedClassFields = handleClassFields(classNode, decoratedMembers, typeChecker, importAliasMap, filteredMethodsAndFields);
validateMethods(diagnostics, classMembers);
const currentDecorators = retrieveTsDecorators(classNode);
return ts$1.factory.updateClassDeclaration(classNode, [
@@ -276975,19 +276975,8 @@ const removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap
return ts$1.factory.updateMethodDeclaration(member, [...(newDecorators !== null && newDecorators !== void 0 ? newDecorators : []), ...((_a = retrieveTsModifiers(member)) !== null && _a !== void 0 ? _a : [])], member.asteriskToken, member.name, member.questionToken, member.typeParameters, member.parameters, member.type, member.body);
}
else if (ts$1.isPropertyDeclaration(member)) {
- if (shouldInitializeInConstructor(member, importAliasMap)) {
- // if the current class member is decorated with either 'State' or
- // 'Prop' we need to modify the property declaration to transform it
- // from a class field but we handle this in the `handleClassFields`
- // method below, so we just want to return the class member here
- // untouched.
- return member;
- }
- else {
- // update the property to remove decorators
- const modifiers = retrieveTsModifiers(member);
- return ts$1.factory.updatePropertyDeclaration(member, [...(newDecorators !== null && newDecorators !== void 0 ? newDecorators : []), ...(modifiers !== null && modifiers !== void 0 ? modifiers : [])], member.name, member.questionToken, member.type, member.initializer);
- }
+ const modifiers = retrieveTsModifiers(member);
+ return ts$1.factory.updatePropertyDeclaration(member, [...(newDecorators !== null && newDecorators !== void 0 ? newDecorators : []), ...(modifiers !== null && modifiers !== void 0 ? modifiers : [])], member.name, member.questionToken, member.type, member.initializer);
}
else {
const err = buildError(diagnostics);
@@ -277127,10 +277116,9 @@ const filterDecorators = (decorators, excludeList) => {
* @param importAliasMap a map of Stencil decorator names to their import names
* @returns a list of updated class elements which can be inserted into the class
*/
-function handleClassFields(classNode, classMembers, typeChecker, importAliasMap) {
+function handleClassFields(classNode, classMembers, typeChecker, importAliasMap, updatedClassMembers) {
var _a;
const statements = [];
- const updatedClassMembers = [];
for (const member of classMembers) {
if (shouldInitializeInConstructor(member, importAliasMap) && ts$1.isPropertyDeclaration(member)) {
const memberName = tsPropDeclNameAsString(member, typeChecker);
@@ -277141,11 +277129,6 @@ function handleClassFields(classNode, classMembers, typeChecker, importAliasMap)
// just 'undefined'
(_a = member.initializer) !== null && _a !== void 0 ? _a : ts$1.factory.createIdentifier('undefined'))));
}
- else {
- // if it's not a class field that is decorated with a Stencil decorator then
- // we just push it onto our class member list
- updatedClassMembers.push(member);
- }
}
if (statements.length === 0) {
// we didn't encounter any class fields we need to update, so we can
52 changes: 0 additions & 52 deletions patches/@stencil+core+4.20.0.patch

This file was deleted.

Loading