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: workaround for the features option schematics error #18923

Closed
wants to merge 7 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
2 changes: 2 additions & 0 deletions feature-libs/asm/schematics/add-asm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
finalizeInstallation,
LibraryOptions as SpartacusAsmOptions,
readPackageJson,
normalizeOptionsFeatures,
validateSpartacusInstallation,
} from '@spartacus/schematics';
import { peerDependencies } from '../../package.json';
Expand All @@ -26,6 +27,7 @@ export function addAsmFeatures(options: SpartacusAsmOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
2 changes: 1 addition & 1 deletion feature-libs/asm/schematics/add-asm/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["ASM"]
}
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/cart/schematics/add-cart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
finalizeInstallation,
LibraryOptions as SpartacusCartOptions,
readPackageJson,
normalizeOptionsFeatures,
validateSpartacusInstallation,
} from '@spartacus/schematics';
import { peerDependencies } from '../../package.json';
Expand All @@ -26,6 +27,7 @@ export function addCartFeatures(options: SpartacusCartOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
2 changes: 1 addition & 1 deletion feature-libs/cart/schematics/add-cart/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"items": {
"enum": [
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/checkout/schematics/add-checkout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusCheckoutOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -26,6 +27,7 @@ export function addCheckoutFeatures(options: SpartacusCheckoutOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"items": {
"enum": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusCustomerTicketingOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -28,6 +29,7 @@ export function addCustomerTicketingFeatures(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Customer-Ticketing"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusEstimatedDeliveryDateOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -28,6 +29,7 @@ export function addEstimatedDeliveryDateFeature(
return (tree: Tree, _context: SchematicContext) => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Estimated-Delivery-Date"]
}
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/order/schematics/add-order/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusOrderOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -26,6 +27,7 @@ export function addOrderFeatures(options: SpartacusOrderOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
2 changes: 1 addition & 1 deletion feature-libs/order/schematics/add-order/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Order"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusOrganizationOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -28,6 +29,7 @@ export function addSpartacusOrganization(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"items": {
"enum": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusPDFInvoicesOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -29,6 +30,7 @@ export function addPDFInvoicesFeature(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["PDF-Invoices"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusPickupInStoreOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -28,6 +29,7 @@ export function addPickupInStoreFeatures(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Pickup-In-Store"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusProductConfiguratorOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -28,6 +29,7 @@ export function addProductConfiguratorFeatures(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"items": {
"enum": [
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/product/schematics/add-product/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusProductOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -26,6 +27,7 @@ export function addSpartacusProduct(options: SpartacusProductOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
2 changes: 1 addition & 1 deletion feature-libs/product/schematics/add-product/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"items": {
"enum": [
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/qualtrics/schematics/add-qualtrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusQualtricsOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -26,6 +27,7 @@ export function addQualtricsFeatures(options: SpartacusQualtricsOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Qualtrics"]
}
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/quote/schematics/add-quote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusQuoteOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -26,6 +27,7 @@ export function addQuoteFeatures(options: SpartacusQuoteOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
2 changes: 1 addition & 1 deletion feature-libs/quote/schematics/add-quote/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Quote"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusRequestedDeliveryDateOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -29,6 +30,7 @@ export function addRequestedDeliveryDateFeature(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Requested-Delivery-Date"]
}
Expand Down
2 changes: 2 additions & 0 deletions feature-libs/smartedit/schematics/add-smartedit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
readPackageJson,
SpartacusSmartEditOptions,
validateSpartacusInstallation,
Expand All @@ -26,6 +27,7 @@ export function addSmartEditFeatures(options: SpartacusSmartEditOptions): Rule {
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["SmartEdit"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
analyzeApplication,
analyzeCrossFeatureDependencies,
finalizeInstallation,
normalizeOptionsFeatures,
LibraryOptions as SpartacusStorefinderOptions,
readPackageJson,
validateSpartacusInstallation,
Expand All @@ -28,6 +29,7 @@ export function addStorefinderFeatures(
return (tree: Tree, _context: SchematicContext): Rule => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
options.features = normalizeOptionsFeatures(options);

const features = analyzeCrossFeatureDependencies(
options.features as string[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"default": true
},
"features": {
"type": "array",
"type": ["array", "string"],
"uniqueItems": true,
"default": ["Store-Finder"]
}
Expand Down
Loading
Loading