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

chore: Schematics - improve lib utils to support feature name constants #12238

Merged
merged 130 commits into from
May 10, 2021

Conversation

znikola
Copy link
Contributor

@znikola znikola commented Apr 30, 2021

closes #12042

@znikola znikola marked this pull request as ready for review May 7, 2021 06:32
Copy link
Contributor

@marlass marlass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also use these variables in cmsComponents listing covered in featureModules config in each feature root module?

@github-actions
Copy link
Contributor

Hosting service deployment

❗ Spartacus deployment failed ( ERR Failed to execute command [application deploy] due to: Error: Deploy
Failed. Could not generate environment or presigned URL.
Response code: 500
Message: Could not deploy new application, the limit: 10 for the
tenant: spartacus has been reached
Type: internal_service_error

). Check job logs for details.)

@znikola znikola merged commit 58963fc into develop May 10, 2021
@znikola znikola deleted the feature/GH-12042 branch May 10, 2021 13:54
@znikola znikola temporarily deployed to dev May 10, 2021 13:54 Inactive
@github-actions
Copy link
Contributor

Public API changes

⚠️ @spartacus/asm/root

 // @public (undocumented)
 export const ASM_ENABLED_LOCAL_STORAGE_KEY = "asm_enabled";
 
+// @public (undocumented)
+export const ASM_FEATURE = "asm";
+
 // @public
 export class AsmAuthHttpHeaderService extends AuthHttpHeaderService {
     constructor(authService: AuthService, authStorageService: AuthStorageService, csAgentAuthService: CsAgentAuthService, oAuthLibWrapperService: OAuthLibWrapperService, routingService: RoutingService, globalMessageService: GlobalMessageService, occEndpointsService: OccEndpointsService);

⚠️ @spartacus/cart/saved-cart/root

 import { Cart } from '@spartacus/core';
 import { CartEvent } from '@spartacus/core';
+import { CmsConfig } from '@spartacus/core';
 import { Observable } from 'rxjs';
 import { StateUtils } from '@spartacus/core';
 
@@
 export const CART_SAVED_CART_FEATURE = "cartSavedCart";
 
 // @public (undocumented)
-export function defaultCartSavedCartComponentsConfig(): {
-    featureModules: {
-        cartSavedCart: {
-            cmsComponents: string[];
-        };
-        cartSavedCartCore: string;
-    };
-};
+export function defaultCartSavedCartComponentsConfig(): CmsConfig;
 
 // @public (undocumented)
 export class DeleteSavedCartEvent extends SavedCartEvent {

⚠️ @spartacus/cdc/root

 import { AuthService } from '@spartacus/core';
 import { AuthToken } from '@spartacus/core';
 import { BaseSiteService } from '@spartacus/core';
+import { CmsConfig } from '@spartacus/core';
 import { CmsService } from '@spartacus/core';
 import { ConfigInitializerService } from '@spartacus/core';
 import { LanguageService } from '@spartacus/core';
@@
 }
 
 // @public (undocumented)
-export function defaultCdcComponentsConfig(): {
-    featureModules: {
-        cdc: {
-            cmsComponents: string[];
-        };
-        cdcCore: string;
-    };
-};
+export function defaultCdcComponentsConfig(): CmsConfig;
 
 
 // (No @packageDocumentation comment for this package)

⚠️ @spartacus/organization/administration/root

+import { CmsConfig } from '@spartacus/core';
 import { LayoutConfig } from '@spartacus/storefront';
 
 // @public (undocumented)
@@
 }
 
 // @public (undocumented)
+export function defaultOrganizationAdministrationComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
 export const defaultOrganizationLayoutConfig: LayoutConfig;
 
+// @public (undocumented)
+export const ORGANIZATION_ADMINISTRATION_FEATURE = "organizationAdministration";
 
+
 // (No @packageDocumentation comment for this package)

⚠️ @spartacus/organization/order-approval/root

+import { CmsConfig } from '@spartacus/core';
+
 // @public (undocumented)
+export function defaultOrganizationOrderApprovalComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
 export class OrderApprovalRootModule {
 }
 
+// @public (undocumented)
+export const ORGANIZATION_ORDER_APPROVAL_FEATURE = "organizationOrderApproval";
 
+
 // (No @packageDocumentation comment for this package)

⚠️ @spartacus/product/bulk-pricing/root

+import { CmsConfig } from '@spartacus/core';
+
 // @public (undocumented)
 export class BulkPricingRootModule {
 }
 
+// @public (undocumented)
+export function defaultProductBulkPricingComponentsConfig(): CmsConfig;
 
+// @public (undocumented)
+export const PRODUCT_BULK_PRICING_FEATURE = "productBulkPricing";
+
+
 // (No @packageDocumentation comment for this package)

⚠️ @spartacus/product/variants/root

+import { CmsConfig } from '@spartacus/core';
+
 // @public (undocumented)
+export function defaultProductVariantsComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
+export const PRODUCT_VARIANTS_FEATURE = "productVariants";
+
+// @public (undocumented)
 export class ProductVariantsRootModule {
 }
 

⚠️ @spartacus/product-configurator/rulebased/root

 import { AuthService } from '@spartacus/core';
 import { BehaviorSubject } from 'rxjs';
+import { CmsConfig } from '@spartacus/core';
 import { HttpClient } from '@angular/common/http';
 import { HttpEvent } from '@angular/common/http';
 import { HttpHandler } from '@angular/common/http';
@@
 export class CpqConfiguratorRootModule {
 }
 
+// @public (undocumented)
+export function defaultProductConfiguratorRulebasedComponentsConfig(): CmsConfig;
+
 // @public
 export const MARKER_HEADER_CPQ_CONFIGURATOR = "x-cpq-configurator";
 
+// @public (undocumented)
+export const PRODUCT_CONFIGURATOR_RULEBASED_FEATURE = "productConfiguratorRulebased";
+
 // @public
 export class RulebasedConfiguratorRootFeatureModule {
 }

⚠️ @spartacus/product-configurator/textfield/root

+import { CmsConfig } from '@spartacus/core';
 import { ModuleWithProviders } from '@angular/core';
 
+// @public (undocumented)
+export function defaultProductConfiguratorTextfieldComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
+export const PRODUCT_CONFIGURATOR_TEXTFIELD_FEATURE = "productConfiguratorTextfield";
+
 // @public
 export class TextfieldConfiguratorRootFeatureModule {
 }

⚠️ @spartacus/qualtrics/root

+import { CmsConfig } from '@spartacus/core';
+
 // @public (undocumented)
+export function defaultQualtricsComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
+export const QUALTRICS_FEATURE = "qualtrics";
+
+// @public (undocumented)
 export class QualtricsRootModule {
 }
 

⚠️ @spartacus/smartedit/root

 import { Location as Location_2 } from '@angular/common';
 
 // @public (undocumented)
