@oracle/oraclejet-audit 16.1.4 → 17.0.0
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.
- package/corePackMigrator/cli.js +1 -1
- package/corePackMigrator/corePackMigrator.js +2 -2
- package/corePackMigrator/metadata/actionCardMetadata.json +10 -0
- package/corePackMigrator/metadata/avatarMetadata.json +11 -1
- package/corePackMigrator/metadata/bindIfMetadata.json +4 -0
- package/corePackMigrator/metadata/buttonMetadata.json +65 -49
- package/corePackMigrator/metadata/chartMetadata.json +53 -0
- package/corePackMigrator/metadata/collapsibleMetadata.json +27 -12
- package/corePackMigrator/metadata/conveyorBeltMetadata.json +34 -0
- package/corePackMigrator/metadata/datePickerMetadata.json +43 -0
- package/corePackMigrator/metadata/drawerLayoutMetadata.json +18 -0
- package/corePackMigrator/metadata/drawerPopupMetadata.json +27 -14
- package/corePackMigrator/metadata/filePickerMetadata.json +20 -7
- package/corePackMigrator/metadata/formLayoutMetadata.json +11 -1
- package/corePackMigrator/metadata/highlightTextMetadata.json +10 -0
- package/corePackMigrator/metadata/inputDateMetadata.json +110 -0
- package/corePackMigrator/metadata/inputNumberMetadata.json +107 -75
- package/corePackMigrator/metadata/inputPasswordMetadata.json +111 -75
- package/corePackMigrator/metadata/inputTextMetadata.json +118 -81
- package/corePackMigrator/metadata/labelValueMetadata.json +245 -0
- package/corePackMigrator/metadata/legendItemMetadata.json +11 -1
- package/corePackMigrator/metadata/legendMetadata.json +59 -49
- package/corePackMigrator/metadata/listItemLayoutMetadata.json +11 -1
- package/corePackMigrator/metadata/listviewMetadata.json +104 -63
- package/corePackMigrator/metadata/messageBannerMetadata.json +10 -0
- package/corePackMigrator/metadata/messagesMetadata.json +11 -1
- package/corePackMigrator/metadata/progressBarMetadata.json +11 -1
- package/corePackMigrator/metadata/progressCircleMetadata.json +10 -0
- package/corePackMigrator/metadata/radiosetMetadata.json +11 -1
- package/corePackMigrator/metadata/ratingGaugeMetadata.json +113 -87
- package/corePackMigrator/metadata/selectManyMetadata.json +72 -42
- package/corePackMigrator/metadata/selectSingleMetadata.json +61 -46
- package/corePackMigrator/metadata/selectorMetadata.json +1 -1
- package/corePackMigrator/metadata/statusMeterGaugeMetadata.json +1 -1
- package/corePackMigrator/metadata/tagCloudMetadata.json +10 -0
- package/corePackMigrator/metadata/textAreaMetadata.json +88 -46
- package/corePackMigrator/resource/astUtils.js +1 -1
- package/corePackMigrator/resource/componentMigrator.js +1 -1
- package/corePackMigrator/resource/fileScanner.js +1 -1
- package/corePackMigrator/resource/htmlUtils.js +1 -1
- package/corePackMigrator/resource/manifest.json +137 -36
- package/corePackMigrator/resource/testUtils.js +6 -0
- package/corePackMigrator/templates/componentMetaData.json +118 -14
- package/corePackMigrator/templates/migrationConfig.json +4 -0
- package/corePackMigrator/utilities/deltaWebElementAPIs.js +6 -0
- package/corePackMigrator/utilities/logging.js +1 -1
- package/jaf-amd.js +1 -1
- package/lib/AstJson.js +1 -1
- package/lib/Components.js +1 -1
- package/lib/Config.js +1 -1
- package/lib/ConfigEx.js +6 -0
- package/lib/ConfigLib.js +1 -1
- package/lib/MetaLib.js +1 -1
- package/lib/OjCPack.js +1 -1
- package/lib/RegTypes.js +1 -1
- package/lib/RulePack.js +1 -1
- package/lib/RuleSet.js +1 -1
- package/lib/Rules.js +1 -1
- package/lib/TsxUtils.js +1 -1
- package/lib/checkage.js +1 -1
- package/lib/defaults.js +1 -1
- package/lib/extends.js +1 -1
- package/lib/migrator.js +1 -1
- package/lib/ns.js +1 -1
- package/libext/expparser.js +1 -1
- package/meta/16.1.0/jetauditmeta.js +1 -1
- package/meta/17.0.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +3 -3
- package/profiles/best-practice.json +97 -78
- package/profiles/redwood-strict.json +22 -14
- package/rulepacks/csp/csp-json-unsafe-expr.js +1 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
- package/rulepacks/jetwc/jetwc-css-scoping.js +1 -1
- package/rulepacks/jetwc/jetwc-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +1 -1
- package/rulepacks/jetwc/jetwc-markdown-link.js +1 -1
- package/rulepacks/jetwc/jetwc-namespace.js +1 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +1 -1
- package/rulepacks/jetwc/jetwc-property-nesting.js +1 -1
- package/rulepacks/jetwc/jetwc-property-translatable.js +1 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +1 -1
- package/rulepacks/jetwc/jetwc-reserved-property.js +1 -1
- package/rulepacks/jetwc/jetwc-schema.js +1 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +1 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +1 -1
- package/rulepacks/jetwc/rules.json +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +1 -1
- package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
- package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +1 -1
- package/rulepacks/jetwco/jetwco-component-api-changes.js +1 -1
- package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +1 -1
- package/rulepacks/jetwco/jetwco-license-info.js +1 -1
- package/rulepacks/jetwco/jetwco-prerelease-cdn.js +1 -1
- package/rulepacks/jetwco/jetwco-validate-applied-audits.js +1 -1
- package/rulepacks/jetwco/rules.json +1 -1
- package/rules/jet/helpers/cssHelper.js +1 -1
- package/rules/jet/helpers/has-attrib-value.js +6 -0
- package/rules/jet/helpers/tsx/has-prop-value.js +6 -0
- package/rules/jet/msgid.json +1 -1
- package/rules/jet/oj-acc-button-label.js +6 -0
- package/rules/jet/oj-css-style-bp-display.js +1 -1
- package/rules/jet/oj-html-attr-expr-writeback.js +1 -1
- package/rules/jet/oj-html-bindif-test.js +1 -1
- package/rules/jet/oj-html-binding-as-slot-child.js +1 -1
- package/rules/jet/oj-html-bp-button-xs-chroming.js +6 -0
- package/rules/jet/oj-html-bp-title-to-tooltip.js +6 -0
- package/rules/jet/oj-html-button-size-chroming.js +6 -0
- package/rules/jet/oj-html-dlg-title.js +1 -1
- package/rules/jet/oj-html-form-bindif.js +1 -1
- package/rules/jet/oj-html-ko-comment.js +1 -1
- package/rules/jet/oj-html-ko-databind.js +1 -1
- package/rules/jet/oj-html-ojattr-value.js +1 -1
- package/rules/jet/oj-html-ojtag-ns.js +1 -1
- package/rules/jet/oj-html-redwood-clear-icon.js +6 -0
- package/rules/jet/oj-html-slot-default.js +1 -1
- package/rules/jet/oj-html-slot-pref-content.js +1 -1
- package/rules/jet/oj-html-style-abs-units.js +1 -1
- package/rules/jet/oj-html-style-bp-color.js +1 -1
- package/rules/jet/oj-html-style-bp-display.js +1 -1
- package/rules/jet/oj-html-style-bp-font-family.js +1 -1
- package/rules/jet/oj-html-style-bp-font.js +1 -1
- package/rules/jet/oj-html-style-bp-margin-padding.js +6 -0
- package/rules/jet/oj-html-wctag-maintenance.js +1 -1
- package/rules/jet/oj-tsx-acc-button-label.js +6 -0
- package/rules/jet/oj-tsx-bp-button-xs-chroming.js +6 -0
- package/rules/jet/oj-tsx-bp-title-to-tooltip.js +6 -0
- package/rules/jet/oj-tsx-button-size-chroming.js +6 -0
- package/rules/jet/oj-tsx-dlg-title.js +1 -1
- package/rules/jet/oj-tsx-form-bindif.js +1 -1
- package/rules/jet/oj-tsx-ojtag-ns.js +1 -1
- package/rules/jet/oj-tsx-redwood-clear-icon.js +6 -0
- package/rules/jet/oj-tsx-slot-default.js +6 -0
- package/rules/jet/oj-tsx-slot-pref-content.js +1 -1
- package/rules/jet/oj-tsx-style-abs-units.js +6 -0
- package/rules/jet/oj-tsx-style-bp-margin-padding.js +6 -0
- package/rules/jet/oj-tsx-wctag-maintenance.js +1 -1
- package/rules/jet/rules.json +1 -1
- package/schema/component-schema.json +1 -1
- package/src/JafCore.js +1 -1
- package/types/index.d.ts +3 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Requires Legacy and the Core Pack tag details.",
|
|
2
|
+
"description": "Requires Legacy and the Core Pack tag details. corePackTag : string or array of strings",
|
|
3
3
|
"legacyTag": "",
|
|
4
4
|
"corePackTag": "",
|
|
5
|
+
"corePackTag": ["corePackTag", "corePackTag"],
|
|
5
6
|
"migrateImports": {
|
|
6
7
|
"description": "Action to migrate the import statements from legacy to core pack for the components in .ts, .js, .tsx, and .json files
|
|
7
8
|
from : the legacy component import statement : string
|
|
@@ -40,13 +41,21 @@
|
|
|
40
41
|
"attributeValue": "attributeValue"
|
|
41
42
|
}
|
|
42
43
|
],
|
|
43
|
-
"slotContentToAttribute":
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
"slotContentToAttribute": [
|
|
45
|
+
{
|
|
46
|
+
"description": "Action to move content from a slot and assign the value of a specified attribute.
|
|
47
|
+
fromDescendant : Content will be taken from the tag provided. If no tag is provided the value will be taken from the node being processed : string
|
|
48
|
+
slotNameFrom : The value of the specified slot will be added to the attribute provided : string
|
|
49
|
+
toDescendant : Content will be added to the tag provided. If no tag is provided the value will be added to the tag being processed : string
|
|
50
|
+
slotNameTo : toDescendant tag should have the specified slot value : string
|
|
51
|
+
attribute : Core pack attribute that will be added with the value from the slot : string",
|
|
52
|
+
"fromDescendant": "",
|
|
53
|
+
"slotNameFrom": "",
|
|
54
|
+
"toDescendant": "",
|
|
55
|
+
"slotNameTo": "",
|
|
56
|
+
"attribute": ""
|
|
57
|
+
}
|
|
58
|
+
],
|
|
50
59
|
"commentSlotContent": {
|
|
51
60
|
"description": "Action to comment out a specific slot's content including the slot tag.
|
|
52
61
|
slotName : list all the slot names that should be commented in the core pack code. : string ",
|
|
@@ -74,7 +83,9 @@
|
|
|
74
83
|
],
|
|
75
84
|
"migrateAttributes": [
|
|
76
85
|
{
|
|
77
|
-
"description": "Action updates the attribute/value pair with a different attribute/ value pair. If the
|
|
86
|
+
"description": "Action updates the attribute/value pair with a different attribute/ value pair. If the 'To' attribute/value pair is not provided then the legacy attribute/value is removed.
|
|
87
|
+
toDescendant : Attribute will be transfered from tag being migrated to specified tag
|
|
88
|
+
fromDescendant : Attribute will be transfered from specified tag to tag being migrated
|
|
78
89
|
depAttribute : Dependency attribute : string
|
|
79
90
|
depValue : Dependency attribute value : string
|
|
80
91
|
fromAttribute : Legacy attribute : string
|
|
@@ -90,6 +101,8 @@
|
|
|
90
101
|
},
|
|
91
102
|
{
|
|
92
103
|
"description": "Action updates the attribute/value pair with a different attribute/ value pair. If the "To" attribute/value pair is not provided then the legacy attribute/value is removed.
|
|
104
|
+
toDescendant : Attribute will be transfered from tag being migrated to specified tag
|
|
105
|
+
fromDescendant : Attribute will be transfered from specified tag to tag being migrated
|
|
93
106
|
depAttribute : Dependency attribute : string
|
|
94
107
|
depValue : Dependency attribute value : string
|
|
95
108
|
fromAttribute : Legacy attribute : string
|
|
@@ -100,6 +113,41 @@
|
|
|
100
113
|
"fromValue": "attributeValue",
|
|
101
114
|
"toAttribute": "attribute",
|
|
102
115
|
"toValue": "attributeValue"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"description": "Action updates the attribute/value pair with a different attribute/ value pair. If the 'To' attribute/value pair is not provided then the legacy attribute/value is removed.
|
|
119
|
+
toDescendant : Attribute will be transfered from tag being migrated to specified tag
|
|
120
|
+
fromDescendant : Attribute will be transfered from specified tag to tag being migrated
|
|
121
|
+
depAttribute : Dependency attribute : string
|
|
122
|
+
depValue : Dependency attribute value : string
|
|
123
|
+
fromAttribute : Legacy attribute : string
|
|
124
|
+
fromValue : Legacy attribute value : string
|
|
125
|
+
toAttribute : Core Pack attribute : string
|
|
126
|
+
toValue : Core Pack attribute value : string",
|
|
127
|
+
"toDescendant": "tag",
|
|
128
|
+
"depAttribute": "attribute",
|
|
129
|
+
"depValue": "attributeValue",
|
|
130
|
+
"fromAttribute": "attribute",
|
|
131
|
+
"fromValue": "attributeValue",
|
|
132
|
+
"toAttribute": "attribute",
|
|
133
|
+
"toValue": "attributeValue"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"description": "Action updates the attribute/value pair with a different attribute/ value pair. If the 'To' attribute/value pair is not provided then the legacy attribute/value is removed.
|
|
137
|
+
toDescendant : Attribute will be transfered from tag being migrated to specified tag
|
|
138
|
+
fromDescendant : Attribute will be transfered from specified tag to tag being migrated
|
|
139
|
+
depAttribute : Dependency attribute : string
|
|
140
|
+
depValue : Dependency attribute value : string
|
|
141
|
+
fromAttribute : Legacy attribute : string
|
|
142
|
+
fromValue : Legacy attribute value : string
|
|
143
|
+
toAttribute : Core Pack attribute : string",
|
|
144
|
+
"fromDescendant": "tag",
|
|
145
|
+
"depAttribute": "attribute",
|
|
146
|
+
"depValue": "attributeValue",
|
|
147
|
+
"fromAttribute": "attribute",
|
|
148
|
+
"fromValue": "attributeValue",
|
|
149
|
+
"toAttribute": "attribute",
|
|
150
|
+
"toValue": "attributeValue"
|
|
103
151
|
}
|
|
104
152
|
],
|
|
105
153
|
"migrateChildren": [
|
|
@@ -112,22 +160,78 @@
|
|
|
112
160
|
"description": "Defines the rule set that can contain a slot or attribute that will cause functionally breaking change and will be ignored as part of the migration
|
|
113
161
|
slot : Migration will be skipped if the specified slot exists in the legacy code : string
|
|
114
162
|
attribute : Migration will be skipped if the specified attribute exists in the legacy code : string
|
|
115
|
-
allowedValues: Migration will be skipped if the value of the attribute is not in the allowed array : array
|
|
116
|
-
prohibitedValues: Migration will be skipped if the value of the attribute is in the prohibited array : array
|
|
117
|
-
|
|
163
|
+
allowedValues : Migration will be skipped if the value of the attribute is not in the allowed array : array
|
|
164
|
+
prohibitedValues : Migration will be skipped if the value of the attribute is in the prohibited array : array
|
|
165
|
+
missAttribute : Migration will be skipped if the component does not have the specified attribute : object with attribute/value pair
|
|
166
|
+
missSlot : Migration will be skipped if the component does not have the specified slot value : string
|
|
167
|
+
descendant : Migration will be skipped if tag being migrated has the specified tag as a descendant : string",
|
|
168
|
+
"slot": ""
|
|
118
169
|
},
|
|
119
170
|
{
|
|
120
171
|
"description": "Defines the rule set that can contain a slot or attribute that will cause functionally breaking change and will be ignored as part of the migration
|
|
121
172
|
slot : Migration will be skipped if the specified slot exists in the legacy code : string
|
|
122
173
|
attribute : Migration will be skipped if the specified attribute exists in the legacy code : string
|
|
123
174
|
allowedValues: Migration will be skipped if the value of the attribute is not in the allowed array : array
|
|
124
|
-
prohibitedValues: Migration will be skipped if the value of the attribute is in the prohibited array : array
|
|
175
|
+
prohibitedValues: Migration will be skipped if the value of the attribute is in the prohibited array : array
|
|
176
|
+
missAttribute: Migration will be skipped if the component does not have the specified attribute : object with attribute/value pair
|
|
177
|
+
missSlot : Migration will be skipped if the component does not have the specified slot value : string
|
|
178
|
+
descendant : Migration will be skipped if tag being migrated has the specified tag as a descendant : string",
|
|
179
|
+
"descendant": "",
|
|
125
180
|
"attribute": "",
|
|
126
181
|
"allowedValues": [],
|
|
127
182
|
"prohibitedValues": []
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"description": "Defines the rule set that can contain a slot or attribute that will cause functionally breaking change and will be ignored as part of the migration
|
|
186
|
+
slot : Migration will be skipped if the specified slot exists in the legacy code : string
|
|
187
|
+
attribute : Migration will be skipped if the specified attribute exists in the legacy code : string
|
|
188
|
+
allowedValues: Migration will be skipped if the value of the attribute is not in the allowed array : array
|
|
189
|
+
prohibitedValues: Migration will be skipped if the value of the attribute is in the prohibited array : array
|
|
190
|
+
missAttribute: Migration will be skipped if the component does not have any of the specified attributes : object with attribute/value pair
|
|
191
|
+
missSlot : Migration will be skipped if the component does not have the specified slot value : string
|
|
192
|
+
descendant : Migration will be skipped if tag being migrated has the specified tag as a descendant : string",
|
|
193
|
+
"missAttribute": {
|
|
194
|
+
"attribute1": "",
|
|
195
|
+
"attribute2": ""
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"description": "Defines the rule set that can contain a slot or attribute that will cause functionally breaking change and will be ignored as part of the migration
|
|
200
|
+
slot : Migration will be skipped if the specified slot exists in the legacy code : string
|
|
201
|
+
attribute : Migration will be skipped if the specified attribute exists in the legacy code : string
|
|
202
|
+
allowedValues: Migration will be skipped if the value of the attribute is not in the allowed array : array
|
|
203
|
+
prohibitedValues: Migration will be skipped if the value of the attribute is in the prohibited array : array
|
|
204
|
+
missAttribute: Migration will be skipped if the component does not have any of the specified attributes : object with attribute/value pair
|
|
205
|
+
missSlot : Migration will be skipped if the component does not have the specified slot value : string
|
|
206
|
+
descendant : Migration will be skipped if tag being migrated has the specified tag as a descendant : string",
|
|
207
|
+
|
|
208
|
+
"missSlot": ""
|
|
128
209
|
}
|
|
129
210
|
],
|
|
130
211
|
"description": "Defines potential attributes a component may have that could cause problems if assigned expressions as values.
|
|
131
212
|
Attributes listed here will be logged in dry run mode when encountered with expressions as values.",
|
|
132
|
-
"importantAttributes":[]
|
|
213
|
+
"importantAttributes":[],
|
|
214
|
+
"migrateTest": {
|
|
215
|
+
"description": "Information needed to migrate Web driver test scripts",
|
|
216
|
+
"type": {
|
|
217
|
+
"description": "Information needed to migrate type declarations in Web driver test script
|
|
218
|
+
from : legacy type : string
|
|
219
|
+
to : core pack type : string",
|
|
220
|
+
"from": "",
|
|
221
|
+
"to": ""
|
|
222
|
+
},
|
|
223
|
+
"locator": {
|
|
224
|
+
"description": "Information needed to migrate any instance of component being migrated
|
|
225
|
+
from : legacy locator : string
|
|
226
|
+
to : core pack locator : string",
|
|
227
|
+
"from": "",
|
|
228
|
+
"to": ""
|
|
229
|
+
},
|
|
230
|
+
"ruleSetToIgnore":
|
|
231
|
+
[
|
|
232
|
+
{ "description": "Methods/APIs listed here are not supported in core pack Web Driver"},
|
|
233
|
+
"method1",
|
|
234
|
+
"method2"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
133
237
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "migrationConfig.json can be used by the USER to fine tune the operations and behavior of the Migration Framework
|
|
3
|
+
testFiles: Set to 'true' if the directory to migrate contains only test files.
|
|
4
|
+
testFilesExtension: Specific extension for test files.
|
|
3
5
|
excludeFolders : The Array contains folder names that the migration framework will skip. The full path for the folder name should be provided.
|
|
4
6
|
excludeFiles : The Array contains file names that the migration framework will skip. The full path for the file name should be provided.
|
|
5
7
|
excludeComponents : The Array contains Legacy component tags that the migration framework will skip migration
|
|
@@ -11,6 +13,8 @@
|
|
|
11
13
|
baseMigrationDir : The root directory the migrator will be ran from. The migrator runs from the calling directory if not specified. Relative or absolute paths can be used.
|
|
12
14
|
logFileName : The name for the log file generated during migration. The default name will be used if not specified.
|
|
13
15
|
logFilePath : The output location for the log file generated during migration. The calling directory will be used by default if not specified.",
|
|
16
|
+
"testFiles": "",
|
|
17
|
+
"testFilesExtension": "",
|
|
14
18
|
"excludeFolders": [],
|
|
15
19
|
"excludeFiles": [],
|
|
16
20
|
"excludeComponents": [],
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
global.manifestData=require("../resource/manifest.json");const testUtils=require("../resource/testUtils");const traverse=require("ast-traverse");var fs=require("fs");const path=require("path");for(let obj of global.manifestData){let componentMetadata=require("../metadata/"+obj.metadata+".json");if(componentMetadata.migrateTest){global.plugins=[global.plugins=["typescript","decorators"]];let webElementName=componentMetadata.migrateTest.type.to;let legacyTag=componentMetadata.legacyTag[3].toUpperCase()+componentMetadata.legacyTag.substring(4);let legacyName="";let upperCase=false;for(let char of legacyTag){if(char==="-"){upperCase=true}else{if(upperCase){legacyName+=char.toUpperCase();upperCase=false}else{legacyName+=char}}}let legacyTestAdapt;let filePath="../../../../../packages/oraclejet-webdriver/elements/"+componentMetadata.legacyTag+"/Oj"+legacyName+".ts";try{legacyTestAdapt=fs.readFileSync(path.resolve(__dirname,filePath),{encoding:"utf8"})}catch(err){continue}filePath="../../../../../packages/oraclejet-webdriver/elements/"+componentMetadata.legacyTag+"/Oj"+legacyName+"Base.ts";let legacyTestAdaptBase=fs.readFileSync(path.resolve(__dirname,filePath),{encoding:"utf8"});let legacyApi=[];let ast=testUtils.generateAST(legacyTestAdapt);traverse(ast,{pre:function(node){if(node.type==="ClassMethod"){legacyApi.push(node.key.name)}}});ast=testUtils.generateAST(legacyTestAdaptBase);traverse(ast,{pre:function(node){if(node.type==="ClassMethod"){legacyApi.push(node.key.name)}}});filePath="/Users/mmelendr/dev/jet/packages/oraclejet-core-pack/src/components/oj-c/"+componentMetadata.corePackTag.substring(5)+"/__webdriver__/"+webElementName+".ts";let corePackTestAdapt=fs.readFileSync(path.resolve(__dirname,filePath),{encoding:"utf8"});filePath="/Users/mmelendr/dev/jet/packages/oraclejet-core-pack/src/components/oj-c/"+componentMetadata.corePackTag.substring(5)+"/__webdriver__/"+webElementName+"Base.ts";let corePacktestAdaptBase=fs.readFileSync(path.resolve(__dirname,filePath),{encoding:"utf8"});let corePackApi=[];ast=testUtils.generateAST(corePackTestAdapt);traverse(ast,{pre:function(node){if(node.type==="ClassMethod"){corePackApi.push(node.key.name)}}});ast=testUtils.generateAST(corePacktestAdaptBase);traverse(ast,{pre:function(node){if(node.type==="ClassMethod"){corePackApi.push(node.key.name)}}});let delta=[];for(let method in legacyApi){if(!corePackApi.includes(legacyApi[method])){delta.push(legacyApi[method])}}filePath="/Users/mmelendr/dev/jet/rt/audit/jaf/corePackMigrator/metadata/"+legacyName[0].toLowerCase()+legacyName.substring(1)+"Metadata.json";if(delta.length>0){componentMetadata.migrateTest.ruleSetToIgnore=delta;fs.writeFileSync(path.resolve(__dirname,filePath),JSON.stringify(componentMetadata,null,1))}}}
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
function consoleLog(text){global.jaf.log.console(text)}function logMessage(text){global.jaf.log.msg(text)}function logFilePath(filepath,err){if(err){global.jaf.log.msg(`\nFile in: ${filepath}`)}else{global.jaf.log.msg(`\nMigrating in: ${filepath}`)}}function logImportUpdate(from,to){global.jaf.log.msg(`\tImport: Updated from "${from}" to "${to}"`)}function logImportAppend(from
|
|
6
|
+
function consoleLog(text){global.jaf.log.console(text)}function consoleWarning(text){let clr=global.jaf.utils.color;let warnMsg=`\n[Warn]: ${text}`;global.jaf.log.console(clr.PINK(warnMsg))}function logMessage(text){global.jaf.log.msg(text)}function logFilePath(filepath,err){if(err){global.jaf.log.msg(`\nFile in: ${filepath}`)}else{global.jaf.log.msg(`\nMigrating in: ${filepath}`)}}function logImportUpdate(from,to){global.jaf.log.msg(`\tImport: Updated from "${from}" to "${to}"`)}function logImportAppend(to,from){global.jaf.log.msg(`\tImport: Appended "${to}" ${from?`to "${from}"`:""}`)}function logMissingImport(component,to){global.jaf.log.msg(`\tImport: Added "${to}" for "${component}" to top of file due to missing import`)}function logTagMigration(from,to,isDescendant){let msg="";isDescendant?msg=`\t\tDescendant tag migrated from "${from}" to "${to}"`:msg=`\tTag migrated from "${from}" to "${to}"`;return msg}function logTagProcessed(component){return`\tProcessed tag: "${component}"`}function logClassNameToAttribute(className,attribute,value){return`\t\tClass name of "${className}" migrated to "${attribute}" attribute with value of "${value}"`}function logAttributeMigration(fromAtt,fromVal,toAtt,toVal){let msg="";toVal?msg=`\t\tAttribute migrated from "${fromAtt}" with a value of "${fromVal}" to "${toAtt}" with a value of "${toVal}"`:msg=`\t\tAttribute migrated from "${fromAtt}" with a value of "${fromVal}" to "${toAtt}" with no value`;return msg}function logAttributeDeprecation(from,fromVal){return`\t\tAttribute deprecated, removed "${from}" ${fromVal?`with a value of "${fromVal}"`:""}`}function logAttributeAddition(toAtt,toVal){return`\t\tAttribute added, "${toAtt}" with a value of "${toVal}"`}function logAttributeTransfer(fromTag,toTag,att,val){return`\t\tAttribute "${att}" with value "${val}" transfered from "${fromTag}" to "${toTag}"`}function logTypeMigration(fromType,toType){global.jaf.log.msg(`\tType migrated from "${fromType}" to "${toType}"`)}function logLocatorMigration(fromLoc,toLoc,variable){global.jaf.log.msg(`\tLocator migrated from "${fromLoc}" to "${toLoc}" on "${variable}"`)}function logCssLocMigration(legacyTag,corePackTag){global.jaf.log.msg(`\tCss locator migrated from "${legacyTag}" to "${corePackTag}"`)}function logMethodDeprecation(method,webElement){global.jaf.log.msg(`\tTest will fail: Method "${method}" is not supported for corepack "${webElement}"`)}function logTestAttributeDeprecation(attribute,value,webElement){global.jaf.log.msg(`\tTest will fail: Attribute "${attribute}" ${value?`with a value of "${value}"`:""} was dprecated for corepack "${webElement}"`)}function logTestAttributeMigration(fromAtt,toAtt,fromVal,toVal){global.jaf.log.msg(`\tAttribute migrated from "${fromAtt}" ${fromVal?`with a value of "${fromVal}" to "${toAtt}" ${toVal?`with a value of "${toVal}"`:""}`:`to "${toAtt}"`}`)}function logIgnoreComponent(component,attribute,value,parent,missingAtt=false){if(!attribute){global.jaf.log.msg(`\tIgnored "${component}" processing. There is nothing to process for this component`)}else{if(parent){global.jaf.log.msg(`\tRule to ignore: "${parent}" filtered out due to${missingAtt?" missing ":" "}attribute "${attribute}" ${value?`with value of "${value}" `:""}on child "${component}"`)}else{if(typeof attribute==="object"){const keys=Object.keys(attribute);let key=keys[0];value=attribute[key];attribute=key}global.jaf.log.msg(`\tRule to ignore: "${component}" filtered out due to${missingAtt?" missing ":" "}attribute "${attribute}" ${value?`with value of "${value}"`:""}`)}}}function logComponentReplacement(component,replacement){return`\t\tComponent "${component}" replaced with "${replacement}"`}function logIgnoreDataDriven(component){global.jaf.log.msg(`\t"${component}" migration ignored due to being data driven. Manual migration is required until the component migration is supported.`)}function logCommentSlotContent(component,value,child){return`\t\tCommented out ${component}\n\t\t\t${child?`has ${child}`:""} with "slot" attribute having value of "${value}"`}function logSlotContentToAttribute(component,attribute,value){let msg="";value?msg=`\t\tSlot migrated: "${component}" added attribute "${attribute}" with value of "${value}"`:msg=`\t\tSlot migration ignored: "${component}" did not add attribute "${attribute}" due to value of "${value}"`;return msg}function logAttributeExpression(component,attribute,value){global.jaf.log.msg(`\t\tAttribute expression: "${component}" has attribute "${attribute}" with value as expression of "${value}"`)}function logExcludeAttributeExpression(component,attribute,value){global.jaf.log.msg(`\tMigration skipped: "${component}" has attribute "${attribute}" with value as expression of "${value}"`)}function logIncludeExcludeIssue(type){const text=`\nMigration attempt exited. The migration config file used has values for both include${type} and exclude${type}. Please use only one or the other.`;global.jaf.log.msg(text);consoleLog(text)}function logApiLinks(){global.jaf.log.msg(`\nComponent API Migration Sections`);global.manifestData.forEach(component=>global.jaf.log.msg(`\t${component.componentName}: ${component.migrationApiLink}`))}exports.consoleLog=consoleLog;exports.consoleWarning=consoleWarning;exports.logMessage=logMessage;exports.logFilePath=logFilePath;exports.logImportUpdate=logImportUpdate;exports.logImportAppend=logImportAppend;exports.logMissingImport=logMissingImport;exports.logTagMigration=logTagMigration;exports.logTagProcessed=logTagProcessed;exports.logClassNameToAttribute=logClassNameToAttribute;exports.logAttributeMigration=logAttributeMigration;exports.logAttributeDeprecation=logAttributeDeprecation;exports.logAttributeAddition=logAttributeAddition;exports.logAttributeTransfer=logAttributeTransfer;exports.logTypeMigration=logTypeMigration;exports.logLocatorMigration=logLocatorMigration;exports.logCssLocMigration=logCssLocMigration;exports.logMethodDeprecation=logMethodDeprecation;exports.logTestAttributeDeprecation=logTestAttributeDeprecation;exports.logTestAttributeMigration=logTestAttributeMigration;exports.logIgnoreComponent=logIgnoreComponent;exports.logComponentReplacement=logComponentReplacement;exports.logIgnoreDataDriven=logIgnoreDataDriven;exports.logCommentSlotContent=logCommentSlotContent;exports.logSlotContentToAttribute=logSlotContentToAttribute;exports.logAttributeExpression=logAttributeExpression;exports.logExcludeAttributeExpression=logExcludeAttributeExpression;exports.logIncludeExcludeIssue=logIncludeExcludeIssue;exports.logApiLinks=logApiLinks;
|