@oracle/oraclejet-audit 14.1.5 → 15.0.1
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 +6 -0
- package/corePackMigrator/corePackMigrator.js +10 -0
- package/corePackMigrator/metadata/avatarMetadata.json +40 -0
- package/corePackMigrator/metadata/buttonMetadata.json +55 -0
- package/corePackMigrator/metadata/collapsibleMetadata.json +15 -0
- package/corePackMigrator/metadata/filePickerMetadata.json +8 -0
- package/corePackMigrator/metadata/inputNumberMetadata.json +56 -0
- package/corePackMigrator/metadata/inputPasswordMetadata.json +50 -0
- package/corePackMigrator/metadata/inputTextMetadata.json +62 -0
- package/corePackMigrator/metadata/legendItemMetadata.json +8 -0
- package/corePackMigrator/metadata/legendMetadata.json +18 -0
- package/corePackMigrator/metadata/legendSectionMetadata.json +8 -0
- package/corePackMigrator/metadata/listItemLayoutMetadata.json +15 -0
- package/corePackMigrator/metadata/listviewMetadata.json +8 -0
- package/corePackMigrator/metadata/messagesMetadata.json +35 -0
- package/corePackMigrator/metadata/progressBarMetadata.json +15 -0
- package/corePackMigrator/metadata/progressCircleMetadata.json +8 -0
- package/corePackMigrator/metadata/ratingGaugeMetadata.json +78 -0
- package/corePackMigrator/metadata/selectManyMetadata.json +39 -0
- package/corePackMigrator/metadata/selectSingleMetadata.json +39 -0
- package/corePackMigrator/metadata/statusMeterGaugeMetadata.json +99 -0
- package/corePackMigrator/metadata/textAreaMetadata.json +44 -0
- package/corePackMigrator/resource/astUtils.js +6 -0
- package/corePackMigrator/resource/componentMigrator.js +6 -0
- package/corePackMigrator/resource/fileScanner.js +6 -0
- package/corePackMigrator/resource/htmlUtils.js +6 -0
- package/corePackMigrator/resource/manifest.json +102 -0
- package/corePackMigrator/resource/migrationConfig.json +21 -0
- package/corePackMigrator/templates/componentMetaData.json +119 -0
- package/corePackMigrator/templates/migrationConfig.json +17 -0
- package/corePackMigrator/utilities/logging.js +6 -0
- package/jaf-amd.js +1 -1
- package/lib/AST_Ts.js +1 -1
- package/lib/Cli.js +1 -1
- package/lib/Components.js +1 -1
- package/lib/Config.js +1 -1
- package/lib/ConfigLib.js +1 -1
- package/lib/DomUtils.js +1 -1
- package/lib/FileIndex.js +1 -1
- package/lib/FileSet.js +1 -1
- package/lib/FsUtils.js +1 -1
- package/lib/HtmlUtils.js +1 -1
- package/lib/JsonLoader.js +1 -1
- package/lib/MetaLib.js +1 -1
- package/lib/NetUtils.js +1 -1
- package/lib/Parser.js +1 -1
- package/lib/RegTypes.js +1 -1
- package/lib/Registry.js +1 -1
- package/lib/Reporter.js +1 -1
- package/lib/RulePack.js +1 -1
- package/lib/RuleSet.js +1 -1
- package/lib/Rules.js +1 -1
- package/lib/Scope.js +1 -1
- package/lib/Ts.js +1 -1
- package/lib/TsxUtils.js +1 -1
- package/lib/TsxUtils2.js +6 -0
- package/lib/Utils.js +1 -1
- package/lib/ZipUtils.js +1 -1
- package/lib/checkage.js +1 -1
- package/lib/cmdline.js +1 -1
- package/lib/defaults.js +1 -1
- package/lib/exportRules.js +1 -1
- package/lib/filetypes.js +1 -1
- package/lib/groups.js +1 -1
- package/lib/help.js +1 -1
- package/lib/jetver.js +1 -1
- package/lib/jsx.js +1 -1
- package/lib/maint.js +6 -0
- package/lib/manpage.js +1 -1
- package/lib/manual.js +1 -1
- package/lib/migrator.js +6 -0
- package/lib/msgidLoader.js +1 -1
- package/lib/ns.js +1 -1
- package/lib/outfile.js +1 -1
- package/lib/schema.js +1 -1
- package/lib/scopewalker.js +1 -1
- package/libext/expparser.js +1 -1
- package/meta/14.0.0/jetauditmeta.js +1 -1
- package/meta/14.1.0/jetauditmeta.js +1 -1
- package/meta/15.0.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +16 -8
- package/profiles/redwood-strict.json +2 -1
- package/rulepacks/csp/csp-html-script-unsafe-inline.js +1 -1
- package/rulepacks/csp/csp-html-unsafe-expr.js +1 -1
- package/rulepacks/csp/csp-js-script-unsafe-eval.js +1 -1
- package/rulepacks/csp/csp-js-style-unsafe-inline.js +1 -1
- package/rulepacks/csp/csp-json-unsafe-expr.js +6 -0
- package/rulepacks/csp/msgid.json +1 -1
- package/rulepacks/csp/rules.json +1 -1
- package/rulepacks/jetwc/jetwc-absolute-jetversion.js +1 -1
- package/rulepacks/jetwc/jetwc-aria-redefinition.js +1 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +1 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +1 -1
- package/rulepacks/jetwc/jetwc-component-dependencies.js +1 -1
- package/rulepacks/jetwc/jetwc-component-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-component-foldername.js +1 -1
- package/rulepacks/jetwc/jetwc-component-location.js +1 -1
- package/rulepacks/jetwc/jetwc-component-type.js +1 -1
- package/rulepacks/jetwc/jetwc-css-oj-complete.js +1 -1
- package/rulepacks/jetwc/jetwc-css-pack-load-path.js +6 -0
- package/rulepacks/jetwc/jetwc-css-scoping.js +1 -1
- package/rulepacks/jetwc/jetwc-data-property-prefix.js +1 -1
- package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +1 -1
- package/rulepacks/jetwc/jetwc-disabled-property.js +1 -1
- package/rulepacks/jetwc/jetwc-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +1 -1
- package/rulepacks/jetwc/jetwc-event-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-events.js +1 -1
- package/rulepacks/jetwc/jetwc-exchange-images.js +1 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +1 -1
- package/rulepacks/jetwc/jetwc-loader-file.js +1 -1
- package/rulepacks/jetwc/jetwc-markdown-link.js +1 -1
- package/rulepacks/jetwc/jetwc-method-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-methods.js +1 -1
- package/rulepacks/jetwc/jetwc-namespace.js +1 -1
- package/rulepacks/jetwc/jetwc-nested-defaults.js +1 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +1 -1
- package/rulepacks/jetwc/jetwc-nls-root.js +1 -1
- package/rulepacks/jetwc/jetwc-oj-register.js +1 -1
- package/rulepacks/jetwc/jetwc-ojcss.js +1 -1
- package/rulepacks/jetwc/jetwc-pack-children.js +1 -1
- package/rulepacks/jetwc/jetwc-packable-components.js +1 -1
- package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +1 -1
- package/rulepacks/jetwc/jetwc-prerelease-pattern.js +1 -1
- package/rulepacks/jetwc/jetwc-prerelease-version.js +1 -1
- package/rulepacks/jetwc/jetwc-property-changed.js +1 -1
- package/rulepacks/jetwc/jetwc-property-displayname.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-public-modules.js +1 -1
- package/rulepacks/jetwc/jetwc-reference-npm-path.js +6 -0
- package/rulepacks/jetwc/jetwc-register-css.js +1 -1
- package/rulepacks/jetwc/jetwc-register-with-promises.js +1 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +1 -1
- package/rulepacks/jetwc/jetwc-required-subproperty.js +1 -1
- package/rulepacks/jetwc/jetwc-reserved-property.js +1 -1
- package/rulepacks/jetwc/jetwc-schema.js +1 -1
- package/rulepacks/jetwc/jetwc-semantic-version.js +1 -1
- package/rulepacks/jetwc/jetwc-slot-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-slots.js +1 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +1 -1
- package/rulepacks/jetwc/jetwc-status-since.js +6 -0
- package/rulepacks/jetwc/jetwc-unused-events.js +1 -1
- package/rulepacks/jetwc/jetwc-unused-slots.js +1 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +1 -1
- package/rulepacks/jetwc/jetwc-vb-icon.js +1 -1
- package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +1 -1
- package/rulepacks/jetwc/jetwc-vcomponent-loader.js +1 -1
- package/rulepacks/jetwc/jetwc-vcomponent-version.js +1 -1
- package/rulepacks/jetwc/jetwc-version-openrange.js +1 -1
- package/rulepacks/jetwc/jetwc-writeback-required.js +1 -1
- package/rulepacks/jetwc/msgid.json +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-preCompiler.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +1 -1
- package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-componentType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-dependencies.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-events.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-helpers.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-jetVer.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methodParams.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methods.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-packBundle.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-packContent.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-properties.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-publicModules.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-slots.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-typeMappingOverrides.js +6 -0
- package/rulepacks/jetwco/jetwco-compjson-ns-reg.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-component-cdn.js +1 -1
- package/rulepacks/jetwco/jetwco-description-standards.js +1 -1
- package/rulepacks/jetwco/jetwco-displayname-standards.js +1 -1
- package/rulepacks/jetwco/jetwco-exchange-version-check.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-thirdparty-ba.js +1 -1
- package/rulepacks/jetwco/msgid.json +1 -1
- package/rulepacks/jetwco/rules.json +1 -1
- package/rules/jaf/jaf-ts-noparser.js +6 -0
- package/rules/jaf/msgid.json +1 -1
- package/rules/jaf/rules.json +1 -1
- package/rules/jet/helpers/has-slot-name.js +1 -1
- package/rules/jet/helpers/style-selector.js +1 -1
- package/rules/jet/helpers/tsx/has-slot-name.js +6 -0
- package/rules/jet/msgid.json +1 -1
- package/rules/jet/oj-acc-aria-labelledby.js +1 -1
- package/rules/jet/oj-cca-compjson-bp-ar.js +1 -1
- package/rules/jet/oj-cca-compjson-bp-obj.js +1 -1
- package/rules/jet/oj-css-bp-dir-flow.js +1 -1
- package/rules/jet/oj-html-attr-$unique.js +1 -1
- package/rules/jet/oj-html-attr-expr-delims.js +6 -0
- package/rules/jet/oj-html-combo-converter.js +1 -1
- package/rules/jet/oj-html-file-pick-accept.js +1 -1
- package/rules/jet/oj-html-form-bindif.js +1 -1
- package/rules/jet/oj-html-input-isodate.js +1 -1
- package/rules/jet/oj-html-invalid-doctype.js +1 -1
- package/rules/jet/oj-html-msgs-cat-text.js +1 -1
- package/rules/jet/oj-html-ojattr-deprecated.js +1 -1
- package/rules/jet/oj-html-ojattr-enum-deprecated.js +1 -1
- package/rules/jet/oj-html-ojtag-deprecated.js +1 -1
- package/rules/jet/oj-html-ojtag-ns.js +1 -1
- package/rules/jet/oj-html-rating-gauge-track-resize.js +6 -0
- package/rules/jet/oj-html-self-close.js +1 -1
- package/rules/jet/oj-html-slot-deprecated.js +1 -1
- package/rules/jet/oj-html-slot-item-minmax.js +1 -1
- package/rules/jet/oj-html-slot-name.js +1 -1
- package/rules/jet/oj-html-slot-pref-content.js +1 -1
- package/rules/jet/oj-html-style.js +1 -1
- package/rules/jet/oj-html-stylesel.js +1 -1
- package/rules/jet/oj-html-tabbar-edge.js +6 -0
- package/rules/jet/oj-html-unsup-theme.js +1 -1
- package/rules/jet/oj-html-wctag-maintenance.js +1 -1
- package/rules/jet/oj-html-wctag-nested.js +1 -1
- package/rules/jet/oj-html-wctag-supersedes.js +6 -0
- package/rules/jet/oj-js-numconv-pattern.js +6 -0
- package/rules/jet/oj-ts-numconv-pattern.js +6 -0
- package/rules/jet/oj-tsx-5-tag-obs.js +1 -1
- package/rules/jet/oj-tsx-acc-avatar-aria-role.js +6 -0
- package/rules/jet/oj-tsx-acc-button-onclick.js +1 -1
- package/rules/jet/oj-tsx-aria-ojselector-labelledby.js +1 -1
- package/rules/jet/oj-tsx-aria-prop.js +1 -1
- package/rules/jet/oj-tsx-attr-req.js +1 -1
- package/rules/jet/oj-tsx-cca-tagname.js +1 -1
- package/rules/jet/oj-tsx-combo-converter.js +1 -1
- package/rules/jet/oj-tsx-databind-all.js +1 -1
- package/rules/jet/oj-tsx-dlg-title.js +1 -1
- package/rules/jet/oj-tsx-form-bindif.js +6 -0
- package/rules/jet/oj-tsx-form-noflex.js +6 -0
- package/rules/jet/oj-tsx-input-isodate.js +1 -1
- package/rules/jet/oj-tsx-ojattr-deprecated.js +6 -0
- package/rules/jet/oj-tsx-ojattr-enum-deprecated.js +6 -0
- package/rules/jet/oj-tsx-ojattr-value.js +1 -1
- package/rules/jet/oj-tsx-ojattr.js +1 -1
- package/rules/jet/oj-tsx-ojtag-deprecated.js +1 -1
- package/rules/jet/oj-tsx-ojtag-ns.js +6 -0
- package/rules/jet/oj-tsx-pageopts-type.js +1 -1
- package/rules/jet/oj-tsx-picker-attrs.js +1 -1
- package/rules/jet/oj-tsx-prop-inline-definition.js +1 -1
- package/rules/jet/oj-tsx-rating-gauge-size.js +1 -1
- package/rules/jet/oj-tsx-rating-gauge-track-resize.js +6 -0
- package/rules/jet/oj-tsx-slot-deprecated.js +6 -0
- package/rules/jet/oj-tsx-slot-pref-content.js +6 -0
- package/rules/jet/oj-tsx-tabbar-edge.js +6 -0
- package/rules/jet/oj-tsx-unsup-theme.js +1 -1
- package/rules/jet/oj-tsx-wctag-maintenance.js +1 -1
- package/rules/jet/oj-tsx-wctag-nested.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 +6 -4
- package/rules/jet/oj-html-cspexpr.js +0 -6
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"legacyTag": "oj-status-meter-gauge",
|
|
3
|
+
"corePackTag": "oj-c-meter-bar",
|
|
4
|
+
"migrateImports": {
|
|
5
|
+
"from": "ojs/ojgauge",
|
|
6
|
+
"to": ["oj-c/meter-bar", "oj-c/meter-circle", "oj-c/rating-gauge"]
|
|
7
|
+
},
|
|
8
|
+
"migrateTagByAttribute": [
|
|
9
|
+
{
|
|
10
|
+
"fromTag": "oj-status-meter-gauge",
|
|
11
|
+
"toTag": "oj-c-meter-bar",
|
|
12
|
+
"attribute": "orientation",
|
|
13
|
+
"attributeValue": "vertical"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"fromTag": "oj-status-meter-gauge",
|
|
17
|
+
"toTag": "oj-c-meter-bar",
|
|
18
|
+
"attribute": "orientation",
|
|
19
|
+
"attributeValue": "horizontal"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"fromTag": "oj-status-meter-gauge",
|
|
23
|
+
"toTag": "oj-c-meter-circle",
|
|
24
|
+
"attribute": "orientation",
|
|
25
|
+
"attributeValue": "circular"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"migrateAttributes": [
|
|
29
|
+
{
|
|
30
|
+
"fromAttribute": "metric-label.converter",
|
|
31
|
+
"fromValue": "",
|
|
32
|
+
"toAttribute": "",
|
|
33
|
+
"toValue": ""
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"fromAttribute": "metric-label.position",
|
|
37
|
+
"fromValue": "",
|
|
38
|
+
"toAttribute": "",
|
|
39
|
+
"toValue": ""
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"fromAttribute": "metric-label.rendered",
|
|
43
|
+
"fromValue": "",
|
|
44
|
+
"toAttribute": "",
|
|
45
|
+
"toValue": ""
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"fromAttribute": "metric-label.scaling",
|
|
49
|
+
"fromValue": "",
|
|
50
|
+
"toAttribute": "",
|
|
51
|
+
"toValue": ""
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"fromAttribute": "metric-label.style",
|
|
55
|
+
"fromValue": "",
|
|
56
|
+
"toAttribute": "",
|
|
57
|
+
"toValue": ""
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"fromAttribute": "metric-label.text",
|
|
61
|
+
"fromValue": "",
|
|
62
|
+
"toAttribute": "",
|
|
63
|
+
"toValue": ""
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"fromAttribute": "metric-label.text-type",
|
|
67
|
+
"fromValue": "",
|
|
68
|
+
"toAttribute": "",
|
|
69
|
+
"toValue": ""
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"fromAttribute": "thresholds.shortDesc",
|
|
73
|
+
"fromValue": "",
|
|
74
|
+
"toAttribute": "thresholds.accessibleLabel",
|
|
75
|
+
"toValue": ""
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"fromAttribute": "",
|
|
79
|
+
"fromValue": "",
|
|
80
|
+
"toAttribute": "orientation",
|
|
81
|
+
"toValue": "horizontal"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"fromAttribute": "threshold-display",
|
|
85
|
+
"fromValue": "currentOnly",
|
|
86
|
+
"toAttribute": "threshold-display",
|
|
87
|
+
"toValue": "plotArea"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"fromAttribute": "threshold-display",
|
|
91
|
+
"fromValue": "onIndicator",
|
|
92
|
+
"toAttribute": "threshold-display",
|
|
93
|
+
"toValue": "indicator"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"NOT COMPLETE YET. NEED TO ADD MORE": {
|
|
97
|
+
"plot-area": "auto"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"legacyTag": "oj-text-area",
|
|
3
|
+
"corePackTag": "oj-c-text-area",
|
|
4
|
+
"migrateImports": {
|
|
5
|
+
"from": "ojs/ojinputtext",
|
|
6
|
+
"to": ["oj-c/input-text", "oj-c/text-area", "oj-c/input-password"]
|
|
7
|
+
},
|
|
8
|
+
"classNameToAttribute": [
|
|
9
|
+
{
|
|
10
|
+
"className": "oj-form-control-text-align-right",
|
|
11
|
+
"attribute": "textAlign",
|
|
12
|
+
"attributeValue": "right"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"className": "oj-form-control-text-align-start",
|
|
16
|
+
"attribute": "textAlign",
|
|
17
|
+
"attributeValue": "start"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"className": "oj-form-control-text-align-end",
|
|
21
|
+
"attribute": "textAlign",
|
|
22
|
+
"attributeValue": "end"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"migrateAttributes": [
|
|
26
|
+
{
|
|
27
|
+
"fromAttribute": "translations.required.message-detail",
|
|
28
|
+
"fromValue": "",
|
|
29
|
+
"toAttribute": "required-message-detail",
|
|
30
|
+
"toValue": ""
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"fromAttribute": "labeledge",
|
|
34
|
+
"fromValue": "provided",
|
|
35
|
+
"toAttribute": "labeledge",
|
|
36
|
+
"toValue": ""
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"ruleSetToIgnore": [
|
|
40
|
+
{
|
|
41
|
+
"attribute": "converter"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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
|
+
const estree=require("@typescript-eslint/typescript-estree");const traverse=require("ast-traverse");const logging=require("../utilities/logging");function _checkFileUpdate(){if(!global.fileIsUpdated){global.fileIsUpdated=true;global.migrationMetrics.files+=1;logging.logFilePath(global.filePath);return true}return false}function _generateAST(code){return estree.parse(code,{comment:true,filePath:global.filePath,jsx:true,loc:true,range:true})}function _commentJSXNode(text,locObj){let dataArray=text.split("\n");let{start,end}=locObj;let startString=dataArray[start.line-1];dataArray[start.line-1]=[startString.slice(0,start.column)," {/* ",startString.slice(start.column)].join("");let endString=dataArray[end.line-1];if(start.line===end.line){end.column+=5}dataArray[end.line-1]=[endString.slice(0,end.column)," */} ",endString.slice(end.column)].join("");text=dataArray.join("\n");return text}function _getText(text,locObj){let specificText;const dataArray=text.split("\n");const{start,end}=locObj;if(start.line===end.line){specificText=dataArray[start.line-1].substring(start.column,end.column);return specificText}else{dataArray[start.line-1]=dataArray[start.line-1].substring(start.column);const textByLines=dataArray.slice(start.line-1,end.line).map(s=>s.trim());specificText=textByLines.join("\n");return specificText}}function _updateText(text,locObj,replaceString){let replaceArray=replaceString.split("");let dataArray=text.split("\n");let{start,end}=locObj;if(start.line!=end.line){let firtLineArray=dataArray[locObj.start.line-1].split("");dataArray[locObj.start.line-1]=firtLineArray.splice(0,start.column).concat(...replaceArray).join("");for(let i=locObj.end.line-2;i>start.line-1;i--){dataArray[i]=""}let lastLineArray=dataArray[end.line-1].split("");dataArray[end.line-1]=lastLineArray.splice(end.column,end.column).join("")}else{let updateLineArray=dataArray[locObj.start.line-1].split("");updateLineArray.splice(locObj.start.column,locObj.end.column-locObj.start.column,...replaceArray);dataArray[locObj.start.line-1]=updateLineArray.join("")}text=dataArray.join("\n");return text}function _appendText(text,locObj,appendString){let appendArray=appendString.split("");let dataArray=text.split("\n");let updateLineArray=dataArray[locObj.end.line-1].split("");updateLineArray.splice(locObj.end.column+1,0,...appendArray);dataArray[locObj.end.line-1]=updateLineArray.join("");text=dataArray.join("\n");return text}function _getLabelFromASTDOMNode(astnode,code){let label="";for(let currentNode of astnode.children){if(currentNode.type=="JSXText"){if(/\S/.test(currentNode.value)){label=currentNode.value.trim()}}else if(currentNode.type=="JSXExpressionContainer"){if(currentNode.expression&¤tNode.expression.type!="JSXEmptyExpression"){expression=_getText(code,currentNode.loc);label={expression:expression}}}else if(currentNode.type=="JSXElement"&¤tNode.openingElement.name.name.toUpperCase()=="OJ-BIND-TEXT"){currentNode.openingElement.attributes.forEach(attr=>{if(attr.name.name=="value")label=attr.value.value})}else if(currentNode.children){label=_getLabelFromASTDOMNode(currentNode,code)}}return label}function _getLabelFromLegacyButton(astnode,slotName,code){for(let child of astnode.children){switch(child.type){case"JSXText":if(/\S/.test(child.value)){return{label:child.value.trim(),cnode:child}}break;case"JSXExpressionContainer":if(child.expression&&child.expression.type!="JSXEmptyExpression"){expression=_getText(code,child.loc);return{label:{expression:expression},cnode:child}}break;case"JSXElement":let slotValue;switch(child.openingElement.name.name.toUpperCase()){case"SPAN":case"DIV":child.openingElement.attributes.forEach(attr=>{if(attr.name.name=="slot"&&(attr.value.value===slotName||!attr.value.value.length))slotValue=true});if(!child.openingElement.attributes.map(att=>att.name.name).includes("slot")){slotValue=true}if(slotValue){let label=_getLabelFromASTDOMNode(child,code);return{label:label,cnode:child}}break}break}}}function _hasAttributesToIgnore(component,ignoreRuleData){if(ignoreRuleData&&component.attributes.length){for(let obj of ignoreRuleData){for(let i=0;i<component.attributes.length;i++){let attribute=component.attributes[i];if(obj.attribute&&obj.attribute===attribute.name.name){_checkFileUpdate();logging.logIgnoreComponent(component.name.name,obj.attribute);return true}let arr=Object.keys(obj);let key=arr[0];if(attribute.name.name===key&&attribute.value.value===obj[key]){_checkFileUpdate();logging.logIgnoreComponent(component.name.name,key,obj[key]);return true}}}}return false}function _hasExpressionAttributes(component,code,isPre=false){const excludedAttributes=global.configData.excludeAttributeExpressions[component.name.name];if(global.jaf.options.dryRunMode&&isPre){component.attributes.forEach(attribute=>{if(attribute.value&&attribute.value.type==="JSXExpressionContainer"){const expression=_getText(code,attribute.value.loc);if(_checkFileUpdate()){logging.logAttributeExpression(component.name.name,attribute.name.name,expression)}}})}if(excludedAttributes&&excludedAttributes.length){for(let exAtt of excludedAttributes){for(let i=0;i<component.attributes.length;i++){const attribute=component.attributes[i];if(exAtt===attribute.name.name&&attribute.value.type==="JSXExpressionContainer"){const expression=_getText(code,attribute.value.loc);if(isPre){_checkFileUpdate();logging.logExcludeAttributeExpression(component.name.name,exAtt,expression)}return true}}}}return false}function commentSlotContent(code,data,ignoreRuleData,componentName){let ast=_generateAST(code);traverse(ast,{pre:function(node){if(node.type=="JSXElement"&&node.openingElement.name.name===componentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))&&!_hasExpressionAttributes(node.openingElement,code,true)){node.children.forEach(child=>{if(child.openingElement&&child.openingElement.attributes){child.openingElement.attributes.forEach(attribute=>{if(attribute.name.name=="slot"&&attribute.value.value==data.slot){code=_commentJSXNode(code,child.loc);_checkFileUpdate();logging.logCommentSlotContent(componentName,data.slot)}})}})}}});return code}function slotContentToAttribute(code,data,ignoreRuleData,componentName){if(data.attribute||data.slotName){let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type=="JSXElement"&&node.openingElement.name.name===componentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))&&!_hasExpressionAttributes(node.openingElement,code,true)&&!node.openingElement.attributes.map(att=>att.name.name).includes(data.attribute)){let obj={line:node.openingElement.loc.end.line,column:node.openingElement.loc.end.column-1};const legacyButtonLabel=_getLabelFromLegacyButton(node,data.slotName,code);if(legacyButtonLabel){const{label,cnode}=legacyButtonLabel;if(label){code=_commentJSXNode(code,cnode.loc);code=_updateText(code,{start:obj,end:obj},` ${data.attribute}=${label.expression?`${label.expression}`:`"${label}"`}`);_checkFileUpdate()}logging.logSlotContentToAttribute(componentName,data.attribute,label.expression?label.expression:label);code=slotContentToAttribute(code,data,ignoreRuleData,componentName)}}},post:function(node){if(!isUpdated&&node.type=="JSXElement"&&node.openingElement.name.name===componentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))&&!_hasExpressionAttributes(node.openingElement,code)&&!node.openingElement.attributes.map(att=>att.name.name).includes(data.attribute)){isUpdated=true}}})}return code}function classNameToAttribute(code,data){for(let obj of data){let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type=="JSXAttribute"&&node.name.name=="class"&&node.value?.value?.includes(obj.className)){if(obj.attribute){classNames=node.value.value.split(" ");index=classNames.indexOf(obj.className);classNames.splice(index,1);if(classNames.length===0){code=_updateText(code,node.loc,obj.attribute+"="+"\""+obj.attributeValue+"\"")}else{code=_updateText(code,node.loc,`class="${classNames.join(" ")}"`);node.loc.end.column-=obj.className.length+2;code=_appendText(code,node.loc,`\n${obj.attribute}="${obj.attributeValue}"`)}_checkFileUpdate();logging.logClassNameToAttribute(obj.className,obj.attribute,obj.attributeValue);code=classNameToAttribute(code,data)}}},post:function(node){if(!isUpdated&&node.type=="JSXAttribute"&&node.name.name=="class"&&node.value?.value?.includes(obj.className)){isUpdated=true}}})}return code}function handleSpecialCase(code,data){let obj;let regex;if(data[1]){obj=data[1];regex=new RegExp(obj.fromString.split(" ").join("\\s*"),"igm");code=code.replace(regex,obj.toString)}obj=data[0];regex=new RegExp(obj.fromString.split(" ").join("\\s*"),"igm");code=code.replace(regex,obj.toString);return code}function migrateTag(code,legacyComponentName,coreComponentName,ignoreRuleData){let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type=="JSXElement"&&node.openingElement.name.name===legacyComponentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(legacyComponentName))&&!_hasExpressionAttributes(node.openingElement,code,true)){code=_updateText(code,node.openingElement.name.loc,coreComponentName);_checkFileUpdate();logging.logTagMigration(legacyComponentName,coreComponentName);global.migrationMetrics.components+=1;if(node.closingElement&&node.closingElement.name.name===legacyComponentName){if(node.openingElement.name.loc.start.line===node.closingElement.name.loc.start.line){const lengthDif=coreComponentName.length-node.closingElement.name.name.length;node.closingElement.name.loc.start.column+=lengthDif;node.closingElement.name.loc.end.column+=lengthDif}code=_updateText(code,node.closingElement.name.loc,coreComponentName)}code=migrateTag(code,legacyComponentName,coreComponentName,ignoreRuleData)}},post:function(node){if(!isUpdated&&node.type=="JSXElement"&&node.openingElement.name.name===legacyComponentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(legacyComponentName))&&!_hasExpressionAttributes(node.openingElement,code)){isUpdated=true}}});return code}function migrateTagByAttribute(code,data,ignoreRuleData){for(const tagSet in data){let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){tag=data[tagSet];if(!isUpdated&&node.type=="JSXElement"&&node.openingElement.name.name===tag.fromTag&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))&&!_hasExpressionAttributes(node.openingElement,code,true)){node.openingElement.attributes.forEach(attribute=>{if(attribute.name.name===tag.attribute&&attribute.value.value===tag.attributeValue){code=_updateText(code,node.openingElement.name.loc,tag.toTag);_checkFileUpdate();logging.logTagMigration(tag.fromTag,tag.toTag);global.migrationMetrics.components+=1;if(node.closingElement&&node.closingElement.name.name===tag.fromTag){if(node.openingElement.name.loc.start.line===node.closingElement.name.loc.start.line){const lengthDif=tag.toTag.length-node.closingElement.name.name.length;node.closingElement.name.loc.start.column+=lengthDif;node.closingElement.name.loc.end.column+=lengthDif}code=_updateText(code,node.closingElement.name.loc,tag.toTag)}code=migrateTagByAttribute(code,data,ignoreRuleData)}})}},post:function(node){if(!isUpdated&&node.type=="JSXElement"&&node.openingElement.name.name===tag.fromTag&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))&&!_hasExpressionAttributes(node.openingElement,code)){isUpdated=true}}})}return code}function migrateImports(code,importData,ruleSetToIgnore){if(importData){if(Array.isArray(importData.to)&&importData.to.some(s=>code.includes(s))||code.includes(importData.to)){if(Array.isArray(importData.to)){for(let i=0;i<importData.to.length;i++){if(new RegExp(`\nimport ('|")${importData.to[i]}('|")*`).test(code)){return code}}}else if(new RegExp(`\nimport ('|")${importData.to}('|")*`).test(code)){return code}}if(ruleSetToIgnore&&ruleSetToIgnore.length>0){if(Array.isArray(importData.to)&&importData.to.length>0){importData.to.forEach(toVal=>{let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type=="ImportDeclaration"&&node.source.value===importData.from&&!node.specifiers.length){code=_appendText(code,node.loc,`\nimport "${toVal}";`);_checkFileUpdate();logging.logImportAppend(importData.from,toVal);code=migrateImports(code,importData,ruleSetToIgnore)}},post:function(node){if(!isUpdated&&node.type=="ImportDeclaration"&&node.source.value===importData.from&&!node.specifiers.length){isUpdated=true}}})})}else{let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type=="ImportDeclaration"&&node.source.value===importData.from&&!node.specifiers.length){code=_appendText(code,node.loc,`\nimport "${importData.to}";`);_checkFileUpdate();logging.logImportAppend(importData.from,importData.to);code=migrateImports(code,importData,ruleSetToIgnore)}},post:function(node){if(!isUpdated&&node.type=="ImportDeclaration"&&node.source.value===importData.from&&!node.specifiers.length){isUpdated=true}}})}}else{if(Array.isArray(importData.to)&&importData.to.length>0){let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type=="ImportDeclaration"&&node.source.value===importData.from&&!node.specifiers.length){code=_updateText(code,node.loc,`import "${importData.to[0]}";`);_checkFileUpdate();logging.logImportUpdate(importData.from,importData.to);for(let i=1;i<importData.to.length;i++){node.loc.end.column=node.loc.end.column+`"${importData.to[i-1]}"`.length;code=_appendText(code,node.loc,`\nimport "${importData.to[i]}";`);_checkFileUpdate();logging.logImportAppend(importData.from,importData.to[i]);code=migrateImports(code,importData,ruleSetToIgnore)}}},post:function(node){if(!isUpdated&&node.type=="ImportDeclaration"&&node.source.value===importData.from&&!node.specifiers.length){isUpdated=true}}})}else{let ast=_generateAST(code);traverse(ast,{pre:function(node){if(node.type=="ImportDeclaration"&&!node.specifiers.length&&node.source.value===importData.from){code=_updateText(code,node.loc,`import "${importData.to}";`);_checkFileUpdate();logging.logImportUpdate(importData.from,importData.to);code=migrateImports(code,importData,ruleSetToIgnore)}}})}}return code}}function migrateAttributes(code,data,ignoreRuleData,componentName){if(data&&data.length>0){for(const attributeSet in data){let isUpdated=false;let ast=_generateAST(code);traverse(ast,{pre:function(node){if(!isUpdated&&node.type==="JSXElement"&&node.openingElement.name.name===componentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))){let component=node.openingElement;let attObj=data[attributeSet];let hasDepAttribute=true;if(attObj.depAttribute){hasDepAttribute=component.attributes.map(att=>att.name.name).includes(attObj.depAttribute)}const hasToAttribute=component.attributes.map(att=>att.name.name).includes(attObj.toAttribute);component.attributes.forEach(attribute=>{const hasFromAttribute=attObj.fromValue?attribute.name.name===attObj.fromAttribute&&attribute.value.value===attObj.fromValue:attribute.name.name===attObj.fromAttribute;if(hasDepAttribute&&hasFromAttribute&&attObj.toAttribute){if(attObj.toValue){code=_updateText(code,attribute.loc,` ${attObj.toAttribute}="${attObj.toValue}" `);_checkFileUpdate();logging.logAttributeMigration(attObj.fromAttribute,attObj.fromValue,attObj.toAttribute,attObj.toValue)}else{const attValue=attribute.value.value||{expression:_getText(code,attribute.value.loc)};code=_updateText(code,attribute.loc,` ${attObj.toAttribute}=${attValue.expression||`"${attValue}"`} `);_checkFileUpdate();logging.logAttributeMigration(attObj.fromAttribute,attValue.expression||attValue,attObj.toAttribute,attValue.expression||attValue)}code=migrateAttributes(code,data,ignoreRuleData,componentName)}else if(hasDepAttribute&&hasFromAttribute&&!attObj.toAttribute){code=_updateText(code,attribute.loc,"");_checkFileUpdate();logging.logAttributeDeprecation(attObj.fromAttribute,attObj.fromValue);code=migrateAttributes(code,data,ignoreRuleData,componentName)}});if(hasDepAttribute&&!attObj.fromAttribute&&attObj.toAttribute&&!hasToAttribute){code=_appendText(code,node.openingElement.name.loc,` ${attObj.toAttribute}="${attObj.toValue}" `);_checkFileUpdate();logging.logAttributeAddition(attObj.toAttribute,attObj.toValue);code=migrateAttributes(code,data,ignoreRuleData,componentName)}}},post:function(node){if(!isUpdated&&node.type==="JSXElement"&&node.openingElement.name.name===componentName&&(!_hasAttributesToIgnore(node.openingElement,ignoreRuleData)||global.configData.forceMigration.includes(componentName))){isUpdated=true}}})}return code}}exports.commentSlotContent=commentSlotContent;exports.slotContentToAttribute=slotContentToAttribute;exports.classNameToAttribute=classNameToAttribute;exports.handleSpecialCase=handleSpecialCase;exports.migrateImports=migrateImports;exports.migrateTag=migrateTag;exports.migrateTagByAttribute=migrateTagByAttribute;exports.migrateAttributes=migrateAttributes;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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
|
+
"use strict";var fs=require("fs");const utils=require("./htmlUtils");const astUtils=require("./astUtils");function migrateHTML(filePath,componentMetadata){let text=fs.readFileSync(filePath,{encoding:"utf8",flag:"r"});const COMPONENT_NAME=componentMetadata.legacyTag;for(let key in componentMetadata){if(typeof utils[key]=="function"&&key!=="migrateTagByAttribute"){text=utils[key](text,COMPONENT_NAME,componentMetadata[key],componentMetadata.ruleSetToIgnore)}}if(componentMetadata["migrateTagByAttribute"]){text=utils["migrateTagByAttribute"](text,componentMetadata.legacyTag,componentMetadata["migrateTagByAttribute"],componentMetadata.ruleSetToIgnore)}else{text=utils["migrateTag"](text,componentMetadata.legacyTag,componentMetadata.corePackTag,componentMetadata.ruleSetToIgnore)}if(!global.jaf.options.dryRunMode&&global.fileIsUpdated){fs.writeFileSync(filePath,text,err=>{if(err){console.error(err)}})}}function migrateTSX(filePath,componentMetadata){let code=fs.readFileSync(filePath,{encoding:"utf8",flag:"r"});const COMPONENT_NAME=componentMetadata.legacyTag;for(let key in componentMetadata){if(typeof astUtils[key]=="function"&&key!=="migrateTagByAttribute"){code=astUtils[key](code,componentMetadata[key],componentMetadata.ruleSetToIgnore,COMPONENT_NAME)}}if(componentMetadata["migrateTagByAttribute"]){code=astUtils["migrateTagByAttribute"](code,componentMetadata["migrateTagByAttribute"],componentMetadata.ruleSetToIgnore)}else{code=astUtils["migrateTag"](code,componentMetadata.legacyTag,componentMetadata.corePackTag,componentMetadata.ruleSetToIgnore)}const importToData=componentMetadata.migrateImports.to;if(code.includes(componentMetadata.corePackTag)&&(Array.isArray(importToData)&&!importToData.some(s=>code.includes(s))||!code.includes(importToData))){if(Array.isArray(importToData)){importToData.forEach(toImport=>{code=`import "${toImport}";\n`+code})}else{code=`import "${importToData}";\n`+code}}if(!global.jaf.options.dryRunMode&&global.fileIsUpdated){fs.writeFileSync(filePath,code,err=>{if(err){console.error(err)}})}}exports.migrateHTML=migrateHTML;exports.migrateTSX=migrateTSX;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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
|
+
const path=require("path");const fs=require("fs");const fileSets={};function getConfigData(sourcePath){try{if(!fs.existsSync(sourcePath)){return}if(sourcePath.toLowerCase().includes("migrationconfig.json")){let text=fs.readFileSync(sourcePath,{encoding:"utf8",flag:"r"});return JSON.parse(text)}}catch(error){console.log("Error: "+error.stack);process.exit(0)}}function scanForFiles(startPath){let{excludeFolders,fileTypes,excludeFiles}=global.configData;const regex=new RegExp(`.(${fileTypes.map(i=>"."+i).join("|")})$`,"i");try{if(!fs.existsSync(startPath)){return}let files=fs.readdirSync(startPath);for(let i=0;i<files.length;i++){let filename=path.join(startPath,files[i]);let stat=fs.lstatSync(filename);if(stat.isDirectory()){if(!excludeFolders.includes(filename)){scanForFiles(filename)}}else{if(!excludeFiles.includes(filename)){let info=regex.exec(filename);if(info&&info["index"]){if(fileSets[info[1]]){fileSets[info[1]].push(filename)}else{fileSets[info[1]]=[filename]}}}}}return fileSets}catch(error){console.log("Error: "+error.stack);process.exit(0)}}exports.scanForFiles=scanForFiles;exports.getConfigData=getConfigData;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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
|
+
const{parseDocument,DomUtils}=require("htmlparser2");const render=require("dom-serializer").default;const logging=require("../utilities/logging");function _checkFileUpdate(){if(!global.fileIsUpdated){global.fileIsUpdated=true;global.migrationMetrics.files+=1;logging.logFilePath(global.filePath);return true}return false}function _getLabelFromDOMNode(node,slotName){let label;let cnode;if(node&&node.children&&!!node.children.length){for(let child of node.children){if(child.type&&child.type=="text"){if(/\S/.test(child.data)){label=child.data.trim();cnode=_getDom("<!-- "+render(child,{decodeEntities:false})+" -->");DomUtils.replaceElement(child,cnode);break}}else if(child.type&&child.type=="tag"&&child.name.toUpperCase()=="OJ-BIND-TEXT"&&(!slotName&&!child.attribs.slot||slotName&&child.attribs.slot===slotName)){label=child.attribs.value;cnode=_getDom("<!-- "+render(child,{decodeEntities:false})+" -->");DomUtils.replaceElement(child,cnode);break}else if(child.children&&!!child.children.length){label=_getLabelFromDOMNode(child,slotName)}}}return label}function _getDom(text=""){return parseDocument(text,{withStartIndices:true,withEndIndices:true})}function _filterComponentsByIgnoreRule(components,ignoreRuleData){let obj;components=components.filter(component=>{for(let i=0;i<ignoreRuleData.length;i++){obj=ignoreRuleData[i];let arr=Object.keys(obj);let key=arr[0];if(obj[key].includes(component.attribs[key])){_checkFileUpdate();logging.logIgnoreComponent(component.name,key,obj[key]);return false}else{for(let child of component.children){if(child.attribs&&obj[key].includes(child.attribs[key])){_checkFileUpdate();logging.logIgnoreComponent(child.name,key,obj[key]);return false}}}}return true});return components}function _filterComponentsAttributeExpressions(components,componentName){const excludedAttributes=global.configData.excludeAttributeExpressions[componentName];const regex=new RegExp(`((\\{\\{)|(\\[\\[)).*((\\}\\})|(\\]\\]))`);components=components.filter(component=>{if(global.jaf.options.dryRunMode){for(const attribute in component.attribs){if(regex.test(component.attribs[attribute])){if(_checkFileUpdate()){logging.logAttributeExpression(component.name,attribute,component.attribs[attribute])}}}}if(excludedAttributes&&excludedAttributes.length){for(let i=0;i<excludedAttributes.length;i++){if(component.attribs[`:${excludedAttributes[i]}`]){excludedAttributes[i]=`:${excludedAttributes[i]}`}if(regex.test(component.attribs[excludedAttributes[i]])){_checkFileUpdate();logging.logExcludeAttributeExpression(componentName,excludedAttributes[i],component.attribs[excludedAttributes[i]]);return false}}}return true});return components}function commentSlotContent(text,componentName,data,ignoreRuleData){let slotValue=data.slot;const dom=_getDom(text);let components=DomUtils.getElementsByTagName(componentName,dom);if(ignoreRuleData&&!global.configData.forceMigration.includes(componentName))components=_filterComponentsByIgnoreRule(components,ignoreRuleData);components=_filterComponentsAttributeExpressions(components,componentName);components.forEach(component=>{component.children.forEach(child=>{if(child.name&&child.attribs.slot==slotValue){let cnode=_getDom("<!-- "+render(child,{decodeEntities:false})+" -->");DomUtils.replaceElement(child,cnode);_checkFileUpdate();logging.logCommentSlotContent(component.name,slotValue,child.name)}})});return render(dom,{decodeEntities:false})}function slotContentToAttribute(text,componentName,data,ignoreRuleData){const dom=_getDom(text);let components=DomUtils.getElementsByTagName(componentName,dom);if(ignoreRuleData&&!global.configData.forceMigration.includes(componentName))components=_filterComponentsByIgnoreRule(components,ignoreRuleData);components=_filterComponentsAttributeExpressions(components,componentName);components.forEach(component=>{if(!Object.keys(component.attribs).includes(data.attribute)){component.attribs[data.attribute]=_getLabelFromDOMNode(component,data.slotName);if(!component.attribs[data.attribute]){delete component.attribs[data.attribute]}_checkFileUpdate();logging.logSlotContentToAttribute(component.name,data.attribute,component.attribs[data.attribute])}});return render(dom,{decodeEntities:false})}function migrateTag(text,legacyComponentName,coreComponentName,ignoreRuleData){if(!coreComponentName)return text;const dom=_getDom(text);let components=DomUtils.getElementsByTagName(legacyComponentName,dom);if(ignoreRuleData&&!global.configData.forceMigration.includes(legacyComponentName))components=_filterComponentsByIgnoreRule(components,ignoreRuleData);components=_filterComponentsAttributeExpressions(components,legacyComponentName);components.forEach(component=>{component.name=coreComponentName;_checkFileUpdate();logging.logTagMigration(legacyComponentName,coreComponentName);global.migrationMetrics.components+=1});return render(dom,{decodeEntities:false})}function migrateTagByAttribute(text,componentName,data,ignoreRuleData){const dom=_getDom(text);let components=DomUtils.getElementsByTagName(componentName,dom);if(ignoreRuleData&&!global.configData.forceMigration.includes(componentName))components=_filterComponentsByIgnoreRule(components,ignoreRuleData);components=_filterComponentsAttributeExpressions(components,componentName);components.forEach(component=>{for(const tagSet in data){tag=data[tagSet];hasAttAndVal=tag.attributeValue===DomUtils.getAttributeValue(component,tag.attribute);if(hasAttAndVal){component.name=tag.toTag;_checkFileUpdate();logging.logTagMigration(componentName,tag.toTag);global.migrationMetrics.components+=1}}});return render(dom,{decodeEntities:false})}function classNameToAttribute(text,componentName,data,ignoreRuleData){const dom=_getDom(text);let components=DomUtils.getElementsByTagName(componentName,dom);let classNames;let index;if(ignoreRuleData&&!global.configData.forceMigration.includes(componentName))components=_filterComponentsByIgnoreRule(components,ignoreRuleData);components=_filterComponentsAttributeExpressions(components,componentName);data.forEach(obj=>{let from=obj.className;let to=obj.attributeValue;let attribute=obj.attribute;components.forEach(component=>{if(component.attribs.class){classNames=component.attribs.class.split(" ");index=classNames.indexOf(from);if(index!=-1&&attribute){classNames.splice(index,1);if(classNames.length==0)delete component.attribs.class;else component.attribs.class=classNames.join(" ");component.attribs[attribute]=to;_checkFileUpdate();logging.logClassNameToAttribute(from,attribute,to)}}})});return render(dom,{decodeEntities:false})}function migrateAttributes(text,componentName,data,ignoreRuleData){const dom=_getDom(text);let components=DomUtils.getElementsByTagName(componentName,dom);let obj;if(ignoreRuleData&&!global.configData.forceMigration.includes(componentName))components=_filterComponentsByIgnoreRule(components,ignoreRuleData);components=_filterComponentsAttributeExpressions(components,componentName);for(const attributeName in data){obj=data[attributeName];components.forEach(component=>{let hasDepAttribute=true;if(obj.depAttribute){hasDepAttribute=DomUtils.hasAttrib(component,obj.depAttribute)}const hasFromAttribute=obj.fromValue?obj.fromValue===DomUtils.getAttributeValue(component,obj.fromAttribute):DomUtils.hasAttrib(component,obj.fromAttribute);const hasToAttribute=DomUtils.hasAttrib(component,obj.toAttribute);if(hasDepAttribute&&hasFromAttribute&&obj.toAttribute){if(obj.toValue){component.attribs[obj.toAttribute]=obj.toValue;_checkFileUpdate();logging.logAttributeMigration(obj.fromAttribute,obj.fromValue,obj.toAttribute,obj.toValue)}else{component.attribs[obj.toAttribute]=component.attribs[obj.fromAttribute];_checkFileUpdate();logging.logAttributeMigration(obj.fromAttribute,component.attribs[obj.fromAttribute],obj.toAttribute,component.attribs[obj.fromAttribute])}delete component.attribs[obj.fromAttribute]}else if(hasDepAttribute&&hasFromAttribute&&!obj.toAttribute){delete component.attribs[obj.fromAttribute];_checkFileUpdate();logging.logAttributeDeprecation(obj.fromAttribute,obj.fromValue)}else if(hasDepAttribute&&!obj.fromAttribute&&obj.toAttribute&&!hasToAttribute){component.attribs[obj.toAttribute]=obj.toValue;_checkFileUpdate();logging.logAttributeAddition(obj.toAttribute,obj.toValue)}})}return render(dom,{decodeEntities:false})}function handleSpecialCase(code,componentName,data){let obj;let regex;if(data[1]){obj=data[1];regex=new RegExp(obj.fromString.split(" ").join("\\s*"),"igm");code=code.replace(regex,obj.toString)}obj=data[0];regex=new RegExp(obj.fromString.split(" ").join("\\s*"),"igm");code=code.replace(regex,obj.toString);return code}exports.slotContentToAttribute=slotContentToAttribute;exports.commentSlotContent=commentSlotContent;exports.migrateTag=migrateTag;exports.classNameToAttribute=classNameToAttribute;exports.handleSpecialCase=handleSpecialCase;exports.migrateAttributes=migrateAttributes;exports.migrateTagByAttribute=migrateTagByAttribute;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"componentName": "oj-button",
|
|
4
|
+
"metadata": "buttonMetadata",
|
|
5
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojButton.html#migration-section"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"componentName": "oj-avatar",
|
|
9
|
+
"metadata": "avatarMetadata",
|
|
10
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojAvatar.html#migration-section"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"componentName": "oj-collapsible",
|
|
14
|
+
"metadata": "collapsibleMetadata",
|
|
15
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojCollapsible.html#migration-section"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"componentName": "oj-messages",
|
|
19
|
+
"metadata": "messagesMetadata",
|
|
20
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojMessages.html#migration-section"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"componentName": "oj-file-picker",
|
|
24
|
+
"metadata": "filePickerMetadata",
|
|
25
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojFilePicker.html#migration-section"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"componentName": "oj-list-item-layout",
|
|
29
|
+
"metadata": "listItemLayoutMetadata",
|
|
30
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojListItemLayout.html#migration-section"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"componentName": "oj-progress-circle",
|
|
34
|
+
"metadata": "progressCircleMetadata",
|
|
35
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojProgressCircle.html#migration-section"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"componentName": "oj-progress-bar",
|
|
39
|
+
"metadata": "progressBarMetadata",
|
|
40
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojProgressBar.html#migration-section"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"componentName": "oj-rating-gauge",
|
|
44
|
+
"metadata": "ratingGaugeMetadata",
|
|
45
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojRatingGauge.html#migration-section"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"componentName": "oj-input-number",
|
|
49
|
+
"metadata": "inputNumberMetadata",
|
|
50
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojInputNumber.html#migration-section"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"componentName": "oj-input-password",
|
|
54
|
+
"metadata": "inputPasswordMetadata",
|
|
55
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojInputPassword.html#migration-section"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"componentName": "oj-input-text",
|
|
59
|
+
"metadata": "inputTextMetadata",
|
|
60
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojInputText.html#migration-section"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"componentName": "oj-text-area",
|
|
64
|
+
"metadata": "textAreaMetadata",
|
|
65
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojTextArea.html#migration-section"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"componentName": "oj-list-view",
|
|
69
|
+
"metadata": "listViewMetadata",
|
|
70
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojListView.html#migration-section"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"componentName": "oj-select-single",
|
|
74
|
+
"metadata": "selectSingleMetadata",
|
|
75
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojSelectSingle.html#migration-section"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"componentName": "oj-select-many",
|
|
79
|
+
"metadata": "selectManyMetadata",
|
|
80
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojSelectMany.html#migration-section"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"componentName": "oj-status-meter-gauge",
|
|
84
|
+
"metadata": "statusMeterGaugeMetadata",
|
|
85
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojStatusMeterGauge.html#migration-section"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"componentName": "oj-legend",
|
|
89
|
+
"metadata": "legendMetadata",
|
|
90
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojLegend.html#migration-section"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"componentName": "oj-legend-item",
|
|
94
|
+
"metadata": "legendItemMetadata",
|
|
95
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojLegend.html#migration-section"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"componentName": "oj-legend-section",
|
|
99
|
+
"metadata": "legendSectionMetadata",
|
|
100
|
+
"migrationApiLink": "https://jet.oraclecorp.com/trunk/jsdocs/oj.ojLegend.html#migration-section"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"excludeFolders": [
|
|
3
|
+
".tscache",
|
|
4
|
+
".vs",
|
|
5
|
+
".vscode",
|
|
6
|
+
".yarn",
|
|
7
|
+
"build",
|
|
8
|
+
"built",
|
|
9
|
+
"dt",
|
|
10
|
+
"node_modules",
|
|
11
|
+
"packages",
|
|
12
|
+
"sandbox",
|
|
13
|
+
"scripts",
|
|
14
|
+
"web"
|
|
15
|
+
],
|
|
16
|
+
"fileTypes": ["ts", "js", "tsx", "html", "jsx", "json", "css"],
|
|
17
|
+
"excludeFiles": [],
|
|
18
|
+
"excludeComponents": [],
|
|
19
|
+
"forceMigration": [],
|
|
20
|
+
"excludeAttributeExpressions": {}
|
|
21
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Requires Legacy and the Core Pack tag details.",
|
|
3
|
+
"legacyTag": "",
|
|
4
|
+
"corePackTag": "",
|
|
5
|
+
"migrateImports": {
|
|
6
|
+
"description": "Action to migrate the import statements from legacy to core pack for the components in .ts, .js, .tsx, and .json files
|
|
7
|
+
from : the legacy component import statement : string
|
|
8
|
+
to : the core pack component import statement : string or array or strings",
|
|
9
|
+
"from": "legacyImport",
|
|
10
|
+
"to": "corePackImport"
|
|
11
|
+
},
|
|
12
|
+
"migrateImports": {
|
|
13
|
+
"description": "Action to migrate the import statements from legacy to core pack for the components in .ts, .js, .tsx, and .json files
|
|
14
|
+
from the legacy component import statement : string
|
|
15
|
+
to the core pack component import statement : string or array or strings",
|
|
16
|
+
"from": "legacyImport",
|
|
17
|
+
"to": ["corePackImport", "corePackImport"]
|
|
18
|
+
},
|
|
19
|
+
"migrateTagByAttribute": [
|
|
20
|
+
{
|
|
21
|
+
"description": "Action migrates the component tag from legacy to core pack only if the legacy component contains a specific attribute/value
|
|
22
|
+
fromTag : Legacy tag : string
|
|
23
|
+
toTag : Core pack tag : string
|
|
24
|
+
attribute : Attribute name that would decide the core pack tag : string
|
|
25
|
+
attributeValue : Attribute value that would decide the core pack tag : string",
|
|
26
|
+
"fromTag": "legacyTag",
|
|
27
|
+
"toTag": "corePackTag",
|
|
28
|
+
"attribute": "attribute",
|
|
29
|
+
"attributeValue": "attributeValue"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"description": "Action migrates the component tag from legacy to core pack only if the legacy component contains a specific attribute/value
|
|
33
|
+
fromTag : Legacy tag : string
|
|
34
|
+
toTag : Core pack tag : string
|
|
35
|
+
attribute : Attribute name that would decide the core pack tag : string
|
|
36
|
+
attributeValue : Attribute value that would decide the core pack tag : string",
|
|
37
|
+
"fromTag": "legacyTag",
|
|
38
|
+
"toTag": "corePackTag",
|
|
39
|
+
"attribute": "attribute",
|
|
40
|
+
"attributeValue": "attributeValue"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"slotContentToAttribute": {
|
|
44
|
+
"description": "Action to move content from a slot and assign the value of a specified attribute.
|
|
45
|
+
slotName : The value of the specified slot will be added to the attribute provided : string
|
|
46
|
+
attribute : Core pack attribute that will be added with the value from the slot : string",
|
|
47
|
+
"slotName": "",
|
|
48
|
+
"attribute": ""
|
|
49
|
+
},
|
|
50
|
+
"commentSlotContent": {
|
|
51
|
+
"description": "Action to comment out a specific slot's content including the slot tag.
|
|
52
|
+
slotName : list all the slot names that should be commented in the core pack code. : string ",
|
|
53
|
+
"slotName": ""
|
|
54
|
+
},
|
|
55
|
+
"classNameToAttribute": [
|
|
56
|
+
{
|
|
57
|
+
"description": "Action to migrate a class defined on a component in legacy to a specific attribute value pair in the core pack.
|
|
58
|
+
className : information of class that now would migrate to attribute/value pair : string
|
|
59
|
+
attribute : Core pack attribute : string
|
|
60
|
+
attributeValue : Core pack attribute's value : string",
|
|
61
|
+
"className": "",
|
|
62
|
+
"attribute": "",
|
|
63
|
+
"attributeValue": ""
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"description": "Action to migrate a class defined on a component in legacy to a specific attribute value pair in the core pack.
|
|
67
|
+
className : information of class that now would migrate to attribute/value pair : string
|
|
68
|
+
attribute : Core pack attribute : string
|
|
69
|
+
attributeValue : Core pack attribute's value : string",
|
|
70
|
+
"className": "",
|
|
71
|
+
"attribute": "",
|
|
72
|
+
"attributeValue": ""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"migrateAttributes": [
|
|
76
|
+
{
|
|
77
|
+
"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.
|
|
78
|
+
depAttribute : Dependency attribute : string
|
|
79
|
+
depValue : Dependency attribute value : string
|
|
80
|
+
fromAttribute : Legacy attribute : string
|
|
81
|
+
fromValue : Legacy attribute value : string
|
|
82
|
+
toAttribute : Core Pack attribute : string
|
|
83
|
+
toValue : Core Pack attribute value : string",
|
|
84
|
+
"depAttribute": "attribute",
|
|
85
|
+
"depValue": "attributeValue",
|
|
86
|
+
"fromAttribute": "attribute",
|
|
87
|
+
"fromValue": "attributeValue",
|
|
88
|
+
"toAttribute": "attribute",
|
|
89
|
+
"toValue": "attributeValue"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"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.
|
|
93
|
+
depAttribute : Dependency attribute : string
|
|
94
|
+
depValue : Dependency attribute value : string
|
|
95
|
+
fromAttribute : Legacy attribute : string
|
|
96
|
+
fromValue : Legacy attribute value : string
|
|
97
|
+
toAttribute : Core Pack attribute : string
|
|
98
|
+
toValue : Core Pack attribute value : string",
|
|
99
|
+
"fromAttribute": "attribute",
|
|
100
|
+
"fromValue": "attributeValue",
|
|
101
|
+
"toAttribute": "attribute",
|
|
102
|
+
"toValue": "attributeValue"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"ruleSetToIgnore": [
|
|
106
|
+
{
|
|
107
|
+
"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
|
|
108
|
+
slot : Migration will be skipped if the specified slot exists in the legacy code : string
|
|
109
|
+
attribute : Migration will be skipped if the specified attribute exists in the legacy code : string",
|
|
110
|
+
"slotName": ""
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"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
|
|
114
|
+
slot : Migration will be skipped if the specified slot exists in the legacy code : string
|
|
115
|
+
attribute : Migration will be skipped if the specified attribute exists in the legacy code : string",
|
|
116
|
+
"attribute": ""
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "migrationConfig.json can be used by the USER to fine tune the operations and behavior of the Migration Framework
|
|
3
|
+
excludeFolder : The Array contains folder names that the migration framework will skip. The full path for the file name should be provided.
|
|
4
|
+
excludeFiles : The Array contains file names that the migration framework will skip. The full path for the file name should be provided.
|
|
5
|
+
excludeComponents : The Array contains Legacy component tags that the migration framework will skip migration
|
|
6
|
+
forceMigration : The Array contains Legacy component tags for which the IgnoreRuleSet will be ignored and tag will be migrated to core pack
|
|
7
|
+
excludeAttributeExpressions : The object contains component specific attributes that should not be migrated if contains a expression as value",
|
|
8
|
+
"excludeFolders": [],
|
|
9
|
+
"excludeFiles": [],
|
|
10
|
+
"excludeComponents": [],
|
|
11
|
+
"forceMigration": [],
|
|
12
|
+
"excludeAttributeExpressions" :
|
|
13
|
+
{
|
|
14
|
+
"legacyTag1": ["attributes"],
|
|
15
|
+
"legacyTag2": ["attributes"]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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
|
+
function consoleLog(text){global.jaf.log.console(text)}function logMessage(text){global.jaf.log.msg(text)}function logFilePath(filepath){global.jaf.log.msg(`\nMigrating in: ${filepath}`)}function logImportUpdate(from,to){global.jaf.log.msg(`\tImport: Updated from "${from}" to "${to}"`)}function logImportAppend(from,to){global.jaf.log.msg(`\tImport: Appended "${to}" to "${from}"`)}function logTagMigration(from,to){global.jaf.log.msg(`\tTag migrated from "${from}" to "${to}"`)}function logClassNameToAttribute(className,attribute,value){global.jaf.log.msg(`\tClass name of "${className}" migrated to "${attribute}" attribute with value of "${value}"`)}function logAttributeMigration(fromAtt,fromVal,toAtt,toVal){global.jaf.log.msg(`\tAttribute migrated from "${fromAtt}" with a value of "${fromVal}" to "${toAtt}" with a value of "${toVal}"`)}function logAttributeDeprecation(from,fromVal){global.jaf.log.msg(`\tAttribute deprecated, removed "${from}" ${fromVal?`with a value of "${fromVal}"`:""}`)}function logAttributeAddition(toAtt,toVal){global.jaf.log.msg(`\tAttribute added, "${toAtt}" with a value of "${toVal}"`)}function logIgnoreComponent(component,attribute,value){global.jaf.log.msg(`\tRule to ignore: "${component}" filtered out due to attribute "${attribute}" ${value?`with value of "${value}"`:""}`)}function logCommentSlotContent(component,value,child){global.jaf.log.msg(`\tCommented out ${component}`);global.jaf.log.msg(`\t\t${child?`has ${child}`:""} with "slot" attribute having value of "${value}"`)}function logSlotContentToAttribute(component,attribute,value){value?global.jaf.log.msg(`\tSlot migrated: "${component}" added attribute "${attribute}" with value of "${value}"`):global.jaf.log.msg(`\tSlot migration ignored: "${component}" did not add attribute "${attribute}" due to value of "${value}"`)}function logAttributeExpression(component,attribute,value){global.jaf.log.msg(`\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}"`)}exports.consoleLog=consoleLog;exports.logMessage=logMessage;exports.logFilePath=logFilePath;exports.logImportUpdate=logImportUpdate;exports.logImportAppend=logImportAppend;exports.logTagMigration=logTagMigration;exports.logClassNameToAttribute=logClassNameToAttribute;exports.logAttributeMigration=logAttributeMigration;exports.logAttributeDeprecation=logAttributeDeprecation;exports.logAttributeAddition=logAttributeAddition;exports.logIgnoreComponent=logIgnoreComponent;exports.logCommentSlotContent=logCommentSlotContent;exports.logSlotContentToAttribute=logSlotContentToAttribute;exports.logAttributeExpression=logAttributeExpression;exports.logExcludeAttributeExpression=logExcludeAttributeExpression;
|