+export const SMART_EDIT_FEATURE = "smartEdit";
+
+// @public (undocumented)
 export abstract class SmartEditConfig {
     // (undocumented)
     smartEdit: {

⚠️ @spartacus/storefinder/root

+import { CmsConfig } from '@spartacus/core';
 import { LayoutConfig } from '@spartacus/storefront';
 
 // @public (undocumented)
+export function defaultStoreFinderComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
 export const defaultStoreFinderLayoutConfig: LayoutConfig;
 
 // @public (undocumented)
+export const STORE_FINDER_FEATURE = "storeFinder";
+
+// @public (undocumented)
 export class StoreFinderRootModule {
 }
 

⚠️ @spartacus/tracking/personalization/root

+import { CmsConfig } from '@spartacus/core';
+
 // @public (undocumented)
+export function defaultPersonalizationComponentsConfig(): CmsConfig;
+
+// @public (undocumented)
+export const PERSONALIZATION_FEATURE = "personalization";
+
+// @public (undocumented)
 export abstract class PersonalizationConfig {
     // (undocumented)
     personalization: {

⚠️ @spartacus/user/account/root

+import { CmsConfig } from '@spartacus/core';
 import { CxEvent } from '@spartacus/core';
 import { Observable } from 'rxjs';
 
 // @public (undocumented)
-export function defaultUserAccountComponentsConfig(): {
-    featureModules: {
-        userAccount: {
-            cmsComponents: string[];
-        };
-        userAccountCore: string;
-    };
-};
+export function defaultUserAccountComponentsConfig(): CmsConfig;
 
 // @public (undocumented)
 export interface User {

⚠️ @spartacus/user/profile/root

+import { CmsConfig } from '@spartacus/core';
 import { Observable } from 'rxjs';
 import { User } from '@spartacus/user/account/root';
 
 // @public (undocumented)
-export function defaultUserProfileComponentsConfig(): {
-    featureModules: {
-        userProfile: {
-            cmsComponents: string[];
-        };
-        userProfileCore: string;
-    };
-};
+export function defaultUserProfileComponentsConfig(): CmsConfig;
 
 // @public (undocumented)
 export interface Title {

⚠️ Some entry points are currently impossible to analyze.

Read more
  • @spartacus/asm/core - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/cart/saved-cart/core - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/core - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/organization/administration/core - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/organization/order-approval - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/product-configurator/rulebased - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/storefinder/core - ERROR: "import * as ___ from ___;" is not supported yet for local files.
  • @spartacus/storefront - ERROR: The expression contains an import() type, which is not yet supported by API Extractor:
  • @spartacus/user/account/components - ERROR: The expression contains an import() type, which is not yet supported by API Extractor:
  • @spartacus/user/profile/components - ERROR: The expression contains an import() type, which is not yet supported by API Extractor:

💰 How to debug problems?

Read more

Problem with import() type

It happens when type is deduced by TS based on code and at the same time the deduced type is not present in the file.
In this specific case to support api-extractor it's worth to add type declaration explicitly.

Debugging steps:

  • go to the bot action logs
  • find api-extractor logs for broken library
  • check in which file and line the problems exists
  • build the library locally and check content of the file mentioned in logs (look for import()
  • add explicit type to problematic source code
  • build the library once again and verify that the import( is no longer present
  • commit and push the code with defined type

Problem with import * as ___

Api-extractor doesn't support this namespace syntax.
Check if you really need to use namespace in the library. Try to avoid namespaces when possible.

marcinkapica added a commit that referenced this pull request May 11, 2021
* develop: (23 commits)
  fix: remove tabbing focus when using mouse (#12349)
  refactor: Revert previous commit: "Remove checkout dependency in user lib." (#12373)
  chore: update e2e cart helper functions (#12368)
  refactor: Remove checkout dependency in user lib.  (#12307)
  chore: Schematics - improve lib utils to support feature name constants (#12238)
  fix: Fix usage of redirectUri config on SSR (#12364)
  test: refactor product configuration e2e cypress helper and test classes (#12352)
  feat: Add new slot for template definition (#12251)
  fix: Check availability of config form before setting focus (#12342)
  chore: Update schematics + run.sh script (#12344)
  Revert "chore: Update the run.sh script to include saved cart as a general feature-lib instead of only b2b (#12332)" (#12343)
  chore: require successful SSR in the epic release checklist (#12337)
  chore: Fix strict mode issues in common entry point (#12312)
  chore: Update the run.sh script to include saved cart as a general feature-lib instead of only b2b (#12332)
  chore: fix text files using CRLF line endings to use LF (#12325)
  fix: Add cart context check for cart bundle and issue component (#12322)
  fix: Re-enable check for applicable cart context (#12296)
  fix: Provide breakpoint service as mandatory dependency (#12310)
  Revert "chore: TMS migration (#12249)" (#12306)
  fix: Configurator menu should not be displayed twice on screen resize (#12250)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements in feature lib schematic util
2 participants