-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cascading] from release/11.0.0-rc to main (#1983)
<!-- {"currentBranch":"release/11.0.0-rc","targetBranch":"main","bypassReviewers":false,"isConflicting":false} --> ## Cascading from release/11.0.0-rc to main --- :heavy_exclamation_mark: The pull request is conflicting with the target branch. You can fix the issue locally with the following commands: <details open> <summary>Using <b>gh CLI</b></summary> ```shell gh pr checkout 1983 git pull --ff origin main ``` and update this Pull Request with ```shell gh pr push 1983 ``` </details> <details> <summary>Using <b>git</b> only</summary> ```shell git fetch origin git checkout origin/cascading/11.0.0-rc-main git pull --ff origin main ``` and update this Pull Request with ```shell git push origin HEAD:cascading/11.0.0-rc-main ``` </details> --- <small>This Pull Request has been generated with :heart: by the [Otter](https://github.com/AmadeusITGroup/otter) cascading tool.</small>
- Loading branch information
Showing
51 changed files
with
3,483 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
registry=http://127.0.0.1:4873 | ||
registry=http://127.0.0.1:4873/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ages/@o3r/components/builders/metadata-check/helpers/config-metadata-comparison.helper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import type { ComponentConfigOutput } from '@o3r/components'; | ||
import type { MetadataComparator } from '@o3r/extractors'; | ||
|
||
/** | ||
* Interface describing a config migration element | ||
*/ | ||
export interface MigrationConfigData { | ||
/** Library name */ | ||
libraryName: string; | ||
/** | ||
* Configuration name | ||
*/ | ||
configName?: string; | ||
/** | ||
* Configuration property name | ||
*/ | ||
propertyName?: string; | ||
} | ||
|
||
/** | ||
* Returns an array of config metadata from a metadata file. | ||
* To be easily parseable, the properties will be split in separate items of the array. | ||
* @param content Content of a migration metadata files | ||
* @example Array conversion | ||
* ```javascript | ||
* [{ library: '@o3r/demo', properties: [{name : 'property1', type: 'string'}, {name : 'property2', type: 'number'}] }] | ||
* ``` | ||
* will become : | ||
* ```javascript | ||
* [{ library: '@o3r/demo', properties: [{name : 'property1', type: 'string'}] }, { library: '@o3r/demo', properties: [{name : 'property2', type: 'number'}] }] | ||
* ``` | ||
*/ | ||
const getConfigurationArray = (content: ComponentConfigOutput[]): ComponentConfigOutput[] => content.flatMap((config) => | ||
config.properties.length > 1 | ||
? config.properties.map((prop) => ({...config, properties: [prop]})) | ||
: [config] | ||
); | ||
|
||
const getConfigurationPropertyName = (config: ComponentConfigOutput) => `${config.library}#${config.name}` + (config.properties.length ? ` ${config.properties[0].name}` : ''); | ||
|
||
const isMigrationConfigurationDataMatch = (config: ComponentConfigOutput, migrationData: MigrationConfigData) => | ||
migrationData.libraryName === config.library | ||
&& (!migrationData.configName || migrationData.configName === config.name) | ||
&& (!migrationData.propertyName || config.properties[0]?.name === migrationData.propertyName); | ||
|
||
/** | ||
* Comparator used to compare one version of config metadata with another | ||
*/ | ||
export const configMetadataComparator: MetadataComparator<ComponentConfigOutput, MigrationConfigData, ComponentConfigOutput[]> = { | ||
getArray: getConfigurationArray, | ||
getIdentifier: getConfigurationPropertyName, | ||
isMigrationDataMatch: isMigrationConfigurationDataMatch | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/@o3r/components/builders/metadata-check/helpers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './config-metadata-comparison.helper'; |
Oops, something went wrong.