JSS component is missing Angular component implementation.
-JSS component is missing Angular component implementation.
+Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
", - editable: "{\"commands\":[{\"click\":\"chrome:field:editcontrol({command:\\\"webedit:edithtml\\\"})\",\"header\":\"Edit Text\",\"icon\":\"/temp/iconcache/office/16x16/pencil.png\",\"disabledIcon\":\"/temp/pencil_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the text\",\"type\":null},{\"click\":\"chrome:field:execute({command:\\\"bold\\\", userInterface:true, value:true})\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/font_style_bold.png\",\"disabledIcon\":\"/temp/font_style_bold_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Bold\",\"type\":null},{\"click\":\"chrome:field:execute({command:\\\"Italic\\\", userInterface:true, value:true})\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/font_style_italics.png\",\"disabledIcon\":\"/temp/font_style_italics_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Italic\",\"type\":null},{\"click\":\"chrome:field:execute({command:\\\"Underline\\\", userInterface:true, value:true})\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/font_style_underline.png\",\"disabledIcon\":\"/temp/font_style_underline_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Underline\",\"type\":null},{\"click\":\"chrome:field:insertlink\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/link.png\",\"disabledIcon\":\"/temp/link_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Insert a link into the text field.\",\"type\":null},{\"click\":\"chrome:field:insertimage\",\"header\":\"Insert image\",\"icon\":\"/temp/iconcache/office/16x16/photo_landscape.png\",\"disabledIcon\":\"/temp/photo_landscape_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Insert an image into the text field.\",\"type\":null},{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"/temp/iconcache/office/16x16/cubes.png\",\"disabledIcon\":\"/temp/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"/temp/iconcache/office/16x16/users_family.png\",\"disabledIcon\":\"/temp/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit:editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"/temp/iconcache/office/16x16/windows.png\",\"disabledIcon\":\"/temp/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the variations.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore://master/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"Body\",\"expandedDisplayName\":null}Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
", + value: + 'Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
', + editable: + '{"commands":[{"click":"chrome:field:editcontrol({command:\\"webedit:edithtml\\"})","header":"Edit Text","icon":"/temp/iconcache/office/16x16/pencil.png","disabledIcon":"/temp/pencil_disabled16x16.png","isDivider":false,"tooltip":"Edit the text","type":null},{"click":"chrome:field:execute({command:\\"bold\\", userInterface:true, value:true})","header":"","icon":"/temp/iconcache/office/16x16/font_style_bold.png","disabledIcon":"/temp/font_style_bold_disabled16x16.png","isDivider":false,"tooltip":"Bold","type":null},{"click":"chrome:field:execute({command:\\"Italic\\", userInterface:true, value:true})","header":"","icon":"/temp/iconcache/office/16x16/font_style_italics.png","disabledIcon":"/temp/font_style_italics_disabled16x16.png","isDivider":false,"tooltip":"Italic","type":null},{"click":"chrome:field:execute({command:\\"Underline\\", userInterface:true, value:true})","header":"","icon":"/temp/iconcache/office/16x16/font_style_underline.png","disabledIcon":"/temp/font_style_underline_disabled16x16.png","isDivider":false,"tooltip":"Underline","type":null},{"click":"chrome:field:insertlink","header":"","icon":"/temp/iconcache/office/16x16/link.png","disabledIcon":"/temp/link_disabled16x16.png","isDivider":false,"tooltip":"Insert a link into the text field.","type":null},{"click":"chrome:field:insertimage","header":"Insert image","icon":"/temp/iconcache/office/16x16/photo_landscape.png","disabledIcon":"/temp/photo_landscape_disabled16x16.png","isDivider":false,"tooltip":"Insert an image into the text field.","type":null},{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{},"displayName":"Body","expandedDisplayName":null}Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
', }, }, params: { - shade: "dark", - titleSize: "1", + shade: 'dark', + titleSize: '1', }, }, { - name: "code", - type: "text/sitecore", - contents: "", + name: 'code', + type: 'text/sitecore', + contents: '', attributes: { - type: "text/sitecore", - id: "scEnclosingTag_r_", - chrometype: "rendering", - kind: "close", - hintkey: "JumbotronRendering", - class: "scpm", + type: 'text/sitecore', + id: 'scEnclosingTag_r_', + chrometype: 'rendering', + kind: 'close', + hintkey: 'JumbotronRendering', + class: 'scpm', }, }, { - name: "code", - type: "text/sitecore", - contents: "", + name: 'code', + type: 'text/sitecore', + contents: '', attributes: { - type: "text/sitecore", - id: "scEnclosingTag_", - chrometype: "placeholder", - kind: "close", - hintname: "page-header", - class: "scpm", + type: 'text/sitecore', + id: 'scEnclosingTag_', + chrometype: 'placeholder', + kind: 'close', + hintname: 'page-header', + class: 'scpm', }, }, ], - "page-content": [ + 'page-content': [ { - name: "code", - type: "text/sitecore", - contents: "{\"commands\":[{\"click\":\"chrome:placeholder:addControl\",\"header\":\"Add to here\",\"icon\":\"/temp/iconcache/office/16x16/add.png\",\"disabledIcon\":\"/temp/add_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Add a new rendering to the '{0}' placeholder.\",\"type\":\"\"},{\"click\":\"chrome:placeholder:editSettings\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/window_gear.png\",\"disabledIcon\":\"/temp/window_gear_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the placeholder settings.\",\"type\":\"\"}],\"contextItemUri\":\"sitecore://master/{9BCF4A17-2EC7-4160-9504-5ABD096B46AE}?lang=en&ver=1\",\"custom\":{\"allowedRenderings\":[],\"editable\":\"true\"},\"displayName\":\"page-content\",\"expandedDisplayName\":null}", + name: 'code', + type: 'text/sitecore', + contents: + '{"commands":[{"click":"chrome:placeholder:addControl","header":"Add to here","icon":"/temp/iconcache/office/16x16/add.png","disabledIcon":"/temp/add_disabled16x16.png","isDivider":false,"tooltip":"Add a new rendering to the \'{0}\' placeholder.","type":""},{"click":"chrome:placeholder:editSettings","header":"","icon":"/temp/iconcache/office/16x16/window_gear.png","disabledIcon":"/temp/window_gear_disabled16x16.png","isDivider":false,"tooltip":"Edit the placeholder settings.","type":""}],"contextItemUri":"sitecore://master/{9BCF4A17-2EC7-4160-9504-5ABD096B46AE}?lang=en&ver=1","custom":{"allowedRenderings":[],"editable":"true"},"displayName":"page-content","expandedDisplayName":null}', attributes: { - "type": "text/sitecore", - "chrometype": "placeholder", - "kind": "open", - "id": "page_content", - "key": "page-content", - "class": "scpm", - "data-selectable": "true", + type: 'text/sitecore', + chrometype: 'placeholder', + kind: 'open', + id: 'page_content', + key: 'page-content', + class: 'scpm', + 'data-selectable': 'true', }, }, { - name: "code", - type: "text/sitecore", - contents: "{\"commands\":[{\"click\":\"chrome:rendering:sort\",\"header\":\"Change position\",\"icon\":\"/temp/iconcache/office/16x16/document_size.png\",\"disabledIcon\":\"/temp/document_size_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Move component.\",\"type\":\"\"},{\"click\":\"javascript:Sitecore.PageModes.PageEditor.postRequest('webedit:componentoptions(referenceId={6701AC71-845D-4DE4-BF8E-1F4FEDDF8908},renderingId={6C254609-5347-4768-9FFB-1FF620320CE9},id={199C8794-311F-4B50-9BDC-88AEFB3EE172})',null,false)\",\"header\":\"Edit Experience Editor Options\",\"icon\":\"/temp/iconcache/office/16x16/clipboard_check_edit.png\",\"disabledIcon\":\"/temp/clipboard_check_edit_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the Experience Editor options for the component.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:properties\",\"header\":\"Edit component properties\",\"icon\":\"/temp/iconcache/office/16x16/elements_branch.png\",\"disabledIcon\":\"/temp/elements_branch_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the properties for the component.\",\"type\":\"common\"},{\"click\":\"javascript:Sitecore.PageModes.PageEditor.postRequest('webedit:setdatasource(referenceId={6701AC71-845D-4DE4-BF8E-1F4FEDDF8908},renderingId={6C254609-5347-4768-9FFB-1FF620320CE9},id={199C8794-311F-4B50-9BDC-88AEFB3EE172})',null,false)\",\"header\":\"{dsHeader}\",\"icon\":\"/temp/iconcache/office/16x16/data.png\",\"disabledIcon\":\"/temp/data_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"{dsTooltip}\",\"type\":\"datasourcesmenu\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"/temp/iconcache/office/16x16/users_family.png\",\"disabledIcon\":\"/temp/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit:editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"/temp/iconcache/office/16x16/windows.png\",\"disabledIcon\":\"/temp/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Test the component.\",\"type\":\"sticky\"},{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"/temp/iconcache/office/16x16/cubes.png\",\"disabledIcon\":\"/temp/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"datasourcesmenu\"},{\"click\":\"chrome:rendering:delete\",\"header\":\"Delete\",\"icon\":\"/temp/iconcache/office/16x16/delete.png\",\"disabledIcon\":\"/temp/delete_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Remove component.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore://master/{199C8794-311F-4B50-9BDC-88AEFB3EE172}?lang=en&ver=1\",\"custom\":{\"renderingID\":\"6C254609534747689FFB1FF620320CE9\",\"editable\":\"true\"},\"displayName\":\"DownloadCalloutRendering\",\"expandedDisplayName\":null}", + name: 'code', + type: 'text/sitecore', + contents: + '{"commands":[{"click":"chrome:rendering:sort","header":"Change position","icon":"/temp/iconcache/office/16x16/document_size.png","disabledIcon":"/temp/document_size_disabled16x16.png","isDivider":false,"tooltip":"Move component.","type":""},{"click":"javascript:Sitecore.PageModes.PageEditor.postRequest(\'webedit:componentoptions(referenceId={6701AC71-845D-4DE4-BF8E-1F4FEDDF8908},renderingId={6C254609-5347-4768-9FFB-1FF620320CE9},id={199C8794-311F-4B50-9BDC-88AEFB3EE172})\',null,false)","header":"Edit Experience Editor Options","icon":"/temp/iconcache/office/16x16/clipboard_check_edit.png","disabledIcon":"/temp/clipboard_check_edit_disabled16x16.png","isDivider":false,"tooltip":"Edit the Experience Editor options for the component.","type":"common"},{"click":"chrome:rendering:properties","header":"Edit component properties","icon":"/temp/iconcache/office/16x16/elements_branch.png","disabledIcon":"/temp/elements_branch_disabled16x16.png","isDivider":false,"tooltip":"Edit the properties for the component.","type":"common"},{"click":"javascript:Sitecore.PageModes.PageEditor.postRequest(\'webedit:setdatasource(referenceId={6701AC71-845D-4DE4-BF8E-1F4FEDDF8908},renderingId={6C254609-5347-4768-9FFB-1FF620320CE9},id={199C8794-311F-4B50-9BDC-88AEFB3EE172})\',null,false)","header":"{dsHeader}","icon":"/temp/iconcache/office/16x16/data.png","disabledIcon":"/temp/data_disabled16x16.png","isDivider":false,"tooltip":"{dsTooltip}","type":"datasourcesmenu"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Test the component.","type":"sticky"},{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"datasourcesmenu"},{"click":"chrome:rendering:delete","header":"Delete","icon":"/temp/iconcache/office/16x16/delete.png","disabledIcon":"/temp/delete_disabled16x16.png","isDivider":false,"tooltip":"Remove component.","type":"sticky"}],"contextItemUri":"sitecore://master/{199C8794-311F-4B50-9BDC-88AEFB3EE172}?lang=en&ver=1","custom":{"renderingID":"6C254609534747689FFB1FF620320CE9","editable":"true"},"displayName":"DownloadCalloutRendering","expandedDisplayName":null}', attributes: { - "type": "text/sitecore", - "chrometype": "rendering", - "kind": "open", - "hintname": "DownloadCalloutRendering", - "id": "r_6701AC71845D4DE4BF8E1F4FEDDF8908", - "class": "scpm", - "data-selectable": "true", + type: 'text/sitecore', + chrometype: 'rendering', + kind: 'open', + hintname: 'DownloadCalloutRendering', + id: 'r_6701AC71845D4DE4BF8E1F4FEDDF8908', + class: 'scpm', + 'data-selectable': 'true', }, }, { - uid: "6701ac71-845d-4de4-bf8e-1f4feddf8908", - componentName: "DownloadCallout", + uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', + componentName: 'DownloadCallout', fields: { linkText: { - value: "Download", - editable: "{\"commands\":[{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"/temp/iconcache/office/16x16/cubes.png\",\"disabledIcon\":\"/temp/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"/temp/iconcache/office/16x16/users_family.png\",\"disabledIcon\":\"/temp/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit:editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"/temp/iconcache/office/16x16/windows.png\",\"disabledIcon\":\"/temp/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the variations.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore://master/{199C8794-311F-4B50-9BDC-88AEFB3EE172}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"LinkText\",\"expandedDisplayName\":null}Download", + value: 'Download', + editable: + '{"commands":[{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{199C8794-311F-4B50-9BDC-88AEFB3EE172}?lang=en&ver=1","custom":{},"displayName":"LinkText","expandedDisplayName":null}Download', }, }, params: {}, }, { - name: "div", - type: "", - contents: "", + name: 'div', + type: '', + contents: + '', attributes: { style: { - backgroundColor: "white", + backgroundColor: 'white', opacity: 0.35, - filter: "alpha(opacity=35)", + filter: 'alpha(opacity=35)', }, }, }, { - name: "code", - type: "text/sitecore", - contents: "", + name: 'code', + type: 'text/sitecore', + contents: '', attributes: { - type: "text/sitecore", - id: "scEnclosingTag_r_", - chrometype: "rendering", - kind: "close", - hintkey: "DownloadCalloutRendering", - class: "scpm", + type: 'text/sitecore', + id: 'scEnclosingTag_r_', + chrometype: 'rendering', + kind: 'close', + hintkey: 'DownloadCalloutRendering', + class: 'scpm', }, }, { - name: "code", - type: "text/sitecore", - contents: "", + name: 'code', + type: 'text/sitecore', + contents: '', attributes: { - type: "text/sitecore", - id: "scEnclosingTag_", - chrometype: "placeholder", - kind: "close", - hintname: "page-content", - class: "scpm", + type: 'text/sitecore', + id: 'scEnclosingTag_', + chrometype: 'placeholder', + kind: 'close', + hintname: 'page-content', + class: 'scpm', }, }, ], }, }, { - name: "code", - type: "text/sitecore", - contents: "", + name: 'code', + type: 'text/sitecore', + contents: '', attributes: { - type: "text/sitecore", - id: "scEnclosingTag_r_", - chrometype: "rendering", - kind: "close", - hintkey: "HomeRendering", - class: "scpm", + type: 'text/sitecore', + id: 'scEnclosingTag_r_', + chrometype: 'rendering', + kind: 'close', + hintkey: 'HomeRendering', + class: 'scpm', }, }, { - name: "code", - type: "text/sitecore", - contents: "", + name: 'code', + type: 'text/sitecore', + contents: '', attributes: { - type: "text/sitecore", - id: "scEnclosingTag_", - chrometype: "placeholder", - kind: "close", - hintname: "main", - class: "scpm", + type: 'text/sitecore', + id: 'scEnclosingTag_', + chrometype: 'placeholder', + kind: 'close', + hintname: 'main', + class: 'scpm', }, }, ], }, fields: { - key: "{\"commands\":[{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"/temp/iconcache/office/16x16/cubes.png\",\"disabledIcon\":\"/temp/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"/temp/iconcache/office/16x16/users_family.png\",\"disabledIcon\":\"/temp/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit:editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"/temp/iconcache/office/16x16/windows.png\",\"disabledIcon\":\"/temp/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the variations.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore://master/{9BCF4A17-2EC7-4160-9504-5ABD096B46AE}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"Key\",\"expandedDisplayName\":null}This is a some sample <p>field data</p> o'boy! "wow"", + key: + '{"commands":[{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{9BCF4A17-2EC7-4160-9504-5ABD096B46AE}?lang=en&ver=1","custom":{},"displayName":"Key","expandedDisplayName":null}This is a some sample <p>field data</p> o'boy! "wow"', }, }, }, }; -export const imageField = "{\"commands\":[{\"click\":\"chrome:field:editcontrol({command:\\\"webedit: chooseimage\\\"})\",\"header\":\"Choose Image\",\"icon\":\"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2.png\",\"disabledIcon\":\"/temp/photo_landscape2_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Choose an image.\",\"type\":\"\"},{\"click\":\"chrome:field:editcontrol({command:\\\"webedit: editimage\\\"})\",\"header\":\"Properties\",\"icon\":\"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2_edit.png\",\"disabledIcon\":\"/temp/photo_landscape2_edit_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Modify image appearance.\",\"type\":\"\"},{\"click\":\"chrome:field:editcontrol({command:\\\"webedit: clearimage\\\"})\",\"header\":\"Clear\",\"icon\":\"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2_delete.png\",\"disabledIcon\":\"/temp/photo_landscape2_delete_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Remove the image.\",\"type\":\"\"},{\"click\":\"chrome:common:edititem({command:\\\"webedit: open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"/temp/iconcache/office/16x16/cubes.png\",\"disabledIcon\":\"/temp/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit: personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"/temp/iconcache/office/16x16/users_family.png\",\"disabledIcon\":\"/temp/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit: editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"/temp/iconcache/office/16x16/windows.png\",\"disabledIcon\":\"/temp/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the variations.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore://master/{F5201E35-7674-44EB-B903-E52488A0EB5A}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"Image\",\"expandedDisplayName\":null}
";
-export const richTextField = "{\"commands\":[{\"click\":\"chrome:field:editcontrol({command:\\\"webedit:edithtml\\\"})\",\"header\":\"Edit Text\",\"icon\":\"/temp/iconcache/office/16x16/pencil.png\",\"disabledIcon\":\"/temp/pencil_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the text\",\"type\":null},{\"click\":\"chrome:field:execute({command:\\\"bold\\\", userInterface:true, value:true})\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/font_style_bold.png\",\"disabledIcon\":\"/temp/font_style_bold_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Bold\",\"type\":null},{\"click\":\"chrome:field:execute({command:\\\"Italic\\\", userInterface:true, value:true})\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/font_style_italics.png\",\"disabledIcon\":\"/temp/font_style_italics_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Italic\",\"type\":null},{\"click\":\"chrome:field:execute({command:\\\"Underline\\\", userInterface:true, value:true})\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/font_style_underline.png\",\"disabledIcon\":\"/temp/font_style_underline_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Underline\",\"type\":null},{\"click\":\"chrome:field:insertlink\",\"header\":\"\",\"icon\":\"/temp/iconcache/office/16x16/link.png\",\"disabledIcon\":\"/temp/link_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Insert a link into the text field.\",\"type\":null},{\"click\":\"chrome:field:insertimage\",\"header\":\"Insert image\",\"icon\":\"/temp/iconcache/office/16x16/photo_landscape.png\",\"disabledIcon\":\"/temp/photo_landscape_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Insert an image into the text field.\",\"type\":null},{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"/temp/iconcache/office/16x16/cubes.png\",\"disabledIcon\":\"/temp/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"/temp/iconcache/office/16x16/users_family.png\",\"disabledIcon\":\"/temp/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit:editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"/temp/iconcache/office/16x16/windows.png\",\"disabledIcon\":\"/temp/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the variations.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore://master/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"Body\",\"expandedDisplayName\":null}Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
"; -export const generalLinkField = "{\"commands\":[{\"click\":\"chrome:field:editcontrol({command:\\\"webedit:editlink\\\"})\",\"header\":\"Edit link\",\"icon\":\"\/temp\/iconcache\/networkv2\/16x16\/link_edit.png\",\"disabledIcon\":\"\/temp\/link_edit_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edits the link destination and appearance\",\"type\":\"\"},{\"click\":\"chrome:field:editcontrol({command:\\\"webedit:clearlink\\\"})\",\"header\":\"Clear Link\",\"icon\":\"\/temp\/iconcache\/networkv2\/16x16\/link_delete.png\",\"disabledIcon\":\"\/temp\/link_delete_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Clears The Link\",\"type\":\"\"},{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"\/temp\/iconcache\/office\/16x16\/cubes.png\",\"disabledIcon\":\"\/temp\/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"\/temp\/iconcache\/office\/16x16\/users_family.png\",\"disabledIcon\":\"\/temp\/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"},{\"click\":\"chrome:rendering:editvariations({command:\\\"webedit:editvariations\\\"})\",\"header\":\"Edit variations\",\"icon\":\"\/temp\/iconcache\/office\/16x16\/windows.png\",\"disabledIcon\":\"\/temp\/windows_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the variations.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore:\/\/master\/{5DE985D8-565B-4437-B6FF-0CED110BEDE6}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"link\",\"expandedDisplayName\":null}<\/code>hello world<\/a><\/code>";
-export const textField = "{\"commands\":[{\"click\":\"chrome:common:edititem({command:\\\"webedit:open\\\"})\",\"header\":\"Edit the related item\",\"icon\":\"\/temp\/iconcache\/office\/16x16\/cubes.png\",\"disabledIcon\":\"\/temp\/cubes_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Edit the related item in the Content Editor.\",\"type\":\"common\"},{\"click\":\"chrome:rendering:personalize({command:\\\"webedit:personalize\\\"})\",\"header\":\"Personalize\",\"icon\":\"\/temp\/iconcache\/office\/16x16\/users_family.png\",\"disabledIcon\":\"\/temp\/users_family_disabled16x16.png\",\"isDivider\":false,\"tooltip\":\"Create or edit personalization for this component.\",\"type\":\"sticky\"}],\"contextItemUri\":\"sitecore:\/\/master\/{D0BC9D8D-32A3-4E0B-B4A5-1F9A1DCEC31A}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"Title\",\"expandedDisplayName\":null}<\/span>Sturdy Templates<\/span>";
+export const imageField =
+ '{"commands":[{"click":"chrome:field:editcontrol({command:\\"webedit: chooseimage\\"})","header":"Choose Image","icon":"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2.png","disabledIcon":"/temp/photo_landscape2_disabled16x16.png","isDivider":false,"tooltip":"Choose an image.","type":""},{"click":"chrome:field:editcontrol({command:\\"webedit: editimage\\"})","header":"Properties","icon":"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2_edit.png","disabledIcon":"/temp/photo_landscape2_edit_disabled16x16.png","isDivider":false,"tooltip":"Modify image appearance.","type":""},{"click":"chrome:field:editcontrol({command:\\"webedit: clearimage\\"})","header":"Clear","icon":"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2_delete.png","disabledIcon":"/temp/photo_landscape2_delete_disabled16x16.png","isDivider":false,"tooltip":"Remove the image.","type":""},{"click":"chrome:common:edititem({command:\\"webedit: open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit: personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit: editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{F5201E35-7674-44EB-B903-E52488A0EB5A}?lang=en&ver=1","custom":{},"displayName":"Image","expandedDisplayName":null}
';
+export const richTextField =
+ '{"commands":[{"click":"chrome:field:editcontrol({command:\\"webedit:edithtml\\"})","header":"Edit Text","icon":"/temp/iconcache/office/16x16/pencil.png","disabledIcon":"/temp/pencil_disabled16x16.png","isDivider":false,"tooltip":"Edit the text","type":null},{"click":"chrome:field:execute({command:\\"bold\\", userInterface:true, value:true})","header":"","icon":"/temp/iconcache/office/16x16/font_style_bold.png","disabledIcon":"/temp/font_style_bold_disabled16x16.png","isDivider":false,"tooltip":"Bold","type":null},{"click":"chrome:field:execute({command:\\"Italic\\", userInterface:true, value:true})","header":"","icon":"/temp/iconcache/office/16x16/font_style_italics.png","disabledIcon":"/temp/font_style_italics_disabled16x16.png","isDivider":false,"tooltip":"Italic","type":null},{"click":"chrome:field:execute({command:\\"Underline\\", userInterface:true, value:true})","header":"","icon":"/temp/iconcache/office/16x16/font_style_underline.png","disabledIcon":"/temp/font_style_underline_disabled16x16.png","isDivider":false,"tooltip":"Underline","type":null},{"click":"chrome:field:insertlink","header":"","icon":"/temp/iconcache/office/16x16/link.png","disabledIcon":"/temp/link_disabled16x16.png","isDivider":false,"tooltip":"Insert a link into the text field.","type":null},{"click":"chrome:field:insertimage","header":"Insert image","icon":"/temp/iconcache/office/16x16/photo_landscape.png","disabledIcon":"/temp/photo_landscape_disabled16x16.png","isDivider":false,"tooltip":"Insert an image into the text field.","type":null},{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{},"displayName":"Body","expandedDisplayName":null}Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
';
+export const generalLinkField =
+ '{"commands":[{"click":"chrome:field:editcontrol({command:\\"webedit:editlink\\"})","header":"Edit link","icon":"/temp/iconcache/networkv2/16x16/link_edit.png","disabledIcon":"/temp/link_edit_disabled16x16.png","isDivider":false,"tooltip":"Edits the link destination and appearance","type":""},{"click":"chrome:field:editcontrol({command:\\"webedit:clearlink\\"})","header":"Clear Link","icon":"/temp/iconcache/networkv2/16x16/link_delete.png","disabledIcon":"/temp/link_delete_disabled16x16.png","isDivider":false,"tooltip":"Clears The Link","type":""},{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{5DE985D8-565B-4437-B6FF-0CED110BEDE6}?lang=en&ver=1","custom":{},"displayName":"link","expandedDisplayName":null}
hello world
';
+export const textField =
+ '{"commands":[{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"}],"contextItemUri":"sitecore://master/{D0BC9D8D-32A3-4E0B-B4A5-1F9A1DCEC31A}?lang=en&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Sturdy Templates';
diff --git a/packages/sitecore-jss-angular/src/testData/non-ee-data.ts b/packages/sitecore-jss-angular/src/testData/non-ee-data.ts
index ef8bc7999c..d1f786b3fe 100644
--- a/packages/sitecore-jss-angular/src/testData/non-ee-data.ts
+++ b/packages/sitecore-jss-angular/src/testData/non-ee-data.ts
@@ -1,54 +1,53 @@
// these rules enforce "correct" JSON format instead of normal object format
-/* tslint:disable:object-literal-key-quotes quotemark trailing-comma one-line max-line-length prettier */
-
export const convertedDevData = {
sitecore: {
context: {
pageEditing: false,
},
route: {
- name: "home",
- displayName: "Home",
+ name: 'home',
+ displayName: 'Home',
placeholders: {
main: [
{
- componentName: "Home",
+ componentName: 'Home',
fields: {
message: {
- value: "JavaScript all the things!",
+ value: 'JavaScript all the things!',
},
},
- uid: "2339622d-093b-4258-8334-95979e41efa6",
+ uid: '2339622d-093b-4258-8334-95979e41efa6',
renderingParams: [],
placeholders: {
- "page-header": [
+ 'page-header': [
{
- componentName: "Jumbotron",
+ componentName: 'Jumbotron',
params: {
- shade: "dark",
- titleSize: "1",
+ shade: 'dark',
+ titleSize: '1',
},
fields: {
titleText: {
- value: "Your Favorite Source of Free Bootstrap Themes!",
+ value: 'Your Favorite Source of Free Bootstrap Themes!',
},
body: {
- value: "Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
",
+ value:
+ 'Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
',
},
},
- uid: "53c31a2a-75d5-43c6-a0b8-66b7c7859c30",
+ uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30',
},
],
- "page-content": [
+ 'page-content': [
{
- componentName: "DownloadCallout",
+ componentName: 'DownloadCallout',
fields: {
linkText: {
- value: "Download",
+ value: 'Download',
},
},
- uid: "6701ac71-845d-4de4-bf8e-1f4feddf8908",
+ uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908',
params: [],
},
],
@@ -57,7 +56,7 @@ export const convertedDevData = {
],
},
fields: {
- key: "This is a some sample <p>field data</p> o'boy! "wow"",
+ key: 'This is a some sample <p>field data</p> o'boy! "wow"',
},
},
},
@@ -69,57 +68,59 @@ export const convertedLayoutServiceData = {
pageEditing: false,
},
route: {
- name: "home",
- displayName: "Home",
+ name: 'home',
+ displayName: 'Home',
placeholders: {
main: [
{
- componentName: "Home",
+ componentName: 'Home',
fields: {
message: {
- value: "JavaScript all the things!",
- editable: "JavaScript all the things!",
+ value: 'JavaScript all the things!',
+ editable: 'JavaScript all the things!',
},
},
- uid: "2339622d-093b-4258-8334-95979e41efa6",
+ uid: '2339622d-093b-4258-8334-95979e41efa6',
renderingParams: [],
placeholders: {
- "page-header": [
+ 'page-header': [
{
- componentName: "Jumbotron",
+ componentName: 'Jumbotron',
fields: {
titleText: {
- value: "Your Favorite Source of Free Bootstrap Themes!",
- editable: "Your Favorite Source of Free Bootstrap Themes!",
+ value: 'Your Favorite Source of Free Bootstrap Themes!',
+ editable: 'Your Favorite Source of Free Bootstrap Themes!',
},
body: {
- value: "Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
",
- editable: "Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
",
+ value:
+ 'Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
',
+ editable:
+ 'Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!
',
},
},
params: {
shade: {
- value: "dark",
- editable: "dark",
+ value: 'dark',
+ editable: 'dark',
},
titleSize: {
- value: "1",
- editable: "1",
+ value: '1',
+ editable: '1',
},
},
- uid: "53c31a2a-75d5-43c6-a0b8-66b7c7859c30",
+ uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30',
},
],
- "page-content": [
+ 'page-content': [
{
- componentName: "DownloadCallout",
+ componentName: 'DownloadCallout',
fields: {
linkText: {
- value: "Download",
- editable: "Download",
+ value: 'Download',
+ editable: 'Download',
},
},
- uid: "6701ac71-845d-4de4-bf8e-1f4feddf8908",
+ uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908',
params: [],
},
],
@@ -128,7 +129,7 @@ export const convertedLayoutServiceData = {
],
},
fields: {
- key: "This is a some sample <p>field data</p> o'boy! "wow"",
+ key: 'This is a some sample <p>field data</p> o'boy! "wow"',
},
},
},
diff --git a/packages/sitecore-jss-angular/tslint.json b/packages/sitecore-jss-angular/tslint.json
deleted file mode 100644
index 6dc74dbc44..0000000000
--- a/packages/sitecore-jss-angular/tslint.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": [
- "../../tslint.json"
- ],
- "rulesDirectory": [
- "node_modules/codelyzer"
- ]
-}
diff --git a/packages/sitecore-jss-cli/.eslintrc b/packages/sitecore-jss-cli/.eslintrc
new file mode 100644
index 0000000000..5c9d573e39
--- /dev/null
+++ b/packages/sitecore-jss-cli/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "../../.eslintrc",
+ "rules": {
+ "@typescript-eslint/explicit-module-boundary-types": "off"
+ }
+}
\ No newline at end of file
diff --git a/packages/sitecore-jss-cli/.npmignore b/packages/sitecore-jss-cli/.npmignore
index 5a13aa45a8..2277964bfa 100644
--- a/packages/sitecore-jss-cli/.npmignore
+++ b/packages/sitecore-jss-cli/.npmignore
@@ -4,12 +4,11 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
-tslint.json
npm-debug*
!/types
.nycrc
diff --git a/packages/sitecore-jss-cli/package-lock.json b/packages/sitecore-jss-cli/package-lock.json
index dd318e8fff..c6d69e0ea5 100644
--- a/packages/sitecore-jss-cli/package-lock.json
+++ b/packages/sitecore-jss-cli/package-lock.json
@@ -30,6 +30,38 @@
"js-tokens": "^4.0.0"
}
},
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ }
+ }
+ },
"@nodelib/fs.scandir": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
@@ -252,6 +284,18 @@
"integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==",
"dev": true
},
+ "acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
+ },
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
"aggregate-error": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
@@ -366,6 +410,12 @@
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
@@ -430,6 +480,12 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true
+ },
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@@ -555,6 +611,15 @@
"assert-plus": "^1.0.0"
}
},
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
@@ -587,6 +652,12 @@
"type-detect": "^4.0.0"
}
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+ "dev": true
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -641,6 +712,15 @@
"path-type": "^4.0.0"
}
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@@ -655,6 +735,15 @@
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA=="
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -756,12 +845,242 @@
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true
+ },
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@@ -796,6 +1115,12 @@
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "dev": true
+ },
"fastq": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz",
@@ -805,6 +1130,15 @@
"reusify": "^1.0.4"
}
},
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -831,6 +1165,22 @@
"is-buffer": "~2.0.3"
}
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@@ -873,6 +1223,12 @@
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -914,6 +1270,23 @@
"is-glob": "^4.0.1"
}
},
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ },
+ "dependencies": {
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
"globby": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz",
@@ -1012,6 +1385,22 @@
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
},
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ }
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "dev": true
+ },
"indent-string": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
@@ -1220,6 +1609,12 @@
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -1267,6 +1662,16 @@
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
"dev": true
},
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
"lie": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
@@ -1362,6 +1767,15 @@
"integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==",
"dev": true
},
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
"make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
@@ -1671,6 +2085,18 @@
}
}
},
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"nise": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz",
@@ -1763,6 +2189,20 @@
"wrappy": "1"
}
},
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@@ -1798,6 +2238,15 @@
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
},
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
"parse-json": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
@@ -1853,11 +2302,23 @@
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true
},
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise.allsettled": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz",
@@ -1998,6 +2459,12 @@
"strip-indent": "^3.0.0"
}
},
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"request": {
"version": "2.88.2",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
@@ -2050,6 +2517,12 @@
"path-parse": "^1.0.6"
}
},
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ },
"reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -2148,6 +2621,49 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -2285,6 +2801,64 @@
"has-flag": "^3.0.0"
}
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"tmp": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz",
@@ -2353,6 +2927,15 @@
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
@@ -2394,6 +2977,12 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -2463,6 +3052,12 @@
}
}
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
+ },
"workerpool": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz",
@@ -2489,6 +3084,12 @@
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
},
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
"yargs": {
"version": "14.2.3",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz",
diff --git a/packages/sitecore-jss-cli/package.json b/packages/sitecore-jss-cli/package.json
index ab4894f8c1..b3621047d9 100644
--- a/packages/sitecore-jss-cli/package.json
+++ b/packages/sitecore-jss-cli/package.json
@@ -6,7 +6,7 @@
"build": "npm run clean && tsc",
"watch": "npm run build -- --watch",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ../../tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.ts",
"prepublishOnly": "npm run build",
"jss": "node ./dist/bin/jss.js",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
@@ -60,6 +60,7 @@
"chai": "^4.2.0",
"cross-env": "^6.0.3",
"del-cli": "^3.0.1",
+ "eslint": "^7.15.0",
"mocha": "^8.1.3",
"sinon": "^7.5.0",
"ts-node": "^8.4.1",
diff --git a/packages/sitecore-jss-cli/src/cli-shared.ts b/packages/sitecore-jss-cli/src/cli-shared.ts
index b3eb3d82bb..871c417176 100644
--- a/packages/sitecore-jss-cli/src/cli-shared.ts
+++ b/packages/sitecore-jss-cli/src/cli-shared.ts
@@ -7,11 +7,17 @@ process.on('unhandledRejection', (err) => {
throw err;
});
-export default function cli(commands: { [key: string]: CommandModule & { disableStrictArgs?: boolean} }) {
+/**
+ * @param {any} commands
+ */
+export default function cli(commands: {
+ [key: string]: CommandModule & { disableStrictArgs?: boolean };
+}) {
let appCommands = yargs.usage('$0 ');
// this prevents yargs from showing help with 'jss.js' as the base command
// when the command is just 'jss' as a global bin
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
(appCommands as any).$0 = 'jss';
for (const cmd of Object.keys(commands)) {
diff --git a/packages/sitecore-jss-cli/src/cli.global.ts b/packages/sitecore-jss-cli/src/cli.global.ts
index b2744dc23a..8e273ed881 100644
--- a/packages/sitecore-jss-cli/src/cli.global.ts
+++ b/packages/sitecore-jss-cli/src/cli.global.ts
@@ -1,8 +1,10 @@
import cli from './cli-shared';
import * as commands from './scripts/index.global';
-// implements CLI commands when executed from a globally installed node_modules folder
-
+/**
+ * implements CLI commands when executed from a globally installed node_modules folder
+ */
export default function() {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
cli(commands as any);
}
diff --git a/packages/sitecore-jss-cli/src/cli.ts b/packages/sitecore-jss-cli/src/cli.ts
index ede4b8d026..f1e5da04ee 100644
--- a/packages/sitecore-jss-cli/src/cli.ts
+++ b/packages/sitecore-jss-cli/src/cli.ts
@@ -4,6 +4,9 @@ import resolvePackage from './resolve-package';
import runPackageScript from './run-package-script';
import * as commands from './scripts';
+/**
+ * Get package script commands
+ */
async function getPackageScriptCommands() {
const packageJson = await resolvePackage();
const result: { [key: string]: CommandModule } = {};
@@ -23,6 +26,7 @@ async function getPackageScriptCommands() {
builder: {},
disableStrictArgs: true,
handler: (argv: Arguments) => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((argv as any)._[0]) {
runPackageScript(process.argv.slice(2));
}
@@ -35,7 +39,9 @@ async function getPackageScriptCommands() {
return result;
}
-// implements CLI commands when executed from a local node_modules folder
+/**
+ * implements CLI commands when executed from a local node_modules folder
+ */
export default async function() {
const packageScripts = await getPackageScriptCommands();
diff --git a/packages/sitecore-jss-cli/src/create/create.source.folder.ts b/packages/sitecore-jss-cli/src/create/create.source.folder.ts
index cdea111c30..1bd7ef53d8 100644
--- a/packages/sitecore-jss-cli/src/create/create.source.folder.ts
+++ b/packages/sitecore-jss-cli/src/create/create.source.folder.ts
@@ -3,10 +3,12 @@ import fs from 'fs-extra';
import path from 'path';
export class FolderSource {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
argv: any;
destinationPath: string;
templatePath = '';
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(argv: any, destinationPath: string) {
this.argv = argv;
this.destinationPath = destinationPath;
diff --git a/packages/sitecore-jss-cli/src/create/create.source.github.ts b/packages/sitecore-jss-cli/src/create/create.source.github.ts
index afbbe880cb..bf60d17d63 100644
--- a/packages/sitecore-jss-cli/src/create/create.source.github.ts
+++ b/packages/sitecore-jss-cli/src/create/create.source.github.ts
@@ -9,9 +9,11 @@ export class GitHubSource {
branch: string;
githubListApi: string;
githubDownloadUrl: string;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
argv: any;
destinationPath: string;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(argv: any, destinationPath: string) {
const repository = argv.repository || 'Sitecore/jss';
const branch = argv.branch || 'master';
@@ -26,7 +28,7 @@ export class GitHubSource {
async getFromSource() {
await this.verifyTemplate();
- return new Promise((resolve, reject) => {
+ return new Promise((resolve, reject) => {
tmp.setGracefulCleanup();
// unsafeCleanup just means it'll kill any files left in the temp folder
@@ -50,40 +52,51 @@ export class GitHubSource {
async verifyTemplate() {
return new Promise((resolve) => {
- // tslint:disable-next-line:max-line-length
- request.get(this.githubListApi, { proxy: this.argv.proxy, json: true, headers: { 'User-Agent': 'SitecoreJSSCLI' } }, (error, response, body) => {
- if (error) {
- console.error(chalk.red(error));
- process.exit(1);
- }
-
- if (response.statusCode !== 200) {
- console.error(chalk.red(`Server sent ${response.statusCode} ${response.statusMessage} while enumerating templates.`));
- process.exit(1);
- }
-
- if (!body || !Array.isArray(body)) {
- console.log(body);
- console.error(chalk.red('Received unexpected response from server while trying to enumerate templates.'));
- process.exit(1);
- }
-
- const apiResult: Array<{ name: string }> = body;
- if (!apiResult.some((result) => result.name === this.argv.template)) {
- console.error(chalk.red(`Template ${this.argv.template} did not exist.`));
- console.error(chalk.red('Valid templates are: '));
- apiResult.forEach((result) => {
- if (result.name === 'node-headless-ssr-proxy') {
- return;
- }
-
- console.error(chalk.yellow(result.name));
- });
- process.exit(1);
- }
+ request.get(
+ this.githubListApi,
+ { proxy: this.argv.proxy, json: true, headers: { 'User-Agent': 'SitecoreJSSCLI' } },
+ (error, response, body) => {
+ if (error) {
+ console.error(chalk.red(error));
+ process.exit(1);
+ }
+
+ if (response.statusCode !== 200) {
+ console.error(
+ chalk.red(
+ `Server sent ${response.statusCode} ${response.statusMessage} while enumerating templates.`
+ )
+ );
+ process.exit(1);
+ }
+
+ if (!body || !Array.isArray(body)) {
+ console.log(body);
+ console.error(
+ chalk.red(
+ 'Received unexpected response from server while trying to enumerate templates.'
+ )
+ );
+ process.exit(1);
+ }
+
+ const apiResult: Array<{ name: string }> = body;
+ if (!apiResult.some((result) => result.name === this.argv.template)) {
+ console.error(chalk.red(`Template ${this.argv.template} did not exist.`));
+ console.error(chalk.red('Valid templates are: '));
+ apiResult.forEach((result) => {
+ if (result.name === 'node-headless-ssr-proxy') {
+ return;
+ }
- resolve(apiResult);
- });
+ console.error(chalk.yellow(result.name));
+ });
+ process.exit(1);
+ }
+
+ resolve(apiResult);
+ }
+ );
});
}
@@ -91,7 +104,10 @@ export class GitHubSource {
console.log(chalk.cyan(`Acquiring templates from ${this.githubDownloadUrl}...`));
await new Promise((resolve, reject) => {
- const res = request.get(this.githubDownloadUrl, { proxy: this.argv.proxy, headers: { 'User-Agent': 'SitecoreJSSCLI' } });
+ const res = request.get(this.githubDownloadUrl, {
+ proxy: this.argv.proxy,
+ headers: { 'User-Agent': 'SitecoreJSSCLI' },
+ });
const fileStream = fs.createWriteStream(fileName, { autoClose: true });
res.pipe(fileStream);
res.on('error', reject);
@@ -106,36 +122,39 @@ export class GitHubSource {
fs.mkdirSync(this.destinationPath);
- return new Promise((resolve, reject) => {
+ return new Promise((resolve, reject) => {
fs.readFile(zipFile, (err, data) => {
if (err) {
reject(err);
}
const jszip = new JSZip();
- const writePromises: Array> = [];
+ const writePromises: Array> = [];
jszip.loadAsync(data).then(async (zip) => {
- zip.filter((innerPath) => filter.test(innerPath)).forEach((file) => {
- const relativePath = (filter.exec(file.name) as any)[1];
- const outputPath = path.join(this.destinationPath, relativePath);
-
- if (file.dir) {
- // create directory
- if (!fs.existsSync(outputPath)) {
- console.log(chalk.gray(`mkdir ${outputPath}`));
- fs.mkdirSync(outputPath);
+ zip
+ .filter((innerPath) => filter.test(innerPath))
+ .forEach((file) => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const relativePath = (filter.exec(file.name) as any)[1];
+ const outputPath = path.join(this.destinationPath, relativePath);
+
+ if (file.dir) {
+ // create directory
+ if (!fs.existsSync(outputPath)) {
+ console.log(chalk.gray(`mkdir ${outputPath}`));
+ fs.mkdirSync(outputPath);
+ }
+ } else {
+ // read file from zip, write to file
+ writePromises.push(
+ file.async('nodebuffer').then((content) => {
+ console.log(chalk.gray(`write ${outputPath}`));
+ fs.writeFileSync(outputPath, content);
+ })
+ );
}
- } else {
- // read file from zip, write to file
- writePromises.push(
- file.async('nodebuffer').then((content) => {
- console.log(chalk.gray(`write ${outputPath}`));
- fs.writeFileSync(outputPath, content);
- })
- );
- }
- });
+ });
await Promise.all(writePromises);
resolve();
diff --git a/packages/sitecore-jss-cli/src/create/index.ts b/packages/sitecore-jss-cli/src/create/index.ts
index 35e4436ae0..bd457a42fe 100644
--- a/packages/sitecore-jss-cli/src/create/index.ts
+++ b/packages/sitecore-jss-cli/src/create/index.ts
@@ -3,6 +3,11 @@ import fs from 'fs';
import glob from 'glob';
import path from 'path';
+/**
+ * @param {string} projectFolder
+ * @param {string} name
+ * @param {string} hostName
+ */
export function applyNameToProject(projectFolder: string, name: string, hostName: string) {
console.log(chalk.cyan(`Setting package name ${name}...`));
diff --git a/packages/sitecore-jss-cli/src/micro-manifest.ts b/packages/sitecore-jss-cli/src/micro-manifest.ts
index 44329f284c..fb63046f99 100644
--- a/packages/sitecore-jss-cli/src/micro-manifest.ts
+++ b/packages/sitecore-jss-cli/src/micro-manifest.ts
@@ -1,4 +1,8 @@
-import { packageDeploy, resolveScJssConfig, verifySetup } from '@sitecore-jss/sitecore-jss-dev-tools';
+import {
+ packageDeploy,
+ resolveScJssConfig,
+ verifySetup,
+} from '@sitecore-jss/sitecore-jss-dev-tools';
import fs from 'fs';
import path from 'path';
import tmp from 'tmp';
@@ -6,7 +10,15 @@ import resolvePackage from './resolve-package';
import { handler as manifestHandler } from './scripts/manifest';
import { handler as packageHandler } from './scripts/package';
-export default async function microManifest(argv: { [key: string]: any }, manifestContents: string) {
+/**
+ * @param {any} argv
+ * @param {string} manifestContents
+ */
+export default async function microManifest(
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ argv: { [key: string]: any },
+ manifestContents: string
+) {
verifySetup();
const packageJson = await resolvePackage();
@@ -18,13 +30,12 @@ export default async function microManifest(argv: { [key: string]: any }, manife
throw new Error('App Name was not defined as a parameter or in the package.json config');
}
- const jssConfig = await resolveScJssConfig({ configPath: argv.config });
+ const jssConfig = await resolveScJssConfig({ configPath: argv.config as string });
if (!argv.deployUrl) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const legacyConfig = jssConfig.sitecore as any;
- argv.deployUrl = legacyConfig.shipUrl
- ? legacyConfig.shipUrl
- : jssConfig.sitecore.deployUrl;
+ argv.deployUrl = legacyConfig.shipUrl ? legacyConfig.shipUrl : jssConfig.sitecore.deployUrl;
}
if (!argv.deployUrl) {
throw new Error('deployUrl was not defined as a parameter or in the scjssconfig.json file');
@@ -32,7 +43,6 @@ export default async function microManifest(argv: { [key: string]: any }, manife
if (/\/ship\/services\/package/.test(argv.deployUrl)) {
throw new Error(
- // tslint:disable-next-line:max-line-length
'deployUrl appears to be a Sitecore.Ship endpoint. JSS no longer uses Ship. You will need to reconfigure your endpoint to the JSS deploy service and provide an app shared secret to deploy.'
);
}
@@ -44,13 +54,17 @@ export default async function microManifest(argv: { [key: string]: any }, manife
throw new Error('deploySecret was not defined as a parameter or in the scjssconfig.json file');
}
- return new Promise((resolve, reject) => {
+ return new Promise((resolve, reject) => {
tmp.dir({ unsafeCleanup: true }, async (err, tempDir, cleanupTempDir) => {
- if (err) { reject(err); }
+ if (err) {
+ reject(err);
+ }
// generate micro-manifest to deploy with
const manifestFolder = path.join(tempDir, 'manifest');
- if (!fs.existsSync(manifestFolder)) { fs.mkdirSync(manifestFolder); }
+ if (!fs.existsSync(manifestFolder)) {
+ fs.mkdirSync(manifestFolder);
+ }
const manifestArgs = {
manifestSourceFiles: [path.join(manifestFolder, 'tempManifestSource.js')],
@@ -66,7 +80,9 @@ export default async function microManifest(argv: { [key: string]: any }, manife
// run a package deploy of our custom manifest
const packageDir = path.join(tempDir, 'package');
- if (!fs.existsSync(packageDir)) { fs.mkdirSync(packageDir); }
+ if (!fs.existsSync(packageDir)) {
+ fs.mkdirSync(packageDir);
+ }
const packageArgs = {
skipManifest: true,
diff --git a/packages/sitecore-jss-cli/src/resolve-package.ts b/packages/sitecore-jss-cli/src/resolve-package.ts
index a4773496e8..276513bd6e 100644
--- a/packages/sitecore-jss-cli/src/resolve-package.ts
+++ b/packages/sitecore-jss-cli/src/resolve-package.ts
@@ -1,5 +1,6 @@
import resolve from 'resolve';
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default (): Promise =>
new Promise((resolvePromise, rejectPromise) => {
resolve('./package.json', { basedir: process.cwd() }, (error, packageJson) => {
@@ -7,6 +8,7 @@ export default (): Promise =>
console.warn('No package.json could be found in the current directory.');
rejectPromise();
} else {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
resolvePromise(require(packageJson as string));
}
});
diff --git a/packages/sitecore-jss-cli/src/run-package-script.ts b/packages/sitecore-jss-cli/src/run-package-script.ts
index 5eb56ce202..4659178192 100644
--- a/packages/sitecore-jss-cli/src/run-package-script.ts
+++ b/packages/sitecore-jss-cli/src/run-package-script.ts
@@ -3,7 +3,14 @@ import spawn from './spawn';
// runs a package.json script using npm
// uses yarn semantics for args (i.e. pass ['scriptname', '--myarg=value'], no -- needed)
-export default function runPackageScript(args: string[], options?: SpawnSyncOptionsWithStringEncoding) {
+/**
+ * @param {string[]} args
+ * @param {SpawnSyncOptionsWithStringEncoding} [options]
+ */
+export default function runPackageScript(
+ args: string[],
+ options?: SpawnSyncOptionsWithStringEncoding
+) {
// npm needs a -- delimiter before any extra args
const npmArgs = ['run', ...args.slice(0, 1), '--', ...args.slice(1)];
@@ -12,7 +19,14 @@ export default function runPackageScript(args: string[], options?: SpawnSyncOpti
// runs a package.json script using yarn or npm
// uses yarn semantics for args (i.e. pass ['scriptname', '--myarg=value'], no -- needed)
-export function runPackageManagerCommand(npmArgs: string[], options?: SpawnSyncOptionsWithStringEncoding) {
+/**
+ * @param {string[]} npmArgs
+ * @param {SpawnSyncOptionsWithStringEncoding} options
+ */
+export function runPackageManagerCommand(
+ npmArgs: string[],
+ options?: SpawnSyncOptionsWithStringEncoding
+) {
console.log(`> npm ${npmArgs.join(' ')}`);
spawn('npm', npmArgs, options);
}
diff --git a/packages/sitecore-jss-cli/src/scripts/clean.ts b/packages/sitecore-jss-cli/src/scripts/clean.ts
index d39403141d..144ca6e6e2 100644
--- a/packages/sitecore-jss-cli/src/scripts/clean.ts
+++ b/packages/sitecore-jss-cli/src/scripts/clean.ts
@@ -1,3 +1,4 @@
+/* eslint-disable prettier/prettier */
import { clean } from '@sitecore-jss/sitecore-jss-dev-tools';
import resolvePackage from '../resolve-package';
@@ -13,6 +14,10 @@ export const builder = {
},
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
const packageJson = await resolvePackage();
diff --git a/packages/sitecore-jss-cli/src/scripts/create.ts b/packages/sitecore-jss-cli/src/scripts/create.ts
index 35663b6f09..d07bb39f86 100644
--- a/packages/sitecore-jss-cli/src/scripts/create.ts
+++ b/packages/sitecore-jss-cli/src/scripts/create.ts
@@ -1,3 +1,4 @@
+/* eslint-disable prettier/prettier */
import chalk from 'chalk';
import fs from 'fs';
import path from 'path';
@@ -7,6 +8,9 @@ import { GitHubSource } from '../create/create.source.github';
import { runPackageManagerCommand } from '../run-package-script';
import spawn from '../spawn';
+/**
+ * @param {any} yargs
+ */
export function builder(yargs: Argv) {
return yargs.command(
'create ',
@@ -54,13 +58,16 @@ export function builder(yargs: Argv) {
.option('proxy', {
requiresArg: false,
type: 'string',
- describe:
- 'Specify a HTTP proxy when downloading templates.',
+ describe: 'Specify a HTTP proxy when downloading templates.',
}),
handler
);
}
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function handler(argv: any) {
const newProjectPath = path.join(process.cwd(), argv.name);
const createScriptPath = path.join(newProjectPath, 'jss-create.js');
@@ -88,14 +95,12 @@ async function handler(argv: any) {
}
nextStepsList.push(`* Connect to Sitecore with ${chalk.green('jss setup')} (optional)`);
- nextStepsList.push(`* Check out the JSS documentation at https://jss.sitecore.net`);
+ nextStepsList.push('* Check out the JSS documentation at https://jss.sitecore.net');
if (!fs.existsSync(createScriptPath)) {
console.warn(
chalk.yellow(
- `Template ${
- argv.template
- } did not have a jss-create.js in its root to invoke. No template configuration will be performed.`
+ `Template ${argv.template} did not have a jss-create.js in its root to invoke. No template configuration will be performed.`
)
);
} else {
@@ -109,6 +114,10 @@ async function handler(argv: any) {
nextSteps(argv.name, nextStepsList);
}
+/**
+ * @param {string} name
+ * @param {string} proposedPath
+ */
function checkName(name: string, proposedPath: string) {
if (!/^[a-z\-_.]+$/.test(name)) {
console.error(
@@ -127,6 +136,9 @@ function checkName(name: string, proposedPath: string) {
}
}
+/**
+ * @param {string} projectFolder
+ */
function installPackages(projectFolder: string) {
console.log(chalk.cyan('Installing packages...'));
runPackageManagerCommand(['install'], { cwd: projectFolder, encoding: 'utf8' });
@@ -159,6 +171,10 @@ function installPackages(projectFolder: string) {
}
}
+/**
+ * @param {string} name
+ * @param {string[]} nextStepsArray
+ */
function nextSteps(name: string, nextStepsArray: string[]) {
console.log(chalk.red(' -/oyhdmNNNNmdhyo/- '));
console.log(chalk.red(' :sdMMMMMMMMMMMMMMMMMMMMds: '));
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.app.ts b/packages/sitecore-jss-cli/src/scripts/deploy.app.ts
index e6a51ec458..42231b1534 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.app.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.app.ts
@@ -11,6 +11,10 @@ export const builder = {
...filesBuilder,
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
return itemsHandler(argv)
.then(() => filesHandler(argv))
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts
index 978ec9f0dc..807f20d97e 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts
@@ -3,37 +3,44 @@ import { Argv } from '../../node_modules/@types/yargs';
import microManifest from '../micro-manifest';
import { args as templateArgs } from './deploy.template';
+/**
+ * @param {Argv} yargs
+ */
export default function builder(yargs: Argv) {
return yargs.command(
'component ',
- // tslint:disable-next-line:max-line-length
'Deploys a new component (or updates an existing component) to the Sitecore server when using Sitecore-first development. `jss deploy component --help` for options.',
args,
handler
);
}
+/**
+ * @param {Argv} yargs
+ */
export function args(yargs: Argv) {
return templateArgs(yargs)
.option('allowedPlaceholders', {
requiresArg: false,
type: 'array',
describe:
- // tslint:disable-next-line:max-line-length
'The placeholder name(s) to allow the rendering to be placed in. For example --allowedPlaceholders Foo or --allowedPlaceholders Foo Bar',
})
.option('exposesPlaceholders', {
requiresArg: false,
type: 'array',
describe:
- // tslint:disable-next-line:max-line-length
'The names of any placeholders that are exposed on this component (to place other components in). This will cause placeholder settings items to be generated for them.',
});
}
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function handler(argv: any) {
// create micro-manifest to deploy from
- const fields: Array<{ name: string, type: string }> = [];
+ const fields: Array<{ name: string; type: string }> = [];
if (argv.fields && argv.fields.length > 0) {
argv.fields.forEach((field: string) => {
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts
index 047ae4afb8..bd805593bc 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts
@@ -1,3 +1,4 @@
+/* eslint-disable prettier/prettier */
import { deploy, verifySetup, resolveScJssConfig } from '@sitecore-jss/sitecore-jss-dev-tools';
import path from 'path';
import resolvePackage from '../resolve-package';
@@ -18,17 +19,20 @@ export const builder = {
requiresArg: false,
type: 'string',
describe:
- // tslint:disable-next-line:max-line-length
'Destination path to deploy to. Defaults to the \'instancePath\' set in scjssconfig.json, combined with the \'sitecoreConfigPath\' setting from package.json.',
- },
- config: {
- requiresArg: false,
- type: 'string',
- describe: 'Path to scjssconfig file.',
- default: './scjssconfig.json'
- }
+ },
+ config: {
+ requiresArg: false,
+ type: 'string',
+ describe: 'Path to scjssconfig file.',
+ default: './scjssconfig.json',
+ },
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
verifySetup();
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts
index 8b34c70b0a..9e96963e3e 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts
@@ -1,3 +1,4 @@
+/* eslint-disable prettier/prettier */
import { deploy, verifySetup, resolveScJssConfig } from '@sitecore-jss/sitecore-jss-dev-tools';
import fs from 'fs';
import path from 'path';
@@ -7,7 +8,6 @@ import runPackageScript from '../run-package-script';
export const command = 'files';
export const describe =
- // tslint:disable-next-line:max-line-length
'Deploys the app\'s build artifact files to the Sitecore server using a direct file copy (no Sitecore items will be deployed). `jss deploy files --help` for options.';
export const builder = {
@@ -21,15 +21,14 @@ export const builder = {
requiresArg: false,
type: 'string',
describe:
- // tslint:disable-next-line:max-line-length
'Destination path to deploy to. Defaults to the \'instancePath\' set in scjssconfig.json, combined with the \'sitecoreDistPath\' setting from package.json.',
- },
- config: {
- requiresArg: false,
- type: 'string',
- describe: 'Path to scjssconfig file.',
- default: './scjssconfig.json'
- },
+ },
+ config: {
+ requiresArg: false,
+ type: 'string',
+ describe: 'Path to scjssconfig file.',
+ default: './scjssconfig.json',
+ },
exclude: {
requiresArg: false,
type: 'array',
@@ -47,7 +46,6 @@ export const builder = {
requiresArg: false,
type: 'string',
describe:
- // tslint:disable-next-line:max-line-length
'Name of the npm script to run to perform a build before deploying. To skip running any script, use --skipBuild or pass the argument with a blank value.',
default: 'build',
},
@@ -60,6 +58,10 @@ export const builder = {
},
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
verifySetup();
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts
index 14f13d66f2..4b979b4f7e 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts
@@ -1,4 +1,9 @@
-import { packageDeploy, verifySetup, resolveScJssConfig } from '@sitecore-jss/sitecore-jss-dev-tools';
+/* eslint-disable prettier/prettier */
+import {
+ packageDeploy,
+ verifySetup,
+ resolveScJssConfig,
+} from '@sitecore-jss/sitecore-jss-dev-tools';
import resolvePackage from '../resolve-package';
import { builder as packageBuilder, handler as packageHandler } from './package';
@@ -32,16 +37,15 @@ export const builder = {
requiresArgs: false,
type: 'boolean',
describe:
- // tslint:disable-next-line:max-line-length
'If true, skips build, manifest, and packaging steps. This can be used to consume existing output from jss package (via the packageOutputPath parameter) without rebuilding it.',
default: false,
- },
- config: {
- requiresArg: false,
- type: 'string',
- describe: 'Path to scjssconfig file.',
- default: './scjssconfig.json'
- },
+ },
+ config: {
+ requiresArg: false,
+ type: 'string',
+ describe: 'Path to scjssconfig file.',
+ default: './scjssconfig.json',
+ },
proxy: {
requiresArgs: false,
type: 'string',
@@ -50,11 +54,16 @@ export const builder = {
acceptCertificate: {
requiresArgs: false,
type: 'string',
- describe: 'Whitelists a specific SSL certificate thumbprint, regardless of normal SSL validation. Useful for self-signed certificates.',
+ describe:
+ 'Whitelists a specific SSL certificate thumbprint, regardless of normal SSL validation. Useful for self-signed certificates.',
},
...packageBuilder,
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
verifySetup();
@@ -70,10 +79,9 @@ export async function handler(argv: any) {
const jssConfig = await resolveScJssConfig({ configPath: argv.config });
if (!argv.deployUrl) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const legacyConfig = jssConfig.sitecore as any;
- argv.deployUrl = legacyConfig.shipUrl
- ? legacyConfig.shipUrl
- : jssConfig.sitecore.deployUrl;
+ argv.deployUrl = legacyConfig.shipUrl ? legacyConfig.shipUrl : jssConfig.sitecore.deployUrl;
}
if (!argv.deployUrl) {
throw new Error('deployUrl was not defined as a parameter or in the scjssconfig.json file');
@@ -81,7 +89,6 @@ export async function handler(argv: any) {
if (/\/ship\/services\/package/.test(argv.deployUrl)) {
throw new Error(
- // tslint:disable-next-line:max-line-length
'deployUrl appears to be a Sitecore.Ship endpoint. JSS no longer uses Ship. You will need to reconfigure your endpoint to the JSS deploy service and provide an app shared secret to deploy.'
);
}
@@ -93,7 +100,7 @@ export async function handler(argv: any) {
throw new Error('deploySecret was not defined as a parameter or in the scjssconfig.json file');
}
- let continuation: Promise = Promise.resolve();
+ let continuation: Promise = Promise.resolve();
if (!argv.skipPackage) {
continuation = packageHandler(argv);
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.package.ts b/packages/sitecore-jss-cli/src/scripts/deploy.package.ts
index fb6ab6cac1..ef9e380c63 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.package.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.package.ts
@@ -17,6 +17,9 @@ export const builder = {
...packageBuilder,
};
+/**
+ * Deploy package handler
+ */
export async function handler() {
console.error('jss deploy package is no longer used. Use jss deploy app instead.');
process.exit(1);
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts
index 8848bc48e9..1e47caef9e 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts
@@ -1,17 +1,23 @@
+/* eslint-disable prettier/prettier */
import chalk from 'chalk';
import { Argv } from '../../node_modules/@types/yargs';
import microManifest from '../micro-manifest';
+/**
+ * @param {Argv} yargs
+ */
export default function builder(yargs: Argv) {
return yargs.command(
'template ',
- // tslint:disable-next-line:max-line-length
'Deploys a new template (or updates an existing template) to the Sitecore server when using Sitecore-first development. `jss deploy template --help` for options.',
args,
handler
);
}
+/**
+ * @param {Argv} yargs
+ */
export function args(yargs: Argv) {
return yargs
.positional('name', {
@@ -27,7 +33,6 @@ export function args(yargs: Argv) {
requiresArg: false,
type: 'array',
describe:
- // tslint:disable-next-line:max-line-length
'Creates template fields. Fields can be either a plain name, or name:fieldType. For example, --fields Foo Bar or --fields Foo "Bar Bas:Rich Text"',
})
.option('icon', {
@@ -39,13 +44,13 @@ export function args(yargs: Argv) {
requiresArg: false,
type: 'string',
describe: 'The name of the app. Defaults to the package.json config value.',
- })
- .option('config', {
- requiresArg: false,
- type: 'string',
- describe: 'Path to scjssconfig file.',
- default: './scjssconfig.json'
- })
+ })
+ .option('config', {
+ requiresArg: false,
+ type: 'string',
+ describe: 'Path to scjssconfig file.',
+ default: './scjssconfig.json',
+ })
.option('deployUrl', {
requiresArg: false,
type: 'string',
@@ -63,13 +68,17 @@ export function args(yargs: Argv) {
requiresArg: false,
type: 'string',
describe:
- 'Whitelists a specific SSL certificate thumbprint, regardless of normal SSL validation. Useful for self-signed certificates.'
+ 'Whitelists a specific SSL certificate thumbprint, regardless of normal SSL validation. Useful for self-signed certificates.',
});
}
+/**
+ * @param {Argv} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function handler(argv: any) {
// create micro-manifest to deploy from
- const fields: Array<{ name: string, type: string }> = [];
+ const fields: Array<{ name: string; type: string }> = [];
if (argv.fields && argv.fields.length > 0) {
argv.fields.forEach((field: string) => {
diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.ts b/packages/sitecore-jss-cli/src/scripts/deploy.ts
index d2ca3dd01b..ea2c990fa7 100644
--- a/packages/sitecore-jss-cli/src/scripts/deploy.ts
+++ b/packages/sitecore-jss-cli/src/scripts/deploy.ts
@@ -1,3 +1,5 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+
import { Argv } from '../../node_modules/@types/yargs';
import * as app from './deploy.app';
import component from './deploy.component';
@@ -7,6 +9,9 @@ import * as items from './deploy.items';
import * as pkg from './deploy.package';
import template from './deploy.template';
+/**
+ * @param {Argv} yargs
+ */
export function builder(yargs: Argv) {
return yargs
.command({
@@ -27,6 +32,7 @@ export function builder(yargs: Argv) {
return innerYargs;
},
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
handler: () => {},
})
.demandCommand(2);
diff --git a/packages/sitecore-jss-cli/src/scripts/easter-egg.ts b/packages/sitecore-jss-cli/src/scripts/easter-egg.ts
index 57f57b59a5..27e30a5127 100644
--- a/packages/sitecore-jss-cli/src/scripts/easter-egg.ts
+++ b/packages/sitecore-jss-cli/src/scripts/easter-egg.ts
@@ -1,9 +1,13 @@
+/* eslint-disable prettier/prettier */
export const command = 'whats-the-password';
export const describe = false;
export const builder = {};
+/**
+ * Easter egg handler
+ */
export function handler() {
console.log('Why it\'s b, of course.');
}
diff --git a/packages/sitecore-jss-cli/src/scripts/elephant.ts b/packages/sitecore-jss-cli/src/scripts/elephant.ts
index 76bf85a210..2b9877e315 100644
--- a/packages/sitecore-jss-cli/src/scripts/elephant.ts
+++ b/packages/sitecore-jss-cli/src/scripts/elephant.ts
@@ -4,6 +4,9 @@ export const describe = false;
export const builder = {};
+/**
+ * Elephant handler
+ */
export function handler() {
console.log(` _.-- ,.--.
.' .' /
diff --git a/packages/sitecore-jss-cli/src/scripts/index.global.ts b/packages/sitecore-jss-cli/src/scripts/index.global.ts
index 6a74ef3546..763f7bd7fb 100644
--- a/packages/sitecore-jss-cli/src/scripts/index.global.ts
+++ b/packages/sitecore-jss-cli/src/scripts/index.global.ts
@@ -5,8 +5,4 @@ import * as create from './create';
import * as easterEgg from './easter-egg';
import * as elephant from './elephant';
-export {
- easterEgg,
- elephant,
- create as any
-};
+export { easterEgg, elephant, create as any };
diff --git a/packages/sitecore-jss-cli/src/scripts/index.ts b/packages/sitecore-jss-cli/src/scripts/index.ts
index 7133e1a90b..4dec2fe43c 100644
--- a/packages/sitecore-jss-cli/src/scripts/index.ts
+++ b/packages/sitecore-jss-cli/src/scripts/index.ts
@@ -10,12 +10,4 @@ import * as manifest from './manifest';
import * as pkg from './package';
import * as setup from './setup';
-export {
- easterEgg,
- elephant,
- setup,
- deploy,
- pkg,
- manifest,
- clean
-};
+export { easterEgg, elephant, setup, deploy, pkg, manifest, clean };
diff --git a/packages/sitecore-jss-cli/src/scripts/manifest.ts b/packages/sitecore-jss-cli/src/scripts/manifest.ts
index 5e55d021bf..4198a10d66 100644
--- a/packages/sitecore-jss-cli/src/scripts/manifest.ts
+++ b/packages/sitecore-jss-cli/src/scripts/manifest.ts
@@ -9,7 +9,6 @@ import resolvePackage from '../resolve-package';
export const command = 'manifest';
export const describe =
- // tslint:disable-next-line:max-line-length
'Generates a JSS manifest file which defines app assets to import into Sitecore. Nothing is deployed or added to a deployment package; this just collects assets. See `jss package`, which takes the manifest and turns it into a deployable package. `jss manifest --help` for options.';
export const builder = {
@@ -28,7 +27,6 @@ export const builder = {
requiresArgs: false,
type: 'string',
describe:
- // tslint:disable-next-line:max-line-length
'A JS module to require before processing the manifest. This may initialize a custom compiler (Babel, TypeScript), perform init tasks, etc.',
default: './sitecore/definitions/config.js',
},
@@ -63,7 +61,6 @@ export const builder = {
requiresArgs: false,
type: 'array',
describe:
- // tslint:disable-next-line:max-line-length
'Sets the root placeholder name(s) for the app. If set, overrides root placeholders set in the package.json',
alias: 'p',
},
@@ -71,7 +68,6 @@ export const builder = {
requiresArgs: false,
type: 'boolean',
describe:
- // tslint:disable-next-line:max-line-length
'Causes the JSS import to run as a wipe + recreate of any existing app items. Pass --unattendedWipe in addition to bypass interactive confirmation for CI scenarios.',
alias: 'w',
default: false,
@@ -102,6 +98,10 @@ export const builder = {
},
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
const packageJson = await resolvePackage();
@@ -110,7 +110,6 @@ export async function handler(argv: any) {
language = packageJson.config.language;
}
if (!language) {
- // tslint:disable-next-line:no-string-throw
throw 'Language was not defined as a parameter or in the package.json { config: { language: "en" } }';
}
@@ -119,7 +118,6 @@ export async function handler(argv: any) {
appName = packageJson.config.appName;
}
if (!appName) {
- // tslint:disable-next-line:no-string-throw
throw '--appName was not defined as a parameter or in the package.json { config: { appName: "myJssAppName" } }';
}
@@ -133,7 +131,6 @@ export async function handler(argv: any) {
rootPlaceholders = packageJson.config.rootPlaceholders;
}
if (!rootPlaceholders) {
- // tslint:disable-next-line:no-string-throw
throw '--rootPlaceholders was not defined as a parameter or in the package.json { config: { rootPlaceholders: ["ph-name"] } }';
}
diff --git a/packages/sitecore-jss-cli/src/scripts/package.ts b/packages/sitecore-jss-cli/src/scripts/package.ts
index 93b41a71b0..a672c1d435 100644
--- a/packages/sitecore-jss-cli/src/scripts/package.ts
+++ b/packages/sitecore-jss-cli/src/scripts/package.ts
@@ -5,7 +5,6 @@ import { builder as manifestBuilder, handler as manifestHandler } from './manife
export const command = 'package';
export const describe =
- // tslint:disable-next-line:max-line-length
'Generates a JSS manifest package file that can be deployed to Sitecore. Nothing is deployed. See also jss deploy package, which takes the package and deploys it to Sitecore. `jss package --help` for options.';
export const builder = {
@@ -19,7 +18,6 @@ export const builder = {
requiresArgs: false,
type: 'boolean',
describe:
- // tslint:disable-next-line:max-line-length
'If true, skips manifest generation. This can be used to consume existing output from jss manifest (via the manifestOutputPath parameter) without rebuilding it.',
default: false,
},
@@ -27,6 +25,10 @@ export const builder = {
...manifestBuilder,
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
const packageJson = await resolvePackage();
@@ -37,7 +39,7 @@ export async function handler(argv: any) {
throw new Error('App Name was not defined as a parameter or in the package.json config');
}
- let continuation: Promise = Promise.resolve();
+ let continuation: Promise = Promise.resolve();
// if we need items, generate the manifest
if (!argv.noItems && !argv.skipManifest) {
diff --git a/packages/sitecore-jss-cli/src/scripts/setup.ts b/packages/sitecore-jss-cli/src/scripts/setup.ts
index 412dbe9bcc..33ead5b8d5 100644
--- a/packages/sitecore-jss-cli/src/scripts/setup.ts
+++ b/packages/sitecore-jss-cli/src/scripts/setup.ts
@@ -1,3 +1,4 @@
+/* eslint-disable prettier/prettier */
import { setup } from '@sitecore-jss/sitecore-jss-dev-tools';
export const command = 'setup';
@@ -50,6 +51,10 @@ export const builder = {
},
};
+/**
+ * @param {any} argv
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handler(argv: any) {
setup(!argv.nonInteractive, argv.outputFile, argv);
}
diff --git a/packages/sitecore-jss-cli/src/spawn.ts b/packages/sitecore-jss-cli/src/spawn.ts
index 070f2fb37d..edf718a8ea 100644
--- a/packages/sitecore-jss-cli/src/spawn.ts
+++ b/packages/sitecore-jss-cli/src/spawn.ts
@@ -1,7 +1,16 @@
import { SpawnSyncOptionsWithStringEncoding } from 'child_process';
import spawn from 'cross-spawn';
-export default function(command: string, args: string[], options?: SpawnSyncOptionsWithStringEncoding) {
+/**
+ * @param {string} command
+ * @param {string[]} args
+ * @param {SpawnSyncOptionsWithStringEncoding} options
+ */
+export default function(
+ command: string,
+ args: string[],
+ options?: SpawnSyncOptionsWithStringEncoding
+) {
const result = spawn.sync(command, args, Object.assign({ stdio: 'inherit' }, options));
if (result.signal) {
diff --git a/packages/sitecore-jss-dev-tools/.eslintrc b/packages/sitecore-jss-dev-tools/.eslintrc
new file mode 100644
index 0000000000..5c9d573e39
--- /dev/null
+++ b/packages/sitecore-jss-dev-tools/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "../../.eslintrc",
+ "rules": {
+ "@typescript-eslint/explicit-module-boundary-types": "off"
+ }
+}
\ No newline at end of file
diff --git a/packages/sitecore-jss-dev-tools/.npmignore b/packages/sitecore-jss-dev-tools/.npmignore
index 7d2dda9ed6..56a24e1aa2 100644
--- a/packages/sitecore-jss-dev-tools/.npmignore
+++ b/packages/sitecore-jss-dev-tools/.npmignore
@@ -4,12 +4,11 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
-tslint.json
npm-debug*
*.log
!/types
diff --git a/packages/sitecore-jss-dev-tools/package-lock.json b/packages/sitecore-jss-dev-tools/package-lock.json
index 8fbd796d4a..586de6f107 100644
--- a/packages/sitecore-jss-dev-tools/package-lock.json
+++ b/packages/sitecore-jss-dev-tools/package-lock.json
@@ -30,6 +30,53 @@
"js-tokens": "^4.0.0"
}
},
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ }
+ }
+ },
"@nodelib/fs.scandir": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
@@ -316,6 +363,18 @@
"negotiator": "0.6.2"
}
},
+ "acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
+ },
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
"aggregate-error": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
@@ -433,6 +492,12 @@
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
@@ -517,6 +582,12 @@
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true
+ },
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@@ -726,6 +797,12 @@
"type-detect": "^4.0.0"
}
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+ "dev": true
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -788,6 +865,15 @@
"path-type": "^4.0.0"
}
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@@ -813,6 +899,15 @@
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -920,11 +1015,256 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true
+ },
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
@@ -1000,6 +1340,12 @@
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "dev": true
+ },
"fastq": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz",
@@ -1008,6 +1354,15 @@
"reusify": "^1.0.4"
}
},
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -1048,6 +1403,22 @@
"is-buffer": "~2.0.3"
}
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@@ -1099,6 +1470,12 @@
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -1140,6 +1517,23 @@
"is-glob": "^4.0.1"
}
},
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ },
+ "dependencies": {
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
"globby": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz",
@@ -1259,6 +1653,22 @@
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw=="
},
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ }
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "dev": true
+ },
"indent-string": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
@@ -1461,6 +1871,12 @@
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -1497,6 +1913,16 @@
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
"dev": true
},
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
"lines-and-columns": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
@@ -1585,6 +2011,15 @@
"integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==",
"dev": true
},
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
"make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
@@ -1917,6 +2352,12 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
@@ -2021,6 +2462,20 @@
"wrappy": "1"
}
},
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@@ -2053,6 +2508,15 @@
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
"parse-json": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
@@ -2118,6 +2582,18 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
},
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise.allsettled": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz",
@@ -2282,6 +2758,12 @@
"strip-indent": "^3.0.0"
}
},
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"request": {
"version": "2.88.2",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
@@ -2336,6 +2818,12 @@
"path-parse": "^1.0.6"
}
},
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ },
"reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -2471,6 +2959,49 @@
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -2607,6 +3138,64 @@
"has-flag": "^3.0.0"
}
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -2661,6 +3250,15 @@
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
@@ -2721,6 +3319,12 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -2797,6 +3401,12 @@
}
}
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
+ },
"workerpool": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz",
@@ -2825,6 +3435,12 @@
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
"yargs": {
"version": "14.2.3",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz",
diff --git a/packages/sitecore-jss-dev-tools/package.json b/packages/sitecore-jss-dev-tools/package.json
index c58ea25f50..98fc652461 100644
--- a/packages/sitecore-jss-dev-tools/package.json
+++ b/packages/sitecore-jss-dev-tools/package.json
@@ -6,7 +6,7 @@
"build": "npm run clean && tsc",
"watch": "npm run build -- --watch",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ../../tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
"prepublishOnly": "npm run build",
"coverage": "nyc --require ts-node/register npm test"
@@ -60,6 +60,7 @@
"chai": "^4.2.0",
"cross-env": "^6.0.3",
"del-cli": "^3.0.1",
+ "eslint": "^7.15.0",
"mocha": "^8.1.3",
"sinon": "^7.5.0",
"ts-node": "^8.4.1",
diff --git a/packages/sitecore-jss-dev-tools/src/bin/deploy.ts b/packages/sitecore-jss-dev-tools/src/bin/deploy.ts
index d1e21ff155..24e63b5d80 100644
--- a/packages/sitecore-jss-dev-tools/src/bin/deploy.ts
+++ b/packages/sitecore-jss-dev-tools/src/bin/deploy.ts
@@ -4,7 +4,7 @@ import path from 'path';
import { deploy, DeployOptions } from '../deploy';
import { replaceConfigTokens } from '../setup/jss-config';
-const options: any = {};
+const options = {} as DeployOptions;
process.argv.forEach((value, index, map) => {
switch (value) {
diff --git a/packages/sitecore-jss-dev-tools/src/clean.ts b/packages/sitecore-jss-dev-tools/src/clean.ts
index 0fe8231695..eda5517e5f 100644
--- a/packages/sitecore-jss-dev-tools/src/clean.ts
+++ b/packages/sitecore-jss-dev-tools/src/clean.ts
@@ -4,6 +4,9 @@ export interface CleanOptions {
path: string;
}
+/**
+ * @param {CleanOptions} options
+ */
export function clean(options: CleanOptions) {
if (!options.path) {
throw new Error('please specify path via options.path argument');
diff --git a/packages/sitecore-jss-dev-tools/src/deploy.ts b/packages/sitecore-jss-dev-tools/src/deploy.ts
index f5d83fe78b..93ae8fffcf 100644
--- a/packages/sitecore-jss-dev-tools/src/deploy.ts
+++ b/packages/sitecore-jss-dev-tools/src/deploy.ts
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import del from 'del';
-import fsExtra from 'fs-extra';
+import fsExtra, { CopyOptionsSync } from 'fs-extra';
import path from 'path';
export interface DeployOptions {
@@ -10,6 +10,9 @@ export interface DeployOptions {
clean?: boolean;
}
+/**
+ * @param {DeployOptions} options
+ */
export function deploy(options: DeployOptions) {
let createdDestination = false;
@@ -19,7 +22,7 @@ export function deploy(options: DeployOptions) {
fsExtra.ensureDirSync(options.destinationPath);
}
- const copyOptions: any = {};
+ const copyOptions: CopyOptionsSync = {};
if (options.excludeFile) {
if (typeof options.excludeFile === 'string') {
copyOptions.filter = (src: string) => {
@@ -58,7 +61,9 @@ export function deploy(options: DeployOptions) {
del.sync([`${options.destinationPath}/**`, `!${options.destinationPath}`], { force: true });
}
- console.log(`Copying ${chalk.green(options.sourcePath)} to ${chalk.green(options.destinationPath)}...`);
+ console.log(
+ `Copying ${chalk.green(options.sourcePath)} to ${chalk.green(options.destinationPath)}...`
+ );
fsExtra.copySync(options.sourcePath, options.destinationPath, copyOptions);
console.log();
diff --git a/packages/sitecore-jss-dev-tools/src/digest.test.ts b/packages/sitecore-jss-dev-tools/src/digest.test.ts
index 506bd24451..391fe0d489 100644
--- a/packages/sitecore-jss-dev-tools/src/digest.test.ts
+++ b/packages/sitecore-jss-dev-tools/src/digest.test.ts
@@ -5,21 +5,23 @@ describe('digest', () => {
describe('digest', () => {
it('should generate expected file hash', () => {
const inputPath = './src/testData/digest/hello.txt';
- return digest(inputPath).then((result) => expect(result).to.equal('uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek='));
+ return digest(inputPath).then((result) =>
+ expect(result).to.equal('uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=')
+ );
});
});
describe('hmac', () => {
it('should generate expected HMAC with one factor', () => {
const secret = 'movezig';
- const factors = [ 'hello' ];
+ const factors = ['hello'];
expect(hmac(factors, secret)).to.equal('sMbb3tOTS9cPb2o0KAfDrBODcdvp8EOW7P9u2TpPvl8=');
});
it('should generate expected lowercase HMAC with uppercase input', () => {
const secret = 'movezig';
- const factors = [ 'HELLO', 'wOrlD' ];
- const lcFactors = [ 'hello', 'world' ];
+ const factors = ['HELLO', 'wOrlD'];
+ const lcFactors = ['hello', 'world'];
expect(hmac(factors, secret)).to.equal(hmac(lcFactors, secret));
});
});
diff --git a/packages/sitecore-jss-dev-tools/src/digest.ts b/packages/sitecore-jss-dev-tools/src/digest.ts
index f2dc0dff4a..abdfed6a81 100644
--- a/packages/sitecore-jss-dev-tools/src/digest.ts
+++ b/packages/sitecore-jss-dev-tools/src/digest.ts
@@ -1,18 +1,24 @@
-
import { createHash, createHmac } from 'crypto';
import { createReadStream } from 'fs';
+/**
+ * @param {string} path
+ */
export function digest(path: string): Promise {
return new Promise((resolve, reject) => {
const hash = createHash('sha256');
createReadStream(path)
.pipe(hash.setEncoding('base64'))
- .on('error', (err: any) => reject(err))
+ .on('error', (err: unknown) => reject(err))
.on('finish', () => resolve(hash.read() as string));
});
}
+/**
+ * @param {string[]} factors
+ * @param {string} secret
+ */
export function hmac(factors: string[], secret: string) {
const mac = createHmac('sha256', secret);
mac.setEncoding('base64');
diff --git a/packages/sitecore-jss-dev-tools/src/disconnected-server/DisconnectedLayoutServiceOptions.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/DisconnectedLayoutServiceOptions.ts
index 7cf8740353..831424c4de 100644
--- a/packages/sitecore-jss-dev-tools/src/disconnected-server/DisconnectedLayoutServiceOptions.ts
+++ b/packages/sitecore-jss-dev-tools/src/disconnected-server/DisconnectedLayoutServiceOptions.ts
@@ -1,3 +1,5 @@
+/* eslint-disable */
+
import { ManifestInstance } from '@sitecore-jss/sitecore-jss-manifest';
export type CustomizeRenderFunction = (
diff --git a/packages/sitecore-jss-dev-tools/src/disconnected-server/create-default-disconnected-server.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/create-default-disconnected-server.ts
index b3fdec5f1a..cc03bb0306 100644
--- a/packages/sitecore-jss-dev-tools/src/disconnected-server/create-default-disconnected-server.ts
+++ b/packages/sitecore-jss-dev-tools/src/disconnected-server/create-default-disconnected-server.ts
@@ -3,7 +3,11 @@ import Express from 'express';
import { join } from 'path';
import { ManifestManager } from '../manifest-manager';
import { createDisconnectedDictionaryService } from './dictionary-service';
-import { CustomizeContextFunction, CustomizeRenderFunction, CustomizeRouteFunction } from './DisconnectedLayoutServiceOptions';
+import {
+ CustomizeContextFunction,
+ CustomizeRenderFunction,
+ CustomizeRouteFunction,
+} from './DisconnectedLayoutServiceOptions';
import { createDisconnectedLayoutService } from './layout-service';
export interface DisconnectedServerOptions {
@@ -34,6 +38,7 @@ export interface DisconnectedServerOptions {
* Express-like server instance to attach to. Defaults to a new Express instance if not passed.
* Extra middleware, etc can be attached before passing the option.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
server?: any;
/**
@@ -50,6 +55,7 @@ export interface DisconnectedServerOptions {
* Hook function that is called after the disconnected server middleware is registered with the server,
* but before the server starts listening. Useful to add your own middleware after the disconnected middleware.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
afterMiddlewareRegistered?: (server: any) => void;
/**
@@ -88,6 +94,9 @@ export interface DisconnectedServerOptions {
customizeRendering?: CustomizeRenderFunction;
}
+/**
+ * @param {DisconnectedServerOptions} options
+ */
export function createDefaultDisconnectedServer(options: DisconnectedServerOptions) {
let app = options.server;
@@ -99,7 +108,7 @@ export function createDefaultDisconnectedServer(options: DisconnectedServerOptio
// for GA the appRoot was expected to be $app/scripts
// which didn't make sense. This allows both sane app roots
// and GA-style app roots to keep working.
- if(options.appRoot.endsWith('scripts')) {
+ if (options.appRoot.endsWith('scripts')) {
options.appRoot = join(options.appRoot, '..');
}
@@ -108,7 +117,9 @@ export function createDefaultDisconnectedServer(options: DisconnectedServerOptio
// to keep working even with appRoot now relative to the actual app root
// We do this by stripping '../' from path leads, making the path './data' instead - theoretically, the chance of
// wanting to actually escape from the app root entirely otherwise is awfully low.
- options.watchPaths = options.watchPaths.map(path => path.startsWith('../') ? path.substring(1) : path);
+ options.watchPaths = options.watchPaths.map((path) =>
+ path.startsWith('../') ? path.substring(1) : path
+ );
// the manifest manager maintains the state of the disconnected manifest data during the course of the dev run
// it provides file watching services, and language switching capabilities
@@ -162,7 +173,9 @@ export function createDefaultDisconnectedServer(options: DisconnectedServerOptio
if (options.onListening) {
options.onListening();
} else {
- console.log(`JSS Disconnected-mode Proxy is listening on port ${options.port}. (PID: ${process.pid})`);
+ console.log(
+ `JSS Disconnected-mode Proxy is listening on port ${options.port}. (PID: ${process.pid})`
+ );
}
});
}
diff --git a/packages/sitecore-jss-dev-tools/src/disconnected-server/default-document.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/default-document.ts
index 6a9c0af770..50c7dae52a 100644
--- a/packages/sitecore-jss-dev-tools/src/disconnected-server/default-document.ts
+++ b/packages/sitecore-jss-dev-tools/src/disconnected-server/default-document.ts
@@ -1,3 +1,5 @@
+import { Request, Response, NextFunction } from 'express';
+
/*
Implements middleware that returns the app index.html for route requests
*/
@@ -6,8 +8,13 @@ export interface DefaultDocumentMiddlewareOptions {
indexFilePath: string;
}
-export function createDefaultDocumentMiddleware({ indexFilePath }: DefaultDocumentMiddlewareOptions) {
- return function defaultDocumentMiddleware(req: any, res: any, next: any) {
+/**
+ * @param {DefaultDocumentMiddlewareOptions} config
+ */
+export function createDefaultDocumentMiddleware({
+ indexFilePath,
+}: DefaultDocumentMiddlewareOptions) {
+ return function defaultDocumentMiddleware(req: Request, res: Response, next: NextFunction) {
if (req.path === '/favicon.ico' || req.path.endsWith('.map')) {
next();
return;
diff --git a/packages/sitecore-jss-dev-tools/src/disconnected-server/dictionary-service.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/dictionary-service.ts
index 7a2405f911..2d7fbd23bd 100644
--- a/packages/sitecore-jss-dev-tools/src/disconnected-server/dictionary-service.ts
+++ b/packages/sitecore-jss-dev-tools/src/disconnected-server/dictionary-service.ts
@@ -1,4 +1,6 @@
-import { ManifestInstance } from '@sitecore-jss/sitecore-jss-manifest';
+/* eslint-disable */
+
+import { DictionaryDefinition, ManifestInstance } from '@sitecore-jss/sitecore-jss-manifest';
/*
Implements a fake version of the Sitecore JSS Dictionary Service that is powered by a local manifest file
@@ -10,9 +12,9 @@ export interface DictionaryServiceOutput {
phrases: { [k: string]: string };
}
-function defaultCustomizeDictionary(dictionary: any, language: string, appName: string) {
+function defaultCustomizeDictionary(dictionary: DictionaryDefinition[], language: string, appName: string) {
// turn dictionary from { key: foo, value: bar } into { foo: bar }
- const finalDictionary = dictionary.reduce((result: any, current: { key: string, value: string }) => {
+ const finalDictionary = dictionary.reduce((result: { [key: string]: unknown }, current: { key: string, value: string }) => {
// eslint-disable-next-line no-param-reassign
result[current.key] = current.value;
return result;
@@ -42,7 +44,7 @@ export function createDisconnectedDictionaryService({
customizeDictionary,
manifestLanguageChangeCallback,
}: DisconnectedDictionaryServiceOptions) {
- let currentManifest = manifest;
+ let currentManifest: ManifestInstance = manifest;
const service = {
middleware: async function disconnectedLayoutServiceMiddleware(request: any, response: any) {
@@ -67,7 +69,6 @@ export function createDisconnectedDictionaryService({
console.error(
`> [DICTIONARY] ERROR: Received request for dictionary in ${language} but the manifest data was in ${
currentManifest.language
- // tslint:disable-next-line:max-line-length
}. To enable switching languages at runtime, please pass 'manifestLanguageChangeCallback: function(newLanguage) { return manifestInNewLanguage; }' in the service creation options.`
);
response.sendStatus(404);
diff --git a/packages/sitecore-jss-dev-tools/src/disconnected-server/layout-service.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/layout-service.ts
index d2785d89d4..72c5296d9a 100644
--- a/packages/sitecore-jss-dev-tools/src/disconnected-server/layout-service.ts
+++ b/packages/sitecore-jss-dev-tools/src/disconnected-server/layout-service.ts
@@ -1,11 +1,16 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
import { ManifestInstance, RouteDefinition } from '@sitecore-jss/sitecore-jss-manifest';
import chalk from 'chalk';
-import { CustomizeRenderFunction, DisconnectedLayoutServiceOptions } from './DisconnectedLayoutServiceOptions';
-
-/*
- Implements a fake version of the Sitecore JSS Layout Service that is powered by a local manifest file
-*/
-
+import { Request, Response } from 'express';
+import {
+ CustomizeRenderFunction,
+ DisconnectedLayoutServiceOptions,
+} from './DisconnectedLayoutServiceOptions';
+
+/**
+ * Implements a fake version of the Sitecore JSS Layout Service that is powered by a local manifest file
+ * @param {string} language
+ */
function createDefaultContext(language: string) {
return {
pageEditing: false,
@@ -17,6 +22,10 @@ function createDefaultContext(language: string) {
};
}
+/**
+ * @param {string} routePath
+ * @param {ManifestInstance} manifest
+ */
function getRouteData(routePath: string, manifest: ManifestInstance) {
const pathBits = routePath.split('/').filter((bit: string) => bit && bit.length > 0);
@@ -58,8 +67,10 @@ function getRouteData(routePath: string, manifest: ManifestInstance) {
return currentRoute;
}
+/**
+ * @param {string} dynamicKey
+ */
function extractDynamicPlaceholderKeyDetails(dynamicKey: string) {
- /* tslint:disable max-line-length */
// attempts to match a dynamic placeholder key of the format (key)-{UID}-{index}, e.g. page-content-{BC8C7AB9-6D40-5393-ABDE-6D7DF27F2D3F}-0
const dynamicKeyMatches = /^(.*)-(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})-([0-9]+)$/.exec(
dynamicKey
@@ -84,6 +95,9 @@ function extractDynamicPlaceholderKeyDetails(dynamicKey: string) {
};
}
+/**
+ * @param {string} placeholderKey
+ */
function extractTopLevelPlaceholderDetails(placeholderKey: string) {
let keySegment = placeholderKey;
@@ -106,6 +120,10 @@ function extractTopLevelPlaceholderDetails(placeholderKey: string) {
return extractDynamicPlaceholderKeyDetails(keySegment);
}
+/**
+ * @param {string} placeholderKey
+ * @param {any} resultObject
+ */
function getOrCreatePlaceholderPath(placeholderKey: string, resultObject: any): any {
const placeholderDetails = extractTopLevelPlaceholderDetails(placeholderKey);
@@ -163,6 +181,9 @@ function getOrCreatePlaceholderPath(placeholderKey: string, resultObject: any):
return placeholder;
}
+/**
+ * @param {any} input
+ */
export function remapFieldsArrayToFieldsObject(input: any) {
// fields go from "name: foo, value: bar" to "foo: { value: bar, editable: bar }"
return input.reduce((fieldReduceResult: any, current: any) => {
@@ -219,40 +240,60 @@ export function remapFieldsArrayToFieldsObject(input: any) {
}, {});
}
-function convertManifestLayoutDataToLayoutServiceFormat(manifestLayout: any, placeholders: string[], currentManifest: ManifestInstance, request: any, response: any, customizeHook?: CustomizeRenderFunction) {
+/**
+ * @param {any} manifestLayout
+ * @param {string[]} placeholders
+ * @param {ManifestInstance} currentManifest
+ * @param {any} request
+ * @param {any} response
+ * @param {CustomizeRenderFunction} [customizeHook]
+ */
+function convertManifestLayoutDataToLayoutServiceFormat(
+ manifestLayout: any,
+ placeholders: string[],
+ currentManifest: ManifestInstance,
+ request: any,
+ response: any,
+ customizeHook?: CustomizeRenderFunction
+) {
const result: any = {};
// we sort by placeholder key length to ensure we create the rendering tree in hierarchy order
- manifestLayout
- .forEach((rendering: any) => {
- const placeholder = getOrCreatePlaceholderPath(rendering.placeholderKey, result);
-
- const transformedRendering: any = {
- uid: rendering.uid,
- // shared renderings defined as items instead of on the route will have 'template'; pure renderings will have 'renderingName'
- componentName: rendering.renderingName ? rendering.renderingName : rendering.template,
- dataSource: 'available-in-connected-mode',
- };
-
- if (rendering.renderingParams) {
- // rendering params go from "name: foo, value: bar" to "foo: bar"
- transformedRendering.params = rendering.renderingParams.reduce((reduceResult: any, current: any) => {
+ manifestLayout.forEach((rendering: any) => {
+ const placeholder = getOrCreatePlaceholderPath(rendering.placeholderKey, result);
+
+ const transformedRendering: any = {
+ uid: rendering.uid,
+ // shared renderings defined as items instead of on the route will have 'template'; pure renderings will have 'renderingName'
+ componentName: rendering.renderingName ? rendering.renderingName : rendering.template,
+ dataSource: 'available-in-connected-mode',
+ };
+
+ if (rendering.renderingParams) {
+ // rendering params go from "name: foo, value: bar" to "foo: bar"
+ transformedRendering.params = rendering.renderingParams.reduce(
+ (reduceResult: any, current: any) => {
// eslint-disable-next-line no-param-reassign
reduceResult[current.name] = current.value.toString();
return reduceResult;
- }, {});
- }
+ },
+ {}
+ );
+ }
- if (rendering.dataSource && rendering.dataSource.fields) {
- // fields go from "name: foo, value: bar" to "foo: { value: bar, editable: bar }"
- transformedRendering.fields = remapFieldsArrayToFieldsObject(rendering.dataSource.fields);
- }
+ if (rendering.dataSource && rendering.dataSource.fields) {
+ // fields go from "name: foo, value: bar" to "foo: { value: bar, editable: bar }"
+ transformedRendering.fields = remapFieldsArrayToFieldsObject(rendering.dataSource.fields);
+ }
- const customizeResult = (customizeHook && customizeHook(transformedRendering, rendering, currentManifest, request, response)) || transformedRendering;
+ const customizeResult =
+ (customizeHook &&
+ customizeHook(transformedRendering, rendering, currentManifest, request, response)) ||
+ transformedRendering;
- // adds the rendering object to its placeholder in the LS output
- placeholder.push(customizeResult);
- });
+ // adds the rendering object to its placeholder in the LS output
+ placeholder.push(customizeResult);
+ });
// ensure empty placeholders are defined
placeholders.forEach((key) => {
@@ -264,7 +305,22 @@ function convertManifestLayoutDataToLayoutServiceFormat(manifestLayout: any, pla
return result;
}
-function defaultCustomizeRoute(route: any, language: string, currentManifest: ManifestInstance, request: any, response: any, customizeRendering?: CustomizeRenderFunction) {
+/**
+ * @param {any} route
+ * @param {string} language
+ * @param {ManifestInstance} currentManifest
+ * @param {any} request
+ * @param {any} response
+ * @param {CustomizeRenderFunction} [customizeRendering]
+ */
+function defaultCustomizeRoute(
+ route: any,
+ language: string,
+ currentManifest: ManifestInstance,
+ request: any,
+ response: any,
+ customizeRendering?: CustomizeRenderFunction
+) {
const transformedRoute = Object.assign(
{
databaseName: 'available-in-connected-mode',
@@ -300,6 +356,9 @@ function defaultCustomizeRoute(route: any, language: string, currentManifest: Ma
return transformedRoute;
}
+/**
+ * @param {DisconnectedLayoutServiceOptions} config
+ */
export function createDisconnectedLayoutService({
manifest,
customizeContext,
@@ -312,8 +371,11 @@ export function createDisconnectedLayoutService({
console.log(`🔌 Disconnected ${chalk.red('Layout Service')} initializing...⏳`);
const service = {
- middleware: async function disconnectedLayoutServiceMiddleware(request: any, response: any) {
- const language = request.query.sc_lang ? request.query.sc_lang : 'en';
+ middleware: async function disconnectedLayoutServiceMiddleware(
+ request: Request,
+ response: Response
+ ) {
+ const language = (request.query.sc_lang ? request.query.sc_lang : 'en') as string;
const routePath = request.query.item;
// check to see if the language is different than what we have loaded, and if so change it
@@ -332,9 +394,7 @@ export function createDisconnectedLayoutService({
}
} else {
console.error(
- `> [LAYOUT] ERROR: Received request for layout in ${language} but the manifest data was in ${
- currentManifest.language
- }. To enable switching languages at runtime, please pass 'manifestLanguageChangeCallback: function(newLanguage) { return manifestInNewLanguage; }' in the service creation options.`
+ `> [LAYOUT] ERROR: Received request for layout in ${language} but the manifest data was in ${currentManifest.language}. To enable switching languages at runtime, please pass 'manifestLanguageChangeCallback: function(newLanguage) { return manifestInNewLanguage; }' in the service creation options.`
);
response.sendStatus(404);
return;
@@ -349,11 +409,18 @@ export function createDisconnectedLayoutService({
}
// lookup route data
- const rawRoute = getRouteData(routePath, currentManifest);
+ const rawRoute = getRouteData(routePath as string, currentManifest);
let route;
if (rawRoute) {
- route = defaultCustomizeRoute(rawRoute, language, currentManifest, request, response, customizeRendering);
+ route = defaultCustomizeRoute(
+ rawRoute,
+ language,
+ currentManifest,
+ request,
+ response,
+ customizeRendering
+ );
if (customizeRoute && typeof customizeRoute === 'function') {
route = customizeRoute(route, rawRoute, currentManifest, request, response);
}
diff --git a/packages/sitecore-jss-dev-tools/src/disconnected-server/media-service.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/media-service.ts
index 922eed10f0..c728f9e416 100644
--- a/packages/sitecore-jss-dev-tools/src/disconnected-server/media-service.ts
+++ b/packages/sitecore-jss-dev-tools/src/disconnected-server/media-service.ts
@@ -1,3 +1,4 @@
+import { Request, Response } from 'express';
import fs from 'fs';
import path from 'path';
@@ -10,8 +11,14 @@ export interface DisconnectedAssetMiddlewareOptions {
staticRootPath: string;
}
-export function createDisconnectedAssetMiddleware({ manifestPath, staticRootPath }: DisconnectedAssetMiddlewareOptions) {
- return function disconnectedAssetMiddleware(request: any, response: any) {
+/**
+ * @param {DisconnectedAssetMiddlewareOptions} config
+ */
+export function createDisconnectedAssetMiddleware({
+ manifestPath,
+ staticRootPath,
+}: DisconnectedAssetMiddlewareOptions) {
+ return function disconnectedAssetMiddleware(request: Request, response: Response) {
let localUrl = request.originalUrl;
// strip query
diff --git a/packages/sitecore-jss-dev-tools/src/index.ts b/packages/sitecore-jss-dev-tools/src/index.ts
index bdfc52243b..cec5bdb535 100644
--- a/packages/sitecore-jss-dev-tools/src/index.ts
+++ b/packages/sitecore-jss-dev-tools/src/index.ts
@@ -6,16 +6,25 @@ export { deploy } from './deploy';
export { clean } from './clean';
export { packageDeploy, PackageDeployOptions } from './package-deploy';
export { packageGenerate } from './package-generate';
-export { createDisconnectedAssetMiddleware, DisconnectedAssetMiddlewareOptions } from './disconnected-server/media-service';
+export {
+ createDisconnectedAssetMiddleware,
+ DisconnectedAssetMiddlewareOptions,
+} from './disconnected-server/media-service';
export { createDisconnectedLayoutService } from './disconnected-server/layout-service';
export {
DisconnectedLayoutServiceOptions,
CustomizeContextFunction,
CustomizeRenderFunction,
- CustomizeRouteFunction
+ CustomizeRouteFunction,
} from './disconnected-server/DisconnectedLayoutServiceOptions';
-export { createDisconnectedDictionaryService, DisconnectedDictionaryServiceOptions } from './disconnected-server/dictionary-service';
-export { createDefaultDocumentMiddleware, DefaultDocumentMiddlewareOptions } from './disconnected-server/default-document';
+export {
+ createDisconnectedDictionaryService,
+ DisconnectedDictionaryServiceOptions,
+} from './disconnected-server/dictionary-service';
+export {
+ createDefaultDocumentMiddleware,
+ DefaultDocumentMiddlewareOptions,
+} from './disconnected-server/default-document';
export { ManifestManager } from './manifest-manager';
export { createDefaultDisconnectedServer } from './disconnected-server/create-default-disconnected-server';
export { ScJssConfig, JssConfiguration, resolveScJssConfig } from './resolve-scjssconfig';
diff --git a/packages/sitecore-jss-dev-tools/src/manifest-manager.ts b/packages/sitecore-jss-dev-tools/src/manifest-manager.ts
index eb1803a4c8..1ed3a8e772 100644
--- a/packages/sitecore-jss-dev-tools/src/manifest-manager.ts
+++ b/packages/sitecore-jss-dev-tools/src/manifest-manager.ts
@@ -27,6 +27,7 @@ export class ManifestManager {
rootPath: string;
watcher?: FSWatcher;
watcherSourcePaths: string[];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
manifestArgs: any;
constructor({
diff --git a/packages/sitecore-jss-dev-tools/src/mergeFs.test.ts b/packages/sitecore-jss-dev-tools/src/mergeFs.test.ts
index a31419d56e..38f3ee8f5e 100644
--- a/packages/sitecore-jss-dev-tools/src/mergeFs.test.ts
+++ b/packages/sitecore-jss-dev-tools/src/mergeFs.test.ts
@@ -2,6 +2,7 @@ import { expect } from 'chai';
import { mergeFs } from './';
describe('merge files', () => {
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
before(() => {});
describe('merge route data', () => {
@@ -25,5 +26,6 @@ describe('merge files', () => {
});
});
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
after(() => {});
});
diff --git a/packages/sitecore-jss-dev-tools/src/mergeFs.ts b/packages/sitecore-jss-dev-tools/src/mergeFs.ts
index 00594a845f..7c7276ae6c 100644
--- a/packages/sitecore-jss-dev-tools/src/mergeFs.ts
+++ b/packages/sitecore-jss-dev-tools/src/mergeFs.ts
@@ -2,7 +2,7 @@ import fs from 'fs';
import yaml from 'js-yaml';
import path from 'path';
-const IS_HIDDEN_FILE = (file: string): boolean => path.basename(file).startsWith('.')
+const IS_HIDDEN_FILE = (file: string): boolean => path.basename(file).startsWith('.');
const tryParseJsonOrYaml = (jsonString: string) => {
try {
@@ -21,15 +21,20 @@ const tryParseJsonOrYaml = (jsonString: string) => {
export interface FileResult {
filename: string;
path: string;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
contents: any;
}
-export type CustomFileParser = (filePath: string, contents: string) => any | null;
+export type CustomFileParser = (filePath: string, contents: string) => unknown | null;
-const processFileSync = (filePath: string, parseFileContents?: CustomFileParser): FileResult | null => {
+const processFileSync = (
+ filePath: string,
+ parseFileContents?: CustomFileParser
+): FileResult | null => {
// if no encoding is specified, readFileSync returns a buffer instead of a string
const contents = fs.readFileSync(filePath, 'utf8');
if (contents) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
let contentObject: any;
if (parseFileContents) {
@@ -62,8 +67,9 @@ const readDirSync = (dir: string) => {
dirList: [],
};
- if (IS_HIDDEN_FILE(dir))
+ if (IS_HIDDEN_FILE(dir)) {
return result;
+ }
const list = fs.readdirSync(dir);
if (!list) {
@@ -73,8 +79,9 @@ const readDirSync = (dir: string) => {
list.forEach((file: string) => {
const filePath = path.join(dir, file);
- if (IS_HIDDEN_FILE(file))
+ if (IS_HIDDEN_FILE(file)) {
return;
+ }
const stats = fs.statSync(filePath);
@@ -115,7 +122,10 @@ export interface MergeFsResult {
folders: MergeFsResult[];
}
-export const mergeFs = (rootPath: string, parseFileContents?: CustomFileParser): Promise =>
+export const mergeFs = (
+ rootPath: string,
+ parseFileContents?: CustomFileParser
+): Promise =>
new Promise((resolve, reject) => {
if (!rootPath) {
reject(new Error('rootPath is not defined'));
diff --git a/packages/sitecore-jss-dev-tools/src/package-deploy.ts b/packages/sitecore-jss-dev-tools/src/package-deploy.ts
index 8bc57e012c..1df7fe8aa6 100644
--- a/packages/sitecore-jss-dev-tools/src/package-deploy.ts
+++ b/packages/sitecore-jss-dev-tools/src/package-deploy.ts
@@ -20,26 +20,40 @@ export interface PackageDeployOptions {
// using a Windows trusted CA - so SSL connections to Sitecore will fail from Node.
// If the options.acceptCertificate is passed, we disable normal SSL validation and use this function
// to whitelist only a cert with the specific thumbprint - essentially certificate pinning.
+/**
+ * @param {request.Request} req
+ * @param {PackageDeployOptions} options
+ */
function applyCertPinning(req: request.Request, options: PackageDeployOptions) {
req.on('socket', (socket) => {
socket.on('secureConnect', () => {
const fingerprint = (socket as TLSSocket).getPeerCertificate().fingerprint;
// Match the fingerprint with our saved fingerprint
- if (options.acceptCertificate && (! doFingerprintsMatch(options.acceptCertificate, fingerprint))) {
+ if (
+ options.acceptCertificate &&
+ !doFingerprintsMatch(options.acceptCertificate, fingerprint)
+ ) {
// Abort request, optionally emit an error event
- // tslint:disable-next-line:max-line-length
- req.emit('error', new Error(`Expected server SSL certificate to have thumbprint ${options.acceptCertificate} from acceptCertificate, but got ${fingerprint} from server. This may mean the certificate has changed, or that a malicious certificate is present.`));
+ req.emit(
+ 'error',
+ new Error(
+ `Expected server SSL certificate to have thumbprint ${options.acceptCertificate} from acceptCertificate, but got ${fingerprint} from server. This may mean the certificate has changed, or that a malicious certificate is present.`
+ )
+ );
return req.abort();
}
});
});
}
+/**
+ * @param {string} fp
+ */
function normalizeFingerprint(fp: string): string {
//
// The fingerprint for a certificate is a 20-byte value.
- // Such values are typically expressed as strings, but
+ // Such values are typically expressed as strings, but
// there are many different formats that may be used.
//
// For example, the following values all represent
@@ -52,11 +66,19 @@ function normalizeFingerprint(fp: string): string {
// Before two fingerprints can be properly compared,
// they must be converted into the same format. This
// function implements the logic for that conversion.
- return fp.toLowerCase().replace(new RegExp(':', 'g'),'');
+ return fp.toLowerCase().replace(new RegExp(':', 'g'), '');
}
-function doFingerprintsMatch(fp1:string, fp2:string): boolean {
+/**
+ * @param {string} fp1
+ * @param {string} fp2
+ */
+function doFingerprintsMatch(fp1: string, fp2: string): boolean {
return normalizeFingerprint(fp1) === normalizeFingerprint(fp2);
}
+/**
+ * @param {PackageDeployOptions} options
+ * @param {string} taskName
+ */
async function watchJobStatus(options: PackageDeployOptions, taskName: string) {
let logOffset = 0;
const errors: string[] = [];
@@ -88,100 +110,111 @@ async function watchJobStatus(options: PackageDeployOptions, taskName: string) {
}
return new Promise((resolve, reject) => {
+ /**
+ * Send job status request
+ */
function sendJobStatusRequest() {
- // tslint:disable-next-line:max-line-length
- const req = request.get(`${options.importServiceUrl}/status?appName=${options.appName}&jobName=${taskName}&after=${logOffset}`, requestBaseOptions, (error, response, body) => {
- if (error || response.statusCode < 200 || response.statusCode >= 300) {
- // tslint:disable-next-line:max-line-length
- console.error(chalk.red('Unexpected response from import status service. The import task is probably still running; check the Sitecore logs for details.'));
- if (error) {
- console.error(chalk.red(error));
- }
- if (response && response.statusMessage) {
- console.error(chalk.red(response.statusMessage));
- }
- if (body) {
- console.error(chalk.red(body));
+ const req = request.get(
+ `${options.importServiceUrl}/status?appName=${options.appName}&jobName=${taskName}&after=${logOffset}`,
+ requestBaseOptions,
+ (error, response, body) => {
+ if (error || response.statusCode < 200 || response.statusCode >= 300) {
+ console.error(
+ chalk.red(
+ 'Unexpected response from import status service. The import task is probably still running; check the Sitecore logs for details.'
+ )
+ );
+ if (error) {
+ console.error(chalk.red(error));
+ }
+ if (response && response.statusMessage) {
+ console.error(chalk.red(response.statusMessage));
+ }
+ if (body) {
+ console.error(chalk.red(body));
+ }
+ reject();
+ return;
}
- reject();
- return;
- }
- try {
- const logReplies: string[] = JSON.parse(body);
+ try {
+ const logReplies: string[] = JSON.parse(body);
- let complete = false;
+ let complete = false;
- logReplies.forEach((entry) => {
- logOffset++;
+ logReplies.forEach((entry) => {
+ logOffset++;
- const entryBits = /^(\[([A-Z]+)\] )?(.+)/.exec(entry);
+ const entryBits = /^(\[([A-Z]+)\] )?(.+)/.exec(entry);
- let entryLevel = 'INFO';
- let message = entry;
-
- if (entryBits && entryBits[2]) {
- entryLevel = entryBits[2];
- // 3 = '[] ' in say [INFO] My log message
- // we're not using the capture group as the message might be multi-line
- message = entry.substring(entryLevel.length + 3);
- }
+ let entryLevel = 'INFO';
+ let message = entry;
- if (entry.startsWith('Job ended:')) {
- console.log();
- console.log('Import is complete.');
-
- if (warnings.length > 0) {
- console.log();
- console.warn(chalk.yellow('IMPORT WARNING(S) OCCURRED!'));
- warnings.forEach((w) => console.error(chalk.yellow(w)));
+ if (entryBits && entryBits[2]) {
+ entryLevel = entryBits[2];
+ // 3 = '[] ' in say [INFO] My log message
+ // we're not using the capture group as the message might be multi-line
+ message = entry.substring(entryLevel.length + 3);
}
- if (errors.length > 0) {
+ if (entry.startsWith('Job ended:')) {
console.log();
- console.error(chalk.red('IMPORT ERROR(S) OCCURRED!'));
- errors.forEach((e) => console.error(chalk.red(e)));
- reject();
- } else {
- resolve();
+ console.log('Import is complete.');
+
+ if (warnings.length > 0) {
+ console.log();
+ console.warn(chalk.yellow('IMPORT WARNING(S) OCCURRED!'));
+ warnings.forEach((w) => console.error(chalk.yellow(w)));
+ }
+
+ if (errors.length > 0) {
+ console.log();
+ console.error(chalk.red('IMPORT ERROR(S) OCCURRED!'));
+ errors.forEach((e) => console.error(chalk.red(e)));
+ reject();
+ } else {
+ resolve();
+ }
+
+ complete = true;
+ return;
}
- complete = true;
- return;
- }
+ if (message.startsWith('[JSS] - ')) {
+ message = message.substring(8);
+ }
- if (message.startsWith('[JSS] - ')) {
- message = message.substring(8);
- }
+ switch (entryLevel) {
+ case 'WARN':
+ console.warn(chalk.yellow(message));
+ warnings.push(message);
+ break;
+ case 'ERROR':
+ console.error(chalk.red(message));
+ errors.push(message);
+ break;
+ case 'DEBUG':
+ console.log(chalk.white(message));
+ break;
+ default:
+ console.log(chalk.green(message));
+ break;
+ }
+ });
- switch (entryLevel) {
- case 'WARN':
- console.warn(chalk.yellow(message));
- warnings.push(message);
- break;
- case 'ERROR':
- console.error(chalk.red(message));
- errors.push(message);
- break;
- case 'DEBUG':
- console.log(chalk.white(message));
- break;
- default:
- console.log(chalk.green(message));
- break;
+ if (!complete) {
+ setTimeout(sendJobStatusRequest, 1000);
}
- });
-
- if (!complete) {
- setTimeout(sendJobStatusRequest, 1000);
+ } catch (error) {
+ console.error(
+ chalk.red(`Unexpected error processing reply from import status service: ${error}`)
+ );
+ console.error(chalk.red(`Response: ${body}`));
+ console.error(chalk.red('Consult the Sitecore logs for details.'));
+ reject(error);
}
- } catch (error) {
- console.error(chalk.red(`Unexpected error processing reply from import status service: ${error}`));
- console.error(chalk.red(`Response: ${body}`));
- console.error(chalk.red('Consult the Sitecore logs for details.'));
- reject(error);
}
- });
+ );
applyCertPinning(req, options);
}
@@ -190,15 +223,20 @@ async function watchJobStatus(options: PackageDeployOptions, taskName: string) {
});
}
+/**
+ * @param {PackageDeployOptions} options
+ */
export async function packageDeploy(options: PackageDeployOptions) {
if (!options.secret) {
- // tslint:disable-next-line:max-line-length
- throw new Error('Deployment secret was not passed. A shared secret must be configured on both the Sitecore app config and the JS app config');
+ throw new Error(
+ 'Deployment secret was not passed. A shared secret must be configured on both the Sitecore app config and the JS app config'
+ );
}
if (options.secret.length < 32) {
- // tslint:disable-next-line:max-line-length
- throw new Error('Deployment secret was too short. Use a RANDOM (not words or phrases) secret at least 32 characters long.');
+ throw new Error(
+ 'Deployment secret was too short. Use a RANDOM (not words or phrases) secret at least 32 characters long.'
+ );
}
let packageFile = null;
@@ -244,27 +282,30 @@ export async function packageDeploy(options: PackageDeployOptions) {
console.log(`Sending package ${packageFile} to ${options.importServiceUrl}...`);
return new Promise((resolve, reject) => {
- const req = request.post(options.importServiceUrl, requestBaseOptions, (error, response, body) => {
- if (error || response.statusCode < 200 || response.statusCode >= 300) {
- console.error(chalk.red('Unexpected response from import service:'));
- if (error) {
- console.error(chalk.red(error));
- }
- if (response && response.statusMessage) {
- console.error(chalk.red(`Status message: ${response.statusMessage}`));
- }
- if (body) {
- console.error(chalk.red(`Body: ${body}`));
+ const req = request.post(
+ options.importServiceUrl,
+ requestBaseOptions,
+ (error, response, body) => {
+ if (error || response.statusCode < 200 || response.statusCode >= 300) {
+ console.error(chalk.red('Unexpected response from import service:'));
+ if (error) {
+ console.error(chalk.red(error));
+ }
+ if (response && response.statusMessage) {
+ console.error(chalk.red(`Status message: ${response.statusMessage}`));
+ }
+ if (body) {
+ console.error(chalk.red(`Body: ${body}`));
+ }
+ reject();
+ return;
}
- reject();
- return;
- }
- console.log(chalk.green(`Sitecore has accepted import task ${body}`));
- resolve(body);
- });
+ console.log(chalk.green(`Sitecore has accepted import task ${body}`));
+ resolve(body);
+ }
+ );
applyCertPinning(req, options);
- })
- .then((taskName) => watchJobStatus(options, taskName));
+ }).then((taskName) => watchJobStatus(options, taskName));
}
diff --git a/packages/sitecore-jss-dev-tools/src/package-generate.ts b/packages/sitecore-jss-dev-tools/src/package-generate.ts
index 214717b559..06914875ae 100644
--- a/packages/sitecore-jss-dev-tools/src/package-generate.ts
+++ b/packages/sitecore-jss-dev-tools/src/package-generate.ts
@@ -8,6 +8,9 @@ export interface PackageGenerateOptions {
manifestPath: string;
manifestFileName: string;
}
+/**
+ * @param {PackageGenerateOptions} options
+ */
export function packageGenerate(options: PackageGenerateOptions) {
// clear output folder
fsExtra.emptyDirSync(options.outputPath);
@@ -20,7 +23,10 @@ export function packageGenerate(options: PackageGenerateOptions) {
fsExtra.copySync(path.join('.', options.manifestPath), packageManifestPath);
// generate manifest package
- const updatePackage = path.join(options.outputPath, `${options.appName}.${datepath}.manifest.zip`);
+ const updatePackage = path.join(
+ options.outputPath,
+ `${options.appName}.${datepath}.manifest.zip`
+ );
return new Promise((resolve) => {
createPackage(packageManifestPath, updatePackage, resolve);
diff --git a/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts b/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts
index 1c744ac39d..acb689084e 100644
--- a/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts
+++ b/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts
@@ -10,14 +10,17 @@ export interface JssConfiguration {
}
export interface ScJssConfig {
- sitecore: JssConfiguration;
[configName: string]: JssConfiguration;
+ sitecore: JssConfiguration;
}
-export function resolveScJssConfig({
+/**
+ * @param {any} config
+ */
+export function resolveScJssConfig({
configPath = './scjssconfig.json',
configName = 'sitecore',
- assert = true
+ assert = true,
} = {}): Promise {
return new Promise((resolvePromise, rejectPromise) => {
resolve(configPath, { basedir: process.cwd() }, (error, jssConfigJson) => {
diff --git a/packages/sitecore-jss-dev-tools/src/setup/find-app-name.ts b/packages/sitecore-jss-dev-tools/src/setup/find-app-name.ts
index 12b6480f0e..a40b1ea96e 100644
--- a/packages/sitecore-jss-dev-tools/src/setup/find-app-name.ts
+++ b/packages/sitecore-jss-dev-tools/src/setup/find-app-name.ts
@@ -1,5 +1,8 @@
import fs from 'fs';
+/**
+ * @param {string} path
+ */
export function findAppNameInConfig(path: string) {
if (!fs.existsSync(path)) {
return null;
@@ -9,6 +12,9 @@ export function findAppNameInConfig(path: string) {
return findAppNameInContents(file);
}
+/**
+ * @param {string} contents
+ */
export function findAppNameInContents(contents: string) {
const matches = / {
// this would result in copying files to random places
if (newVal.indexOf('{sitecoreInstancePath}') > -1 && !config.sitecore.instancePath) {
throw new Error(
- // tslint:disable-next-line:max-line-length
`instancePath config variable was used but was undefined or empty. You likely need to run npm run setup or update your ${userConfigPath}`
);
}
diff --git a/packages/sitecore-jss-dev-tools/src/setup/secret-patch.ts b/packages/sitecore-jss-dev-tools/src/setup/secret-patch.ts
index 3c428d3942..12842a227f 100644
--- a/packages/sitecore-jss-dev-tools/src/setup/secret-patch.ts
+++ b/packages/sitecore-jss-dev-tools/src/setup/secret-patch.ts
@@ -1,9 +1,18 @@
import { writeFileSync } from 'fs';
+/**
+ * @param {string} path
+ * @param {string} appName
+ * @param {string} secret
+ */
export function writeSecretPatchFile(path: string, appName: string, secret: string) {
writeFileSync(path, createSecretPatchContents(appName, secret), { encoding: 'utf8' });
}
+/**
+ * @param {string} appName
+ * @param {string} secret
+ */
export function createSecretPatchContents(appName: string, secret: string) {
return `
diff --git a/packages/sitecore-jss-dev-tools/src/setup/setup.ts b/packages/sitecore-jss-dev-tools/src/setup/setup.ts
index 63543a5925..a88c38f221 100644
--- a/packages/sitecore-jss-dev-tools/src/setup/setup.ts
+++ b/packages/sitecore-jss-dev-tools/src/setup/setup.ts
@@ -8,12 +8,20 @@ import { ScJssConfig, JssConfiguration } from '../resolve-scjssconfig';
import { findAppNameInConfig } from './find-app-name';
import { createSecretPatchContents, writeSecretPatchFile } from './secret-patch';
-// tslint:disable:max-line-length
-
const userConfigFileName = 'scjssconfig.json';
export const userConfigPath = path.resolve(process.cwd(), userConfigFileName);
+/**
+ * @param {string | undefined} initialData
+ * @param {boolean} allowInteraction
+ * @param {string} paramName
+ * @param {string} prompt
+ * @param {string} examplePrompt
+ * @param {RegExp} [validation]
+ * @param {string} [validationMessage]
+ * @param {boolean} skipValidationIfNonInteractive
+ */
function getInteractiveData(
initialData: string | undefined,
allowInteraction: boolean,
@@ -22,21 +30,21 @@ function getInteractiveData(
examplePrompt: string,
validation?: RegExp,
validationMessage?: string,
- skipValidationIfNonInteractive: boolean = false
+ skipValidationIfNonInteractive = false
): string {
if (!allowInteraction && !initialData && !skipValidationIfNonInteractive) {
throw new Error(`Non interactive mode specified and ${paramName} not provided.`);
}
if (allowInteraction) {
- const finalPrompt = initialData ? `${prompt} [${initialData}]: ` : `${prompt} ${examplePrompt}: `;
- return rlSync.question(finalPrompt,
- {
- defaultInput: initialData,
- limit: validation,
- limitMessage: validationMessage,
- }
- );
+ const finalPrompt = initialData
+ ? `${prompt} [${initialData}]: `
+ : `${prompt} ${examplePrompt}: `;
+ return rlSync.question(finalPrompt, {
+ defaultInput: initialData,
+ limit: validation,
+ limitMessage: validationMessage,
+ });
}
const result = initialData as string;
@@ -52,8 +60,19 @@ function getInteractiveData(
return result;
}
-export function setup(interactive: boolean, outputFile?: string, initialData?: JssConfiguration, configName = 'sitecore') {
- const getValidation = (regexp: RegExp) => initialData?.skipValidation ? undefined : regexp;
+/**
+ * @param {boolean} interactive
+ * @param {string} outputFile
+ * @param {JssConfiguration} [initialData]
+ * @param {string} [configName]
+ */
+export function setup(
+ interactive: boolean,
+ outputFile?: string,
+ initialData?: JssConfiguration,
+ configName = 'sitecore'
+) {
+ const getValidation = (regexp: RegExp) => (initialData?.skipValidation ? undefined : regexp);
let config: ScJssConfig = {
sitecore: {
@@ -71,14 +90,23 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J
const existingFile = fs.readFileSync(outputFile, 'utf8');
const existingJson = JSON.parse(existingFile) as ScJssConfig;
- console.log(chalk.green(`Found existing ${outputFile}. The existing config will become defaults in this setup session.`));
+ console.log(
+ chalk.green(
+ `Found existing ${outputFile}. The existing config will become defaults in this setup session.`
+ )
+ );
config = existingJson;
} catch (e) {
- console.warn(chalk.yellow(`Found existing ${outputFile} but error reading it. Existing values will be ignored.`), e);
+ console.warn(
+ chalk.yellow(
+ `Found existing ${outputFile} but error reading it. Existing values will be ignored.`
+ ),
+ e
+ );
}
}
- const existingConfigObject = config[configName] || {} as JssConfiguration;
+ const existingConfigObject = config[configName] || ({} as JssConfiguration);
// merge existing values with any CLI arguments (which should override any preexisting values)
if (initialData) {
@@ -117,13 +145,20 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J
}
}
} else {
- console.warn(chalk.yellow('Non-interactive mode specified and no instancePath given. File/config deployment will not be available.'));
+ console.warn(
+ chalk.yellow(
+ 'Non-interactive mode specified and no instancePath given. File/config deployment will not be available.'
+ )
+ );
}
};
// if you are setting up for the first time, we don't need an instance path for a remote Sitecore instance
if (interactive) {
- if (!configObject.instancePath && rlSync.keyInYN('Is your Sitecore instance on this machine or accessible via network share?')) {
+ if (
+ !configObject.instancePath &&
+ rlSync.keyInYN('Is your Sitecore instance on this machine or accessible via network share?')
+ ) {
getInstancePath(configObject.instancePath);
} else if (configObject.instancePath) {
getInstancePath(configObject.instancePath);
@@ -134,7 +169,6 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J
const defaultDeployUrl = '/sitecore/api/jss/import';
if (!interactive && !configObject.layoutServiceHost) {
- // tslint:disable-next-line:no-string-throw
throw 'Non interactive mode specified and layoutServiceHost not provided.';
}
@@ -186,16 +220,29 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J
);
if (!configObject.deploySecret && interactive) {
- configObject.deploySecret = Math.random().toString(36).substring(2, 15)
- + Math.random().toString(36).substring(2, 15)
- + Math.random().toString(36).substring(2, 15)
- + Math.random().toString(36).substring(2, 15);
-
- console.log(`Deployment secret has been generated. Ensure the JSS app config on the Sitecore end has the same secret set.`);
+ configObject.deploySecret =
+ Math.random()
+ .toString(36)
+ .substring(2, 15) +
+ Math.random()
+ .toString(36)
+ .substring(2, 15) +
+ Math.random()
+ .toString(36)
+ .substring(2, 15) +
+ Math.random()
+ .toString(36)
+ .substring(2, 15);
+
+ console.log(
+ 'Deployment secret has been generated. Ensure the JSS app config on the Sitecore end has the same secret set.'
+ );
}
if (configObject.deploySecret) {
- const appConfig = glob.sync('./sitecore/config/*.config').find((file) => !file.match(/deploysecret/));
+ const appConfig = glob
+ .sync('./sitecore/config/*.config')
+ .find((file) => !file.match(/deploysecret/));
if (appConfig) {
const appName = findAppNameInConfig(appConfig);
@@ -207,13 +254,27 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J
console.log('Ensure this configuration is deployed to Sitecore.');
} else {
console.log(chalk.yellow(`Unable to resolve JSS app name in ${appConfig}`));
- console.log(chalk.yellow(`For deployment to succeed the app's 'deploySecret' must be set in a Sitecore config patch similar to:`));
+ console.log(
+ chalk.yellow(
+ // eslint-disable-next-line prettier/prettier
+ 'For deployment to succeed the app\'s \'deploySecret\' must be set in a Sitecore config patch similar to:'
+ )
+ );
console.log(createSecretPatchContents('YOUR-JSS-APP-NAME-HERE', configObject.deploySecret));
console.log('');
}
} else {
- console.log(chalk.yellow(`No JSS config patches were in ./sitecore/config to get the JSS app name from.`));
- console.log(chalk.yellow(`For deployment to succeed the app's 'deploySecret' must be set in a Sitecore config patch similar to:`));
+ console.log(
+ chalk.yellow(
+ 'No JSS config patches were in ./sitecore/config to get the JSS app name from.'
+ )
+ );
+ console.log(
+ chalk.yellow(
+ // eslint-disable-next-line prettier/prettier
+ 'For deployment to succeed the app\'s \'deploySecret\' must be set in a Sitecore config patch similar to:'
+ )
+ );
console.log(createSecretPatchContents('YOUR-JSS-APP-NAME-HERE', configObject.deploySecret));
console.log('');
}
@@ -229,15 +290,33 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J
console.log(`JSS connection settings saved to ${chalk.green(outputFile)}`);
console.log();
console.log(chalk.green('NEXT STEPS'));
- console.log(`* Ensure the ${chalk.green('hostName')} in /sitecore/config/*.config is configured as ${chalk.green(hostName)}, and in hosts file if needed.`);
+ console.log(
+ `* Ensure the ${chalk.green(
+ 'hostName'
+ )} in /sitecore/config/*.config is configured as ${chalk.green(
+ hostName
+ )}, and in hosts file if needed.`
+ );
if (configObject.instancePath) {
console.log(`* Deploy your configuration (i.e. '${chalk.green('jss deploy config')}')`);
console.log(`* Deploy your app (i.e. '${chalk.green('jss deploy app -c -d')}')`);
} else {
console.log(`* Deploy the app's items (i.e. ${chalk.green('jss deploy items -c -d')})`);
console.log(`* Create a production build (i.e. ${chalk.green('jss build')})`);
- console.log(`* Copy the build artifacts to the Sitecore instance in the ${chalk.green('sitecoreDistPath')} set in package.json.`);
- console.warn(`${chalk.yellow(' > Note:')} ${chalk.red('jss deploy config')}, ${chalk.red('jss deploy files')}, and ${chalk.red('jss deploy app')} cannot be used with remote Sitecore.`);
+ console.log(
+ `* Copy the build artifacts to the Sitecore instance in the ${chalk.green(
+ 'sitecoreDistPath'
+ )} set in package.json.`
+ );
+ console.warn(
+ `${chalk.yellow(' > Note:')} ${chalk.red('jss deploy config')}, ${chalk.red(
+ 'jss deploy files'
+ )}, and ${chalk.red('jss deploy app')} cannot be used with remote Sitecore.`
+ );
}
- console.log(`* Test your app in integrated mode by visiting ${chalk.green(configObject.layoutServiceHost as string)}`);
+ console.log(
+ `* Test your app in integrated mode by visiting ${chalk.green(
+ configObject.layoutServiceHost as string
+ )}`
+ );
}
diff --git a/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts b/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts
index 95524cd44a..caf0c25cb3 100644
--- a/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts
+++ b/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts
@@ -5,21 +5,28 @@ import { setup, userConfigPath } from './setup';
export const verifySetup = () => {
if (!fs.existsSync(userConfigPath)) {
- console.warn(chalk.yellow(`No Sitecore connection has been configured (missing scjssconfig.json)`));
- // tslint:disable-next-line:max-line-length
- const runSetup = rlSync.keyInYN('This command requires a Sitecore connection. Would you like to configure the connection?');
+ console.warn(
+ chalk.yellow('No Sitecore connection has been configured (missing scjssconfig.json)')
+ );
+ const runSetup = rlSync.keyInYN(
+ 'This command requires a Sitecore connection. Would you like to configure the connection?'
+ );
if (!runSetup) {
- // tslint:disable-next-line:no-string-throw
throw 'This command cannot execute without a Sitecore connection';
}
setup(true);
- console.warn(chalk.yellow(`JSS app configuration must be deployed to Sitecore before continuing.`));
- console.warn(`Use ${chalk.green('jss deploy config')} or copy /sitecore/config/*.config manually to Sitecore's /App_Config/Include`);
+ console.warn(
+ chalk.yellow('JSS app configuration must be deployed to Sitecore before continuing.')
+ );
+ console.warn(
+ `Use ${chalk.green(
+ 'jss deploy config'
+ )} or copy /sitecore/config/*.config manually to Sitecore's /App_Config/Include`
+ );
const continueCommand = rlSync.keyInYN(chalk.yellow('Is the config deployed?'));
if (!continueCommand) {
- // tslint:disable-next-line:no-string-throw
throw 'Retry this command after deploying your JSS app config to Sitecore.';
}
}
diff --git a/packages/sitecore-jss-forms/.eslintrc b/packages/sitecore-jss-forms/.eslintrc
new file mode 100644
index 0000000000..cf556dbaae
--- /dev/null
+++ b/packages/sitecore-jss-forms/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "../../.eslintrc",
+ "rules": {
+ "@typescript-eslint/explicit-module-boundary-types": "off"
+ }
+}
diff --git a/packages/sitecore-jss-forms/.npmignore b/packages/sitecore-jss-forms/.npmignore
index 1d8f6f0306..af4363fcb3 100644
--- a/packages/sitecore-jss-forms/.npmignore
+++ b/packages/sitecore-jss-forms/.npmignore
@@ -4,12 +4,11 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
-tslint.json
npm-debug*
*.log
!/types
diff --git a/packages/sitecore-jss-forms/package-lock.json b/packages/sitecore-jss-forms/package-lock.json
index 8fa54a242e..a0be2b752e 100644
--- a/packages/sitecore-jss-forms/package-lock.json
+++ b/packages/sitecore-jss-forms/package-lock.json
@@ -4,6 +4,73 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
+ "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.10.4"
+ }
+ },
+ "@babel/helper-validator-identifier": {
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
+ "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==",
+ "dev": true
+ },
+ "@babel/highlight": {
+ "version": "7.10.4",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
+ "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.10.4",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ }
+ },
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ }
+ }
+ },
"@sinonjs/commons": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz",
@@ -97,6 +164,30 @@
"integrity": "sha512-MAiEDfjOmuZLSx2rrRj3rR2729wygQbq5mdQsEW4gMRFRDoW93lUU3n0ablmbAIL9pzharzhmcEjrO2zW0JSKg==",
"dev": true
},
+ "acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
+ },
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
+ "ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
"ansi-align": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz",
@@ -187,6 +278,12 @@
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"axios": {
"version": "0.18.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz",
@@ -257,6 +354,12 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true
+ },
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
@@ -481,6 +584,12 @@
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"dev": true
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+ "dev": true
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -521,6 +630,15 @@
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"dot-prop": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
@@ -542,6 +660,15 @@
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
"dev": true
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -616,12 +743,307 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "dev": true,
+ "requires": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ }
+ },
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^3.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ },
+ "which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true
+ },
"execa": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
@@ -637,6 +1059,33 @@
"strip-eof": "^1.0.0"
}
},
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true
+ },
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "dev": true
+ },
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
@@ -656,6 +1105,33 @@
"is-buffer": "~2.0.3"
}
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ },
+ "dependencies": {
+ "rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ }
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
@@ -677,6 +1153,12 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -715,6 +1197,15 @@
"path-is-absolute": "^1.0.0"
}
},
+ "glob-parent": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
+ "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
"global-dirs": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
@@ -724,6 +1215,15 @@
"ini": "^1.3.4"
}
},
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
"globby": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
@@ -809,6 +1309,22 @@
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==",
"dev": true
},
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ }
+ },
"import-lazy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
@@ -891,6 +1407,12 @@
"integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
"dev": true
},
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
"is-finite": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz",
@@ -903,6 +1425,15 @@
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"dev": true
},
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
"is-installed-globally": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz",
@@ -1037,6 +1568,12 @@
"iterate-iterator": "^1.0.1"
}
},
+ "js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true
+ },
"js-yaml": {
"version": "3.14.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
@@ -1047,6 +1584,18 @@
"esprima": "^4.0.0"
}
},
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
+ },
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"just-extend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz",
@@ -1062,6 +1611,16 @@
"package-json": "^4.0.0"
}
},
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
@@ -1480,6 +2039,12 @@
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"nise": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz",
@@ -1570,6 +2135,20 @@
"wrappy": "1"
}
},
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
@@ -1618,6 +2197,15 @@
"semver": "^5.1.0"
}
},
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
@@ -1729,12 +2317,24 @@
"pinkie": "^2.0.0"
}
},
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
"prepend-http": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
"dev": true
},
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise.allsettled": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz",
@@ -1754,6 +2354,12 @@
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
"dev": true
},
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+ "dev": true
+ },
"randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@@ -1824,6 +2430,12 @@
"es-abstract": "^1.17.0-next.1"
}
},
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"registry-auth-token": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz",
@@ -1873,6 +2485,12 @@
"path-parse": "^1.0.6"
}
},
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ },
"rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -1954,6 +2572,49 @@
"supports-color": "^5.5.0"
}
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"source-map-support": {
"version": "0.5.16",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
@@ -2088,6 +2749,58 @@
"has-flag": "^3.0.0"
}
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
"term-size": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
@@ -2097,6 +2810,12 @@
"execa": "^0.7.0"
}
},
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"timed-out": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
@@ -2136,12 +2855,27 @@
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
"dev": true
},
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
"dev": true
},
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ },
"typescript": {
"version": "3.7.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
@@ -2181,6 +2915,15 @@
"xdg-basedir": "^3.0.0"
}
},
+ "uri-js": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
+ "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
+ "dev": true,
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
"url-parse-lax": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",
@@ -2190,6 +2933,12 @@
"prepend-http": "^1.0.1"
}
},
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -2233,6 +2982,12 @@
"string-width": "^2.1.1"
}
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
+ },
"workerpool": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz",
diff --git a/packages/sitecore-jss-forms/package.json b/packages/sitecore-jss-forms/package.json
index 69bfffbb4e..7d6fa8de3c 100644
--- a/packages/sitecore-jss-forms/package.json
+++ b/packages/sitecore-jss-forms/package.json
@@ -5,7 +5,7 @@
"scripts": {
"build": "npm run clean && tsc",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ../../tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
"prepublishOnly": "npm run build",
"coverage": "nyc --require ts-node/register npm test"
@@ -34,6 +34,7 @@
"chai": "^4.2.0",
"chai-string": "^1.5.0",
"del-cli": "^1.1.0",
+ "eslint": "^7.15.0",
"mocha": "^8.1.3",
"sinon": "^7.5.0",
"ts-node": "^8.4.1",
diff --git a/packages/sitecore-jss-forms/src/FormField.ts b/packages/sitecore-jss-forms/src/FormField.ts
index 7003d4c6dd..18f18fe915 100644
--- a/packages/sitecore-jss-forms/src/FormField.ts
+++ b/packages/sitecore-jss-forms/src/FormField.ts
@@ -1,3 +1,5 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+
import { HtmlFormField } from './HtmlFormField';
import { InputViewModel, TitleFieldViewModel, ViewModel, FieldViewModel } from './ViewModel';
@@ -5,16 +7,23 @@ export interface FormField {
model: TViewModel;
}
+/**
+ * @param {any} object
+ */
export function instanceOfFormField(object: any): object is FormField {
return 'model' in object;
}
-export interface ValueFormField extends FormField {
+export interface ValueFormField
+ extends FormField {
indexField: HtmlFormField;
fieldIdField: HtmlFormField;
valueField: HtmlFormField;
}
+/**
+ * @param {FormField} object
+ */
export function instanceOfValueFormField(object: FormField): object is ValueFormField {
return 'indexField' in object;
}
@@ -25,6 +34,9 @@ export interface ButtonFormField extends FormField {
buttonField: HtmlFormField;
}
+/**
+ * @param {FormField} object
+ */
export function instanceOfButtonFormField(object: FormField): object is ButtonFormField {
return 'buttonField' in object;
}
@@ -33,6 +45,9 @@ export interface FormFieldSection extends FormField {
fields: FormField[];
}
+/**
+ * @param {FormField} object
+ */
export function instanceOfFormFieldSection(object: FormField): object is FormFieldSection {
return 'fields' in object;
}
diff --git a/packages/sitecore-jss-forms/src/FormTracker.ts b/packages/sitecore-jss-forms/src/FormTracker.ts
index 6f298cd46b..56d763c056 100644
--- a/packages/sitecore-jss-forms/src/FormTracker.ts
+++ b/packages/sitecore-jss-forms/src/FormTracker.ts
@@ -19,21 +19,26 @@ enum EventIds {
FieldError = 'ea27aca5-432f-424a-b000-26ba5f8ae60a',
}
-export type TrackerFetcher = (formData: TrackingEvent[], endpoint: string) => Promise<{}> | void;
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export type TrackerFetcher = (formData: TrackingEvent[], endpoint: string) => Promise | void;
export interface FormTrackerOptions {
endpoint: string;
fetcher?: TrackerFetcher;
}
+/**
+ * @param {RequestInit} [options]
+ */
export function createFetchBasedTrackerFetcher(options?: RequestInit): TrackerFetcher {
- return (formData, endpoint) => fetch(endpoint, {
- body: JSON.stringify(formData),
- method: 'post',
- // IMPORTANT: Sitecore forms relies on cookies for some state management, so credentials must be included.
- credentials: 'include',
- ...options,
- });
+ return (formData, endpoint) =>
+ fetch(endpoint, {
+ body: JSON.stringify(formData),
+ method: 'post',
+ // IMPORTANT: Sitecore forms relies on cookies for some state management, so credentials must be included.
+ credentials: 'include',
+ ...options,
+ });
}
export class FormTracker {
@@ -49,7 +54,12 @@ export class FormTracker {
this._endpoint = options.endpoint;
}
- /** Should be called prior to pushing any events, and again whenever new form schema data is received */
+ /**
+ * Should be called prior to pushing any events, and again whenever new form schema data is received
+ * @param {string} formId
+ * @param {string} formSessionId
+ * @param {string} enableTracking
+ */
setFormData(formId: string, formSessionId: string, enableTracking: boolean) {
this._formId = formId;
this._formSessionId = formSessionId;
@@ -74,11 +84,15 @@ export class FormTracker {
const blurredAtTick = new Date().getTime();
- let duration = trackableField.focusedAtTick ? Math.round((blurredAtTick - trackableField.focusedAtTick) / 1000) : 0;
+ let duration = trackableField.focusedAtTick
+ ? Math.round((blurredAtTick - trackableField.focusedAtTick) / 1000)
+ : 0;
trackableField.focusedAtTick = undefined;
- const fieldChanged = this._currentField && this._currentField.fieldIdField.value !== trackableField.fieldIdField.value;
+ const fieldChanged =
+ this._currentField &&
+ this._currentField.fieldIdField.value !== trackableField.fieldIdField.value;
if (fieldChanged) {
this._startTrackingField(field, value);
duration = 0;
@@ -157,12 +171,12 @@ export class FormTracker {
}
return {
- formId: this._formId,
- sessionId: this._formSessionId,
- eventId,
- fieldId: field.fieldIdField.value,
- duration,
- fieldName: field.model.name,
+ formId: this._formId,
+ sessionId: this._formSessionId,
+ eventId,
+ fieldId: field.fieldIdField.value,
+ duration,
+ fieldName: field.model.name,
};
}
diff --git a/packages/sitecore-jss-forms/src/JssFormData.test.ts b/packages/sitecore-jss-forms/src/JssFormData.test.ts
index 098ec4202b..002cb8de59 100644
--- a/packages/sitecore-jss-forms/src/JssFormData.test.ts
+++ b/packages/sitecore-jss-forms/src/JssFormData.test.ts
@@ -3,81 +3,77 @@ import { expect } from 'chai';
import { JssFormData } from './JssFormData';
describe('JssFormData', () => {
- it('should append key/value', () => {
- const formData = new JssFormData();
-
- formData.append('xxx', 'val-xxx');
- formData.append('xxx', 'val-xxx');
- formData.append('yyy', 'val-yyy');
-
- expect(formData.get()).to.deep.equal([
- { key: 'xxx', value: 'val-xxx' },
- { key: 'xxx', value: 'val-xxx' },
- { key: 'yyy', value: 'val-yyy' },
- ]);
- });
-
- it('should set key/value', () => {
- const formData = new JssFormData();
-
- formData.set('xxx', 'val-xxx');
- formData.set('xxx', 'val-xxx');
- formData.set('yyy', 'val-yyy');
- formData.set('yyy', 'val-yyy');
-
- expect(formData.get()).to.deep.equal([
- { key: 'xxx', value: 'val-xxx' },
- { key: 'yyy', value: 'val-yyy' },
- ]);
- });
-
- it('should merge overwriting existing values', () => {
- const x1formData = new JssFormData();
- const x1 = {
- a1: 'a1-val',
- a2: 'a2-val',
- };
-
- x1formData.mergeOverwritingExisting(x1);
-
- expect(x1formData.get()).to.deep.equal([
- { key: 'a1', value: 'a1-val' },
- { key: 'a2', value: 'a2-val' },
- ]);
-
- const x2formData = new JssFormData();
- const x2 = {
- x21: 'a1-val',
- x22: 'a2-val',
- x23: [
- 'x231-arr-val',
- 'x232-arr-val',
- 'x233-arr-val',
- ],
- };
-
- x2formData.mergeOverwritingExisting(x2);
-
- expect(x2formData.get()).to.deep.equal([
- { key: 'x21', value: 'a1-val' },
- { key: 'x22', value: 'a2-val' },
- { key: 'x23', value: 'x231-arr-val' },
- { key: 'x23', value: 'x232-arr-val' },
- { key: 'x23', value: 'x233-arr-val' },
- ]);
- });
-
- it('should convert data to url encoded form data', () => {
- const x1formData = new JssFormData();
-
- x1formData.append('x21', 'a1-val');
- x1formData.append('x22', 'a2-val');
- x1formData.append('x23', 'x231-arr-val');
- x1formData.append('x23', 'x232-arr-val');
- x1formData.append('x23', 'x233-arr-val');
-
- expect(x1formData.toUrlEncodedFormData()).to.equal(
- 'x21=a1-val&x22=a2-val&x23=x231-arr-val&x23=x232-arr-val&x23=x233-arr-val'
- );
- });
+ it('should append key/value', () => {
+ const formData = new JssFormData();
+
+ formData.append('xxx', 'val-xxx');
+ formData.append('xxx', 'val-xxx');
+ formData.append('yyy', 'val-yyy');
+
+ expect(formData.get()).to.deep.equal([
+ { key: 'xxx', value: 'val-xxx' },
+ { key: 'xxx', value: 'val-xxx' },
+ { key: 'yyy', value: 'val-yyy' },
+ ]);
+ });
+
+ it('should set key/value', () => {
+ const formData = new JssFormData();
+
+ formData.set('xxx', 'val-xxx');
+ formData.set('xxx', 'val-xxx');
+ formData.set('yyy', 'val-yyy');
+ formData.set('yyy', 'val-yyy');
+
+ expect(formData.get()).to.deep.equal([
+ { key: 'xxx', value: 'val-xxx' },
+ { key: 'yyy', value: 'val-yyy' },
+ ]);
+ });
+
+ it('should merge overwriting existing values', () => {
+ const x1formData = new JssFormData();
+ const x1 = {
+ a1: 'a1-val',
+ a2: 'a2-val',
+ };
+
+ x1formData.mergeOverwritingExisting(x1);
+
+ expect(x1formData.get()).to.deep.equal([
+ { key: 'a1', value: 'a1-val' },
+ { key: 'a2', value: 'a2-val' },
+ ]);
+
+ const x2formData = new JssFormData();
+ const x2 = {
+ x21: 'a1-val',
+ x22: 'a2-val',
+ x23: ['x231-arr-val', 'x232-arr-val', 'x233-arr-val'],
+ };
+
+ x2formData.mergeOverwritingExisting(x2);
+
+ expect(x2formData.get()).to.deep.equal([
+ { key: 'x21', value: 'a1-val' },
+ { key: 'x22', value: 'a2-val' },
+ { key: 'x23', value: 'x231-arr-val' },
+ { key: 'x23', value: 'x232-arr-val' },
+ { key: 'x23', value: 'x233-arr-val' },
+ ]);
+ });
+
+ it('should convert data to url encoded form data', () => {
+ const x1formData = new JssFormData();
+
+ x1formData.append('x21', 'a1-val');
+ x1formData.append('x22', 'a2-val');
+ x1formData.append('x23', 'x231-arr-val');
+ x1formData.append('x23', 'x232-arr-val');
+ x1formData.append('x23', 'x233-arr-val');
+
+ expect(x1formData.toUrlEncodedFormData()).to.equal(
+ 'x21=a1-val&x22=a2-val&x23=x231-arr-val&x23=x232-arr-val&x23=x233-arr-val'
+ );
+ });
});
diff --git a/packages/sitecore-jss-forms/src/JssFormData.ts b/packages/sitecore-jss-forms/src/JssFormData.ts
index b50c4077ec..89721da3b1 100644
--- a/packages/sitecore-jss-forms/src/JssFormData.ts
+++ b/packages/sitecore-jss-forms/src/JssFormData.ts
@@ -4,20 +4,31 @@
* and supports append/get which not all browsers do as of this writing.
*/
export class JssFormData {
- private data = new Array<{ key: string, value: string | File }>();
+ private data = new Array<{ key: string; value: string | File }>();
- /** Appends a new key/value to the form data. Value will be added to any existing value that may exist. */
+ /**
+ * Appends a new key/value to the form data. Value will be added to any existing value that may exist.
+ * @param {string} key
+ * @param {string | File} value
+ */
public append(key: string, value: string | File) {
this.data.push({ key, value });
}
- /** Sets a key/value, removing any existing value(s) set for that key. */
+ /**
+ * Sets a key/value, removing any existing value(s) set for that key.
+ * @param {string} key
+ * @param {string | File} value
+ */
public set(key: string, value: string | File) {
this.data = this.data.filter((entry) => entry.key !== key);
this.append(key, value);
}
- /** Merges form data from a client-side state store (i.e. the user-specified values), overwriting any existing values for the keys */
+ /**
+ * Merges form data from a client-side state store (i.e. the user-specified values), overwriting any existing values for the keys
+ * @param {Object} values
+ */
public mergeOverwritingExisting(values: { [key: string]: string | string[] | boolean | File[] }) {
Object.keys(values).forEach((key) => {
const value = values[key];
@@ -40,13 +51,17 @@ export class JssFormData {
});
}
- /** Gets all key/values in the store. Duplicate keys with different values are possible. */
+ /**
+ * Gets all key/values in the store. Duplicate keys with different values are possible.
+ * @returns {Object} data
+ */
public get() {
return [...this.data];
}
/**
* Converts the store into a FormData that can be POST-ed with fetch as multipart/form-data.
+ * @returns {FormData} form data
*/
public toMultipartFormData(): FormData {
const formData = new FormData();
@@ -57,8 +72,14 @@ export class JssFormData {
/**
* Converts the store into a URL-encoded string suitable to POST as application/x-www-form-urlencoded.
+ * @returns {string} url encoded form data
*/
public toUrlEncodedFormData(): string {
- return this.data.map((entry) => `${encodeURIComponent(entry.key)}=${encodeURIComponent(entry.value.toString())}`).join('&').replace(/%20/g, '+');
+ return this.data
+ .map(
+ (entry) => `${encodeURIComponent(entry.key)}=${encodeURIComponent(entry.value.toString())}`
+ )
+ .join('&')
+ .replace(/%20/g, '+');
}
}
diff --git a/packages/sitecore-jss-forms/src/SitecoreForm.ts b/packages/sitecore-jss-forms/src/SitecoreForm.ts
index d13fd8d308..b7041f4f26 100644
--- a/packages/sitecore-jss-forms/src/SitecoreForm.ts
+++ b/packages/sitecore-jss-forms/src/SitecoreForm.ts
@@ -11,5 +11,6 @@ export interface SitecoreForm {
pageItemId: HtmlFormField;
antiForgeryToken: HtmlFormField;
metadata: FormModel;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
fields: Array>;
}
diff --git a/packages/sitecore-jss-forms/src/ViewModel.ts b/packages/sitecore-jss-forms/src/ViewModel.ts
index 7c557b2812..0b01c963aa 100644
--- a/packages/sitecore-jss-forms/src/ViewModel.ts
+++ b/packages/sitecore-jss-forms/src/ViewModel.ts
@@ -35,6 +35,9 @@ export interface InputViewModel extends TitleFieldViewModel {
value: string | boolean;
}
+/**
+ * @param {ViewModel} object
+ */
export function instanceOfInputViewModel(object: ViewModel): object is InputViewModel {
return 'value' in object;
}
@@ -69,6 +72,9 @@ export interface MultiLineStringInputViewModel extends StringInputViewModel {
rows?: number;
}
+/**
+ * @param {ViewModel} object
+ */
export function instanceOfListViewModel(object: ViewModel): object is ListViewModel {
return 'items' in object;
}
diff --git a/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts b/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts
index 7f2e092e52..832cbc2666 100644
--- a/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts
+++ b/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts
@@ -1,8 +1,11 @@
import { FormField } from './FormField';
import { instanceOfInputViewModel, instanceOfListViewModel } from './ViewModel';
-/** Retrieves the current value of a form field from the form model returned from the JSON API */
-export function getFieldValueFromModel(field: FormField) {
+/** Retrieves the current value of a form field from the form model returned from the JSON API
+ * @param {FormField} field
+ * @returns {string | string[] | boolean} field value
+ */
+export function getFieldValueFromModel(field: FormField) {
if (instanceOfListViewModel(field.model)) {
// field state from API view-model items (list fields with possible multi-select)
// we map this into an array of selected values
diff --git a/packages/sitecore-jss-forms/src/index.ts b/packages/sitecore-jss-forms/src/index.ts
index c49d80592d..b810d50073 100644
--- a/packages/sitecore-jss-forms/src/index.ts
+++ b/packages/sitecore-jss-forms/src/index.ts
@@ -31,14 +31,19 @@ export {
instanceOfListViewModel,
instanceOfInputViewModel,
} from './ViewModel';
-export { submitForm, createFetchBasedFormFetcher, FormSubmitOptions, FormFetcher } from './submitForm';
+export {
+ submitForm,
+ createFetchBasedFormFetcher,
+ FormSubmitOptions,
+ FormFetcher,
+} from './submitForm';
export { getFieldValueFromModel } from './getFieldValueFromModel';
export {
FormTracker,
FormTrackerOptions,
TrackingEvent,
createFetchBasedTrackerFetcher,
- TrackerFetcher
+ TrackerFetcher,
} from './FormTracker';
export { FormResult, FieldValidationErrors } from './FormResult';
diff --git a/packages/sitecore-jss-forms/src/serializeForm.ts b/packages/sitecore-jss-forms/src/serializeForm.ts
index 2157447b74..328c81501d 100644
--- a/packages/sitecore-jss-forms/src/serializeForm.ts
+++ b/packages/sitecore-jss-forms/src/serializeForm.ts
@@ -1,5 +1,3 @@
-// tslint:disable:max-line-length
-
import {
FormField,
instanceOfButtonFormField,
@@ -15,13 +13,15 @@ import { FileInputViewModel, instanceOfInputViewModel } from './ViewModel';
export interface SerializeFormOptions {
submitButtonName?: string | null;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
fieldValueParser?: (field: FormField) => string | string[] | boolean;
}
/**
* Serializes a Sitecore Form data into a format ready to POST to the server.
- * @param form The form schema data from the server
- * @param submitButtonName The name of the submit button that was clicked. Excludes other buttons from serialization. If not passed, all buttons are serialized.
+ * @param {SitecoreForm} form The form schema data from the server
+ * @param {SerializeFormOptions} [options]
+ * @returns {JssFormData} form data
*/
export function serializeForm(form: SitecoreForm, options?: SerializeFormOptions): JssFormData {
if (!options) {
@@ -43,13 +43,23 @@ export function serializeForm(form: SitecoreForm, options?: SerializeFormOptions
return result;
}
-function pushFields(result: JssFormData, fields: Array>, options: SerializeFormOptions) {
+/**
+ * @param {JssFormData} result
+ * @param {Array>} fields
+ * @param {SerializeFormOptions} options
+ */
+function pushFields(
+ result: JssFormData,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ fields: Array>,
+ options: SerializeFormOptions
+) {
fields.forEach((field) => {
if (
instanceOfButtonFormField(field) &&
(!options.submitButtonName || field.buttonField.name === options.submitButtonName)
) {
- pushField(result, field.buttonField, (field.model as any).title);
+ pushField(result, field.buttonField, field.model.title);
pushField(result, field.navigationButtonsField);
pushField(result, field.navigationStepField);
} else if (instanceOfValueFormField(field)) {
@@ -78,11 +88,21 @@ function pushFields(result: JssFormData, fields: Array>, options:
});
}
+/**
+ * @param {JssFormData} result
+ * @param {HtmlFormField} field
+ * @param {string} [overrideValue]
+ */
function pushField(result: JssFormData, field: HtmlFormField, overrideValue?: string) {
// the '' fallback prevents serializing 'null' as a string for empty field values ;)
return pushFieldValue(result, field.name, overrideValue || field.value || '');
}
+/**
+ * @param {JssFormData} result
+ * @param {string} fieldName
+ * @param {string} fieldValue
+ */
function pushFieldValue(result: JssFormData, fieldName: string, fieldValue: string) {
if (!fieldName) {
throw new Error('Field had no name');
diff --git a/packages/sitecore-jss-forms/src/submitForm.ts b/packages/sitecore-jss-forms/src/submitForm.ts
index 227f170a62..edef56871e 100644
--- a/packages/sitecore-jss-forms/src/submitForm.ts
+++ b/packages/sitecore-jss-forms/src/submitForm.ts
@@ -7,20 +7,33 @@ export interface FormSubmitOptions {
fetcher?: FormFetcher;
}
+/**
+ * @param {RequestInit} [options]
+ */
export function createFetchBasedFormFetcher(options?: RequestInit): FormFetcher {
- return (formData: JssFormData, endpoint: string) => fetch(endpoint, {
- body: formData.toMultipartFormData(),
- method: 'post',
- // IMPORTANT: Sitecore forms relies on cookies for some state management, so credentials must be included.
- credentials: 'include',
- // Browser set 'Content-Type' automatically with multipart/form-data; boundary
- ...options,
- })
- .then((res) => res.json())
- .then((res) => res as FormResult);
+ return (formData: JssFormData, endpoint: string) =>
+ fetch(endpoint, {
+ body: formData.toMultipartFormData(),
+ method: 'post',
+ // IMPORTANT: Sitecore forms relies on cookies for some state management, so credentials must be included.
+ credentials: 'include',
+ // Browser set 'Content-Type' automatically with multipart/form-data; boundary
+ ...options,
+ })
+ .then((res) => res.json())
+ .then((res) => res as FormResult);
}
-export function submitForm(formData: JssFormData, endpoint: string, options?: FormSubmitOptions): Promise {
+/**
+ * @param {JssFormData} formData
+ * @param {string} endpoint
+ * @param {FormSubmitOptions} [options]
+ */
+export function submitForm(
+ formData: JssFormData,
+ endpoint: string,
+ options?: FormSubmitOptions
+): Promise {
options = options || {};
if (!options.fetcher) {
diff --git a/packages/sitecore-jss-manifest/.eslintrc b/packages/sitecore-jss-manifest/.eslintrc
new file mode 100644
index 0000000000..116e46f25f
--- /dev/null
+++ b/packages/sitecore-jss-manifest/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "extends": "../../.eslintrc",
+ "rules": {
+ "@typescript-eslint/no-explicit-any": "off",
+ "@typescript-eslint/explicit-module-boundary-types": "off"
+ }
+}
diff --git a/packages/sitecore-jss-manifest/.npmignore b/packages/sitecore-jss-manifest/.npmignore
index 7d2dda9ed6..56a24e1aa2 100644
--- a/packages/sitecore-jss-manifest/.npmignore
+++ b/packages/sitecore-jss-manifest/.npmignore
@@ -4,12 +4,11 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
-tslint.json
npm-debug*
*.log
!/types
diff --git a/packages/sitecore-jss-manifest/package-lock.json b/packages/sitecore-jss-manifest/package-lock.json
index a3630a888f..de9536b32f 100644
--- a/packages/sitecore-jss-manifest/package-lock.json
+++ b/packages/sitecore-jss-manifest/package-lock.json
@@ -4,6 +4,90 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
+ "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.10.4"
+ }
+ },
+ "@babel/helper-validator-identifier": {
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
+ "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==",
+ "dev": true
+ },
+ "@babel/highlight": {
+ "version": "7.10.4",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
+ "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.10.4",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ },
+ "dependencies": {
+ "js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true
+ }
+ }
+ },
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ }
+ }
+ },
"@sinonjs/commons": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz",
@@ -114,6 +198,30 @@
"integrity": "sha512-L6ZOCUl5N/7BgBByqGk3hOsqEvv/orgBy7+JOH2GC57J6xyGO+dahQyG6W8XDvQYjxkWqLkq3RBpbSy5WVR1TQ==",
"dev": true
},
+ "acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
+ },
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
+ "ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
"ansi-align": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz",
@@ -228,6 +336,12 @@
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
@@ -725,6 +839,12 @@
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"dev": true
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+ "dev": true
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -772,6 +892,15 @@
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"dot-prop": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
@@ -792,6 +921,15 @@
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA=="
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -917,12 +1055,310 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "dev": true,
+ "requires": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ }
+ },
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^3.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ },
+ "which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true
+ },
"esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
@@ -944,6 +1380,33 @@
"strip-eof": "^1.0.0"
}
},
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true
+ },
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "dev": true
+ },
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"find-up": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
@@ -969,6 +1432,33 @@
}
}
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ },
+ "dependencies": {
+ "rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ }
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
@@ -989,6 +1479,12 @@
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -1025,6 +1521,15 @@
"path-is-absolute": "^1.0.0"
}
},
+ "glob-parent": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
+ "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
"global-dirs": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
@@ -1154,6 +1659,12 @@
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==",
"dev": true
},
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
"import-fresh": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
@@ -1244,6 +1755,12 @@
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
"integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g=="
},
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
"is-finite": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz",
@@ -1255,6 +1772,15 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
},
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
"is-installed-globally": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz",
@@ -1416,12 +1942,34 @@
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true
},
+ "js-yaml": {
+ "version": "3.14.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ }
+ },
"jsesc": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
"dev": true
},
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
+ },
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"json5": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
@@ -1451,6 +1999,16 @@
"package-json": "^4.0.0"
}
},
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
@@ -1995,6 +2553,12 @@
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"nise": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz",
@@ -2076,6 +2640,20 @@
"wrappy": "1"
}
},
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
"os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
@@ -2247,6 +2825,12 @@
"pinkie": "^2.0.0"
}
},
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
"prepend-http": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
@@ -2259,6 +2843,12 @@
"integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
"dev": true
},
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise.allsettled": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz",
@@ -2370,6 +2960,12 @@
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
"dev": true
},
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"registry-auth-token": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz",
@@ -2525,6 +3121,49 @@
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
"dev": true
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -2649,6 +3288,58 @@
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
"term-size": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
@@ -2658,6 +3349,12 @@
"execa": "^0.7.0"
}
},
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"timed-out": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
@@ -2702,12 +3399,27 @@
"yn": "3.1.1"
}
},
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
"dev": true
},
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ },
"typescript": {
"version": "3.7.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
@@ -2752,6 +3464,15 @@
"xdg-basedir": "^3.0.0"
}
},
+ "uri-js": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
+ "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
+ "dev": true,
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
"url-parse-lax": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",
@@ -2766,6 +3487,12 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -2862,6 +3589,12 @@
}
}
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
+ },
"workerpool": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz",
diff --git a/packages/sitecore-jss-manifest/package.json b/packages/sitecore-jss-manifest/package.json
index 7a818b8eca..6cf783d61d 100644
--- a/packages/sitecore-jss-manifest/package.json
+++ b/packages/sitecore-jss-manifest/package.json
@@ -6,7 +6,7 @@
"scripts": {
"build": "npm run clean && tsc",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ../../tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
"prepublishOnly": "npm run build",
"generate": "npm run build && node ./dist/bin/manifest generate --files ./src/testData/**/*.sitecore.ts --compilers ts-node/register --appName testApp --outputPath ./sitecore/sitecore-import.json --language en",
@@ -50,6 +50,7 @@
"chalk": "^2.4.1",
"del": "^3.0.0",
"del-cli": "^1.1.0",
+ "eslint": "^7.15.0",
"mocha": "^8.1.3",
"sinon": "^7.0.0",
"typescript": "^3.1.3"
diff --git a/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts b/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts
index 8782b003d9..806699929e 100644
--- a/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts
+++ b/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts
@@ -1,6 +1,9 @@
import { ManifestInstance } from './manifest.types';
import { traverseAllItems, traverseAllRenderings } from './traversal';
+/**
+ * @param {string} value
+ */
function isGuid(value: string) {
return /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/.test(
value
@@ -57,9 +60,7 @@ export const createIdMapping = (manifest: ManifestInstance) => {
if (!usedIdMap.has(reference.id)) {
if (isGuid(reference.id)) {
console.warn(
- `The referenced ID ${
- reference.id
- } was not defined in the manifest. Ensure that this item ID already exists in Sitecore before importing.`
+ `The referenced ID ${reference.id} was not defined in the manifest. Ensure that this item ID already exists in Sitecore before importing.`
);
} else {
throw new Error(
diff --git a/packages/sitecore-jss-manifest/src/generator/dynamicPlaceholders.ts b/packages/sitecore-jss-manifest/src/generator/dynamicPlaceholders.ts
index 10e6693668..3a790aefb6 100644
--- a/packages/sitecore-jss-manifest/src/generator/dynamicPlaceholders.ts
+++ b/packages/sitecore-jss-manifest/src/generator/dynamicPlaceholders.ts
@@ -26,7 +26,7 @@ const formatGuid = (guid: string) => {
export const getDynamicPlaceholderKey = (
parentPlaceholderPath: string,
- rendering: { uid: string, [key: string]: any },
+ rendering: { [key: string]: any; uid: string },
placeholderName: string
) => {
if (rendering && rendering.uid) {
diff --git a/packages/sitecore-jss-manifest/src/generator/generate.ts b/packages/sitecore-jss-manifest/src/generator/generate.ts
index 48217b9b52..396936068e 100644
--- a/packages/sitecore-jss-manifest/src/generator/generate.ts
+++ b/packages/sitecore-jss-manifest/src/generator/generate.ts
@@ -89,7 +89,6 @@ const copyMedia = (mediaPaths: Array<{ src: string }>, outputPath: string) => {
console.log(`copied media from: ${mediaSourcePath} to: ${mediaDestinationPath}`);
return { source: mediaSourcePath, destination: mediaDestinationPath, success: true };
}
- // tslint:disable-next-line:no-string-throw
throw `Source media file referred to in manifest data doesn't exist: ${mediaSourcePath}`;
});
};
@@ -112,7 +111,7 @@ const writeOutput = async ({
}
// we remove the media prop as it's unused by the manifest after copying media
- // eslint-disable-next-line no-unused-vars
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
const { media, ...finalManifest } = manifest;
await fs.writeJson(outputPath, finalManifest, { spaces: 2 });
@@ -164,10 +163,14 @@ export interface GenerateToFileOptions extends GenerateOptions {
excludeMedia?: boolean;
}
-// generates the JSON manifest and returns it as a variable
-// NOTE: media is not copied into the manifest when using this method,
-// and no files are written to disk. Use generateToFile() to make a manifest
-// that is designed to get packaged/imported.
+/**
+ * generates the JSON manifest and returns it as a variable
+ * NOTE: media is not copied into the manifest when using this method,
+ * and no files are written to disk. Use generateToFile() to make a manifest
+ * that is designed to get packaged/imported.
+ *
+ * @param {GenerateOptions} config
+ */
export async function generateToVariable({
requireArg,
fileGlobs,
@@ -205,8 +208,12 @@ export async function generateToVariable({
return manifestOutput;
}
-// generates a JSON manifest and writes its contents to a directory. Media referenced in the manifest
-// is also copied to the directory.
+/**
+ * generates a JSON manifest and writes its contents to a directory. Media referenced in the manifest
+ * is also copied to the directory.
+ *
+ * @param {GenerateToFileOptions} config
+ */
export async function generateToFile({
outputPath = 'console',
excludeMedia = false,
diff --git a/packages/sitecore-jss-manifest/src/generator/manifest.babel-shim.ts b/packages/sitecore-jss-manifest/src/generator/manifest.babel-shim.ts
index 12c00c1e4b..1fd2cd0a02 100644
--- a/packages/sitecore-jss-manifest/src/generator/manifest.babel-shim.ts
+++ b/packages/sitecore-jss-manifest/src/generator/manifest.babel-shim.ts
@@ -9,29 +9,69 @@ import { Manifest } from './manifest.types';
// DEPRECATED: favor using typing JSDoc instead, e.g. @param {Manifest} manifest Manifest instance to add components to
-export function addComponent(manifest: Manifest, ...components: ManifestTypes.ComponentDefinition[]) {
+/**
+ * @param {Manifest} manifest
+ * @param {...any} components
+ */
+export function addComponent(
+ manifest: Manifest,
+ ...components: ManifestTypes.ComponentDefinition[]
+) {
manifest.addComponent(...components);
}
+/**
+ * @param {Manifest} manifest
+ * @param {...any} templates
+ */
export function addTemplate(manifest: Manifest, ...templates: ManifestTypes.TemplateDefinition[]) {
manifest.addTemplate(...templates);
}
-export function addPlaceholder(manifest: Manifest, ...placeholders: ManifestTypes.PlaceholderDefinition[]) {
+/**
+ * @param {Manifest} manifest
+ * @param {...any} placeholders
+ */
+export function addPlaceholder(
+ manifest: Manifest,
+ ...placeholders: ManifestTypes.PlaceholderDefinition[]
+) {
manifest.addPlaceholder(...placeholders);
}
-export function addRouteType(manifest: Manifest, ...routeTypes: ManifestTypes.TemplateDefinition[]) {
+/**
+ * @param {Manifest} manifest
+ * @param {...any} routeTypes
+ */
+export function addRouteType(
+ manifest: Manifest,
+ ...routeTypes: ManifestTypes.TemplateDefinition[]
+) {
manifest.addRouteType(...routeTypes);
}
+/**
+ * @param {Manifest} manifest
+ * @param {...any} routes
+ */
export function addRoute(manifest: Manifest, ...routes: ManifestTypes.RouteDefinition[]) {
manifest.addRoute(...routes);
}
+/**
+ * @param {Manifest} manifest
+ * @param {...any} contents
+ */
export function addContent(manifest: Manifest, ...contents: ManifestTypes.ItemDefinition[]) {
manifest.addContent(...contents);
}
-export function addDictionary(manifest: Manifest, ...entries: Array<{ key: string, value: string }>) {
+/**
+ * @param {Manifest} manifest
+ * @param {...any} entries
+ */
+export function addDictionary(
+ manifest: Manifest,
+ ...entries: Array<{ key: string; value: string }>
+) {
manifest.addDictionary(...entries);
}
diff --git a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts
index efeb605662..b4c31bdc12 100644
--- a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts
+++ b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts
@@ -48,7 +48,7 @@ export interface Manifest {
/**
* Adds a translation dictionary entry to the manifest.
*/
- addDictionary: (...entries: Array<{ key: string, value: string }>) => void;
+ addDictionary: (...entries: Array<{ key: string; value: string }>) => void;
language: string;
}
@@ -56,8 +56,8 @@ export interface ManifestInstance {
appName: string;
templates: TemplateDefinition[];
items: {
- routes: RouteDefinition[],
- nonRoutes: ItemDefinition[],
+ routes: RouteDefinition[];
+ nonRoutes: ItemDefinition[];
};
placeholders: PlaceholderDefinition[];
media?: any[];
@@ -152,13 +152,11 @@ export interface FieldDefinition {
storage?: FieldStorage;
}
-// tslint:disable:no-empty-interface
/**
* Defines a non-content parameter that can be set on a component.
* Parameters are more developer-focused options than fields, such as configurable CSS classes.
*/
-export interface RenderingParameterDefinition extends FieldDefinition {
-}
+export type RenderingParameterDefinition = FieldDefinition;
/**
* Explicitly defines a placeholder name, and allows setting the display name.
@@ -332,7 +330,13 @@ export interface LinkFieldValue {
}
export interface ContentFieldValue {
- value: string | number | boolean | ImageFieldValue | LinkFieldValue | Array;
+ value:
+ | string
+ | number
+ | boolean
+ | ImageFieldValue
+ | LinkFieldValue
+ | Array;
editable?: string;
}
@@ -341,7 +345,7 @@ export interface ItemDefinition {
template: string;
displayName?: string;
id?: string;
- fields?: {[key: string]: ContentFieldValue};
+ fields?: { [key: string]: ContentFieldValue };
children?: Array;
path?: string;
insertOptions?: string[];
@@ -351,20 +355,24 @@ export interface ItemReference {
id: string;
}
+/**
+ * @param {ItemDefinition | ItemReference} obj
+ */
export function isItemDefinition(obj: ItemDefinition | ItemReference): obj is ItemDefinition {
return (obj as ItemDefinition).name !== undefined;
}
export interface RouteDefinition extends ItemDefinition {
- placeholders?: {[key: string]: ComponentInstanceDefinition[]};
+ placeholders?: { [key: string]: ComponentInstanceDefinition[] };
}
export interface ComponentInstanceDefinition extends ItemDefinition {
componentName: string;
- placeholders?: {[key: string]: ComponentInstanceDefinition[]};
+ placeholders?: { [key: string]: ComponentInstanceDefinition[] };
}
export interface GeneratePipelineArgs {
+ [key: string]: any;
debug: boolean;
skipPlaceholderBlacklist: boolean;
components: ComponentDefinition[];
@@ -377,8 +385,6 @@ export interface GeneratePipelineArgs {
language: string;
pipelines: { [key: string]: ExecutablePipeline };
pipelineResult: ManifestInstance & { [key: string]: any };
-
- [key: string]: any;
}
export interface GenerateContentItemArgs extends GeneratePipelineArgs {
@@ -397,24 +403,31 @@ export interface GeneratePlaceholdersPipelineArgs {
}
export interface GenerateRouteItemPipelineArgs {
+ [key: string]: any;
route: RouteDefinition;
components: ComponentDefinition[];
pipelines: { [key: string]: ExecutablePipeline };
item: any;
dynamicPlaceholderKeyGenerator: (key: string, rendering: any, parentKey: string) => string;
- datasourceNamer: ({ item, placeholder, rendering, index, }: {
- item: any;
- placeholder: any;
- rendering: any;
- index: number;
- }) => string;
- datasourceDisplayNamer: ({ rendering, index, }: {
- item: any;
- placeholder: any;
- rendering: any;
- index: number;
- }) => string;
+ datasourceNamer: ({
+ item,
+ placeholder,
+ rendering,
+ index,
+ }: {
+ item: any;
+ placeholder: any;
+ rendering: any;
+ index: number;
+ }) => string;
+ datasourceDisplayNamer: ({
+ rendering,
+ index,
+ }: {
+ item: any;
+ placeholder: any;
+ rendering: any;
+ index: number;
+ }) => string;
onRenderingProcessed?: (rendering: any) => void;
-
- [key: string]: any;
}
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts
index 6f9cf7f267..c199cf7a5e 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts
@@ -3,7 +3,7 @@ import { GenerateContentItemArgs } from '../../manifest.types';
import { convertComponentDataToFields, findTemplate, validateFieldDefinitions } from '../../utils';
export default (args: GenerateContentItemArgs) => {
- const { componentName, ...item } = (args.content as any);
+ const { componentName, ...item } = args.content as any;
delete item.children;
delete item.path;
@@ -16,16 +16,28 @@ export default (args: GenerateContentItemArgs) => {
const template = findTemplate(item.template, args.components, args.templates);
if (!template && item.template !== 'Folder') {
- // tslint:disable-next-line:max-line-length
- console.warn(chalk.yellow(`Template ${item.template} used on ${item.name} was not defined in the manifest. If this is not a known Sitecore template or GUID the import will fail.`));
+ console.warn(
+ chalk.yellow(
+ `Template ${item.template} used on ${item.name} was not defined in the manifest. If this is not a known Sitecore template or GUID the import will fail.`
+ )
+ );
}
if (args.content.fields) {
let renderingFields = args.content.fields;
if (template) {
- // tslint:disable-next-line:max-line-length
- const handleError = (fieldName: string) => { throw chalk.red(`Item '${item.name}' defined data for field '${fieldName}'. This field is not defined on '${template.name}'. It may be a typo, or the field may need to be added to the template/component definition.`); };
- renderingFields = validateFieldDefinitions(args.content.fields, template, handleError, args.templates, args.components);
+ const handleError = (fieldName: string) => {
+ throw chalk.red(
+ `Item '${item.name}' defined data for field '${fieldName}'. This field is not defined on '${template.name}'. It may be a typo, or the field may need to be added to the template/component definition.`
+ );
+ };
+ renderingFields = validateFieldDefinitions(
+ args.content.fields,
+ template,
+ handleError,
+ args.templates,
+ args.components
+ );
}
item.fields = convertComponentDataToFields({ data: renderingFields, context: { item } });
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/processNestedContent.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/processNestedContent.ts
index 5a19cec712..3e2c0adca2 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/processNestedContent.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/processNestedContent.ts
@@ -7,7 +7,7 @@ export default async (args: GenerateContentItemArgs) => {
const actualContent = (content as any) as ItemDefinition;
if (actualContent.children && actualContent.children.length > 0) {
const pipeline = { ...pipelines.generateContentItem };
- const pipelineArgs: GenerateContentItemArgs = {
+ const pipelineArgs: GenerateContentItemArgs = {
...pipeline.args,
...args,
};
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/expandReferencedContent.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/expandReferencedContent.ts
index 7b51758a3c..f5bebd2296 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/expandReferencedContent.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/expandReferencedContent.ts
@@ -6,6 +6,9 @@ import { traverseAllItems } from '../../traversal';
// into the manifest. Only items with 'copy:true' are normally fully expanded.
// If manifesting for disconnected mode, we expand everything to provide a complete datasource.
+/**
+ * @param {ManifestInstance} manifest
+ */
function expandReferencedContent(manifest: ManifestInstance) {
// because of transitive references we may need to make multiple expand passes
let expandedItems = false;
@@ -27,7 +30,9 @@ function expandReferencedContent(manifest: ManifestInstance) {
// in a duplicate ID definition. There are two possible cases here:
// (a) an ID reference, in which case removing the ID will not affect the original referenced child ID
// (b) an ID with copy reference, in which case the copy would legitimately always be a duplicate ID unless we unset it
- traverseAllItems(refDeepClone.children, (item) => { delete item.id; });
+ traverseAllItems(refDeepClone.children, (item) => {
+ delete item.id;
+ });
if (targetType === 'rendering') {
expandedRef.dataSource = expandedRef.dataSource || {};
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateContentItems.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateContentItems.ts
index f4246bc53f..3149a77e86 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateContentItems.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateContentItems.ts
@@ -39,7 +39,7 @@ const generateContentItems = async (
export default async (args: GeneratePipelineArgs) => {
const { content, pipelines, components, templates } = args;
- const contentItems = await generateContentItems(content, templates, components, pipelines);
+ const contentItems = await generateContentItems(content, templates, components, pipelines);
return {
...args,
pipelineResult: {
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generatePlaceholders.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generatePlaceholders.ts
index 7a317ccd70..eee71c3f38 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generatePlaceholders.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generatePlaceholders.ts
@@ -1,9 +1,14 @@
import { runPipeline } from '@sitecore-jss/sitecore-pipelines';
import { GeneratePipelineArgs, GeneratePlaceholdersPipelineArgs } from '../../manifest.types';
-const generatePlaceholders = async (
- { items, renderings, placeholders, pipelines, rootPlaceholders, skipPlaceholderBlacklist }: any) => {
-
+const generatePlaceholders = async ({
+ items,
+ renderings,
+ placeholders,
+ pipelines,
+ rootPlaceholders,
+ skipPlaceholderBlacklist,
+}: any) => {
const pipeline = { ...pipelines.generatePlaceholders };
const pipelineArgs: GeneratePlaceholdersPipelineArgs = {
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRenderings.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRenderings.ts
index 427b6f24a4..0ca9614629 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRenderings.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRenderings.ts
@@ -1,4 +1,8 @@
-import { GeneratePipelineArgs, RenderingParameterDefinition, CommonFieldTypes } from '../../manifest.types';
+import {
+ GeneratePipelineArgs,
+ RenderingParameterDefinition,
+ CommonFieldTypes,
+} from '../../manifest.types';
import { checkUnique } from '../../utils';
const getExposedPlaceholders = (component: any) => {
@@ -25,7 +29,7 @@ const getDataSourceTemplate = (component: any, templates: any) => {
return '';
};
-const generateRenderings = ({ components, templates }: { components: any, templates: any }) =>
+const generateRenderings = ({ components, templates }: { components: any; templates: any }) =>
components.map((component: any) => {
const { renderingId, ...rendering } = component;
@@ -46,7 +50,6 @@ const generateRenderings = ({ components, templates }: { components: any, templa
// we normalize that into an object format for the manifest for easier ingestion
if (rendering.params) {
if (!Array.isArray(rendering.params)) {
- // tslint:disable-next-line:no-string-throw
throw `The params property on the component definition for ${rendering.name} is invalid (not an array)`;
}
@@ -72,15 +75,17 @@ export default (args: GeneratePipelineArgs) => {
const duplicateIds = checkUnique(finalRenderings, (rendering) => rendering.id);
if (duplicateIds.length > 0) {
- // tslint:disable-next-line:no-string-throw
- throw `The manifest defined duplicate rendering IDs: ${duplicateIds.join(',')}. This is not allowed.`;
+ throw `The manifest defined duplicate rendering IDs: ${duplicateIds.join(
+ ','
+ )}. This is not allowed.`;
}
const duplicateNames = checkUnique(finalRenderings, (rendering) => rendering.name);
if (duplicateNames.length > 0) {
- // tslint:disable-next-line:no-string-throw
- throw `The manifest defined duplicate rendering names: ${duplicateNames.join(',')}. This is not allowed.`;
+ throw `The manifest defined duplicate rendering names: ${duplicateNames.join(
+ ','
+ )}. This is not allowed.`;
}
return {
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRouteItems.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRouteItems.ts
index ddf239ca6b..181d5d3373 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRouteItems.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRouteItems.ts
@@ -3,13 +3,13 @@ import {
ComponentDefinition,
GeneratePipelineArgs,
GenerateRouteItemPipelineArgs,
- RouteDefinition
+ RouteDefinition,
} from '../../manifest.types';
const generateRouteItems = async (
routes: RouteDefinition[],
components: ComponentDefinition[],
- pipelines: { [key: string]: ExecutablePipeline },
+ pipelines: { [key: string]: ExecutablePipeline }
) => {
const result: any[] = [];
const pipeline = { ...pipelines.generateRouteItem };
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts
index ecbc385ced..65fcb6d61c 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts
@@ -7,7 +7,6 @@ export default (args: any) => {
const templates = components.reduce((result: any, component: any) => {
// throw if you defined a single ID for a component (which since it splits into a template + rendering, needs two explicit IDs set)
if (component.id) {
- // tslint:disable-next-line:no-string-throw max-line-length
throw `The component ${component.name} defined an 'id'. Because a component becomes two separate items in Sitecore, it must have two separate IDs. Please specify unique 'templateId' and 'renderingId' properties instead.`;
}
@@ -44,15 +43,17 @@ export default (args: any) => {
const duplicateIds = checkUnique(finalTemplates, (template) => template.id);
if (duplicateIds.length > 0) {
- // tslint:disable-next-line:no-string-throw
- throw `The manifest defined duplicate template IDs: ${duplicateIds.join(',')}. This is not allowed.`;
+ throw `The manifest defined duplicate template IDs: ${duplicateIds.join(
+ ','
+ )}. This is not allowed.`;
}
const duplicateNames = checkUnique(finalTemplates, (template) => template.name);
if (duplicateNames.length > 0) {
- // tslint:disable-next-line:no-string-throw
- throw `The manifest defined duplicate template names: ${duplicateNames.join(',')}. This is not allowed.`;
+ throw `The manifest defined duplicate template names: ${duplicateNames.join(
+ ','
+ )}. This is not allowed.`;
}
return {
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts
index b1ccc23aeb..dba77c11c0 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts
@@ -10,11 +10,15 @@ export const enhanceTemplates = (templates: any) => {
return newTemplates;
};
-// NOTE: this function does not attempt to do anything about field names
-// that might be duplicated in the template inheritance tree. That said, for
-// the purposes of extracting media field values, we don't need to be concerned
-// about duplicates or naming collisions. We simply need a field type and
-// a field value.
+/**
+ * NOTE: this function does not attempt to do anything about field names
+ * that might be duplicated in the template inheritance tree. That said, for
+ * the purposes of extracting media field values, we don't need to be concerned
+ * about duplicates or naming collisions. We simply need a field type and
+ * a field value.
+ * @param {any} template
+ * @param {any} templateCollection
+ */
function getAllTemplateFields(template: any, templateCollection: any) {
if (!template) {
return null;
@@ -27,7 +31,7 @@ function getAllTemplateFields(template: any, templateCollection: any) {
}
const allFields: any[] = [];
-
+
// If the template has its own fields, add them to the `allFields` array.
if (template.fields && Array.isArray(template.fields)) {
allFields.push(...template.fields);
@@ -37,10 +41,14 @@ function getAllTemplateFields(template: any, templateCollection: any) {
if (template.inherits && Array.isArray(template.inherits)) {
template.inherits.forEach((inheritedTemplateName) => {
const inheritedTemplate = templateCollection.find((t) => t.name === inheritedTemplateName);
- if (!inheritedTemplate || !inheritedTemplate.fields || !Array.isArray(inheritedTemplate.fields)) {
+ if (
+ !inheritedTemplate ||
+ !inheritedTemplate.fields ||
+ !Array.isArray(inheritedTemplate.fields)
+ ) {
return;
}
-
+
const inheritedFields = getAllTemplateFields(inheritedTemplate, templateCollection);
if (inheritedFields) {
allFields.push(...inheritedFields);
@@ -51,10 +59,17 @@ function getAllTemplateFields(template: any, templateCollection: any) {
return allFields;
}
+/**
+ * @param {any} field
+ */
function getMediaFieldValue(field: any) {
return field.value;
}
+/**
+ * @param {any} field
+ * @param {any} templates
+ */
function getNestedFieldValue(field: any, templates: any) {
// If there is only one item
if (!Array.isArray(field.value)) {
@@ -68,6 +83,11 @@ function getNestedFieldValue(field: any, templates: any) {
}, []);
}
+/**
+ * @param {Object} param
+ * @param {any} param.field
+ * @param {any} param.templates
+ */
function getFieldValues({ field, templates }: { field: any; templates: any }) {
switch (field.type) {
case 'Image':
@@ -83,6 +103,10 @@ function getFieldValues({ field, templates }: { field: any; templates: any }) {
}
}
+/**
+ * @param {any} item
+ * @param {any} templates
+ */
export function buildMediaOutput(item: any, templates: any) {
const template = templates.getTemplate(item.template);
if (!template) {
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts
index b595710b0b..38979297b0 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts
@@ -22,19 +22,24 @@ export default (args: GeneratePlaceholdersPipelineArgs) => {
return args;
}
- const blacklistedPlaceholders = args.placeholders.filter((placeholder) => blacklistedKeys.has(placeholder.name));
+ const blacklistedPlaceholders = args.placeholders.filter((placeholder) =>
+ blacklistedKeys.has(placeholder.name)
+ );
if (blacklistedPlaceholders.length === 0) {
return args;
}
- console.error(`The manifest used the following reserved placeholder key names:`);
+ console.error('The manifest used the following reserved placeholder key names:');
blacklistedPlaceholders.forEach((ph) => console.error(ph.name));
console.error();
- console.error('These placeholder name(s) are reserved by the Sitecore system or SXA, and cannot be used without conflict.');
+ console.error(
+ 'These placeholder name(s) are reserved by the Sitecore system or SXA, and cannot be used without conflict.'
+ );
console.error('Consider renaming these placeholders to have a prefix specific to your JSS app.');
- console.error('If you understand the risks and want to use these placeholder names anyway, pass --allowConflictingPlaceholderNames');
+ console.error(
+ 'If you understand the risks and want to use these placeholder names anyway, pass --allowConflictingPlaceholderNames'
+ );
- // tslint:disable-next-line:no-string-throw
throw 'Aborting due to invalid placeholder name.';
};
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/mergePlaceholders.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/mergePlaceholders.test.ts
index 6678c03a30..095d9cca47 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/mergePlaceholders.test.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/mergePlaceholders.test.ts
@@ -4,9 +4,7 @@ import mergePlaceholders from './mergePlaceholders';
describe('generatePlaceholders pipeline', () => {
describe('mergePlaceholders processor', () => {
it('should add placeholders that are not already in the collection', () => {
- const root = [
- 'porg',
- ];
+ const root = ['porg'];
const existing = [
{
@@ -24,7 +22,11 @@ describe('generatePlaceholders pipeline', () => {
];
const additional = ['oak', 'maple'];
const discovered = [...additional, ...existing.slice(0, 2).map((ph) => ph.name)];
- const expected = [...existing, ...additional.map((name) => ({ name })), ...root.map((name) => ({ name }))];
+ const expected = [
+ ...existing,
+ ...additional.map((name) => ({ name })),
+ ...root.map((name) => ({ name })),
+ ];
const args: any = {
placeholders: existing,
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/pipeline.config.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/pipeline.config.ts
index d16f4842ff..16174842b6 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/pipeline.config.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/pipeline.config.ts
@@ -13,10 +13,10 @@ const defaultDatasourceNamer = ({
rendering,
index,
}: {
- item: any,
- placeholder: any,
- rendering: any,
- index: number
+ item: any;
+ placeholder: any;
+ rendering: any;
+ index: number;
}) => {
const placeholderKeys = placeholder.phKey.split('/');
let finalPlaceholderKey;
@@ -39,15 +39,14 @@ const defaultDatasourceDisplayNamer = ({
rendering,
index,
}: {
- item: any,
- placeholder: any,
- rendering: any,
- index: number
-}) =>
-`${rendering.componentName}-${index + 1}`;
+ item: any;
+ placeholder: any;
+ rendering: any;
+ index: number;
+}) => `${rendering.componentName}-${index + 1}`;
const defaultComponentFactory = (components: ComponentDefinition[], componentName: string) =>
-components.find((component) => component.name === componentName);
+ components.find((component) => component.name === componentName);
export const config = (pipelines: PipelineRegistry) => {
const pipeline = pipelineFactory.create('generateRouteItem');
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processPlaceholders.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processPlaceholders.ts
index 7375148321..f65f4586e4 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processPlaceholders.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processPlaceholders.ts
@@ -16,7 +16,6 @@ const getPlaceholderNames = (placeholders: { [k: string]: any } = {}, routeName:
};
if (!placeholder.renderings || !Array.isArray(placeholder.renderings)) {
- // tslint:disable-next-line:no-string-throw max-line-length
throw `Placeholder '${phName}' on route '${routeName}' contained non-array renderings data. Probably a route data authoring error. (YAML indentation?)`;
}
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.test.ts
index a0aeaa56fd..7e055738dc 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.test.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.test.ts
@@ -128,7 +128,7 @@ describe('generateRouteItem pipeline', () => {
const argObject: any = { ...args, route, item };
- // tslint:disable-next-line no-unused-expression
+ // eslint-disable-next-line no-unused-expressions
expect(() => processRenderings(argObject)).to.throw;
});
});
diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts
index c8850fa6ac..92983d43f3 100644
--- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts
+++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts
@@ -17,7 +17,7 @@ const generateRenderingParams = (component: any, rendering: any) => {
return [];
}
- const reducedParams = Object.keys(rendering.params).reduce((result: any, paramName: string) => {
+ const reducedParams = Object.keys(rendering.params).reduce((result: any, paramName: string) => {
return [
...result,
{
@@ -28,19 +28,40 @@ const generateRenderingParams = (component: any, rendering: any) => {
}, []);
if (!Array.isArray(component.params)) {
- // tslint:disable-next-line:max-line-length no-string-throw
- throw chalk.red(`An instance of ${component.name} defined param(s) '${reducedParams.map((rp) => rp.name).join(', ')}', but the component definition did not define any params. Define them on the manifest component definition to use them. Instance definition: ${JSON.stringify(rendering, null, 2)}`);
+ throw chalk.red(
+ `An instance of ${component.name} defined param(s) '${reducedParams
+ .map((rp) => rp.name)
+ .join(
+ ', '
+ )}', but the component definition did not define any params. Define them on the manifest component definition to use them. Instance definition: ${JSON.stringify(
+ rendering,
+ null,
+ 2
+ )}`
+ );
}
// find params that are not defined in manifest
- // tslint:disable-next-line:max-line-length
- const invalidParams = reducedParams.filter((param) => !component.params.some((componentParam: any) => (componentParam.name ? componentParam.name : componentParam) === param.name));
+ const invalidParams = reducedParams.filter(
+ (param) =>
+ !component.params.some(
+ (componentParam: any) =>
+ (componentParam.name ? componentParam.name : componentParam) === param.name
+ )
+ );
if (invalidParams.length > 0) {
const validParams = component.params.map((cp: any) => (cp.name ? cp.name : cp)).join(',');
const invalidParamsString = invalidParams.map((ip) => ip.name).join(', ');
- // tslint:disable-next-line:max-line-length no-string-throw
- throw chalk.red(`Param(s) ${invalidParamsString} defined on an instance of component ${component.name} was not defined on the component definition. Add it to the manifest component definition to use it. Valid params: ${validParams}. Instance definition: ${JSON.stringify(rendering, null, 2)}`);
+ throw chalk.red(
+ `Param(s) ${invalidParamsString} defined on an instance of component ${
+ component.name
+ } was not defined on the component definition. Add it to the manifest component definition to use it. Valid params: ${validParams}. Instance definition: ${JSON.stringify(
+ rendering,
+ null,
+ 2
+ )}`
+ );
}
return reducedParams;
@@ -58,9 +79,17 @@ const generateFields = (
let renderingFields = rendering.fields;
if (component) {
- // tslint:disable-next-line:max-line-length
- const handleError = (fieldName: string) => { throw chalk.red(`${dataSourceItem.name} route datasource defined data for '${fieldName}' on component ${component.name}. This field is not defined on this component. It may be a typo, or the field may need to be added to the component definition.`); };
- renderingFields = validateFieldDefinitions(rendering.fields, component, handleError, allComponents);
+ const handleError = (fieldName: string) => {
+ throw chalk.red(
+ `${dataSourceItem.name} route datasource defined data for '${fieldName}' on component ${component.name}. This field is not defined on this component. It may be a typo, or the field may need to be added to the component definition.`
+ );
+ };
+ renderingFields = validateFieldDefinitions(
+ rendering.fields,
+ component,
+ handleError,
+ allComponents
+ );
}
return convertComponentDataToFields({ data: renderingFields, context: { item: dataSourceItem } });
@@ -74,7 +103,10 @@ const generateChildrenFields = (children: Array)
}
if (child.fields) {
- (child.fields as any) = convertComponentDataToFields({ data: child.fields, context: { item: child } });
+ (child.fields as any) = convertComponentDataToFields({
+ data: child.fields,
+ context: { item: child },
+ });
}
if (child.children) {
@@ -91,19 +123,20 @@ const createDataSourceItem = ({
datasourceDisplayNamer,
...context
}: {
- rendering: any,
+ [key: string]: any;
+ rendering: any;
datasourceNamer: (options: {
- item: any,
- placeholder: any,
- rendering: any,
- index: number}) => string,
+ item: any;
+ placeholder: any;
+ rendering: any;
+ index: number;
+ }) => string;
datasourceDisplayNamer: (options: {
- item: any,
- placeholder: any,
- rendering: any,
- index: number
- }) => string,
- [key: string]: any
+ item: any;
+ placeholder: any;
+ rendering: any;
+ index: number;
+ }) => string;
}) => {
// rendering is an ID reference, not a whole rendering, so this will come from elsewhere
// UNLESS it's a copy - in which case we still want it to get named as a local DS item
@@ -142,14 +175,18 @@ const createDataSourceItem = ({
const generatePlaceholderKey = (
dynamicPlaceholderKeyGenerator: (key: string, rendering: any, parentKey: string) => string,
- placeholder: { phKey: string, phName: string },
+ placeholder: { phKey: string; phName: string },
rendering: any
) => {
const phKey = dynamicPlaceholderKeyGenerator(placeholder.phKey, rendering, placeholder.phName);
return phKey;
};
-const generateRenderingUid = (renderingName: string, renderingIndex: number, parentPlaceholderKey: string) => {
+const generateRenderingUid = (
+ renderingName: string,
+ renderingIndex: number,
+ parentPlaceholderKey: string
+) => {
// 1. We calculate the deterministic namespace UUID for the parent placeholder
const parentNamespace = uuid(renderingName + parentPlaceholderKey, JSS_UUID_NAMESPACE);
@@ -160,7 +197,11 @@ const generateRenderingUid = (renderingName: string, renderingIndex: number, par
return `{${renderingUid.toUpperCase()}}`;
};
-const processRendering = (rendering: any, index: number, context: GenerateRouteItemPipelineArgs) => {
+const processRendering = (
+ rendering: any,
+ index: number,
+ context: GenerateRouteItemPipelineArgs
+) => {
const newContext = { ...context, rendering, index };
const dsItem = createDataSourceItem(newContext);
@@ -168,8 +209,8 @@ const processRendering = (rendering: any, index: number, context: GenerateRouteI
// check for component def, as long as the component isn't an id-only ref
// (defines id but not name)
if (!component && rendering.componentName) {
- // tslint:disable-next-line:max-line-length
- throw chalk.red(`The component '${rendering.componentName}' used on route '${context.route.name}' was not defined in the manifest. Please define this component with 'manifest.addComponent()', or change the name to an existing component name.`
+ throw chalk.red(
+ `The component '${rendering.componentName}' used on route '${context.route.name}' was not defined in the manifest. Please define this component with 'manifest.addComponent()', or change the name to an existing component name.`
);
}
@@ -178,7 +219,7 @@ const processRendering = (rendering: any, index: number, context: GenerateRouteI
const fields = generateFields(component, rendering, dsItem, context.components);
dsItem.fields = fields;
- const layoutRendering: {[k: string]: any} = {
+ const layoutRendering: { [k: string]: any } = {
renderingName: rendering.componentName,
placeholderKey: context.placeholder.phKey,
placeholderName: context.placeholder.phName,
@@ -217,8 +258,8 @@ const processRendering = (rendering: any, index: number, context: GenerateRouteI
const processPlaceholders = (
context: GenerateRouteItemPipelineArgs,
- placeholders?: { [key: string]: ComponentInstanceDefinition[] }) => {
-
+ placeholders?: { [key: string]: ComponentInstanceDefinition[] }
+) => {
if (!placeholders) {
return;
}
@@ -269,8 +310,9 @@ export default (args: GenerateRouteItemPipelineArgs) => {
); // https://stackoverflow.com/a/47298567/201808
if (duplicateDatasourceNames.size > 0) {
const dupes = JSON.stringify(Array.from(duplicateDatasourceNames));
- // tslint:disable-next-line:max-line-length
- throw chalk.red(`Route "${args.item.name}" has rendering(s) with identical names: ${dupes}. Please assign unique rendering names using the 'name' property.`);
+ throw chalk.red(
+ `Route "${args.item.name}" has rendering(s) with identical names: ${dupes}. Please assign unique rendering names using the 'name' property.`
+ );
}
return {
diff --git a/packages/sitecore-jss-manifest/src/generator/traversal.ts b/packages/sitecore-jss-manifest/src/generator/traversal.ts
index fcdd415dc6..e7cdcd1724 100644
--- a/packages/sitecore-jss-manifest/src/generator/traversal.ts
+++ b/packages/sitecore-jss-manifest/src/generator/traversal.ts
@@ -22,16 +22,25 @@ export const traverseItems = (items: any[], callback: (item: any, currentPath: s
traverseInternal(items, []);
};
-// traverses a tree of items on the manifest
-// includes traversal of non-root items (e.g. datasource items, treelist items)
-// `items` is the root of the tree, eg routes or nonRoutes
-// the callback gets two arguments: the item definition, and the item type
-// ('item', 'rendering', or 'datasource')
+/**
+ * traverses a tree of items on the manifest
+ * includes traversal of non-root items (e.g. datasource items, treelist items)
+ * `items` is the root of the tree, eg routes or nonRoutes
+ * the callback gets two arguments: the item definition, and the item type
+ * ('item', 'rendering', or 'datasource')
+ *
+ * @param {any[]} items
+ * @param {Function} callback
+ */
export function traverseAllItems(items: any[], callback: (item: any, type: string) => any) {
if (!items || !items.forEach) {
return;
}
+ /**
+ * @param {any} item
+ * @param {string} type
+ */
function processSingleItem(item: any, type: string) {
callback(item, type);
@@ -61,7 +70,10 @@ export function traverseAllItems(items: any[], callback: (item: any, type: strin
// individual item reference (i.e. droplink, droptree)
// checking for resolvedFromItemId in case referenced objects were not fully built the first run through
- if (currentField.value && (currentField.value.id || currentField.value.resolvedFromItemId)) {
+ if (
+ currentField.value &&
+ (currentField.value.id || currentField.value.resolvedFromItemId)
+ ) {
processCandidateFieldValue(currentField.value);
}
});
@@ -82,7 +94,12 @@ export function traverseAllItems(items: any[], callback: (item: any, type: strin
items.forEach((item: any) => processSingleItem(item, 'item'));
}
-// traverses every field value in an item array, including all children, datasource items, etc
+/**
+ * Traverses every field value in an item array, including all children, datasource items, etc
+ *
+ * @param {any} items
+ * @param {Function} callback
+ */
export function traverseAllFields(items: any, callback: (field: any) => any) {
traverseAllItems(items, (item) => {
if (!item.fields || !Array.isArray(item.fields)) {
@@ -93,7 +110,12 @@ export function traverseAllFields(items: any, callback: (field: any) => any) {
});
}
-// traverses all rendering instance definitions in an item tree
+/**
+ * Traverses all rendering instance definitions in an item tree
+ *
+ * @param {any} items
+ * @param {Function} callback
+ */
export function traverseAllRenderings(items: any, callback: (rendering: any, item: any) => any) {
traverseAllItems(items, (item, type) => {
if (type !== 'item' || !item.layout || !item.layout.renderings) {
diff --git a/packages/sitecore-jss-manifest/src/generator/utils.ts b/packages/sitecore-jss-manifest/src/generator/utils.ts
index f920c2e36e..d0db65a490 100644
--- a/packages/sitecore-jss-manifest/src/generator/utils.ts
+++ b/packages/sitecore-jss-manifest/src/generator/utils.ts
@@ -2,6 +2,9 @@ import { ComponentDefinition, ItemDefinition, TemplateDefinition } from './manif
/**
* Iterates the keys of the given object and constructs a new object with keys that satisfy the given filter function.
+ * @param {Object} obj
+ * @param {Function} filter
+ * @returns {Object} filtered object
*/
export const filterObject = (obj: any, filter: (key: string, value: any) => boolean) =>
Object.keys(obj).reduce((res, key) => {
@@ -14,13 +17,15 @@ export const filterObject = (obj: any, filter: (key: string, value: any) => bool
return res;
}, {});
-export const convertComponentDataToFields = ({ data, context: { item = {} as ItemDefinition } = {} }:
- {
- data: any,
- context: {
- item?: ItemDefinition,
- }
- }) => {
+export const convertComponentDataToFields = ({
+ data,
+ context: { item = {} as ItemDefinition } = {},
+}: {
+ data: any;
+ context: {
+ item?: ItemDefinition;
+ };
+}) => {
if (!data) {
return;
}
@@ -46,13 +51,18 @@ export const convertComponentDataToFields = ({ data, context: { item = {} as Ite
}, initialReduceValue);
};
-const mapFieldValueItem = (item: ItemDefinition, fieldValueItem: ItemDefinition, index: number, fieldName?: string) => {
+const mapFieldValueItem = (
+ item: ItemDefinition,
+ fieldValueItem: ItemDefinition,
+ index: number,
+ fieldName?: string
+) => {
// if a field references a shared item by ID, we don't want to auto-name/template it
if (fieldValueItem.id && !fieldValueItem.name) {
return fieldValueItem;
}
- const fieldItem: ItemDefinition & {[k: string]: any} = {
+ const fieldItem: ItemDefinition & { [k: string]: any } = {
template: `${item.template}-${fieldName}-Item`,
name: `${item.name}-item-${index}`,
};
@@ -81,8 +91,8 @@ const mapFieldValueItem = (item: ItemDefinition, fieldValueItem: ItemDefinition,
export interface FieldValue {
fieldValue: any;
context: {
- fieldName?: string,
- item: any
+ fieldName?: string;
+ item: any;
};
}
@@ -124,8 +134,12 @@ const processFieldValue = ({ fieldValue, context: { fieldName, item } }: FieldVa
return null;
};
-// checks if an array contains duplicate values using a selector function to get the value to check for uniqueness
-// returns array of duplicate keys - or empty array if no dupes
+/**
+ * checks if an array contains duplicate values using a selector function to get the value to check for uniqueness
+ * returns array of duplicate keys - or empty array if no dupes
+ * @param {any[]} input
+ * @param {Function} selector
+ */
export function checkUnique(input: any[], selector: (element: any) => string) {
const uniques = new Set();
const duplicates: string[] = [];
@@ -147,20 +161,30 @@ export function checkUnique(input: any[], selector: (element: any) => string) {
return duplicates;
}
-/** Finds a template definition by name in one or more arrays of template/component definitions */
-export function findTemplate(templateName: string, ...templates: Array>)
-: TemplateDefinition | ComponentDefinition | null {
+/**
+ * Finds a template definition by name in one or more arrays of template/component definitions
+ * @param {string} templateName
+ * @param {...Array>} templates
+ * @returns {TemplateDefinition | ComponentDefinition | null} template
+ */
+export function findTemplate(
+ templateName: string,
+ ...templates: Array>
+): TemplateDefinition | ComponentDefinition | null {
let templateResult: TemplateDefinition | ComponentDefinition | null = null;
- if (!templates) { return null; }
+ if (!templates) {
+ return null;
+ }
templates.forEach((templateList) => {
- if (!templateList) { return; }
+ if (!templateList) {
+ return;
+ }
const template = templateList.find((templateDef: any) => templateDef.name === templateName);
- if (template && templateResult != null) {
- // tslint:disable-next-line:no-string-throw
+ if (template && templateResult !== null) {
throw `Template ${templateName} was defined more than once with the same name.`;
}
@@ -172,31 +196,36 @@ export function findTemplate(templateName: string, ...templates: Array>} inheritedTemplates
+ * @returns {Object} validated fields
+ */
export function validateFieldDefinitions(
fields: { [key: string]: any },
template: TemplateDefinition | ComponentDefinition,
handleError: (fieldName: string) => void,
...inheritedTemplates: Array>
) {
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
inheritedTemplates.forEach(() => {});
- return filterObject(
- fields,
- (fieldName: string) => {
- // we don't have a good way to look up all inherited fields here - so if the rendering inherits a template
- // we disable field filtering so as to allow inherited fields to be defined.
- if (template.inherits) {
- // in future `inheritedTemplates` may be trawled to find inherited values and validate them too
- return true;
- }
-
- const fieldIsValid = Array.isArray(template.fields) && template.fields.some((field) => field.name === fieldName);
- if (!fieldIsValid) {
- // tslint:disable-next-line:no-string-throw max-line-length
- handleError(fieldName);
- }
- return fieldIsValid;
+ return filterObject(fields, (fieldName: string) => {
+ // we don't have a good way to look up all inherited fields here - so if the rendering inherits a template
+ // we disable field filtering so as to allow inherited fields to be defined.
+ if (template.inherits) {
+ // in future `inheritedTemplates` may be trawled to find inherited values and validate them too
+ return true;
}
- );
+
+ const fieldIsValid =
+ Array.isArray(template.fields) && template.fields.some((field) => field.name === fieldName);
+ if (!fieldIsValid) {
+ handleError(fieldName);
+ }
+ return fieldIsValid;
+ });
}
diff --git a/packages/sitecore-jss-manifest/src/generator/validators.ts b/packages/sitecore-jss-manifest/src/generator/validators.ts
index f89a786af1..9671ec1c62 100644
--- a/packages/sitecore-jss-manifest/src/generator/validators.ts
+++ b/packages/sitecore-jss-manifest/src/generator/validators.ts
@@ -17,7 +17,11 @@ const placeholderSchema = joi.object().keys({
displayName: joi.string(),
});
-const validate = (object: any, schema: any, allowUnknown: any): {
+const validate = (
+ object: any,
+ schema: any,
+ allowUnknown: any
+): {
valid: boolean;
error?: joi.ValidationError;
} => {
@@ -31,4 +35,5 @@ const validate = (object: any, schema: any, allowUnknown: any): {
export const validateTemplate = (template: any) => validate(template, templateSchema, true);
-export const validatePlaceholder = (placeholder: any) => validate(placeholder, placeholderSchema, true);
+export const validatePlaceholder = (placeholder: any) =>
+ validate(placeholder, placeholderSchema, true);
diff --git a/packages/sitecore-jss-manifest/src/testData/components/async.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/components/async.sitecore.ts
index feedd90e84..d119361cef 100644
--- a/packages/sitecore-jss-manifest/src/testData/components/async.sitecore.ts
+++ b/packages/sitecore-jss-manifest/src/testData/components/async.sitecore.ts
@@ -4,9 +4,7 @@ export default (manifest: Manifest) => {
return Promise.resolve(manifest).then((manifest1) => {
manifest1.addComponent({
name: 'AsyncComponent',
- placeholders: [
- { name: 'ph1' },
- ],
+ placeholders: [{ name: 'ph1' }],
});
});
};
diff --git a/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts
index 99735cf630..be47af27b5 100644
--- a/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts
+++ b/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts
@@ -9,12 +9,8 @@ export default (manifest: Manifest) => {
{ name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText },
{ name: 'relatedItems', displayName: 'Related Items', type: CommonFieldTypes.ContentList },
],
- placeholders: [
- { name: 'page-header' },
- ],
- params: [
- { name: 'param0' },
- ],
+ placeholders: [{ name: 'page-header' }],
+ params: [{ name: 'param0' }],
});
manifest.addComponent({
diff --git a/packages/sitecore-jss-manifest/src/testData/components/component1.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/components/component1.sitecore.ts
index 25d07bf4f5..11e6667fc4 100644
--- a/packages/sitecore-jss-manifest/src/testData/components/component1.sitecore.ts
+++ b/packages/sitecore-jss-manifest/src/testData/components/component1.sitecore.ts
@@ -4,9 +4,6 @@ export default (manifest: Manifest) => {
manifest.addComponent({
name: 'Component1',
displayName: 'Component1',
- placeholders: [
- { name: 'page-header' },
- { name: 'page-content' },
- ],
+ placeholders: [{ name: 'page-header' }, { name: 'page-content' }],
});
};
diff --git a/packages/sitecore-jss-manifest/src/testData/components/folder0/component0-0.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/components/folder0/component0-0.sitecore.ts
index 7be422a230..ab403cbdd1 100644
--- a/packages/sitecore-jss-manifest/src/testData/components/folder0/component0-0.sitecore.ts
+++ b/packages/sitecore-jss-manifest/src/testData/components/folder0/component0-0.sitecore.ts
@@ -5,14 +5,8 @@ export default (manifest: Manifest) => {
manifest.addComponent({
name: 'Component0-0',
displayName: 'Component0-0',
- fields: [
- { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText },
- ],
- placeholders: [
- { name: 'page-header' },
- ],
- params: [
- { name: 'param1' },
- ],
+ fields: [{ name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }],
+ placeholders: [{ name: 'page-header' }],
+ params: [{ name: 'param1' }],
});
};
diff --git a/packages/sitecore-jss-manifest/src/testData/content/contentData.ts b/packages/sitecore-jss-manifest/src/testData/content/contentData.ts
index 640a87285c..bf38083e7d 100644
--- a/packages/sitecore-jss-manifest/src/testData/content/contentData.ts
+++ b/packages/sitecore-jss-manifest/src/testData/content/contentData.ts
@@ -7,8 +7,9 @@ export default {
value: 'Hello World',
},
body: {
- // tslint:disable-next-line:max-line-length
- value: ' Please note that if you are an existing or new licensee or Whack Whack Star Solutions Solution Partner with a valid agreement to use the Whack Whack Star Solutions Software (\'Existing Agreement\'), the below license agreement is not intended to in any way modify or replace your Existing Agreement. If your Existing Agreement conflicts with the below license agreement, the terms of your Existing Agreement will prevail.
Whack Whack Star Solutions License Agreement
LICENSEE’S USE OF THE Whack Whack Star Solutions SOFTWARE IS SUBJECT TO LICENSEE’S FULL ACCEPTANCE OF THE TERMS, CONDITIONS, DISCLAIMERS AND LICENSE RESTRICTIONS SET FORTH IN THIS AGREEMENT.
1. License Grant : Upon payment in full of the license fee, Licensor grants Licensee a non-exclusive, perpetual, non-transferable, non-assignable, non-sublicensable license, without time limitations, to use the Whack Whack Star Solutions Software in supported configurations as described in the Documentation, in compliance with all applicable laws, in object code form only, exclusively for the Permitted Usage (as that term is defined in Exhibit A) , subject to the terms and conditions set forth in this Agreement and Exhibits A and B hereto, which are incorporated herein and made a part of this Agreement. Except as expressly authorized by this Agreement, \'Licensee\' as used herein does not include any other entity or person, including any present or future subsidiary or affiliate of Licensee, or any entity or person owning any interest in Licensee at present or in the future. Whack Whack Star Solutions Software\' means the software that is licensed by Licensor in this Agreement, and any future Upgrades and Patches, as those terms are defined in Section 6 of this Agreement, that the Licensee may receive in accordance with the terms of the Agreement. \'Documentation\' means the resources made available in the reference section of the Whack Whack Star Solutions Developer Network setting forth the then-current functional, operational, and performance capabilities of the Whack Whack Star Solutions Software (http://wwss.net/documentation).
',
+ value:
+ // eslint-disable-next-line prettier/prettier
+ ' Please note that if you are an existing or new licensee or Whack Whack Star Solutions Solution Partner with a valid agreement to use the Whack Whack Star Solutions Software (\'Existing Agreement\'), the below license agreement is not intended to in any way modify or replace your Existing Agreement. If your Existing Agreement conflicts with the below license agreement, the terms of your Existing Agreement will prevail.
Whack Whack Star Solutions License Agreement
LICENSEE’S USE OF THE Whack Whack Star Solutions SOFTWARE IS SUBJECT TO LICENSEE’S FULL ACCEPTANCE OF THE TERMS, CONDITIONS, DISCLAIMERS AND LICENSE RESTRICTIONS SET FORTH IN THIS AGREEMENT.
1. License Grant : Upon payment in full of the license fee, Licensor grants Licensee a non-exclusive, perpetual, non-transferable, non-assignable, non-sublicensable license, without time limitations, to use the Whack Whack Star Solutions Software in supported configurations as described in the Documentation, in compliance with all applicable laws, in object code form only, exclusively for the Permitted Usage (as that term is defined in Exhibit A) , subject to the terms and conditions set forth in this Agreement and Exhibits A and B hereto, which are incorporated herein and made a part of this Agreement. Except as expressly authorized by this Agreement, \'Licensee\' as used herein does not include any other entity or person, including any present or future subsidiary or affiliate of Licensee, or any entity or person owning any interest in Licensee at present or in the future. Whack Whack Star Solutions Software\' means the software that is licensed by Licensor in this Agreement, and any future Upgrades and Patches, as those terms are defined in Section 6 of this Agreement, that the Licensee may receive in accordance with the terms of the Agreement. \'Documentation\' means the resources made available in the reference section of the Whack Whack Star Solutions Developer Network setting forth the then-current functional, operational, and performance capabilities of the Whack Whack Star Solutions Software (http://wwss.net/documentation).
',
},
image: {
value: {
diff --git a/packages/sitecore-jss-manifest/src/testData/routes/route.ts b/packages/sitecore-jss-manifest/src/testData/routes/route.ts
index 4eed983668..599430ad5d 100644
--- a/packages/sitecore-jss-manifest/src/testData/routes/route.ts
+++ b/packages/sitecore-jss-manifest/src/testData/routes/route.ts
@@ -10,8 +10,8 @@ export default {
value: 'Sitecore Experience Platform + JSS',
},
text: {
- // tslint:disable-next-line:max-line-length
- value: 'From a single connected platform that also integrates with other customer-facing platforms, to a single view of the customer in a big data marketing repository, to completely eliminating much of the complexity that has previously held marketers back, the latest version of Sitecore makes customer experience highly achievable. Learn how the latest version of Sitecore gives marketers the complete data, integrated tools, and automation capabilities to engage customers throughout an iterative lifecycle – the technology foundation absolutely necessary to win customers for life.
For further information, please go to the Sitecore Documentation site
',
+ value:
+ 'From a single connected platform that also integrates with other customer-facing platforms, to a single view of the customer in a big data marketing repository, to completely eliminating much of the complexity that has previously held marketers back, the latest version of Sitecore makes customer experience highly achievable. Learn how the latest version of Sitecore gives marketers the complete data, integrated tools, and automation capabilities to engage customers throughout an iterative lifecycle – the technology foundation absolutely necessary to win customers for life.
For further information, please go to the Sitecore Documentation site
',
},
logoImage: {
value: {
diff --git a/packages/sitecore-jss-manifest/src/testData/routes/routes.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/routes/routes.sitecore.ts
index df76dbe8c6..2516dffd51 100644
--- a/packages/sitecore-jss-manifest/src/testData/routes/routes.sitecore.ts
+++ b/packages/sitecore-jss-manifest/src/testData/routes/routes.sitecore.ts
@@ -3,8 +3,6 @@ import json from './children.json';
import data from './route';
export default (manifest: Manifest) => {
- json.children = [
- data,
- ];
+ json.children = [data];
manifest.addRoute(json);
};
diff --git a/packages/sitecore-jss-manifest/src/typings.d.ts b/packages/sitecore-jss-manifest/src/typings.d.ts
index f3f5966418..bbab69d2fb 100644
--- a/packages/sitecore-jss-manifest/src/typings.d.ts
+++ b/packages/sitecore-jss-manifest/src/typings.d.ts
@@ -1,4 +1,4 @@
-declare module "*.json" {
+declare module '*.json' {
const value: any;
export default value;
}
diff --git a/packages/sitecore-jss-manifest/src/utils.ts b/packages/sitecore-jss-manifest/src/utils.ts
index 328fa58fc3..3c7aa8d2f0 100644
--- a/packages/sitecore-jss-manifest/src/utils.ts
+++ b/packages/sitecore-jss-manifest/src/utils.ts
@@ -10,7 +10,12 @@ export interface ResolveFilesArgs {
workingDirectory: string;
}
// inspired by 'lookupFiles' method: https://github.com/mochajs/mocha/blob/master/lib/utils.js
-export const resolveFiles = ({ fileGlob, extensions, recursive, workingDirectory }: ResolveFilesArgs) => {
+export const resolveFiles = ({
+ fileGlob,
+ extensions,
+ recursive,
+ workingDirectory,
+}: ResolveFilesArgs) => {
let files: string[] = [];
let lookupPath = fileGlob;
const re = new RegExp(`\\.(${extensions.join('|')})$`);
@@ -68,7 +73,13 @@ export const resolveFiles = ({ fileGlob, extensions, recursive, workingDirectory
return files;
};
-export const importModules = ({ fileGlobs = [], workingDirectory = '' }: { fileGlobs: string[], workingDirectory?: string }) => {
+export const importModules = ({
+ fileGlobs = [],
+ workingDirectory = '',
+}: {
+ fileGlobs: string[];
+ workingDirectory?: string;
+}) => {
let resolved: string[] = [];
fileGlobs.forEach((fileGlob) => {
resolved = resolved.concat(
@@ -83,6 +94,8 @@ export const importModules = ({ fileGlobs = [], workingDirectory = '' }: { fileG
// wrap import() in a function so we can control when the promise starts to resolve.
// otherwise, promises start to resolve immediately upon creation.
- const modules = resolved.map((file) => () => importFresh(nodePath.resolve(workingDirectory, file)));
+ const modules = resolved.map((file) => () =>
+ importFresh(nodePath.resolve(workingDirectory, file))
+ );
return modules;
};
diff --git a/packages/sitecore-jss-nextjs-editing-host/.eslintrc b/packages/sitecore-jss-nextjs-editing-host/.eslintrc
new file mode 100644
index 0000000000..ed43f1b103
--- /dev/null
+++ b/packages/sitecore-jss-nextjs-editing-host/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "../../.eslintrc",
+ "rules": {
+ "@typescript-eslint/explicit-module-boundary-types": "off"
+ }
+}
\ No newline at end of file
diff --git a/packages/sitecore-jss-nextjs-editing-host/.npmignore b/packages/sitecore-jss-nextjs-editing-host/.npmignore
index 81961859f2..c94806476e 100644
--- a/packages/sitecore-jss-nextjs-editing-host/.npmignore
+++ b/packages/sitecore-jss-nextjs-editing-host/.npmignore
@@ -4,13 +4,12 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
tsconfig-esm.json
-tslint.json
npm-debug*
*.log
!/types
diff --git a/packages/sitecore-jss-nextjs-editing-host/package-lock.json b/packages/sitecore-jss-nextjs-editing-host/package-lock.json
index 7a6569e013..ac43f63197 100644
--- a/packages/sitecore-jss-nextjs-editing-host/package-lock.json
+++ b/packages/sitecore-jss-nextjs-editing-host/package-lock.json
@@ -672,6 +672,62 @@
"to-fast-properties": "^2.0.0"
}
},
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
"@hapi/accept": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@hapi/accept/-/accept-5.0.1.tgz",
@@ -1241,6 +1297,12 @@
"integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==",
"dev": true
},
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
"adjust-sourcemap-loader": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-3.0.0.tgz",
@@ -1545,6 +1607,12 @@
"integrity": "sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"async-each": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
@@ -1964,6 +2032,12 @@
"write-file-atomic": "^3.0.0"
}
},
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true
+ },
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@@ -2909,6 +2983,12 @@
"dev": true,
"optional": true
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+ "dev": true
+ },
"default-require-extensions": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz",
@@ -3059,6 +3139,15 @@
"path-type": "^4.0.0"
}
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"dom-serializer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.0.1.tgz",
@@ -3259,6 +3348,15 @@
}
}
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"entities": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
@@ -3338,6 +3436,123 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
"eslint-scope": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
@@ -3348,12 +3563,77 @@
"estraverse": "^4.1.1"
}
},
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
+ },
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
"esrecurse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
@@ -3618,6 +3898,12 @@
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "dev": true
+ },
"fastq": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz",
@@ -3633,6 +3919,15 @@
"integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==",
"dev": true
},
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -3683,6 +3978,22 @@
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
"dev": true
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"flush-write-stream": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
@@ -3860,6 +4171,12 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"gauge": {
"version": "2.7.4",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
@@ -4354,6 +4671,24 @@
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "dependencies": {
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ }
+ }
+ },
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@@ -4773,6 +5108,12 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"json5": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
@@ -4800,6 +5141,16 @@
"integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==",
"dev": true
},
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
"line-column": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/line-column/-/line-column-1.0.2.tgz",
@@ -5356,6 +5707,12 @@
"querystring": "^0.2.0"
}
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
@@ -5938,6 +6295,20 @@
"wrappy": "1"
}
},
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
"os-browserify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
@@ -6032,6 +6403,15 @@
}
}
},
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
"parse-asn1": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
@@ -6673,6 +7053,12 @@
}
}
},
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@@ -6694,6 +7080,12 @@
"fromentries": "^1.2.0"
}
},
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise-inflight": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
@@ -7033,6 +7425,12 @@
"integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==",
"dev": true
},
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"release-zalgo": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz",
@@ -7602,6 +8000,25 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -8092,6 +8509,58 @@
"has-flag": "^4.0.0"
}
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
"tapable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
@@ -8261,6 +8730,12 @@
"minimatch": "^3.0.4"
}
},
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"through2": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
@@ -8411,24 +8886,6 @@
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
- "tslint-react": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-4.1.0.tgz",
- "integrity": "sha512-Y7CbFn09X7Mpg6rc7t/WPbmjx9xPI8p1RsQyiGCLWgDR6sh3+IBSlT+bEkc0PSZcWwClOkqq2wPsID8Vep6szQ==",
- "dev": true,
- "requires": {
- "tsutils": "^3.9.1"
- }
- },
- "tsutils": {
- "version": "3.17.1",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz",
- "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==",
- "dev": true,
- "requires": {
- "tslib": "^1.8.1"
- }
- },
"tty-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
@@ -8451,6 +8908,15 @@
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==",
"dev": true
},
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
@@ -8661,6 +9127,12 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -9194,6 +9666,12 @@
"string-width": "^1.0.2 || 2"
}
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
+ },
"worker-farm": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz",
diff --git a/packages/sitecore-jss-nextjs-editing-host/package.json b/packages/sitecore-jss-nextjs-editing-host/package.json
index 1a3605c35a..9124aa2dec 100644
--- a/packages/sitecore-jss-nextjs-editing-host/package.json
+++ b/packages/sitecore-jss-nextjs-editing-host/package.json
@@ -5,7 +5,7 @@
"scripts": {
"build": "npm run clean && tsc",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ./tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
"prepublishOnly": "npm run build",
"coverage": "nyc --require ts-node/register npm test"
@@ -40,6 +40,7 @@
"chai-string": "^1.5.0",
"chalk": "^4.1.0",
"del-cli": "^3.0.1",
+ "eslint": "^7.15.0",
"mocha": "^8.1.3",
"next": "^10.0.3",
"nyc": "^15.1.0",
@@ -48,7 +49,6 @@
"sinon": "^9.2.1",
"sinon-chai": "^3.5.0",
"ts-node": "^9.0.0",
- "tslint-react": "^4.0.0",
"typescript": "^4.0.2"
},
"peerDependencies": {
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts b/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts
index 136bd0018a..d4aaa60611 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts
@@ -11,7 +11,7 @@
*/
type IteratorFunction = (url: string, attributeName: string) => string;
-/*!
+/* !
* The magic, find all occurences of `attr="/`, ignoring any `//` found,
* ensure that the leading `/` of the url is not captured
*
@@ -19,7 +19,7 @@ type IteratorFunction = (url: string, attributeName: string) => string;
*/
const rx = /((href|src|codebase|cite|background|cite|action|profile|formaction|icon|manifest|archive|srcset|poster)=["'])(([.]+\/)|(?:\/))(?!\/)/g;
-/*!
+/* !
* Match the same as above, but capture the full URL for iteration
*/
const captureRx = /((href|src|codebase|cite|background|cite|action|profile|formaction|icon|manifest|archive|srcset|poster)=["'])((([.]+\/)|(?:\/))(?!\/)[^"']*)/g;
@@ -28,8 +28,11 @@ const captureRx = /((href|src|codebase|cite|background|cite|action|profile|forma
* URL replacement using function iteration, this is handled slightly
* different as the user will be supplied with the full attribute value
* for replacement, and will be inserted back correctly
+ * @param {string} str
+ * @param {IteratorFunction} iterator
+ * @returns {string} result
*/
-const iterate = function (str: string, iterator: IteratorFunction): string {
+const iterate = function(str: string, iterator: IteratorFunction): string {
return str.replace(captureRx, (_full, prefix, prop, url) => {
return prefix + iterator(url, prop);
});
@@ -40,7 +43,7 @@ const iterate = function (str: string, iterator: IteratorFunction): string {
*
* @param {string} str The html source
* @param {(string|IteratorFunction)} url The base url to use for replacement, or an iterator function called with (url, attributeName)
- * @return {string} The replaced html source
+ * @returns {string} The replaced html source
*/
export default function absolutify(str: string, url: string | IteratorFunction): string {
if (typeof url === 'string') {
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/config.test.ts b/packages/sitecore-jss-nextjs-editing-host/src/config.test.ts
index 9145a7a2c8..e7e9ed7952 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/config.test.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/config.test.ts
@@ -7,14 +7,14 @@ const expect = chai.use(chaiString).expect;
describe('config', () => {
const publicUrl = 'http://test.com';
const publicUrlDomain = 'test.com';
-
+
beforeEach(() => {
process.env.EDITING_HOST_PUBLIC_URL = publicUrl;
- })
+ });
after(() => {
delete process.env.EDITING_HOST_PUBLIC_URL;
- })
+ });
it('should not apply if disabled', () => {
const withEditing = config({ enabled: false });
@@ -28,49 +28,77 @@ describe('config', () => {
it('should set assetPrefix to public url', () => {
const withEditing = config({ enabled: true });
const nextConfig = withEditing();
- expect(nextConfig).to.have.property('assetPrefix').that.equal(publicUrl);
+ expect(nextConfig)
+ .to.have.property('assetPrefix')
+ .that.equal(publicUrl);
});
-
+
it('should add env.publicUrl as public url', () => {
const withEditing = config({ enabled: true });
const nextConfig = withEditing();
- expect(nextConfig).to.have.property('env').with.property('publicUrl').that.equal(publicUrl);
+ expect(nextConfig)
+ .to.have.property('env')
+ .with.property('publicUrl')
+ .that.equal(publicUrl);
});
-
+
it('should override existing env.publicUrl', () => {
const withEditing = config({ enabled: true });
- const nextConfig = withEditing({ env: { publicUrl: 'http://something.else' }});
- expect(nextConfig).to.have.property('env').with.property('publicUrl').that.equal(publicUrl);
+ const nextConfig = withEditing({ env: { publicUrl: 'http://something.else' } });
+ expect(nextConfig)
+ .to.have.property('env')
+ .with.property('publicUrl')
+ .that.equal(publicUrl);
});
- it ('should set images.path using public url', () => {
+ it('should set images.path using public url', () => {
const withEditing = config({ enabled: true });
const nextConfig = withEditing();
- expect(nextConfig).to.have.property('images').with.property('path').that.startsWith(publicUrl);
+ expect(nextConfig)
+ .to.have.property('images')
+ .with.property('path')
+ .that.startsWith(publicUrl);
});
- it ('should set images.domains using public url', () => {
+ it('should set images.domains using public url', () => {
const withEditing = config({ enabled: true });
const nextConfig = withEditing();
- expect(nextConfig).to.have.property('images').with.property('domains').that.contains(publicUrlDomain);
+ expect(nextConfig)
+ .to.have.property('images')
+ .with.property('domains')
+ .that.contains(publicUrlDomain);
});
- it ('should concat existing images.domains', () => {
+ it('should concat existing images.domains', () => {
const withEditing = config({ enabled: true });
const nextConfig = withEditing({
- images: { domains: ['foo'] }
+ images: { domains: ['foo'] },
});
- expect(nextConfig).to.have.property('images').with.property('domains').that.contains('foo');
- expect(nextConfig).to.have.property('images').with.property('domains').that.contains(publicUrlDomain);
+ expect(nextConfig)
+ .to.have.property('images')
+ .with.property('domains')
+ .that.contains('foo');
+ expect(nextConfig)
+ .to.have.property('images')
+ .with.property('domains')
+ .that.contains(publicUrlDomain);
});
it('should fallback to http://localhost:3000 if public url missing', () => {
delete process.env.EDITING_HOST_PUBLIC_URL;
const withEditing = config({ enabled: true });
const nextConfig = withEditing();
- expect(nextConfig).to.have.property('assetPrefix').that.equal('http://localhost:3000');
- expect(nextConfig).to.have.property('images').with.property('path').that.startsWith('http://localhost:3000');
- expect(nextConfig).to.have.property('images').with.property('domains').that.contains('localhost');
+ expect(nextConfig)
+ .to.have.property('assetPrefix')
+ .that.equal('http://localhost:3000');
+ expect(nextConfig)
+ .to.have.property('images')
+ .with.property('path')
+ .that.startsWith('http://localhost:3000');
+ expect(nextConfig)
+ .to.have.property('images')
+ .with.property('domains')
+ .that.contains('localhost');
});
it('should throw if public url invalid', () => {
@@ -82,7 +110,9 @@ describe('config', () => {
it('should set distDir', () => {
const withEditing = config({ enabled: true, distDir: '.build-editing' });
const nextConfig = withEditing();
- expect(nextConfig).to.have.property('distDir').that.equal('.build-editing');
+ expect(nextConfig)
+ .to.have.property('distDir')
+ .that.equal('.build-editing');
});
it('should throw if distDir is ".next"', () => {
@@ -93,9 +123,10 @@ describe('config', () => {
it('should set distDir to ".next" if primary distDir is different', () => {
const withEditing = config({ enabled: true, distDir: '.next' });
const nextConfig = withEditing({
- distDir: 'build'
+ distDir: 'build',
});
- expect(nextConfig).to.have.property('distDir').that.equal('.next');
+ expect(nextConfig)
+ .to.have.property('distDir')
+ .that.equal('.next');
});
-
});
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/config.ts b/packages/sitecore-jss-nextjs-editing-host/src/config.ts
index 9567ad6ea6..8e0f779f63 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/config.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/config.ts
@@ -21,19 +21,20 @@ export interface ConfigOptions {
* Editing host configuration for next.config.js as a Next.js "plugin"
* See https://github.com/vercel/next-plugins
* @param {ConfigOptions} [options] Configuration options
+ * @returns {ConfigOptions} config
*/
-export function config({
- enabled = false,
- distDir = '.next-editing',
-}: ConfigOptions = {}) {
- return function plugin(nextConfig: any = {}) {
+export function config({ enabled = false, distDir = '.next-editing' }: ConfigOptions = {}) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ return function plugin(nextConfig: any = {}): any {
if (!enabled) {
return nextConfig;
}
const primaryDistDir = nextConfig.distDir ?? NEXT_DEFAULT_DIST_DIR;
if (distDir === primaryDistDir) {
- throw new Error(`The editing 'distDir' (${distDir}) can not be the same as the primary 'distDir' (${primaryDistDir})`);
+ throw new Error(
+ `The editing 'distDir' (${distDir}) can not be the same as the primary 'distDir' (${primaryDistDir})`
+ );
}
console.info(`${chalk.cyan('info')} - Applying editing host configuration`);
@@ -41,14 +42,13 @@ export function config({
const publicUrl = getPublicUrl();
return Object.assign({}, nextConfig, {
-
// Set our public URL as the asset prefix, which is used by Next.js for the JavaScript and CSS files it loads
// See https://nextjs.org/docs/api-reference/next.config.js/cdn-support-with-asset-prefix
assetPrefix: publicUrl,
-
+
// Use dedicated build directory (main app uses '.next')
distDir,
-
+
// Set our public URL to be used by Next.js image optimization
// See https://nextjs.org/docs/basic-features/image-optimization
images: {
@@ -58,7 +58,7 @@ export function config({
// Make our public URL available as an environment variable key
env: {
- publicUrl
+ publicUrl,
},
});
};
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.test.ts b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.test.ts
index 873a01404c..2cdabada3f 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.test.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.test.ts
@@ -1,3 +1,6 @@
+/* eslint-disable no-unused-expressions */
+/* eslint-disable @typescript-eslint/no-explicit-any */
+// eslint-disable-next-line spaced-comment
///
import chai from 'chai';
import sinon from 'sinon';
@@ -14,7 +17,7 @@ chai.use(sinonChai);
const EDIT_ROUTE = '_edit';
-const mockRequest = (body?: object) => {
+const mockRequest = (body?: any) => {
return {
method: 'POST',
url: '/',
@@ -30,14 +33,13 @@ const mockResponse = () => {
};
describe('EditingMiddleware', () => {
-
it('should call renderToHTML', async () => {
const req = mockRequest(EE_BODY);
const res = mockResponse();
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves('');
- const middleware = new EditingMiddleware(nextApp as unknown as Server, EDIT_ROUTE);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, EDIT_ROUTE);
const handler = middleware.getRequestHandler();
await handler(req, res);
@@ -47,7 +49,7 @@ describe('EditingMiddleware', () => {
expect(nextApp.renderToHTML.args[0][0].url, 'request.url').to.equal(EDIT_ROUTE);
expect(nextApp.renderToHTML.args[0][2], 'pathname').to.equal(EDIT_ROUTE);
});
-
+
it('should use custom editRoute', async () => {
const req = mockRequest(EE_BODY);
const res = mockResponse();
@@ -55,7 +57,7 @@ describe('EditingMiddleware', () => {
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves('');
- const middleware = new EditingMiddleware(nextApp as unknown as Server, customEditRoute);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, customEditRoute);
const handler = middleware.getRequestHandler();
await handler(req, res);
@@ -70,13 +72,14 @@ describe('EditingMiddleware', () => {
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves('');
- const middleware = new EditingMiddleware(nextApp as unknown as Server, EDIT_ROUTE);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, EDIT_ROUTE);
const handler = middleware.getRequestHandler();
await handler(req, res);
- expect((nextApp.renderToHTML.args[0][0] as EditingRequest).editingData, 'request.editingData').to.not.be.undefined;
+ expect((nextApp.renderToHTML.args[0][0] as EditingRequest).editingData, 'request.editingData')
+ .to.not.be.undefined;
});
-
+
it('should return json with rendered html', async () => {
const req = mockRequest(EE_BODY);
const res = mockResponse();
@@ -84,7 +87,7 @@ describe('EditingMiddleware', () => {
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves(html);
- const middleware = new EditingMiddleware(nextApp as unknown as Server, EDIT_ROUTE);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, EDIT_ROUTE);
const handler = middleware.getRequestHandler();
await handler(req, res);
@@ -99,7 +102,7 @@ describe('EditingMiddleware', () => {
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves('');
- const middleware = new EditingMiddleware(nextApp as unknown as Server, EDIT_ROUTE);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, EDIT_ROUTE);
const handler = middleware.getRequestHandler();
await handler(req, res);
@@ -107,14 +110,13 @@ describe('EditingMiddleware', () => {
expect(res.status).to.have.been.calledWith(500);
});
-
it('should respond with 500 if rendered html empty', async () => {
const req = mockRequest(EE_BODY);
const res = mockResponse();
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves('');
- const middleware = new EditingMiddleware(nextApp as unknown as Server, EDIT_ROUTE);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, EDIT_ROUTE);
const handler = middleware.getRequestHandler();
await handler(req, res);
@@ -127,23 +129,23 @@ describe('EditingMiddleware', () => {
const res = mockResponse();
const html = '';
const processor = {
- processHtml: sinon.stub()
+ processHtml: sinon.stub(),
} as HtmlProcessor;
const nextApp = sinon.createStubInstance(Server);
nextApp.renderToHTML.resolves(html);
- const middleware = new EditingMiddleware(nextApp as unknown as Server, EDIT_ROUTE, [ processor ]);
+ const middleware = new EditingMiddleware((nextApp as unknown) as Server, EDIT_ROUTE, [
+ processor,
+ ]);
const handler = middleware.getRequestHandler();
await handler(req, res);
expect(processor.processHtml).to.have.been.calledWith(html);
});
-
});
describe('extractEditingData', () => {
-
it('should throw if body missing', () => {
const req = mockRequest();
expect(() => extractEditingData(req)).to.throw;
@@ -160,7 +162,7 @@ describe('extractEditingData', () => {
const data = extractEditingData(req);
expect(data.language).to.equal(EE_LANGUAGE);
});
-
+
it('should return layout data', () => {
const req = mockRequest(EE_BODY);
const data = extractEditingData(req);
@@ -174,5 +176,4 @@ describe('extractEditingData', () => {
const expected = JSON.parse(EE_DICTIONARY);
expect(data.dictionary).to.eql(expected);
});
-
});
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts
index e085b52fb8..a389301b82 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts
@@ -1,3 +1,4 @@
+// eslint-disable-next-line spaced-comment
///
import { parse } from 'url';
import { Request, Response } from 'express';
@@ -5,18 +6,22 @@ import Server from 'next/dist/next-server/server/next-server';
import { EditingData } from '@sitecore-jss/sitecore-jss-nextjs';
import { HtmlProcessor } from './html-processors';
-/**
- * Express middleware for handling requests from the Sitecore Experience Editor.
- * @constructor
- * @param {object} nextApp The Next.js app.
- * @param {string} editRoute The Next.js route to use for rendering.
- * @param {HtmlProcessor[]} [htmlProcessors] Html processors to run on rendered html.
- */
+/** Express middleware for handling requests from the Sitecore Experience Editor. */
export class EditingMiddleware {
- constructor(readonly nextApp: Server, readonly editRoute: string, readonly htmlProcessors?: HtmlProcessor[]) {}
+ /**
+ * @param {Server} nextApp The Next.js app.
+ * @param {string} editRoute The Next.js route to use for rendering.
+ * @param {HtmlProcessor[]} [htmlProcessors] Html processors to run on rendered html.
+ */
+ constructor(
+ readonly nextApp: Server,
+ readonly editRoute: string,
+ readonly htmlProcessors?: HtmlProcessor[]
+ ) {}
/**
* Returns the Express request handler for Experience Editor POST requests.
+ * @returns request handler
*/
public getRequestHandler(): (req: Request, res: Response) => Promise {
return this.handleRequest;
@@ -51,8 +56,8 @@ export class EditingMiddleware {
// Run any post-render processing of the html
if (this.htmlProcessors) {
- this.htmlProcessors.forEach(processor => {
- html = processor.processHtml(html!);
+ this.htmlProcessors.forEach((processor) => {
+ html = html && processor.processHtml(html);
});
}
@@ -66,9 +71,12 @@ export class EditingMiddleware {
html: `${err}`,
});
}
- }
+ };
}
+/**
+ * @param {Request} req
+ */
export function extractEditingData(req: Request): EditingData {
// The Experience Editor will send the following body data structure,
// though we're only concerned with the "args".
@@ -88,9 +96,9 @@ export function extractEditingData(req: Request): EditingData {
// req.body _should_ have already been parsed as JSON at this point (via `body-parser` middleware)
const payload = req.body;
if (!payload || !payload.args || !Array.isArray(payload.args) || payload.args.length < 3) {
- throw new Error(`Unable to extract editing data from request`);
+ throw new Error('Unable to extract editing data from request');
}
-
+
const result = {
path: '',
language: '',
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/editing-server.ts b/packages/sitecore-jss-nextjs-editing-host/src/editing-server.ts
index 903ce9d5b0..4d215be156 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/editing-server.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-server.ts
@@ -38,7 +38,7 @@ export interface EditingServerOptions {
/**
* URL path prefixes that should be ignored during relative to absolute link replacement.
* @default ['-/media/', '~/media/', '-/jssmedia/', '~/jssmedia/', 'sitecore/shell/']
- */
+ */
ignoredReplacementPaths?: string[];
}
@@ -52,7 +52,13 @@ export function startEditingServer({
editRoute = '/_edit',
editPath = '*',
enableCompression = true,
- ignoredReplacementPaths = ['-/media/', '~/media/', '-/jssmedia/', '~/jssmedia/', 'sitecore/shell/'],
+ ignoredReplacementPaths = [
+ '-/media/',
+ '~/media/',
+ '-/jssmedia/',
+ '~/jssmedia/',
+ 'sitecore/shell/',
+ ],
}: EditingServerOptions = {}): void {
const dev = process.env.NODE_ENV !== 'production';
const serverUrl = `http://${hostname}:${port}`;
@@ -63,8 +69,8 @@ export function startEditingServer({
app.prepare().then(() => {
const server = express();
const handle = app.getRequestHandler();
- const handleEdit = new EditingMiddleware(app, editRoute, [
- new AbsolutifyHtmlProcessor(getPublicUrl(), ignoredReplacementPaths)
+ const handleEdit = new EditingMiddleware(app, editRoute, [
+ new AbsolutifyHtmlProcessor(getPublicUrl(), ignoredReplacementPaths),
]).getRequestHandler();
// Disable X-Powered-By header
@@ -72,7 +78,8 @@ export function startEditingServer({
// Wire up the middleware for Experience Editor (assume only POST requests should be handled)
// Note Next.js already includes compression with its handler, so we're only concerned with ours
- const editHandlers: any[] = [ bodyParser.json({ limit: '2mb' }), handleEdit ];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const editHandlers: any[] = [bodyParser.json({ limit: '2mb' }), handleEdit];
if (enableCompression) {
editHandlers.unshift(compression());
}
@@ -83,7 +90,7 @@ export function startEditingServer({
return handle(req, res);
});
- server.listen(port, hostname, (err?: any) => {
+ server.listen(port, hostname, (err?: unknown) => {
if (err) {
throw err;
}
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.test.ts b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.test.ts
index 655a025027..8449f968e8 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.test.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.test.ts
@@ -5,7 +5,6 @@ import { AbsolutifyHtmlProcessor } from './html-processors';
const expect = chai.use(chaiString).expect;
describe('AbsolutifyHtmlProcessor', () => {
-
it('adds public url to relative urls', () => {
const publicUrl = 'http://test.local';
const processor = new AbsolutifyHtmlProcessor(publicUrl);
@@ -22,7 +21,7 @@ describe('AbsolutifyHtmlProcessor', () => {
`;
html = processor.processHtml(html);
-
+
expect(html).contains('http://test.local/dist/styles.css', 'link href');
expect(html).contains('http://test.local/path/file.pdf', 'a href');
expect(html).contains('http://test.local/logo.png', 'img src');
@@ -40,7 +39,7 @@ describe('AbsolutifyHtmlProcessor', () => {
`;
html = processor.processHtml(html);
-
+
expect(html).contains('http://test.local/dist/styles.css');
});
@@ -56,13 +55,13 @@ describe('AbsolutifyHtmlProcessor', () => {
`;
html = processor.processHtml(html);
-
+
expect(html).contains('');
});
it('ignores specified paths', () => {
const publicUrl = 'http://test.local';
- const ignoredPaths = ['/-/media/','/~/jssmedia/', '/sitecore/shell/'];
+ const ignoredPaths = ['/-/media/', '/~/jssmedia/', '/sitecore/shell/'];
const processor = new AbsolutifyHtmlProcessor(publicUrl, ignoredPaths);
let html = `
@@ -77,7 +76,7 @@ describe('AbsolutifyHtmlProcessor', () => {
`;
html = processor.processHtml(html);
-
+
expect(html).contains('href="/sitecore/shell/styles.css"');
expect(html).contains('href="/-/media/path/file.pdf"');
expect(html).contains('src="/~/jssmedia/logo.png"');
@@ -85,7 +84,7 @@ describe('AbsolutifyHtmlProcessor', () => {
it('ignores specified paths without leading slash', () => {
const publicUrl = 'http://test.local';
- const ignoredPaths = ['-/media/','~/jssmedia/', 'sitecore/shell/'];
+ const ignoredPaths = ['-/media/', '~/jssmedia/', 'sitecore/shell/'];
const processor = new AbsolutifyHtmlProcessor(publicUrl, ignoredPaths);
let html = `
@@ -100,7 +99,7 @@ describe('AbsolutifyHtmlProcessor', () => {
`;
html = processor.processHtml(html);
-
+
expect(html).contains('href="/sitecore/shell/styles.css"');
expect(html).contains('href="/-/media/path/file.pdf"');
expect(html).contains('src="/~/jssmedia/logo.png"');
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts
index 617e1095d0..89f65134a8 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts
@@ -1,4 +1,3 @@
-
import absolutify from './absolutify';
export interface HtmlProcessor {
@@ -12,24 +11,25 @@ export interface HtmlProcessor {
/**
* Absolutify HTML processor
- * @constructor
+ * @class
* @param {string} publicUrl The public URL. This will be used when replacing relative links with absolute ones.
* @param {string[]} ignoredPaths URL path prefixes that should be ignored during link replacement.
*/
export class AbsolutifyHtmlProcessor implements HtmlProcessor {
constructor(readonly publicUrl: string, readonly ignoredPaths?: string[]) {}
-
- processHtml(html: string) {
+ processHtml(html: string): string {
return absolutify(html, (relativeUrl) => {
- const ignored = this.ignoredPaths && this.ignoredPaths.some(
- // Check both with a leading slash "/" and without
- (value) => relativeUrl.startsWith(value) || relativeUrl.startsWith('/' + value)
- );
+ const ignored =
+ this.ignoredPaths &&
+ this.ignoredPaths.some(
+ // Check both with a leading slash "/" and without
+ (value) => relativeUrl.startsWith(value) || relativeUrl.startsWith('/' + value)
+ );
if (ignored) {
return relativeUrl;
}
return this.publicUrl.replace(/\/$/, '') + relativeUrl;
});
}
-}
\ No newline at end of file
+}
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/index.ts b/packages/sitecore-jss-nextjs-editing-host/src/index.ts
index 1dd3335afa..b60dde1f4c 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/index.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/index.ts
@@ -1,18 +1,7 @@
-export {
- EditingServerOptions,
- startEditingServer
-} from './editing-server';
+export { EditingServerOptions, startEditingServer } from './editing-server';
-export {
- EditingMiddleware
-} from './editing-middleware';
+export { EditingMiddleware } from './editing-middleware';
-export {
- HtmlProcessor,
- AbsolutifyHtmlProcessor
-} from './html-processors';
+export { HtmlProcessor, AbsolutifyHtmlProcessor } from './html-processors';
-export {
- ConfigOptions,
- config
-} from './config';
+export { ConfigOptions, config } from './config';
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/testData/ee-data.ts b/packages/sitecore-jss-nextjs-editing-host/src/testData/ee-data.ts
index dc1bfd6796..6409444457 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/testData/ee-data.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/testData/ee-data.ts
@@ -17,16 +17,13 @@
export const EE_PATH = '/test/path';
export const EE_LANGUAGE = 'en';
-export const EE_LAYOUT = '{\"sitecore\":{\"context\":{\"pageEditing\":true,\"site\":{\"name\":\"JssNext\"},\"pageState\":\"normal\",\"language\":\"en\"},\"route\":{\"name\":\"home\",\"displayName\":\"home\",\"fields\":{\"pageTitle\":{\"value\":\"Welcome to Sitecore JSS\"}},\"databaseName\":\"master\",\"deviceId\":\"fe5d7fdf-89c0-4d99-9aa3-b5fbd009c9f3\",\"itemId\":\"d6ac9d26-9474-51cf-982d-4f8d44951229\",\"itemLanguage\":\"en\",\"itemVersion\":1,\"layoutId\":\"4092f843-b14e-5f7a-9ae6-3ed9f5c2b919\",\"templateId\":\"ca5a5aeb-55ae-501b-bb10-d37d009a97e1\",\"templateName\":\"App Route\",\"placeholders\":{\"jss-main\":[{\"uid\":\"2c4a53cc-9da8-5f51-9d79-6ee2fc671b2d\",\"componentName\":\"ContentBlock\",\"dataSource\":\"{FF0E7D28-D8EF-539C-9CEC-28E1175F8C1D}\",\"params\":{},\"fields\":{\"heading\":{\"value\":\"Welcome to Sitecore JSS\"},\"content\":{\"value\":\"Thanks for using JSS!! Here are some resources to get you started:<\/p>\"}}}]}}}}';
-export const EE_DICTIONARY = '{\"entry1\":\"Entry One\",\"entry2\":\"Entry Two\"}';
+export const EE_LAYOUT =
+ '{"sitecore":{"context":{"pageEditing":true,"site":{"name":"JssNext"},"pageState":"normal","language":"en"},"route":{"name":"home","displayName":"home","fields":{"pageTitle":{"value":"Welcome to Sitecore JSS"}},"databaseName":"master","deviceId":"fe5d7fdf-89c0-4d99-9aa3-b5fbd009c9f3","itemId":"d6ac9d26-9474-51cf-982d-4f8d44951229","itemLanguage":"en","itemVersion":1,"layoutId":"4092f843-b14e-5f7a-9ae6-3ed9f5c2b919","templateId":"ca5a5aeb-55ae-501b-bb10-d37d009a97e1","templateName":"App Route","placeholders":{"jss-main":[{"uid":"2c4a53cc-9da8-5f51-9d79-6ee2fc671b2d","componentName":"ContentBlock","dataSource":"{FF0E7D28-D8EF-539C-9CEC-28E1175F8C1D}","params":{},"fields":{"heading":{"value":"Welcome to Sitecore JSS"},"content":{"value":"
Thanks for using JSS!! Here are some resources to get you started:
"}}}]}}}}';
+export const EE_DICTIONARY = '{"entry1":"Entry One","entry2":"Entry Two"}';
export const EE_BODY = {
id: 'JssApp',
- args: [
- EE_PATH,
- EE_LAYOUT,
- `{\"language\":\"${EE_LANGUAGE}\",\"dictionary\":${EE_DICTIONARY}}`
- ],
+ args: [EE_PATH, EE_LAYOUT, `{\"language\":\"${EE_LANGUAGE}\",\"dictionary\":${EE_DICTIONARY}}`],
functionName: 'renderView',
moduleName: 'server.bundle',
};
diff --git a/packages/sitecore-jss-nextjs-editing-host/src/util.ts b/packages/sitecore-jss-nextjs-editing-host/src/util.ts
index f4a92ec212..b0d9b916ec 100644
--- a/packages/sitecore-jss-nextjs-editing-host/src/util.ts
+++ b/packages/sitecore-jss-nextjs-editing-host/src/util.ts
@@ -3,13 +3,19 @@ import chalk from 'chalk';
export const getPublicUrl = (): string => {
let url = process.env.EDITING_HOST_PUBLIC_URL;
if (url === undefined) {
- console.warn(`${chalk.yellow.bold('Warning:')} An EDITING_HOST_PUBLIC_URL environment variable is not defined. Falling back to http://localhost:3000.`);
+ console.warn(
+ `${chalk.yellow.bold(
+ 'Warning:'
+ )} An EDITING_HOST_PUBLIC_URL environment variable is not defined. Falling back to http://localhost:3000.`
+ );
url = 'http://localhost:3000';
} else {
try {
new URL(url);
} catch (error) {
- throw new Error(`The EDITING_HOST_PUBLIC_URL environment variable '${url}' is not a valid URL.`);
+ throw new Error(
+ `The EDITING_HOST_PUBLIC_URL environment variable '${url}' is not a valid URL.`
+ );
}
}
// Ensure no trailing slash
diff --git a/packages/sitecore-jss-nextjs-editing-host/tslint.json b/packages/sitecore-jss-nextjs-editing-host/tslint.json
deleted file mode 100644
index 4b5c71f249..0000000000
--- a/packages/sitecore-jss-nextjs-editing-host/tslint.json
+++ /dev/null
@@ -1,100 +0,0 @@
-
-{
- "extends": ["tslint-react"],
- "rules": {
- "align": [
- true,
- "parameters",
- "arguments",
- "statements"
- ],
- "ban": false,
- "class-name": true,
- "comment-format": [
- true,
- "check-space"
- ],
- "curly": true,
- "eofline": false,
- "forin": true,
- "indent": [ true, "spaces" ],
- "interface-name": [true, "never-prefix"],
- "jsdoc-format": true,
- "jsx-no-lambda": false,
- "jsx-no-multiline-js": false,
- "label-position": true,
- "max-line-length": [ false, 0 ],
- "member-ordering": [
- true,
- "public-before-private",
- "static-before-instance",
- "variables-before-functions"
- ],
- "no-any": false,
- "no-arg": true,
- "no-bitwise": true,
- "no-console": [
- false,
- "log",
- "error",
- "debug",
- "info",
- "time",
- "timeEnd",
- "trace"
- ],
- "no-consecutive-blank-lines": true,
- "no-construct": true,
- "no-debugger": true,
- "no-duplicate-variable": true,
- "no-empty": true,
- "no-eval": true,
- "no-shadowed-variable": true,
- "no-string-literal": true,
- "no-switch-case-fall-through": true,
- "no-trailing-whitespace": false,
- "no-unused-expression": false,
- "no-use-before-declare": true,
- "one-line": [
- true,
- "check-catch",
- "check-else",
- "check-open-brace",
- "check-whitespace"
- ],
- "quotemark": [true, "single", "jsx-double"],
- "radix": true,
- "semicolon": [true, "always"],
- "switch-default": true,
-
- "trailing-comma": false,
-
- "triple-equals": [ true, "allow-null-check" ],
- "typedef": [
- true,
- "parameter",
- "property-declaration"
- ],
- "typedef-whitespace": [
- true,
- {
- "call-signature": "nospace",
- "index-signature": "nospace",
- "parameter": "nospace",
- "property-declaration": "nospace",
- "variable-declaration": "nospace"
- }
- ],
- "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
- "whitespace": [
- true,
- "check-branch",
- "check-decl",
- "check-module",
- "check-operator",
- "check-separator",
- "check-type",
- "check-typecast"
- ]
- }
-}
diff --git a/packages/sitecore-jss-nextjs/.eslintrc b/packages/sitecore-jss-nextjs/.eslintrc
new file mode 100644
index 0000000000..3d8eb496f9
--- /dev/null
+++ b/packages/sitecore-jss-nextjs/.eslintrc
@@ -0,0 +1,15 @@
+{
+ "extends": [
+ "plugin:react/recommended",
+ "../../.eslintrc"
+ ],
+ "plugins": ["react"],
+ "settings": {
+ "react": {
+ "version": "detect"
+ }
+ },
+ "globals": {
+ "React": "writable"
+ }
+}
diff --git a/packages/sitecore-jss-nextjs/.npmignore b/packages/sitecore-jss-nextjs/.npmignore
index 81961859f2..c94806476e 100644
--- a/packages/sitecore-jss-nextjs/.npmignore
+++ b/packages/sitecore-jss-nextjs/.npmignore
@@ -4,13 +4,12 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
tsconfig-esm.json
-tslint.json
npm-debug*
*.log
!/types
diff --git a/packages/sitecore-jss-nextjs/global.d.ts b/packages/sitecore-jss-nextjs/global.d.ts
index a836058e14..0fcfe15305 100644
--- a/packages/sitecore-jss-nextjs/global.d.ts
+++ b/packages/sitecore-jss-nextjs/global.d.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
declare module 'style-attr';
declare namespace NodeJS {
diff --git a/packages/sitecore-jss-nextjs/package-lock.json b/packages/sitecore-jss-nextjs/package-lock.json
index ef5559fdb8..8daebe0012 100644
--- a/packages/sitecore-jss-nextjs/package-lock.json
+++ b/packages/sitecore-jss-nextjs/package-lock.json
@@ -640,6 +640,47 @@
"to-fast-properties": "^2.0.0"
}
},
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
"@hapi/accept": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@hapi/accept/-/accept-5.0.1.tgz",
@@ -821,25 +862,6 @@
"fastq": "^1.6.0"
}
},
- "@sitecore-jss/sitecore-jss": {
- "version": "15.0.1",
- "resolved": "https://registry.npmjs.org/@sitecore-jss/sitecore-jss/-/sitecore-jss-15.0.1.tgz",
- "integrity": "sha512-oAQ0guW2r/zF1bESn/4XxZd5ePDouWTAUWjKrxTVMt6FGwSRDB0kBBcepJLbpHDCB3eIShU/yUF+35G3PgrWLw==",
- "requires": {
- "lodash.unescape": "^4.0.1",
- "url-parse": "^1.4.7"
- }
- },
- "@sitecore-jss/sitecore-jss-react": {
- "version": "15.0.1",
- "resolved": "https://registry.npmjs.org/@sitecore-jss/sitecore-jss-react/-/sitecore-jss-react-15.0.1.tgz",
- "integrity": "sha512-FCX7j8YHRmc/YVy0svSCHQSKg5ho/XF5GI3u10/793e7jg6lfdrvu2mqu/ZO49GfA/wM78ke9xyx4ZFw5qQVcw==",
- "requires": {
- "@sitecore-jss/sitecore-jss": "^15.0.1",
- "prop-types": "^15.7.2",
- "style-attr": "^1.3.0"
- }
- },
"@types/chai": {
"version": "4.2.14",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.14.tgz",
@@ -1195,6 +1217,12 @@
}
}
},
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
"acorn-walk": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz",
@@ -1436,6 +1464,41 @@
"integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=",
"dev": true
},
+ "array-includes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz",
+ "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.18.0-next.1",
+ "get-intrinsic": "^1.0.1",
+ "is-string": "^1.0.5"
+ },
+ "dependencies": {
+ "es-abstract": {
+ "version": "1.18.0-next.1",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+ "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+ "dev": true,
+ "requires": {
+ "es-to-primitive": "^1.2.1",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.1",
+ "is-callable": "^1.2.2",
+ "is-negative-zero": "^2.0.0",
+ "is-regex": "^1.1.1",
+ "object-inspect": "^1.8.0",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.1",
+ "string.prototype.trimend": "^1.0.1",
+ "string.prototype.trimstart": "^1.0.1"
+ }
+ }
+ }
+ },
"array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
@@ -1468,6 +1531,40 @@
"es-abstract": "^1.17.0-next.1"
}
},
+ "array.prototype.flatmap": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz",
+ "integrity": "sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.18.0-next.1",
+ "function-bind": "^1.1.1"
+ },
+ "dependencies": {
+ "es-abstract": {
+ "version": "1.18.0-next.1",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+ "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+ "dev": true,
+ "requires": {
+ "es-to-primitive": "^1.2.1",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.1",
+ "is-callable": "^1.2.2",
+ "is-negative-zero": "^2.0.0",
+ "is-regex": "^1.1.1",
+ "object-inspect": "^1.8.0",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.1",
+ "string.prototype.trimend": "^1.0.1",
+ "string.prototype.trimstart": "^1.0.1"
+ }
+ }
+ }
+ },
"arrify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
@@ -1554,6 +1651,12 @@
"integrity": "sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"async-each": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
@@ -1983,6 +2086,12 @@
"get-intrinsic": "^1.0.0"
}
},
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true
+ },
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@@ -2038,6 +2147,42 @@
"integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==",
"dev": true
},
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ }
+ }
+ },
"check-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
@@ -3044,6 +3189,15 @@
"integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=",
"dev": true
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"dom-serializer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
@@ -3251,6 +3405,15 @@
}
}
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
@@ -3439,6 +3602,177 @@
"source-map": "~0.6.1"
}
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-plugin-react": {
+ "version": "7.21.5",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz",
+ "integrity": "sha512-8MaEggC2et0wSF6bUeywF7qQ46ER81irOdWS4QWxnnlAEsnzeBevk1sWh7fhpCghPpXb+8Ks7hvaft6L/xsR6g==",
+ "dev": true,
+ "requires": {
+ "array-includes": "^3.1.1",
+ "array.prototype.flatmap": "^1.2.3",
+ "doctrine": "^2.1.0",
+ "has": "^1.0.3",
+ "jsx-ast-utils": "^2.4.1 || ^3.0.0",
+ "object.entries": "^1.1.2",
+ "object.fromentries": "^2.0.2",
+ "object.values": "^1.1.1",
+ "prop-types": "^15.7.2",
+ "resolve": "^1.18.1",
+ "string.prototype.matchall": "^4.0.2"
+ },
+ "dependencies": {
+ "doctrine": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ }
+ }
+ },
"eslint-scope": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
@@ -3449,12 +3783,71 @@
"estraverse": "^4.1.1"
}
},
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
"esrecurse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
@@ -3731,6 +4124,15 @@
"integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==",
"dev": true
},
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -3767,6 +4169,22 @@
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
"dev": true
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"flush-write-stream": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
@@ -3980,6 +4398,12 @@
"functions-have-names": "^1.2.0"
}
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"functions-have-names": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.1.tgz",
@@ -4496,6 +4920,24 @@
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "dependencies": {
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ }
+ }
+ },
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@@ -4543,6 +4985,17 @@
"dev": true,
"optional": true
},
+ "internal-slot": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.2.tgz",
+ "integrity": "sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g==",
+ "dev": true,
+ "requires": {
+ "es-abstract": "^1.17.0-next.1",
+ "has": "^1.0.3",
+ "side-channel": "^1.0.2"
+ }
+ },
"ip-regex": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz",
@@ -5030,6 +5483,12 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -5057,6 +5516,16 @@
"verror": "1.10.0"
}
},
+ "jsx-ast-utils": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.0.tgz",
+ "integrity": "sha512-EIsmt3O3ljsU6sot/J4E1zDRxfBNrhjyf/OKjlydwgEimQuznlM4Wv7U+ueONJMyEn1WRE0K8dhi3dVAXYT24Q==",
+ "dev": true,
+ "requires": {
+ "array-includes": "^3.1.2",
+ "object.assign": "^4.1.2"
+ }
+ },
"kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -5151,11 +5620,6 @@
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=",
"dev": true
},
- "lodash.unescape": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz",
- "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw="
- },
"log-symbols": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz",
@@ -5691,6 +6155,12 @@
"querystring": "^0.2.0"
}
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"nearley": {
"version": "2.19.7",
"resolved": "https://registry.npmjs.org/nearley/-/nearley-2.19.7.tgz",
@@ -6432,6 +6902,15 @@
}
}
},
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
"parse-asn1": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
@@ -6971,6 +7450,12 @@
"fromentries": "^1.2.0"
}
},
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise-inflight": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
@@ -7356,6 +7841,22 @@
"integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==",
"dev": true
},
+ "regexp.prototype.flags": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz",
+ "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.17.0-next.1"
+ }
+ },
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"release-zalgo": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz",
@@ -7857,6 +8358,38 @@
"integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==",
"dev": true
},
+ "side-channel": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.3.tgz",
+ "integrity": "sha512-A6+ByhlLkksFoUepsGxfj5x1gTSrs+OydsRptUxeNCabQpCFUvcwIczgOigI8vhY/OJCnPnyE9rGiwgvr9cS1g==",
+ "dev": true,
+ "requires": {
+ "es-abstract": "^1.18.0-next.0",
+ "object-inspect": "^1.8.0"
+ },
+ "dependencies": {
+ "es-abstract": {
+ "version": "1.18.0-next.1",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+ "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+ "dev": true,
+ "requires": {
+ "es-to-primitive": "^1.2.1",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.1",
+ "is-callable": "^1.2.2",
+ "is-negative-zero": "^2.0.0",
+ "is-regex": "^1.1.1",
+ "object-inspect": "^1.8.0",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.1",
+ "string.prototype.trimend": "^1.0.1",
+ "string.prototype.trimstart": "^1.0.1"
+ }
+ }
+ }
+ },
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@@ -7926,6 +8459,49 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -8325,6 +8901,43 @@
"strip-ansi": "^4.0.0"
}
},
+ "string.prototype.matchall": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.3.tgz",
+ "integrity": "sha512-OBxYDA2ifZQ2e13cP82dWFMaCV9CGF8GzmN4fljBVw5O5wep0lu4gacm1OL6MjROoUnB8VbkWRThqkV2YFLNxw==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.18.0-next.1",
+ "has-symbols": "^1.0.1",
+ "internal-slot": "^1.0.2",
+ "regexp.prototype.flags": "^1.3.0",
+ "side-channel": "^1.0.3"
+ },
+ "dependencies": {
+ "es-abstract": {
+ "version": "1.18.0-next.1",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+ "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+ "dev": true,
+ "requires": {
+ "es-to-primitive": "^1.2.1",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.1",
+ "is-callable": "^1.2.2",
+ "is-negative-zero": "^2.0.0",
+ "is-regex": "^1.1.1",
+ "object-inspect": "^1.8.0",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.1",
+ "string.prototype.trimend": "^1.0.1",
+ "string.prototype.trimstart": "^1.0.1"
+ }
+ }
+ }
+ },
"string.prototype.trim": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.2.tgz",
@@ -8460,11 +9073,6 @@
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true
},
- "style-attr": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/style-attr/-/style-attr-1.3.0.tgz",
- "integrity": "sha512-srFr54gzEZoy73WgYfnbxCAtNCzF0Hn5RGzK7gi/0G6ttZd9v3WZFGY4ed5ABr43dbGjPNr4T46geUxxUP9i6w=="
- },
"style-loader": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.2.1.tgz",
@@ -8537,12 +9145,81 @@
"integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==",
"dev": true
},
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ },
+ "dependencies": {
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ }
+ }
+ },
"symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
"dev": true
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
"tapable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
@@ -8712,6 +9389,12 @@
"minimatch": "^3.0.4"
}
},
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"through2": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
@@ -8879,24 +9562,6 @@
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
- "tslint-react": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-4.1.0.tgz",
- "integrity": "sha512-Y7CbFn09X7Mpg6rc7t/WPbmjx9xPI8p1RsQyiGCLWgDR6sh3+IBSlT+bEkc0PSZcWwClOkqq2wPsID8Vep6szQ==",
- "dev": true,
- "requires": {
- "tsutils": "^3.9.1"
- }
- },
- "tsutils": {
- "version": "3.17.1",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz",
- "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==",
- "dev": true,
- "requires": {
- "tslib": "^1.8.1"
- }
- },
"tty-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
@@ -9138,6 +9803,12 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
diff --git a/packages/sitecore-jss-nextjs/package.json b/packages/sitecore-jss-nextjs/package.json
index 2f83629f69..215be3b63f 100644
--- a/packages/sitecore-jss-nextjs/package.json
+++ b/packages/sitecore-jss-nextjs/package.json
@@ -7,7 +7,7 @@
"scripts": {
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ./tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.tsx ./src/**/*.ts",
"test": "mocha --require ts-node/register --require ./src/tests/shim.ts ./src/tests/jsdom-setup.ts ./src/tests/enzyme-setup.ts \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\"",
"prepublishOnly": "npm run build",
"coverage": "nyc npm test"
@@ -43,6 +43,8 @@
"del-cli": "^3.0.1",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
+ "eslint": "^7.15.0",
+ "eslint-plugin-react": "^7.21.5",
"jsdom": "^15.1.1",
"mocha": "^8.1.3",
"next": "^10.0.3",
@@ -51,7 +53,6 @@
"react-dom": "^16.9.0",
"react-test-renderer": "^16.9.0",
"ts-node": "^9.0.0",
- "tslint-react": "^4.0.0",
"typescript": "^4.0.2"
},
"peerDependencies": {
diff --git a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx
index 97d5924c86..2f67249708 100644
--- a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx
+++ b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-expressions */
import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
@@ -8,34 +9,32 @@ describe('ComponentPropsContext', () => {
const VALUE = Object.freeze({ x1: 101, y1: 202 });
const X1Component = () => {
- const data = useComponentProps('x1');
-
- return (
- First: {data}
- )
+ const data = useComponentProps('x1');
+
+ return First: {data};
};
const X2Component = () => {
- const data = useComponentProps('y1');
-
- return (
- Second: {data}
- )
+ const data = useComponentProps('y1');
+
+ return Second: {data};
};
it('should render', () => {
- const component = mount(
- <>
-
-
- >
- );
+ const component = mount(
+
+ <>
+
+
+ >
+
+ );
- const x1Div = component.find(X1Component);
- const x2Div = component.find(X2Component);
+ const x1Div = component.find(X1Component);
+ const x2Div = component.find(X2Component);
- expect(x1Div.contains(First: 101)).to.be.true;
+ expect(x1Div.contains(First: 101)).to.be.true;
- expect(x2Div.contains(Second: 202)).to.be.true;
+ expect(x2Div.contains(Second: 202)).to.be.true;
});
});
diff --git a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx
index 93c6da025e..c58210ee16 100644
--- a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx
+++ b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx
@@ -1,5 +1,5 @@
import React, { createContext, useContext, ReactNode } from 'react';
-import { ComponentPropsCollection } from "../sharedTypes/component-props";
+import { ComponentPropsCollection } from '../sharedTypes/component-props';
/**
* Component props context which we are using in order to store data fetched on components level (getStaticProps/getServerSideProps)
@@ -9,20 +9,25 @@ export const ComponentPropsReactContext = createContext(componentUid: string): ComponentData {
const data = useContext(ComponentPropsReactContext);
return data[componentUid] as ComponentData;
-};
+}
export type ComponentPropsContextProps = {
- children: ReactNode;
- value: ComponentPropsCollection;
-}
+ children: ReactNode;
+ value: ComponentPropsCollection;
+};
-export const ComponentPropsContext = ({ children, value }: ComponentPropsContextProps) => (
-
- {children}
-
-)
+export const ComponentPropsContext = ({
+ children,
+ value,
+}: ComponentPropsContextProps): JSX.Element => (
+
+ {children}
+
+);
diff --git a/packages/sitecore-jss-nextjs/src/components/Link.test.tsx b/packages/sitecore-jss-nextjs/src/components/Link.test.tsx
index 2f3a2b40a8..70f6357c9b 100644
--- a/packages/sitecore-jss-nextjs/src/components/Link.test.tsx
+++ b/packages/sitecore-jss-nextjs/src/components/Link.test.tsx
@@ -182,8 +182,8 @@ describe('', () => {
expect(c.find(ReactLink).length).to.equal(0);
});
- it('should render NextLink using internalLinkMatcher', () => {
- const field = {
+ it('should render NextLink using internalLinkMatcher', () => {
+ const field = {
value: {
href: 'http://jssreactweb/home',
text: 'ipsum',
@@ -194,16 +194,20 @@ describe('', () => {
};
const rendered = mount(
-
+
Hello world...
);
expect(rendered.find(NextLink).length).to.equal(1);
expect(rendered.find(ReactLink).length).to.equal(0);
- })
-
- it('should render ReactLink if link is external', () => {
+ });
+
+ it('should render ReactLink if link is external', () => {
const field = {
value: {
href: 'http://jssreactweb/lorem',
diff --git a/packages/sitecore-jss-nextjs/src/components/Link.tsx b/packages/sitecore-jss-nextjs/src/components/Link.tsx
index a676b916f8..19501d6ba2 100644
--- a/packages/sitecore-jss-nextjs/src/components/Link.tsx
+++ b/packages/sitecore-jss-nextjs/src/components/Link.tsx
@@ -4,33 +4,41 @@ import NextLink from 'next/link';
import {
Link as ReactLink,
LinkFieldValue,
+ LinkField,
LinkProps as ReactLinkProps,
LinkPropTypes,
} from '@sitecore-jss/sitecore-jss-react';
export type LinkProps = ReactLinkProps & {
- /**
- * If `href` match with `internalLinkMatcher` regexp, then it's internal link and NextLink will be rendered
- * @defaultvalue /^\//g
- */
- internalLinkMatcher?: RegExp;
+ /**
+ * If `href` match with `internalLinkMatcher` regexp, then it's internal link and NextLink will be rendered
+ * @default /^\//g
+ */
+ internalLinkMatcher?: RegExp;
};
-export const Link = (props: LinkProps) => {
- const { editable, internalLinkMatcher = /^\//g, showLinkTextWithChildrenPresent, ...htmlLinkProps } = props;
-
- const value = (props.field as LinkFieldValue).href ? props.field : props.field.value;
- const hasValidHref = value && value.href;
+export const Link = (props: LinkProps): JSX.Element => {
+ const {
+ editable,
+ internalLinkMatcher = /^\//g,
+ showLinkTextWithChildrenPresent,
+ ...htmlLinkProps
+ } = props;
+
+ const value = ((props.field as LinkFieldValue).href
+ ? props.field
+ : (props.field as LinkField).value) as LinkFieldValue;
+ const { href } = value;
const isEditing = editable && (props.field as LinkFieldValue).editable;
- if (hasValidHref && !isEditing) {
+ if (href && !isEditing) {
const text =
showLinkTextWithChildrenPresent || !props.children ? value.text || value.href : null;
// determine if a link is a route or not.
- if (internalLinkMatcher.test(value.href)) {
+ if (internalLinkMatcher.test(href)) {
return (
-
+
{text}
{props.children}
@@ -50,6 +58,6 @@ Link.defaultProps = {
Link.displayName = 'NextLink';
Link.propTypes = {
- internalLinkMatcher: PropTypes.instanceOf(RegExp),
- ...LinkPropTypes
+ internalLinkMatcher: PropTypes.instanceOf(RegExp),
+ ...LinkPropTypes,
};
diff --git a/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx
index 072c5bfe38..23fcf665e4 100644
--- a/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx
+++ b/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-non-null-assertion */
import React, { ReactNode } from 'react';
import { use, expect, spy } from 'chai';
import { RichText as ReactRichText } from '@sitecore-jss/sitecore-jss-react';
@@ -26,6 +27,7 @@ const Router = () => ({
});
// Should provide RouterContext in case if we render Link from next/link
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Page = ({ children, value }: { children: ReactNode; value?: any }) => (
{children}
);
@@ -40,7 +42,7 @@ describe('RichText', () => {
const props = {
field: {
- value: ``,
+ value: '',
},
};
@@ -90,7 +92,8 @@ describe('RichText', () => {
const props = {
field: {
- value: ``,
+ value:
+ '',
},
internalLinksSelector: 'a[href^="/testpath"]',
};
diff --git a/packages/sitecore-jss-nextjs/src/components/RichText.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.tsx
index d19c98c8a2..79010e87f1 100644
--- a/packages/sitecore-jss-nextjs/src/components/RichText.tsx
+++ b/packages/sitecore-jss-nextjs/src/components/RichText.tsx
@@ -10,14 +10,14 @@ import {
export type RichTextProps = ReactRichTextProps & {
/**
* Selector which should be used in order to prefetch it and attach event listeners
- * @defaultvalue 'a[href^="/"]'
+ * @default 'a[href^="/"]'
*/
internalLinksSelector?: string;
};
const prefetched: { [cacheKey: string]: boolean } = {};
-export const RichText = (props: RichTextProps) => {
+export const RichText = (props: RichTextProps): JSX.Element => {
const { internalLinksSelector = 'a[href^="/"]', ...rest } = props;
const hasText = props.field && props.field.value;
const isEditing = props.editable && props.field && props.field.editable;
@@ -36,7 +36,7 @@ export const RichText = (props: RichTextProps) => {
if (!ev.target) return;
ev.preventDefault();
-
+
const pathname = (ev.target as HTMLAnchorElement).pathname;
router.push(pathname, pathname, { locale: false });
diff --git a/packages/sitecore-jss-nextjs/src/index.ts b/packages/sitecore-jss-nextjs/src/index.ts
index d1e9d7d37f..4434f76dec 100644
--- a/packages/sitecore-jss-nextjs/src/index.ts
+++ b/packages/sitecore-jss-nextjs/src/index.ts
@@ -30,7 +30,7 @@ export {
ComponentPropsCollection,
GetStaticComponentProps,
GetServerSideComponentProps,
- GetInitialComponentProps
+ GetInitialComponentProps,
} from './sharedTypes/component-props';
export { ComponentModule } from './sharedTypes/component-module';
@@ -44,10 +44,7 @@ export {
useComponentProps,
} from './components/ComponentPropsContext';
-export {
- EditingData,
- EditingRequest
-} from './sharedTypes/editing-data';
+export { EditingData, EditingRequest } from './sharedTypes/editing-data';
export { Link } from './components/Link';
export { RichText } from './components/RichText';
diff --git a/packages/sitecore-jss-nextjs/src/services/component-props-service.test.ts b/packages/sitecore-jss-nextjs/src/services/component-props-service.test.ts
index c518af1770..54e06fc6fb 100644
--- a/packages/sitecore-jss-nextjs/src/services/component-props-service.test.ts
+++ b/packages/sitecore-jss-nextjs/src/services/component-props-service.test.ts
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-expressions */
import { ComponentRendering, PlaceholdersData } from '@sitecore-jss/sitecore-jss';
import { expect, use, spy } from 'chai';
import spies from 'chai-spies';
@@ -79,6 +80,7 @@ describe('ComponentPropsService', () => {
});
// In real world: list of imported modules
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const modules: { [componentName: string]: any } = {
namex11: {
fn: fetchFn('x11Data'),
@@ -103,6 +105,7 @@ describe('ComponentPropsService', () => {
};
it('fetchServerSideComponentProps', async () => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const ssrModules: { [componentName: string]: any } = {
namex11: {
getServerSideProps: fetchFn('x11SSRData'),
@@ -144,6 +147,7 @@ describe('ComponentPropsService', () => {
});
it('fetchStaticComponentProps', async () => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const ssgModules: { [componentName: string]: any } = {
namex11: {
getStaticProps: fetchFn('x11StaticData'),
@@ -178,6 +182,7 @@ describe('ComponentPropsService', () => {
});
it('fetchInitialComponentProps', async () => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const ssgModules: { [componentName: string]: any } = {
namex11: {
getInitialProps: fetchFn('x11InitialPropsData'),
diff --git a/packages/sitecore-jss-nextjs/src/services/component-props-service.ts b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts
index 0b6f4b1fbd..21ced4b377 100644
--- a/packages/sitecore-jss-nextjs/src/services/component-props-service.ts
+++ b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts
@@ -31,6 +31,8 @@ export class ComponentPropsService {
/**
* SSR mode
* Fetch component props using getServerSideProps function
+ * @param {FetchComponentPropsArguments} params fetch params
+ * @returns {Promise} props
*/
async fetchServerSideComponentProps(
params: FetchComponentPropsArguments
@@ -53,6 +55,8 @@ export class ComponentPropsService {
/**
* SSG mode
* Fetch component props using getStaticProps function
+ * @param {FetchComponentPropsArguments} params fetch arguments
+ * @returns {Promise} props
*/
async fetchStaticComponentProps(
params: FetchComponentPropsArguments
@@ -75,6 +79,7 @@ export class ComponentPropsService {
/**
* Editing mode
* Fetch component props using getInitialProps function
+ * @param {FetchComponentPropsArguments} params
*/
async fetchInitialComponentProps(
params: FetchComponentPropsArguments
@@ -93,6 +98,10 @@ export class ComponentPropsService {
/**
* Traverse Layout Service data tree and call side effects on component level.
* Side effect function can be: getStaticProps (SSG) or getServerSideProps (SSR)
+ * @param {FetchFunctionFactory} fetchFunctionFactory fetch function factory
+ * @param {LayoutServiceData} layoutData layout data
+ * @param {NextContext} context next context
+ * @returns {Promise} component props
*/
async fetchComponentProps(
fetchFunctionFactory: FetchFunctionFactory,
@@ -113,6 +122,13 @@ export class ComponentPropsService {
/**
* Go through layout service data, check all renderings using displayName, which should make some side effects.
* Write result in requests variable
+ * @param {Object} params params
+ * @param {PlaceholdersData} params.placeholders
+ * @param {FetchFunctionFactory} params.fetchFunctionFactory
+ * @param {LayoutServiceData} params.layoutData
+ * @param {NextContext} params.context
+ * @param {ComponentPropsRequest[]} params.requests
+ * @returns {ComponentPropsRequest[]} array of requests
*/
collectRequests(params: {
placeholders: PlaceholdersData;
@@ -120,7 +136,7 @@ export class ComponentPropsService {
layoutData: LayoutServiceData;
context: NextContext;
requests?: ComponentPropsRequest[];
- }) {
+ }): ComponentPropsRequest[] {
const { placeholders, fetchFunctionFactory, layoutData, context } = params;
// Will be called on first round
@@ -157,12 +173,18 @@ export class ComponentPropsService {
/**
* Execute request for component props
+ * @param {ComponentPropsRequest[]} requests requests
+ * @returns {Promise} requests result
*/
- async execRequests(requests: ComponentPropsRequest[]) {
+ async execRequests(
+ requests: ComponentPropsRequest[]
+ ): Promise {
const componentProps: ComponentPropsCollection = {};
const promises = requests.map((req) => {
- if (!req.rendering.uid) {
+ const { uid } = req.rendering;
+
+ if (!uid) {
console.log(
`Component ${req.rendering.componentName} doesn't have uid, can't store data for this component`
);
@@ -173,11 +195,11 @@ export class ComponentPropsService {
.fetch(req.rendering, req.layoutData, req.context)
.then((result) => {
// Set component specific data in componentProps store
- componentProps[req.rendering.uid!] = result;
+ componentProps[uid] = result;
})
.catch((error) => {
- console.log(`Error during preload data for component ${req.rendering.uid}:`, error);
- componentProps[req.rendering.uid!] = {
+ console.log(`Error during preload data for component ${uid}:`, error);
+ componentProps[uid] = {
error,
};
});
@@ -199,6 +221,9 @@ export class ComponentPropsService {
* flatRenderings(placeholders);
*
* RESULT: [{ uid: 1 }, { uid: 2 }, { uid: 11 }, { uid: 22 }]
+ *
+ * @param {PlaceholdersData} placeholders placeholders
+ * @returns {ComponentRendering[]} renderings
*/
flatRenderings(placeholders: PlaceholdersData): ComponentRendering[] {
const allComponentRenderings: ComponentRendering[] = [];
diff --git a/packages/sitecore-jss-nextjs/src/sharedTypes/component-module.ts b/packages/sitecore-jss-nextjs/src/sharedTypes/component-module.ts
index 73ebde6f82..b2b9c70af0 100644
--- a/packages/sitecore-jss-nextjs/src/sharedTypes/component-module.ts
+++ b/packages/sitecore-jss-nextjs/src/sharedTypes/component-module.ts
@@ -1,4 +1,8 @@
-import { GetInitialComponentProps, GetServerSideComponentProps, GetStaticComponentProps } from './component-props';
+import {
+ GetInitialComponentProps,
+ GetServerSideComponentProps,
+ GetStaticComponentProps,
+} from './component-props';
type Module = {
default: React.Component;
diff --git a/packages/sitecore-jss-nextjs/src/testData/ee-data.ts b/packages/sitecore-jss-nextjs/src/testData/ee-data.ts
index 8bc5790127..6435d1450c 100644
--- a/packages/sitecore-jss-nextjs/src/testData/ee-data.ts
+++ b/packages/sitecore-jss-nextjs/src/testData/ee-data.ts
@@ -244,8 +244,9 @@ export const convertedData = {
fields: {
key: {
value: '',
- editable: '{"commands":[{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{9BCF4A17-2EC7-4160-9504-5ABD096B46AE}?lang=en&ver=1","custom":{},"displayName":"Key","expandedDisplayName":null}This is a some sample <p>field data</p> o'boy! "wow"',
- }
+ editable:
+ '{"commands":[{"click":"chrome:common:edititem({command:\\"webedit:open\\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\\"webedit:personalize\\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\\"webedit:editvariations\\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{9BCF4A17-2EC7-4160-9504-5ABD096B46AE}?lang=en&ver=1","custom":{},"displayName":"Key","expandedDisplayName":null}This is a some sample <p>field data</p> o'boy! "wow"',
+ },
},
},
},
diff --git a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts
index a75551d697..52b98bc2a5 100644
--- a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts
+++ b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts
@@ -1,6 +1,9 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
// https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
declare module 'style-attr';
+
+// eslint-disable-next-line no-var
declare var global: any;
const { JSDOM } = require('jsdom');
@@ -8,13 +11,20 @@ const { JSDOM } = require('jsdom');
const jsdom = new JSDOM('');
const jsDomWindow = jsdom.window;
+/**
+ * @param {any} src
+ * @param {any} target
+ */
function copyProps(src: any, target: any) {
const props = Object.getOwnPropertyNames(src)
- .filter(prop => typeof target[prop] === 'undefined')
- .reduce((result, prop) => ({
- ...result,
- [prop]: Object.getOwnPropertyDescriptor(src, prop),
- }), {});
+ .filter((prop) => typeof target[prop] === 'undefined')
+ .reduce(
+ (result, prop) => ({
+ ...result,
+ [prop]: Object.getOwnPropertyDescriptor(src, prop),
+ }),
+ {}
+ );
Object.defineProperties(target, props);
}
diff --git a/packages/sitecore-jss-nextjs/src/tests/shim.ts b/packages/sitecore-jss-nextjs/src/tests/shim.ts
index 5b3f7f6529..2d0697f584 100644
--- a/packages/sitecore-jss-nextjs/src/tests/shim.ts
+++ b/packages/sitecore-jss-nextjs/src/tests/shim.ts
@@ -1,6 +1,8 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
// React 16 depends on requestAnimationFrame, need a shim for node.js
// https://github.com/facebook/jest/issues/4545
+// eslint-disable-next-line no-var
declare var global: any;
global.requestAnimationFrame = (callback: any) => {
diff --git a/packages/sitecore-jss-nextjs/tslint.json b/packages/sitecore-jss-nextjs/tslint.json
deleted file mode 100644
index 4b5c71f249..0000000000
--- a/packages/sitecore-jss-nextjs/tslint.json
+++ /dev/null
@@ -1,100 +0,0 @@
-
-{
- "extends": ["tslint-react"],
- "rules": {
- "align": [
- true,
- "parameters",
- "arguments",
- "statements"
- ],
- "ban": false,
- "class-name": true,
- "comment-format": [
- true,
- "check-space"
- ],
- "curly": true,
- "eofline": false,
- "forin": true,
- "indent": [ true, "spaces" ],
- "interface-name": [true, "never-prefix"],
- "jsdoc-format": true,
- "jsx-no-lambda": false,
- "jsx-no-multiline-js": false,
- "label-position": true,
- "max-line-length": [ false, 0 ],
- "member-ordering": [
- true,
- "public-before-private",
- "static-before-instance",
- "variables-before-functions"
- ],
- "no-any": false,
- "no-arg": true,
- "no-bitwise": true,
- "no-console": [
- false,
- "log",
- "error",
- "debug",
- "info",
- "time",
- "timeEnd",
- "trace"
- ],
- "no-consecutive-blank-lines": true,
- "no-construct": true,
- "no-debugger": true,
- "no-duplicate-variable": true,
- "no-empty": true,
- "no-eval": true,
- "no-shadowed-variable": true,
- "no-string-literal": true,
- "no-switch-case-fall-through": true,
- "no-trailing-whitespace": false,
- "no-unused-expression": false,
- "no-use-before-declare": true,
- "one-line": [
- true,
- "check-catch",
- "check-else",
- "check-open-brace",
- "check-whitespace"
- ],
- "quotemark": [true, "single", "jsx-double"],
- "radix": true,
- "semicolon": [true, "always"],
- "switch-default": true,
-
- "trailing-comma": false,
-
- "triple-equals": [ true, "allow-null-check" ],
- "typedef": [
- true,
- "parameter",
- "property-declaration"
- ],
- "typedef-whitespace": [
- true,
- {
- "call-signature": "nospace",
- "index-signature": "nospace",
- "parameter": "nospace",
- "property-declaration": "nospace",
- "variable-declaration": "nospace"
- }
- ],
- "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
- "whitespace": [
- true,
- "check-branch",
- "check-decl",
- "check-module",
- "check-operator",
- "check-separator",
- "check-type",
- "check-typecast"
- ]
- }
-}
diff --git a/packages/sitecore-jss-proxy/.eslintrc b/packages/sitecore-jss-proxy/.eslintrc
new file mode 100644
index 0000000000..116e46f25f
--- /dev/null
+++ b/packages/sitecore-jss-proxy/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "extends": "../../.eslintrc",
+ "rules": {
+ "@typescript-eslint/no-explicit-any": "off",
+ "@typescript-eslint/explicit-module-boundary-types": "off"
+ }
+}
diff --git a/packages/sitecore-jss-proxy/.npmignore b/packages/sitecore-jss-proxy/.npmignore
index 7d2dda9ed6..56a24e1aa2 100644
--- a/packages/sitecore-jss-proxy/.npmignore
+++ b/packages/sitecore-jss-proxy/.npmignore
@@ -4,12 +4,11 @@ sitecore
index.test.js
.vscode
.babelrc
-.eslintrc.json
+.eslintrc
.npmignore
.gitignore
jsconfig.json
tsconfig.json
-tslint.json
npm-debug*
*.log
!/types
diff --git a/packages/sitecore-jss-proxy/package-lock.json b/packages/sitecore-jss-proxy/package-lock.json
index 4144654c56..b418a1a5a4 100644
--- a/packages/sitecore-jss-proxy/package-lock.json
+++ b/packages/sitecore-jss-proxy/package-lock.json
@@ -30,6 +30,47 @@
"js-tokens": "^4.0.0"
}
},
+ "@eslint/eslintrc": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
+ "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.1.1",
+ "espree": "^7.3.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^3.13.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "strip-json-comments": "^3.1.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ }
+ }
+ },
"@nodelib/fs.scandir": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
@@ -176,6 +217,18 @@
"@types/node": "*"
}
},
+ "acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
+ },
+ "acorn-jsx": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
+ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
+ "dev": true
+ },
"aggregate-error": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
@@ -186,6 +239,18 @@
"indent-string": "^4.0.0"
}
},
+ "ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
"ansi-colors": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
@@ -268,6 +333,12 @@
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true
},
+ "astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true
+ },
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -310,6 +381,12 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true
+ },
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@@ -451,6 +528,17 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
+ "cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "dev": true,
+ "requires": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ }
+ },
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
@@ -492,6 +580,12 @@
"type-detect": "^4.0.0"
}
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+ "dev": true
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -541,12 +635,30 @@
"path-type": "^4.0.0"
}
},
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
"emoji-regex": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
"dev": true
},
+ "enquirer": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
+ "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "^4.1.1"
+ }
+ },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -649,17 +761,247 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
+ "eslint": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz",
+ "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@eslint/eslintrc": "^0.2.2",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "enquirer": "^2.3.5",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^2.1.0",
+ "eslint-visitor-keys": "^2.0.0",
+ "espree": "^7.3.1",
+ "esquery": "^1.2.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^6.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^12.1.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash": "^4.17.19",
+ "minimatch": "^3.0.4",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "progress": "^2.0.0",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
+ "strip-ansi": "^6.0.0",
+ "strip-json-comments": "^3.1.0",
+ "table": "^6.0.4",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ },
+ "espree": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
+ "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "dev": true,
+ "requires": {
+ "acorn": "^7.4.0",
+ "acorn-jsx": "^5.3.1",
+ "eslint-visitor-keys": "^1.3.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esquery": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
+ "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.1.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
+ "estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true
+ },
"eventemitter3": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz",
"integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg=="
},
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true
+ },
"fast-glob": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz",
@@ -674,6 +1016,18 @@
"picomatch": "^2.2.1"
}
},
+ "fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true
+ },
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "dev": true
+ },
"fastq": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz",
@@ -683,6 +1037,15 @@
"reusify": "^1.0.4"
}
},
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -718,6 +1081,22 @@
"is-buffer": "~2.0.3"
}
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"follow-redirects": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.10.0.tgz",
@@ -744,6 +1123,12 @@
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+ "dev": true
+ },
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -779,6 +1164,23 @@
"is-glob": "^4.0.1"
}
},
+ "globals": {
+ "version": "12.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz",
+ "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==",
+ "dev": true,
+ "requires": {
+ "type-fest": "^0.8.1"
+ },
+ "dependencies": {
+ "type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true
+ }
+ }
+ },
"globby": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz",
@@ -876,6 +1278,22 @@
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ }
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "dev": true
+ },
"indent-string": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
@@ -1061,6 +1479,18 @@
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
"dev": true
},
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
+ },
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
+ },
"just-extend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz",
@@ -1073,6 +1503,16 @@
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
"dev": true
},
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
"lines-and-columns": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
@@ -1144,6 +1584,15 @@
"integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==",
"dev": true
},
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
"make-error": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz",
@@ -1324,6 +1773,12 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
"nise": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz",
@@ -1397,6 +1852,20 @@
"wrappy": "1"
}
},
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dev": true,
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@@ -1430,6 +1899,15 @@
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
"parse-json": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz",
@@ -1454,6 +1932,12 @@
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
+ "path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true
+ },
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
@@ -1486,6 +1970,18 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz",
"integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA=="
},
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true
+ },
+ "progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true
+ },
"promise.allsettled": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz",
@@ -1499,6 +1995,12 @@
"iterate-value": "^1.0.0"
}
},
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+ "dev": true
+ },
"quick-lru": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz",
@@ -1572,6 +2074,12 @@
"strip-indent": "^3.0.0"
}
},
+ "regexpp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
+ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "dev": true
+ },
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
@@ -1598,6 +2106,12 @@
"path-parse": "^1.0.6"
}
},
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ },
"reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -1651,6 +2165,21 @@
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.3.tgz",
"integrity": "sha512-+Eovq+TUyhqwUe+Ac9EaPlfEZOcQyy7uUPhcbEXEIsH73x/gOU56RO8wZDZW98fu3vSxhcPjuKDo1mIrmM7ixw=="
},
+ "shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^3.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true
+ },
"sinon": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz",
@@ -1683,6 +2212,49 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
+ "slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ }
+ }
+ },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -1806,6 +2378,64 @@
}
}
},
+ "table": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.12.4",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
+ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
+ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.0"
+ }
+ }
+ }
+ },
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "dev": true
+ },
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -1841,6 +2471,15 @@
}
}
},
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
@@ -1859,6 +2498,21 @@
"integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==",
"dev": true
},
+ "uri-js": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
+ "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
+ "dev": true,
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "v8-compile-cache": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
+ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -1893,6 +2547,12 @@
"string-width": "^1.0.2 || 2"
}
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
+ },
"workerpool": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz",
@@ -1950,6 +2610,12 @@
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
"yargs": {
"version": "13.3.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
diff --git a/packages/sitecore-jss-proxy/package.json b/packages/sitecore-jss-proxy/package.json
index dcfe8eacf0..41297da2e1 100644
--- a/packages/sitecore-jss-proxy/package.json
+++ b/packages/sitecore-jss-proxy/package.json
@@ -6,7 +6,7 @@
"scripts": {
"build": "npm run clean && tsc",
"clean": "del-cli dist types",
- "lint": "tslint -p . -c ../../tslint.json \"src/**/*.ts\"",
+ "lint": "eslint --fix ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
"prepublishOnly": "npm run build",
"coverage": "nyc --require ts-node/register npm test"
@@ -36,6 +36,7 @@
"@types/set-cookie-parser": "^0.0.5",
"chai": "^4.2.0",
"del-cli": "^3.0.1",
+ "eslint": "^7.15.0",
"mocha": "^8.1.3",
"sinon": "^7.0.0",
"ts-node": "^8.4.1",
diff --git a/packages/sitecore-jss-proxy/src/ProxyConfig.ts b/packages/sitecore-jss-proxy/src/ProxyConfig.ts
index 34ce5cd136..0d4759d235 100644
--- a/packages/sitecore-jss-proxy/src/ProxyConfig.ts
+++ b/packages/sitecore-jss-proxy/src/ProxyConfig.ts
@@ -43,7 +43,8 @@ export interface ProxyConfig {
response: ServerResponse,
proxyResponse: IncomingMessage,
layoutServiceData: any
- ) => Promise