From f9d7f3efc45b9db759589b35dd77f43a1e05ef39 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 15 Dec 2020 01:37:33 +0200 Subject: [PATCH 01/37] configure sitecore-jss-react --- packages/sitecore-jss-react/.eslintrc | 80 ++++++++++++++ packages/sitecore-jss-react/package.json | 9 +- .../src/components/Date.test.tsx | 1 - .../src/components/Date.tsx | 13 ++- .../src/components/File.tsx | 16 +-- .../src/components/Image.tsx | 63 +++++++---- .../src/components/Link.tsx | 26 +++-- .../src/components/Placeholder.tsx | 10 +- .../src/components/PlaceholderCommon.tsx | 91 +++++++++------- .../src/components/RichText.tsx | 10 +- .../src/components/SitecoreContext.tsx | 20 ++-- .../src/components/Text.tsx | 9 +- .../src/components/VisitorIdentification.tsx | 2 +- .../enhancers/withExperienceEditorChromes.tsx | 8 +- .../src/enhancers/withPlaceholder.tsx | 20 ++-- .../enhancers/withSitecoreContext.test.tsx | 10 +- .../src/enhancers/withSitecoreContext.tsx | 15 +-- .../src/testData/ee-data.ts | 1 + .../src/testData/non-ee-data.ts | 1 + packages/sitecore-jss-react/src/utils.ts | 14 ++- packages/sitecore-jss-react/tslint.json | 100 ------------------ 21 files changed, 281 insertions(+), 238 deletions(-) create mode 100644 packages/sitecore-jss-react/.eslintrc delete mode 100644 packages/sitecore-jss-react/tslint.json diff --git a/packages/sitecore-jss-react/.eslintrc b/packages/sitecore-jss-react/.eslintrc new file mode 100644 index 0000000000..4d070e012d --- /dev/null +++ b/packages/sitecore-jss-react/.eslintrc @@ -0,0 +1,80 @@ +{ + "root": true, + "extends": [ + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint", "react"], + "settings": { + "react": { + "version": "detect" + } + }, + "env": { + "browser": true, + "node": true, + "es6": true + }, + "globals": { + "React": "writable" + }, + "ignorePatterns": ["src/**/*.test.*", "src/tests/*", "src/testData/*"], + "rules": { + "@typescript-eslint/indent": ["error", 2], + "no-restricted-globals": "off", + "no-restricted-properties": "off", + "@typescript-eslint/naming-convention": [ + "error", + { + "format": ["PascalCase"], + "selector": "typeLike", + "custom": { + "regex": "^I[A-Z]", + "match": false + } + } + ], + "spaced-comment": "error", + "curly": "error", + "eol-last": ["error", "always"], + "guard-for-in": "error", + "valid-jsdoc": "error", + "no-unused-labels": "error", + "max-len": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/member-ordering": "error", + "@typescript-eslint/no-explicit-any": "error", + "no-caller": "error", + "no-bitwise": "error", + "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-debugger": "error", + "no-redeclare": "error", + "no-empty": "error", + "no-eval": "error", + "no-shadow": "error", + "dot-notation": "error", + "no-fallthrough": "error", + "no-trailing-spaces": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], + "@typescript-eslint/no-use-before-define": "error", + "brace-style": "error", + "quotes": ["error", "single"], + "radix": "error", + "@typescript-eslint/semi": "error", + "default-case": "error", + "comma-dangle": ["error", { "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline" }], + "eqeqeq": "error", + "@typescript-eslint/typedef": "error", + "@typescript-eslint/type-annotation-spacing": "error" + } +} diff --git a/packages/sitecore-jss-react/package.json b/packages/sitecore-jss-react/package.json index 04aa5e44c0..ba1dad4c9c 100644 --- a/packages/sitecore-jss-react/package.json +++ b/packages/sitecore-jss-react/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/**/*.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 --require ts-node/register npm test" @@ -34,12 +34,16 @@ "@types/react": "16.9.2", "@types/react-dom": "^16.9.0", "@types/url-parse": "^1.4.3", + "@typescript-eslint/eslint-plugin": "^4.9.1", + "@typescript-eslint/parser": "^4.9.1", "chai": "^4.2.0", "chai-spies": "^1.0.0", "chai-string": "^1.5.0", "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", "react": "^16.9.0", @@ -47,7 +51,6 @@ "react-test-renderer": "^16.9.0", "sinon": "^7.4.2", "ts-node": "^8.3.0", - "tslint-react": "^4.0.0", "typescript": "3.7.5", "url-parse": "^1.4.7" }, @@ -56,7 +59,7 @@ "react-dom": "^16.9.0" }, "dependencies": { - "@sitecore-jss/sitecore-jss": "^15.0.1", + "@sitecore-jss/sitecore-jss": "file:../sitecore-jss", "prop-types": "^15.7.2", "style-attr": "^1.3.0" }, diff --git a/packages/sitecore-jss-react/src/components/Date.test.tsx b/packages/sitecore-jss-react/src/components/Date.test.tsx index 9dfea19429..3f01146383 100644 --- a/packages/sitecore-jss-react/src/components/Date.test.tsx +++ b/packages/sitecore-jss-react/src/components/Date.test.tsx @@ -44,7 +44,6 @@ describe('<DateField />', () => { const render = (date: Date | null) => <p>{date ? date.toDateString() : ''}</p>; const p = { field: { - value: undefined, editable: 'xxx' }, editable: false, diff --git a/packages/sitecore-jss-react/src/components/Date.tsx b/packages/sitecore-jss-react/src/components/Date.tsx index 69d7154a77..f2b448bd08 100644 --- a/packages/sitecore-jss-react/src/components/Date.tsx +++ b/packages/sitecore-jss-react/src/components/Date.tsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; export interface DateFieldProps { /** The date field data. */ + [htmlAttributes: string]: unknown; field: { value?: string; editable?: string; @@ -17,8 +18,7 @@ export interface DateFieldProps { * @default true */ editable?: boolean; - render?: (date: Date | null) => React.ComponentClass<any> | React.FunctionComponent<any> | React.ReactNode; - [htmlAttributes: string]: any; + render?: (date: Date | null) => React.ComponentClass<unknown> | React.FunctionComponent<unknown> | React.ReactNode; } export const DateField: React.SFC<DateFieldProps> = ({ field, tag, editable, render, ...otherProps }) => { @@ -26,9 +26,12 @@ export const DateField: React.SFC<DateFieldProps> = ({ field, tag, editable, ren return null; } - let children: any; + let children: React.ComponentType | React.ReactNode; - const htmlProps: any = { + const htmlProps: { + [htmlAttr: string]: unknown, + children?: React.ReactNode + } = { ...otherProps, }; @@ -63,4 +66,4 @@ DateField.defaultProps = { editable: true, }; -DateField.displayName = 'Date'; \ No newline at end of file +DateField.displayName = 'Date'; diff --git a/packages/sitecore-jss-react/src/components/File.tsx b/packages/sitecore-jss-react/src/components/File.tsx index fc61ca0bff..d3f20e2323 100644 --- a/packages/sitecore-jss-react/src/components/File.tsx +++ b/packages/sitecore-jss-react/src/components/File.tsx @@ -2,10 +2,10 @@ import PropTypes from 'prop-types'; import React from 'react'; export interface FileFieldValue { + [propName: string]: unknown; src?: string; title?: string; displayName?: string; - [propName: string]: any; } export interface FileField { @@ -13,10 +13,11 @@ export interface FileField { } export interface FileProps { + [attributeName: string]: unknown; /** The file field data. */ field: FileFieldValue | FileField; /** HTML attributes that will be appended to the rendered <a /> tag. */ - [attributeName: string]: any; + children?: React.ReactNode[] } export const File: React.SFC<FileProps> = ({ field, children, ...otherProps }) => { @@ -24,14 +25,14 @@ export const File: React.SFC<FileProps> = ({ field, children, ...otherProps }) = File fields cannot be managed via the EE. We never output "editable." */ - const dynamicField: any = field; + const dynamicField: FileField | FileFieldValue = field; - if (!field || (!dynamicField.value && !dynamicField.src)) { + if (!field || (!dynamicField.value && !(dynamicField as FileFieldValue).src)) { return null; } // handle link directly on field for forgetful devs - const file = dynamicField.src ? field : dynamicField.value; + const file = ((dynamicField as FileFieldValue).src ? field : dynamicField.value) as FileFieldValue; if (!file) { return null; } @@ -50,8 +51,9 @@ File.propTypes = { }), PropTypes.shape({ value: PropTypes.object, - }), + }) ]).isRequired, + children: PropTypes.array, }; -File.displayName = 'File'; \ No newline at end of file +File.displayName = 'File'; diff --git a/packages/sitecore-jss-react/src/components/Image.tsx b/packages/sitecore-jss-react/src/components/Image.tsx index d151c82d5b..fc365ef836 100644 --- a/packages/sitecore-jss-react/src/components/Image.tsx +++ b/packages/sitecore-jss-react/src/components/Image.tsx @@ -5,9 +5,9 @@ import ReactDOMServer from 'react-dom/server'; import { convertAttributesToReactProps } from '../utils'; export interface ImageFieldValue { + [attributeName: string]: unknown; src?: string; /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: any; } export interface ImageField { @@ -16,6 +16,7 @@ export interface ImageField { } export interface ImageSizeParameters { + [attr: string]: string | number | undefined; /** Fixed width of the image */ w?: number; /** Fixed height of the image */ @@ -33,6 +34,7 @@ export interface ImageSizeParameters { } export interface ImageProps { + [attributeName: string]: unknown; /** * The image field data. * @deprecated use field property instead @@ -56,7 +58,7 @@ export interface ImageProps { [paramName: string]: string | number; }; - srcSet?: Array<ImageSizeParameters>; + srcSet?: ImageSizeParameters[]; /** * Custom regexp that finds media URL prefix that will be replaced by `/-/jssmedia` or `/~/jssmedia`. @@ -68,10 +70,9 @@ export interface ImageProps { mediaUrlPrefix?: RegExp; /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: any; } -const getEditableWrapper = (editableMarkup: string, ...otherProps: any[]) => ( +const getEditableWrapper = (editableMarkup: string, ...otherProps: unknown[]) => ( // create an inline wrapper and use dangerouslySetInnerHTML. // if we try to parse the EE value, the parser will strip invalid or disallowed attributes from html elements - and EE uses several <span @@ -87,26 +88,35 @@ const getImageAttrs = ( srcSet, ...otherAttrs }: { - src: string; - srcSet: any; - otherAttrs: any[]; + [key: string]: unknown; + src?: string; + srcSet?: ImageSizeParameters[]; }, - imageParams: any, + imageParams?: { [paramName: string]: string | number }, mediaUrlPrefix?: RegExp ) => { if (!src) { return null; } - const newAttrs: any = { + const newAttrs: { [attr: string]: unknown } = { ...otherAttrs, }; // update image URL for jss handler and image rendering params - const resolvedSrc = mediaApi.updateImageUrl(src, imageParams, mediaUrlPrefix); + const resolvedSrc = mediaApi.updateImageUrl( + src, + imageParams, + mediaUrlPrefix + ); if (srcSet) { // replace with HTML-formatted srcset, including updated image URLs - newAttrs.srcSet = mediaApi.getSrcSet(resolvedSrc, srcSet, imageParams, mediaUrlPrefix); + newAttrs.srcSet = mediaApi.getSrcSet( + resolvedSrc, + srcSet, + imageParams, + mediaUrlPrefix + ); } // always output original src as fallback for older browsers newAttrs.src = resolvedSrc; @@ -126,34 +136,36 @@ export const Image: React.SFC<ImageProps> = ({ media = field; } - const dynamicMedia: any = media; + const dynamicMedia = media as ImageField | ImageFieldValue; - if (!media || (!dynamicMedia.editable && !dynamicMedia.value && !dynamicMedia.src)) { + if (!media || (!dynamicMedia.editable && !dynamicMedia.value && !(dynamicMedia as ImageFieldValue).src)) { return null; } + const imageField = dynamicMedia as ImageField; + // we likely have an experience editor value, should be a string - if (editable && dynamicMedia.editable) { - const foundImg = mediaApi.findEditorImageTag(dynamicMedia.editable); + if (editable && imageField.editable) { + const foundImg = mediaApi.findEditorImageTag(imageField.editable); if (!foundImg) { - return getEditableWrapper(dynamicMedia.editable); + return getEditableWrapper(imageField.editable); } const foundImgProps = convertAttributesToReactProps(foundImg.attrs); // Note: otherProps may override values from foundImgProps, e.g. `style`, `className` prop // We do not attempt to merge. - const imgAttrs = getImageAttrs({ ...foundImgProps, ...otherProps } as any, imageParams, mediaUrlPrefix); + const imgAttrs = getImageAttrs({ ...foundImgProps, ...otherProps }, imageParams, mediaUrlPrefix); if (!imgAttrs) { - return getEditableWrapper(dynamicMedia.editable); + return getEditableWrapper(imageField.editable); } const imgHtml = ReactDOMServer.renderToStaticMarkup(<img {...imgAttrs} />); - const editableMarkup = dynamicMedia.editable.replace(foundImg.imgTag, imgHtml); + const editableMarkup = imageField.editable.replace(foundImg.imgTag, imgHtml); return getEditableWrapper(editableMarkup); } // some wise-guy/gal is passing in a 'raw' image object value - const img = dynamicMedia.src ? media : dynamicMedia.value; + const img = (dynamicMedia as ImageFieldValue).src ? media : dynamicMedia.value as ImageFieldValue; if (!img) { return null; } @@ -174,14 +186,23 @@ Image.propTypes = { PropTypes.shape({ value: PropTypes.object, editable: PropTypes.string, + }) + ]), + field: PropTypes.oneOfType([ + PropTypes.shape({ + src: PropTypes.string, }), + PropTypes.shape({ + value: PropTypes.object, + editable: PropTypes.string, + }) ]), editable: PropTypes.bool, mediaUrlPrefix: PropTypes.instanceOf(RegExp), imageParams: PropTypes.objectOf(PropTypes.oneOfType([ PropTypes.number.isRequired, PropTypes.string.isRequired - ]).isRequired) + ]).isRequired), }; Image.defaultProps = { diff --git a/packages/sitecore-jss-react/src/components/Link.tsx b/packages/sitecore-jss-react/src/components/Link.tsx index c59138e37b..b3541bafd3 100644 --- a/packages/sitecore-jss-react/src/components/Link.tsx +++ b/packages/sitecore-jss-react/src/components/Link.tsx @@ -2,11 +2,12 @@ import React, { ReactElement } from 'react'; import PropTypes from 'prop-types'; export interface LinkFieldValue { + [attributeName: string]: unknown; href?: string; className?: string; title?: string; target?: string; - [attributeName: string]: any; + text?: string; } export interface LinkField { @@ -33,17 +34,17 @@ export type LinkProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLA }; export const Link: React.SFC<LinkProps> = ({ field, editable, children, showLinkTextWithChildrenPresent, ...otherProps }) => { - const dynamicField: any = field; + const dynamicField: LinkField | LinkFieldValue = field; - if (!field || (!dynamicField.editableFirstPart && !dynamicField.value && !dynamicField.href)) { + if (!field || (!dynamicField.editableFirstPart && !dynamicField.value && !(dynamicField as LinkFieldValue).href)) { return null; } - const resultTags: ReactElement<any>[] = []; + const resultTags: ReactElement<unknown>[] = []; // EXPERIENCE EDITOR RENDERING if (editable && dynamicField.editableFirstPart) { - let markup = dynamicField.editableFirstPart + dynamicField.editableLastPart; + const markup = (dynamicField.editableFirstPart as string) + dynamicField.editableLastPart; // in an ideal world, we'd pre-render React children here and inject them between editableFirstPart and editableLastPart. // However, we cannot combine arbitrary unparsed HTML (innerHTML) based components with actual vDOM components (the children) @@ -69,12 +70,15 @@ export const Link: React.SFC<LinkProps> = ({ field, editable, children, showLink } // handle link directly on field for forgetful devs - const link = dynamicField.href ? field : dynamicField.value; + const link = (dynamicField as LinkFieldValue).href + ? (field as LinkFieldValue) + : (dynamicField as LinkField).value; + if (!link) { return null; } - const anchorAttrs: any = { + const anchorAttrs: { [attr: string]: unknown } = { href: link.href, className: link.class, title: link.title, @@ -86,7 +90,7 @@ export const Link: React.SFC<LinkProps> = ({ field, editable, children, showLink anchorAttrs.rel = 'noopener noreferrer'; } - let linkText = showLinkTextWithChildrenPresent || !children ? (link.text || link.href) : null; + const linkText = showLinkTextWithChildrenPresent || !children ? (link.text || link.href) : null; resultTags.push(React.createElement('a', { ...anchorAttrs, ...otherProps, key: 'link' }, linkText, children)); @@ -102,9 +106,11 @@ export const LinkPropTypes = { value: PropTypes.object, editableFirstPart: PropTypes.string, editableLastPart: PropTypes.string, - }), + }) ]).isRequired, editable: PropTypes.bool, + children: PropTypes.node, + showLinkTextWithChildrenPresent: PropTypes.bool, }; Link.propTypes = LinkPropTypes; @@ -113,4 +119,4 @@ Link.defaultProps = { editable: true, }; -Link.displayName = 'Link'; \ No newline at end of file +Link.displayName = 'Link'; diff --git a/packages/sitecore-jss-react/src/components/Placeholder.tsx b/packages/sitecore-jss-react/src/components/Placeholder.tsx index 0090060848..9594abddb9 100644 --- a/packages/sitecore-jss-react/src/components/Placeholder.tsx +++ b/packages/sitecore-jss-react/src/components/Placeholder.tsx @@ -10,7 +10,7 @@ export interface PlaceholderComponentProps extends PlaceholderProps { */ renderEmpty?: ( components: React.ReactNode[] - ) => React.ComponentClass<any> | React.SFC<any> | React.ReactNode; + ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; /** * Render props function that enables control over the rendering of the components in the placeholder. * Useful for techniques like wrapping each child in a wrapper component. @@ -19,7 +19,7 @@ export interface PlaceholderComponentProps extends PlaceholderProps { components: React.ReactNode[], data: (ComponentRendering | HtmlElementRendering)[], props: PlaceholderProps - ) => React.ComponentClass<any> | React.SFC<any> | React.ReactNode; + ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; /** * Render props function that is called for each non-system component added to the placeholder. @@ -28,7 +28,7 @@ export interface PlaceholderComponentProps extends PlaceholderProps { renderEach?: ( component: React.ReactNode, index: number - ) => React.ComponentClass<any> | React.SFC<any> | React.ReactNode; + ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; } function isRawRendering(rendering: HtmlElementRendering | ComponentRendering): rendering is HtmlElementRendering { @@ -43,7 +43,7 @@ class PlaceholderComponent extends PlaceholderCommon<PlaceholderComponentProps> } render() { - let childProps: any = { ...this.props }; + const childProps: PlaceholderComponentProps = { ...this.props }; delete childProps.componentFactory; @@ -84,4 +84,4 @@ class PlaceholderComponent extends PlaceholderCommon<PlaceholderComponentProps> } } -export const Placeholder = withComponentFactory(PlaceholderComponent); \ No newline at end of file +export const Placeholder = withComponentFactory(PlaceholderComponent); diff --git a/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx b/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx index c03a6e476a..2e18069fe0 100644 --- a/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx +++ b/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx @@ -5,7 +5,12 @@ import { ComponentFactory } from '../components/sharedTypes'; import { ComponentRendering, RouteData, Field, Item, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; import { convertAttributesToReactProps } from '../utils'; +type ErrorComponentProps = { + [prop: string]: unknown; +}; + export interface PlaceholderProps { + [key: string]: unknown; /** Name of the placeholder to render. */ name: string; /** Rendering data to be used when rendering the placeholder. */ @@ -38,15 +43,13 @@ export interface PlaceholderProps { * A component that is rendered in place of any components that are in this placeholder, * but do not have a definition in the componentFactory (i.e. don't have a React implementation) */ - missingComponentComponent?: React.ComponentClass<any> | React.FC<any>; + missingComponentComponent?: React.ComponentClass<unknown> | React.FC<unknown>; /** * A component that is rendered in place of the placeholder when an error occurs rendering * the placeholder */ - errorComponent?: React.ComponentClass<any> | React.SFC<any>; - - [key: string]: any; + errorComponent?: React.ComponentClass<ErrorComponentProps> | React.SFC<ErrorComponentProps>; } export class PlaceholderCommon<T extends PlaceholderProps> extends React.Component<T> { @@ -61,18 +64,27 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone ]).isRequired), params: PropTypes.objectOf(PropTypes.string.isRequired), missingComponentComponent: PropTypes.oneOfType([ - PropTypes.object as Requireable<React.ComponentClass<any>>, - PropTypes.func as Requireable<React.FC<any>> + PropTypes.object as Requireable<React.ComponentClass<unknown>>, + PropTypes.func as Requireable<React.FC<unknown>> ]), errorComponent: PropTypes.oneOfType([ - PropTypes.object as Requireable<React.ComponentClass<any>>, - PropTypes.object as Requireable<React.SFC<any>> + PropTypes.object as Requireable<React.ComponentClass<unknown>>, + PropTypes.object as Requireable<React.SFC<unknown>> ]), }; - nodeRefs: any[]; + nodeRefs: Element[]; state: Readonly<{ error?: Error }>; + constructor(props: T) { + super(props); + this.nodeRefs = []; + this.state = {}; + this.addRef = this.addRef.bind(this); + this.updateKeyAttributes = this.updateKeyAttributes.bind(this); + this.createRawElement = this.createRawElement.bind(this); + } + static getPlaceholderDataFromRenderingData(rendering: ComponentRendering | RouteData, name: string) { let result; if (rendering && rendering.placeholders && Object.keys(rendering.placeholders).length > 0) { @@ -93,15 +105,6 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone return result; } - constructor(props: T) { - super(props); - this.nodeRefs = []; - this.state = {}; - this.addRef = this.addRef.bind(this); - this.updateKeyAttributes = this.updateKeyAttributes.bind(this); - this.createRawElement = this.createRawElement.bind(this); - } - componentDidMount() { this.updateKeyAttributes(); } @@ -123,19 +126,23 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone ...placeholderProps } = this.props; - return placeholderData.map((rendering: any, index: number) => { - const key = rendering.uid ? rendering.uid : `component-${index}`; + return placeholderData.map((rendering: ComponentRendering | HtmlElementRendering, index: number) => { + const key = (rendering as ComponentRendering).uid + ? (rendering as ComponentRendering).uid + : `component-${index}`; const commonProps = { key }; // if the element is not a 'component rendering', render it 'raw' - if (!rendering.componentName && rendering.name) { - return this.createRawElement(rendering, commonProps); + if (!(rendering as ComponentRendering).componentName && (rendering as HtmlElementRendering).name) { + return this.createRawElement(rendering as HtmlElementRendering, commonProps); } - let component: ComponentType | null = this.getComponentForRendering(rendering); + const componentRendering = rendering as ComponentRendering; + + let component = this.getComponentForRendering(componentRendering); if (!component) { console.error( - `Placeholder ${name} contains unknown component ${rendering.componentName + `Placeholder ${name} contains unknown component ${componentRendering.componentName }. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.` ); @@ -145,21 +152,21 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone const finalProps = { ...commonProps, ...placeholderProps, - ...((placeholderFields || rendering.fields) && { - fields: { ...placeholderFields, ...rendering.fields }, + ...((placeholderFields || componentRendering.fields) && { + fields: { ...placeholderFields, ...componentRendering.fields }, }), - ...((placeholderParams || rendering.params) && { - params: { ...placeholderParams, ...rendering.params }, + ...((placeholderParams || componentRendering.params) && { + params: { ...placeholderParams, ...componentRendering.params }, }), - rendering, + rendering: componentRendering, }; - return React.createElement(component as any, finalProps); + return React.createElement<{ [attr: string]: unknown }>(component as React.ComponentType, finalProps); }) - .filter((element: any) => element); // remove nulls + .filter(element => element); // remove nulls } - getComponentForRendering(renderingDefinition: { componentName: string }) { + getComponentForRendering(renderingDefinition: { componentName: string }): ComponentType | null { const componentFactory = this.props.componentFactory; if (!componentFactory || typeof componentFactory !== 'function') { @@ -170,20 +177,26 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone return componentFactory(renderingDefinition.componentName); } - addRef(nodeRef: any) { + addRef(nodeRef: Element) { this.nodeRefs.push(nodeRef); } - createRawElement(elem: any, baseProps: any) { + createRawElement(elem: HtmlElementRendering, baseProps: { key?: string }) { if (!elem.name) { console.error( '"elem.name" is undefined in "createRawElement". Something is likely wrong with your component data. Ensure that your components have a name.' ); return null; } - const attributes: any = convertAttributesToReactProps(elem.attributes); + const attributes = convertAttributesToReactProps(elem.attributes); - const props: any = { + const props: { + [attr: string]: unknown; + key?: string; + dangerouslySetInnerHTML: { + __html: string | null + } + } = { ...baseProps, ...attributes, dangerouslySetInnerHTML: { __html: elem.contents }, @@ -192,7 +205,7 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone /* Since we can't set the "key" attribute via React, stash it * so we can set in the DOM after render. */ - if (attributes && attributes.chrometype === 'placeholder') { + if (!Array.isArray(attributes) && attributes && attributes.chrometype === 'placeholder') { props.phkey = elem.attributes.key; // props that get rendered as dom attribute names need to be lowercase, otherwise React complains. props.ref = this.addRef; // only need ref for placeholder containers, trying to add it to other components (e.g. stateless components) may result in a warning. } @@ -205,7 +218,7 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone return; } - this.nodeRefs.forEach((ref: any) => { + this.nodeRefs.forEach((ref: Element) => { if (ref && ref.getAttribute) { // ref might be a wrapped component, so check for existence of getAttribute method const key = ref.getAttribute('phkey'); @@ -218,4 +231,4 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone } }); } -} \ No newline at end of file +} diff --git a/packages/sitecore-jss-react/src/components/RichText.tsx b/packages/sitecore-jss-react/src/components/RichText.tsx index 105060b5d1..3cb2ac407e 100644 --- a/packages/sitecore-jss-react/src/components/RichText.tsx +++ b/packages/sitecore-jss-react/src/components/RichText.tsx @@ -2,6 +2,7 @@ import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; export interface RichTextProps { + [htmlAttributes: string]: unknown; /** The rich text field data. */ field?: { value?: string; @@ -18,19 +19,18 @@ export interface RichTextProps { * @default true */ editable?: boolean; - [htmlAttributes: string]: any; } export const RichText: React.SFC<RichTextProps> = forwardRef(({ field, tag, editable, ...otherProps }, ref) => { if (!field || (!field.editable && !field.value)) { return null; - } + } const htmlProps = { dangerouslySetInnerHTML: { __html: field.editable && editable ? field.editable : field.value, - }, - ref, + }, + ref, ...otherProps, }; @@ -53,4 +53,4 @@ RichText.defaultProps = { editable: true, }; -RichText.displayName = 'RichText'; \ No newline at end of file +RichText.displayName = 'RichText'; diff --git a/packages/sitecore-jss-react/src/components/SitecoreContext.tsx b/packages/sitecore-jss-react/src/components/SitecoreContext.tsx index 1abfb71db0..f3cc6b1c13 100644 --- a/packages/sitecore-jss-react/src/components/SitecoreContext.tsx +++ b/packages/sitecore-jss-react/src/components/SitecoreContext.tsx @@ -4,12 +4,12 @@ import { ComponentFactory } from './sharedTypes'; export interface SitecoreContextProps { componentFactory: ComponentFactory; - context?: any; + context?: unknown; } export interface SitecoreContextState { - setContext: (value: any) => void; - context: any; + setContext: (value: unknown) => void; + context: unknown; } export const SitecoreContextReactContext = React.createContext<SitecoreContextState>({} as SitecoreContextState); @@ -19,7 +19,7 @@ export class SitecoreContext extends React.Component<SitecoreContextProps, Sitec static propTypes = { children: PropTypes.any.isRequired, componentFactory: PropTypes.func, - context: PropTypes.any + context: PropTypes.any, }; static displayName = 'SitecoreContext'; @@ -27,9 +27,9 @@ export class SitecoreContext extends React.Component<SitecoreContextProps, Sitec constructor(props: SitecoreContextProps) { super(props); - let context: any = { + let context: unknown = { pageEditing: false, - } + }; if (props.context) { context = props.context; @@ -41,15 +41,15 @@ export class SitecoreContext extends React.Component<SitecoreContextProps, Sitec this.state = { context, - setContext: this.setContext + setContext: this.setContext, }; } - setContext = (value: any) => { + setContext = (value: unknown) => { this.setState({ - context: value + context: value, }); - } + }; render() { return ( diff --git a/packages/sitecore-jss-react/src/components/Text.tsx b/packages/sitecore-jss-react/src/components/Text.tsx index efb7272b9f..f46c31743b 100644 --- a/packages/sitecore-jss-react/src/components/Text.tsx +++ b/packages/sitecore-jss-react/src/components/Text.tsx @@ -2,6 +2,7 @@ import React, { ReactElement, FunctionComponent } from 'react'; import PropTypes from 'prop-types'; export interface TextProps { + [htmlAttributes: string]: unknown; /** The text field data. */ field?: { value?: string; @@ -21,7 +22,6 @@ export interface TextProps { * If false, HTML-encoding of the field value is disabled and the value is rendered as-is. */ encode?: boolean; - [htmlAttributes: string]: any; } export const Text: FunctionComponent<TextProps> = ({ field, tag, editable, encode, ...otherProps }) => { @@ -61,7 +61,10 @@ export const Text: FunctionComponent<TextProps> = ({ field, tag, editable, encod const setDangerously = (field.editable && editable) || !encode; let children = null; - const htmlProps: any = { + const htmlProps: { + [htmlAttributes: string]: unknown; + children?: React.ReactNode; + } = { ...otherProps, }; @@ -95,4 +98,4 @@ Text.defaultProps = { encode: true, }; -Text.displayName = 'Text'; \ No newline at end of file +Text.displayName = 'Text'; diff --git a/packages/sitecore-jss-react/src/components/VisitorIdentification.tsx b/packages/sitecore-jss-react/src/components/VisitorIdentification.tsx index fcbcb5a7dd..e63d15aad8 100644 --- a/packages/sitecore-jss-react/src/components/VisitorIdentification.tsx +++ b/packages/sitecore-jss-react/src/components/VisitorIdentification.tsx @@ -21,7 +21,7 @@ const VIComponent: React.FC<VIProps> = ({ sitecoreContext }) => { emittedVI = true; const script = document.createElement('script'); - script.src = `/layouts/system/VisitorIdentification.js`; + script.src = '/layouts/system/VisitorIdentification.js'; script.type = 'text/javascript'; const meta = document.createElement('meta'); diff --git a/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx b/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx index 0512cfeb09..9b55f08d51 100644 --- a/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx @@ -1,9 +1,9 @@ -import React from 'react'; +import React, { ComponentType } from 'react'; import { resetExperienceEditorChromes } from '../'; -export const withExperienceEditorChromes = (WrappedComponent: React.ComponentClass<any> | React.SFC<any>) => { - class Enhancer extends React.Component<{}> { - displayName: string = (WrappedComponent as any).displayName || WrappedComponent.name || 'Component'; +export const withExperienceEditorChromes = (WrappedComponent: React.ComponentClass<unknown> | React.SFC<unknown>) => { + class Enhancer extends React.Component<unknown> { + displayName: string = (WrappedComponent as ComponentType).displayName || WrappedComponent.name || 'Component'; componentDidUpdate() { resetExperienceEditorChromes(); diff --git a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx index 73e2b75558..184e12bcb5 100644 --- a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx @@ -10,7 +10,7 @@ export interface WithPlaceholderOptions { * However, if your component data is in a different prop, like say 'route' in a sample app, * this lets you map that. */ - resolvePlaceholderDataFromProps?: (props: any) => ComponentRendering | RouteData; + resolvePlaceholderDataFromProps?: (props: unknown) => ComponentRendering | RouteData; /** * Function to alter the placeholder props from within the HOC. Enables the props to be * transformed before being used by the placeholder/HOC, for example to customize the @@ -33,16 +33,16 @@ export interface PlaceholderToPropMapping { export type WithPlaceholderSpec = (string | PlaceholderToPropMapping) | (string | PlaceholderToPropMapping)[]; export function withPlaceholder(placeholders: WithPlaceholderSpec, options?: WithPlaceholderOptions) { - return (WrappedComponent: React.ComponentClass<any> | React.SFC<any>) => { + return (WrappedComponent: React.ComponentClass<PlaceholderProps> | React.SFC<PlaceholderProps>) => { class WithPlaceholder extends PlaceholderCommon<PlaceholderProps> { static propTypes = PlaceholderCommon.propTypes; - constructor(props: any) { + constructor(props: PlaceholderProps) { super(props); } render() { - let childProps: any = { ...this.props }; + let childProps: PlaceholderProps = { ...this.props }; delete childProps.componentFactory; @@ -58,7 +58,7 @@ export function withPlaceholder(placeholders: WithPlaceholderSpec, options?: Wit return ( <div className="sc-jss-placeholder-error"> A rendering error occurred: {this.state.error.message}. - </div> + </div> ); } @@ -69,18 +69,18 @@ export function withPlaceholder(placeholders: WithPlaceholderSpec, options?: Wit const definitelyArrayPlacholders = !Array.isArray(placeholders) ? [ placeholders ] : placeholders; - definitelyArrayPlacholders.forEach((placeholder: any) => { + definitelyArrayPlacholders.forEach((placeholder: string | PlaceholderToPropMapping) => { let placeholderData: (ComponentRendering | HtmlElementRendering)[]; - if (placeholder.placeholder && placeholder.prop) { + if (typeof placeholder !== 'string' && placeholder.placeholder && placeholder.prop) { placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData(renderingData, placeholder.placeholder); if (placeholderData) { childProps[placeholder.prop] = this.getComponentsForRenderingData(placeholderData); } } else { - placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData(renderingData, placeholder); + placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData(renderingData, placeholder as string); if (placeholderData) { - childProps[placeholder] = this.getComponentsForRenderingData(placeholderData); + childProps[placeholder as string] = this.getComponentsForRenderingData(placeholderData); } } }); @@ -91,4 +91,4 @@ export function withPlaceholder(placeholders: WithPlaceholderSpec, options?: Wit return withComponentFactory(WithPlaceholder); }; -} \ No newline at end of file +} diff --git a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx index cb588562ae..0534dd6c6e 100644 --- a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx @@ -65,11 +65,12 @@ describe('withSitecoreContext', () => { }; const TestComponent: React.FC<any> = (props: any) => { - const reactContext = useSitecoreContext(); + const reactContext = useSitecoreContext(); + const context = reactContext.sitecoreContext as { text: string } return ( <div onClick={reactContext.updateSitecoreContext}> - {reactContext.sitecoreContext.text}{props.customProp} + {context.text}{props.customProp} </div> ) } @@ -99,11 +100,12 @@ describe('withSitecoreContext', () => { }; const TestComponent: React.FC<any> = (props: any) => { - const reactContext = useSitecoreContext({ updatable: true }); + const reactContext = useSitecoreContext({ updatable: true }); + const context = reactContext.sitecoreContext as { text: string } return ( <div onClick={reactContext.updateSitecoreContext}> - {reactContext.sitecoreContext.text}{props.customProp} + {context.text}{props.customProp} </div> ) } diff --git a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx index feb702a7a5..11d816eedf 100644 --- a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx @@ -6,8 +6,8 @@ export interface WithSitecoreContextOptions { } export interface WithSitecoreContextProps { - sitecoreContext: any; - updateSitecoreContext?: ((value: any) => void) | false; + sitecoreContext: unknown; + updateSitecoreContext?: ((value: unknown) => void) | false; } export interface ComponentConsumerProps extends WithSitecoreContextProps { @@ -48,20 +48,21 @@ export function withSitecoreContext(options?: WithSitecoreContextOptions) { * * @see https://jss.sitecore.com/docs/techniques/extending-layout-service/layoutservice-extending-context * - * @param {WithSitecoreContextOptions} [options] - * + * @param {WithSitecoreContextOptions} [options] hook options + * * @example * const EditMode = () => { * const { sitecoreContext } = useSitecoreContext(); * return <span>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span> * } - * + * * @example * const EditMode = () => { * const { sitecoreContext, updateSitecoreContext } = useSitecoreContext({ updatable: true }); * const onClick = () => updateSitecoreContext({ pageEditing: true }); * return <span onClick={onClick}>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span> * } + * @returns {Object} { sitecoreContext, updateSitecoreContext } */ export function useSitecoreContext(options?: WithSitecoreContextOptions) { const reactContext = React.useContext(SitecoreContextReactContext); @@ -69,6 +70,6 @@ export function useSitecoreContext(options?: WithSitecoreContextOptions) { return { sitecoreContext: reactContext.context, - updateSitecoreContext: updatable ? reactContext.setContext : undefined - } + updateSitecoreContext: updatable ? reactContext.setContext : undefined, + }; } diff --git a/packages/sitecore-jss-react/src/testData/ee-data.ts b/packages/sitecore-jss-react/src/testData/ee-data.ts index 8bc5790127..6e8e9fae15 100644 --- a/packages/sitecore-jss-react/src/testData/ee-data.ts +++ b/packages/sitecore-jss-react/src/testData/ee-data.ts @@ -1,3 +1,4 @@ +// @ts-nocheck export const convertedData = { sitecore: { context: { diff --git a/packages/sitecore-jss-react/src/testData/non-ee-data.ts b/packages/sitecore-jss-react/src/testData/non-ee-data.ts index cd1a7d4a31..50754cf768 100644 --- a/packages/sitecore-jss-react/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-react/src/testData/non-ee-data.ts @@ -1,3 +1,4 @@ +// @ts-nocheck export const convertedDevData = { sitecore: { context: { diff --git a/packages/sitecore-jss-react/src/utils.ts b/packages/sitecore-jss-react/src/utils.ts index 018a49464d..43ff8c4eae 100644 --- a/packages/sitecore-jss-react/src/utils.ts +++ b/packages/sitecore-jss-react/src/utils.ts @@ -12,24 +12,32 @@ export const convertKebabCasetoCamelCase = (str: string) => * We are only concerned with style at the moment, which needs to be converted from string to object to satisfy React. * We don't need to convert any other attributes (that we know of), because the placeholder renders them "as-is" by using the special "is" React prop. * For whatever reason though, the "style" prop is still validated as needing to be an object when using the "is" prop, which is why we need to convert from string to object. + * @param {string} [style] style + * @returns {array} converted attributes */ export const convertStyleAttribute = (style = '') => { // styleParse converts a style attribute string into an object format const parsedStyle = styleParse(style, { preserveNumbers: true }); return Object.keys(parsedStyle).reduce((initialResult, styleKey) => { - const result: any = initialResult; + const result: { [key: string]: unknown } = initialResult; const convertedKey = convertKebabCasetoCamelCase(styleKey); result[convertedKey] = parsedStyle[styleKey]; return result; }, {}); }; -export const convertAttributesToReactProps = (attributes: any) => { +export const convertAttributesToReactProps = ( + attributes: null | { + [key: string]: unknown; + style?: string; + class?: string; + } +): [] | { [attr: string]: unknown } => { if (!attributes) { return []; } return Object.keys(attributes).reduce((initialResult, attrName) => { - const result: any = initialResult; + const result: { [key: string]: unknown } = initialResult; switch (attrName) { case 'class': { result.className = attributes.class; diff --git a/packages/sitecore-jss-react/tslint.json b/packages/sitecore-jss-react/tslint.json deleted file mode 100644 index 4b5c71f249..0000000000 --- a/packages/sitecore-jss-react/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" - ] - } -} From 540f8c5966d5809fa1089a8d5d8302f24b49e927 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 15 Dec 2020 09:36:11 +0200 Subject: [PATCH 02/37] Push --- packages/sitecore-jss-nextjs/package.json | 7 ++++-- .../src/components/ComponentPropsContext.tsx | 20 ++++++++------- .../src/components/RichText.tsx | 2 +- .../src/services/component-props-service.ts | 25 ++++++++++++++++--- packages/sitecore-jss/src/mediaApi.ts | 6 ++--- 5 files changed, 41 insertions(+), 19 deletions(-) diff --git a/packages/sitecore-jss-nextjs/package.json b/packages/sitecore-jss-nextjs/package.json index b56b04e912..30b4b7698f 100644 --- a/packages/sitecore-jss-nextjs/package.json +++ b/packages/sitecore-jss-nextjs/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/**/*.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" @@ -33,12 +33,16 @@ "@types/react": "16.9.2", "@types/react-dom": "^16.9.0", "@types/url-parse": "^1.4.3", + "@typescript-eslint/eslint-plugin": "^4.9.1", + "@typescript-eslint/parser": "^4.9.1", "chai": "^4.2.0", "chai-spies": "^1.0.0", "chai-string": "^1.5.0", "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", @@ -47,7 +51,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", "url-parse": "^1.4.7" }, diff --git a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx index 93c6da025e..ed664cc194 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,22 @@ export const ComponentPropsReactContext = createContext<ComponentPropsCollection /** * Hook in order to get access to props related to specific component. Data comes from ComponentPropsContext. * @see ComponentPropsContext + * @param {string} componentUid component uId + * @returns {ComponentData} component props */ export function useComponentProps<ComponentData>(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) => ( - <ComponentPropsReactContext.Provider value={value}> - {children} - </ComponentPropsReactContext.Provider> -) + <ComponentPropsReactContext.Provider value={value}> + {children} + </ComponentPropsReactContext.Provider> +); diff --git a/packages/sitecore-jss-nextjs/src/components/RichText.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.tsx index d19c98c8a2..8a36d0622e 100644 --- a/packages/sitecore-jss-nextjs/src/components/RichText.tsx +++ b/packages/sitecore-jss-nextjs/src/components/RichText.tsx @@ -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/services/component-props-service.ts b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts index a9f0aa7204..0cfe99ced5 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<GetServerSidePropsContext>} params fetch params + * @returns {Promise<ComponentPropsCollection>} props */ async fetchServerSideComponentProps( params: FetchComponentPropsArguments<GetServerSidePropsContext> @@ -53,6 +55,8 @@ export class ComponentPropsService { /** * SSG mode * Fetch component props using getStaticProps function + * @param {FetchComponentPropsArguments<GetStaticPropsContext>} params fetch arguments + * @returns {Promise<ComponentPropsCollection>} props */ async fetchStaticComponentProps( params: FetchComponentPropsArguments<GetStaticPropsContext> @@ -75,6 +79,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<NextContext>} fetchFunctionFactory fetch function factory + * @param {LayoutServiceData} layoutData layout data + * @param {NextContext} context next context + * @returns {Promise<ComponentPropsCollection>} component props */ async fetchComponentProps<NextContext>( fetchFunctionFactory: FetchFunctionFactory<NextContext>, @@ -95,6 +103,8 @@ 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 + * @returns {ComponentPropsRequest<NextContext>[]} array of requests */ collectRequests<NextContext>(params: { placeholders: PlaceholdersData; @@ -102,7 +112,7 @@ export class ComponentPropsService { layoutData: LayoutServiceData; context: NextContext; requests?: ComponentPropsRequest<NextContext>[]; - }) { + }): ComponentPropsRequest<NextContext>[] { const { placeholders, fetchFunctionFactory, layoutData, context } = params; // Will be called on first round @@ -139,8 +149,12 @@ export class ComponentPropsService { /** * Execute request for component props + * @param {ComponentPropsRequest<NextContext>[]} requests requests + * @returns {Promise<ComponentPropsCollection>} requests result */ - async execRequests<NextContext>(requests: ComponentPropsRequest<NextContext>[]) { + async execRequests<NextContext>( + requests: ComponentPropsRequest<NextContext>[] + ): Promise<ComponentPropsCollection> { const componentProps: ComponentPropsCollection = {}; const promises = requests.map((req) => { @@ -155,11 +169,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[req.rendering.uid] = result; }) .catch((error) => { console.log(`Error during preload data for component ${req.rendering.uid}:`, error); - componentProps[req.rendering.uid!] = { + componentProps[req.rendering.uid] = { error, }; }); @@ -181,6 +195,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/src/mediaApi.ts b/packages/sitecore-jss/src/mediaApi.ts index 04905f29b1..f7c1e4ba20 100644 --- a/packages/sitecore-jss/src/mediaApi.ts +++ b/packages/sitecore-jss/src/mediaApi.ts @@ -55,7 +55,7 @@ export const getRequiredParams = (qs: { */ export const updateImageUrl = ( url: string, - params?: { [key: string]: string | undefined }, + params?: { [key: string]: string | number | undefined }, mediaUrlPrefix: RegExp = mediaUrlPrefixRegex ) => { // polyfill node `global` in browser to workaround https://github.com/unshiftio/url-parse/issues/150 @@ -101,8 +101,8 @@ export const updateImageUrl = ( */ export const getSrcSet = ( url: string, - srcSet: Array<{ [key: string]: string | undefined }>, - imageParams?: { [key: string]: string | undefined }, + srcSet: Array<{ [key: string]: string | number | undefined }>, + imageParams?: { [key: string]: string | number | undefined }, mediaUrlPrefix?: RegExp ) => { return srcSet From 32dbce55d8975bf021213bbd99b5bdf325072b3c Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Wed, 16 Dec 2020 11:44:08 +0200 Subject: [PATCH 03/37] Lint sitecore-jss-nextjs --- packages/sitecore-jss-nextjs/.eslintrc | 81 ++++++++++++++ .../src/components/Link.tsx | 41 ++++--- .../src/services/component-props-service.ts | 10 +- packages/sitecore-jss-nextjs/tslint.json | 100 ------------------ .../src/components/Link.tsx | 1 + 5 files changed, 115 insertions(+), 118 deletions(-) create mode 100644 packages/sitecore-jss-nextjs/.eslintrc delete mode 100644 packages/sitecore-jss-nextjs/tslint.json diff --git a/packages/sitecore-jss-nextjs/.eslintrc b/packages/sitecore-jss-nextjs/.eslintrc new file mode 100644 index 0000000000..60e38b769a --- /dev/null +++ b/packages/sitecore-jss-nextjs/.eslintrc @@ -0,0 +1,81 @@ +{ + "root": true, + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint", "react"], + "settings": { + "react": { + "version": "detect" + } + }, + "env": { + "browser": true, + "node": true, + "es6": true + }, + "globals": { + "React": "writable" + }, + "ignorePatterns": ["src/**/*.test.*", "src/tests/*", "src/testData/*"], + "rules": { + "@typescript-eslint/indent": ["error", 2], + "no-restricted-globals": "off", + "no-restricted-properties": "off", + "@typescript-eslint/naming-convention": [ + "error", + { + "format": ["PascalCase"], + "selector": "typeLike", + "custom": { + "regex": "^I[A-Z]", + "match": false + } + } + ], + "spaced-comment": "error", + "curly": ["error", "multi-line"], + "eol-last": ["error", "always"], + "guard-for-in": "error", + "valid-jsdoc": "error", + "no-unused-labels": "error", + "max-len": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/member-ordering": "error", + "@typescript-eslint/no-explicit-any": "error", + "no-caller": "error", + "no-bitwise": "error", + "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-debugger": "error", + "no-redeclare": "error", + "no-empty": "error", + "no-eval": "error", + "no-shadow": "error", + "dot-notation": "error", + "no-fallthrough": "error", + "no-trailing-spaces": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], + "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "variables": false }], + "brace-style": "error", + "quotes": ["error", "single"], + "radix": "error", + "@typescript-eslint/semi": "error", + "default-case": "error", + "comma-dangle": ["error", { "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline" }], + "eqeqeq": "error", + "@typescript-eslint/typedef": "error", + "@typescript-eslint/type-annotation-spacing": "error" + } +} diff --git a/packages/sitecore-jss-nextjs/src/components/Link.tsx b/packages/sitecore-jss-nextjs/src/components/Link.tsx index a676b916f8..0f357a6707 100644 --- a/packages/sitecore-jss-nextjs/src/components/Link.tsx +++ b/packages/sitecore-jss-nextjs/src/components/Link.tsx @@ -4,34 +4,47 @@ 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 + * @defaultvalue /^\//g + */ + internalLinkMatcher?: RegExp; }; export const Link = (props: LinkProps) => { - const { editable, internalLinkMatcher = /^\//g, showLinkTextWithChildrenPresent, ...htmlLinkProps } = props; + const { + editable, + internalLinkMatcher = /^\//g, + showLinkTextWithChildrenPresent, + ...htmlLinkProps + } = props; - const value = (props.field as LinkFieldValue).href ? props.field : props.field.value; - const hasValidHref = value && value.href; + 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 ( - <NextLink href={value.href} key="link" locale={false}> - <a title={value.title} target={value.target} className={value.class} {...htmlLinkProps}> + <NextLink href={href} key="link" locale={false}> + <a + title={value.title} + target={value.target} + className={value.class} + {...htmlLinkProps} + > {text} {props.children} </a> @@ -50,6 +63,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/services/component-props-service.ts b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts index 0cfe99ced5..7711c434ca 100644 --- a/packages/sitecore-jss-nextjs/src/services/component-props-service.ts +++ b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts @@ -158,7 +158,9 @@ export class ComponentPropsService { 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` ); @@ -169,11 +171,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, }; }); 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-react/src/components/Link.tsx b/packages/sitecore-jss-react/src/components/Link.tsx index b3541bafd3..9230287b89 100644 --- a/packages/sitecore-jss-react/src/components/Link.tsx +++ b/packages/sitecore-jss-react/src/components/Link.tsx @@ -5,6 +5,7 @@ export interface LinkFieldValue { [attributeName: string]: unknown; href?: string; className?: string; + class?: string; title?: string; target?: string; text?: string; From 5bd7325d95edf913deeb553db89364be96e2bb4d Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Wed, 16 Dec 2020 14:33:32 +0200 Subject: [PATCH 04/37] lint sitecore-jss-react-native --- .../sitecore-jss-react-native/.eslintrc.json | 12 +- .../sitecore-jss-react-native/package.json | 6 +- .../src/components/Date.test.tsx | 90 +++++----- .../src/components/Date.tsx | 78 +++++---- .../src/components/Image.test.tsx | 24 +-- .../src/components/Image.tsx | 59 +++---- .../src/components/Link.tsx | 163 +++++++++--------- .../src/components/MissingComponent.test.tsx | 35 ++-- .../src/components/Placeholder.test.tsx | 38 ++-- .../src/components/Placeholder.tsx | 40 +++-- .../src/components/PlaceholderCommon.tsx | 37 ++-- .../src/components/RichText.test.tsx | 10 +- .../src/components/RichText.tsx | 6 +- .../src/components/SitecoreContext.tsx | 6 +- .../src/components/Text.test.tsx | 2 +- .../src/components/Text.tsx | 2 +- .../src/components/sharedTypes.ts | 4 +- .../src/dataConversion.test.ts | 8 +- .../src/dataConversion.ts | 27 +-- .../enhancers/withComponentFactory.test.tsx | 144 +++++++++------- packages/sitecore-jss/src/mediaApi.ts | 2 +- 21 files changed, 431 insertions(+), 362 deletions(-) diff --git a/packages/sitecore-jss-react-native/.eslintrc.json b/packages/sitecore-jss-react-native/.eslintrc.json index f44f5fa92b..714c2897c1 100644 --- a/packages/sitecore-jss-react-native/.eslintrc.json +++ b/packages/sitecore-jss-react-native/.eslintrc.json @@ -1,6 +1,8 @@ { - "extends": ["plugin:react/recommended"], - "plugins": ["react-native"], + "root": true, + "extends": ["plugin:@typescript-eslint/recommended"], + "parser": "@typescript-eslint/parser", + "plugins": ["react-native", "@typescript-eslint"], "parserOptions": { "ecmaFeatures": { "jsx": true @@ -8,5 +10,11 @@ }, "env": { "jest": true + }, + "ignorePatterns": ["src/**/*.test.*", "src/tests/*", "src/testData/*"], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/indent": ["error", 2] } } diff --git a/packages/sitecore-jss-react-native/package.json b/packages/sitecore-jss-react-native/package.json index d382308bf6..b5a78697cb 100644 --- a/packages/sitecore-jss-react-native/package.json +++ b/packages/sitecore-jss-react-native/package.json @@ -8,7 +8,7 @@ "clean": "del-cli dist types", "typecheck": "tsc", "fixcrlf": "eslint --rule 'linebreak-style: [\"error\", \"unix\"]' --ext .ts --no-eslintrc --fix ./dist", - "lint": "tslint -p . -c ./tslint.json \"src/**/*.ts\"", + "lint": "eslint --fix ./src/**/*.tsx ./src/**/*.ts", "test": "jest", "prepublishOnly": "npm test && npm run build", "coverage": "jest --config ./jest.config.coverage.js" @@ -49,17 +49,19 @@ "@types/react-native": "^0.60.17", "@types/react-native-htmlview": "^0.12.2", "@types/react-test-renderer": "^16.9.0", + "@typescript-eslint/eslint-plugin": "^4.10.0", + "@typescript-eslint/parser": "^4.10.0", "babel-core": "6.26.3", "babel-jest": "^24.9.0", "babel-preset-env": "^1.7.0", "del-cli": "^3.0.1", + "eslint": "^7.15.0", "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "react": "16.13.1", "react-native": "^0.63.4", "react-test-renderer": "^16.9.0", "ts-jest": "24.1.0", - "tslint-react": "^4.1.0", "typescript": "^3.6.3" }, "resolutions": { diff --git a/packages/sitecore-jss-react-native/src/components/Date.test.tsx b/packages/sitecore-jss-react-native/src/components/Date.test.tsx index 1ff86cb32c..59c9f7a387 100644 --- a/packages/sitecore-jss-react-native/src/components/Date.test.tsx +++ b/packages/sitecore-jss-react-native/src/components/Date.test.tsx @@ -4,48 +4,48 @@ import { View, Text } from 'react-native'; import { DateField } from './Date'; describe('<DateField />', () => { - test('should render nothing with missing field', () => { - const p = { - field: {} - } - - const c = renderer.create(<DateField {...p} />); - - const instance = c.getInstance(); - - expect(instance && instance.children).toEqual(null); - expect(c).toMatchSnapshot(); - }) - - test('should render value', () => { - const p = { - field: { - value: 'xxx' - } - } - - const c = renderer.create(<DateField {...p} />); - - expect(c).toMatchSnapshot(); - }) - - test('should render value using render function', () => { - const render = (date: Date | null) => ( - <View> - <Text>Test test test...</Text> - <Text>{date ? date.toDateString() : ''}</Text> - </View> - ) - - const p = { - field: { - value: '10-23-2003' - }, - render - } - - const c = renderer.create(<DateField {...p} />); - - expect(c).toMatchSnapshot(); - }) -}) + test('should render nothing with missing field', () => { + const p = { + field: {}, + }; + + const c = renderer.create(<DateField {...p} />); + + const instance = c.getInstance(); + + expect(instance && instance.children).toEqual(null); + expect(c).toMatchSnapshot(); + }); + + test('should render value', () => { + const p = { + field: { + value: 'xxx', + }, + }; + + const c = renderer.create(<DateField {...p} />); + + expect(c).toMatchSnapshot(); + }); + + test('should render value using render function', () => { + const render = (date: Date | null) => ( + <View> + <Text>Test test test...</Text> + <Text>{date ? date.toDateString() : ''}</Text> + </View> + ); + + const p = { + field: { + value: '10-23-2003', + }, + render, + }; + + const c = renderer.create(<DateField {...p} />); + + expect(c).toMatchSnapshot(); + }); +}); diff --git a/packages/sitecore-jss-react-native/src/components/Date.tsx b/packages/sitecore-jss-react-native/src/components/Date.tsx index ee6f75176d..173f810dc6 100644 --- a/packages/sitecore-jss-react-native/src/components/Date.tsx +++ b/packages/sitecore-jss-react-native/src/components/Date.tsx @@ -1,57 +1,61 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Text } from 'react-native' +import { Text } from 'react-native'; import HtmlView from 'react-native-htmlview'; export interface DateFieldProps { - /** The date field data. */ - field: { - value?: string; - editable?: string; - }; + /** The date field data. */ + field: { + value?: string; + editable?: string; + }; /** * Can be used to explicitly disable inline editing. * If true and `field.editable` has a value, then `field.editable` will be processed and rendered as component output. If false, `field.editable` value will be ignored and not rendered. * @default true */ - editable?: boolean; - render?: (date: Date | null) => React.ComponentType<any> | React.ReactNode; - [htmlAttributes: string]: any; + editable?: boolean; + render?: (date: Date | null) => React.ComponentType | React.ReactNode; + [htmlAttributes: string]: unknown; } -export const DateField: React.SFC<DateFieldProps> = ({ field, editable, render, ...otherProps }) => { - if (!field || (!field.editable && !field.value)) { - return null; - } - - let children: any; - - if (render) { - children = render(field.value ? new Date(field.value) : null); - } else { - children = field.value - } - - if (field.editable && editable) { - return <HtmlView value={children} {...otherProps} />; - } else { - return render - ? children - : <Text>{children}</Text>; - } +export const DateField: React.FunctionComponent<DateFieldProps> = ({ + field, + editable, + render, + ...otherProps +}) => { + if (!field || (!field.editable && !field.value)) { + return null; + } + + let children; + + if (render) { + children = render(field.value ? new Date(field.value) : null); + } else { + children = field.value as string; + } + + if (field.editable && editable) { + return <HtmlView value={children as string} {...otherProps} />; + } + return render + ? <>{children}</> + : <Text>{children}</Text>; }; DateField.propTypes = { - field: PropTypes.shape({ - value: PropTypes.any, - editable: PropTypes.string, - }).isRequired, - editable: PropTypes.bool, - render: PropTypes.func, + field: PropTypes.shape({ + value: PropTypes.any, + editable: PropTypes.string, + }).isRequired, + editable: PropTypes.bool, + render: PropTypes.func, }; DateField.defaultProps = { - editable: true, + editable: true, }; -DateField.displayName = 'Date'; \ No newline at end of file +DateField.displayName = 'Date'; diff --git a/packages/sitecore-jss-react-native/src/components/Image.test.tsx b/packages/sitecore-jss-react-native/src/components/Image.test.tsx index db832d3467..db76a871ff 100644 --- a/packages/sitecore-jss-react-native/src/components/Image.test.tsx +++ b/packages/sitecore-jss-react-native/src/components/Image.test.tsx @@ -18,8 +18,8 @@ const staticImages = { const networkImages = { 'test-image-1': { src: 'https://jssapp/-/media/myfile.ashx&w=180&h=360', - width: '180', - height: '360', + width: 180, + height: 360, alt: 'Logo', }, }; @@ -86,16 +86,16 @@ describe('<Image />', () => { }); }); }); - }); + }); - test('isSvgImage', () => { - const ut = (source: ImageSourcePropType, expected: boolean) => - expect(isSvgImage(source)).toEqual(expected) + test('isSvgImage', () => { + const ut = (source: ImageSourcePropType, expected: boolean) => + expect(isSvgImage(source)).toEqual(expected); - ut({ uri: './x.svg' }, true); - ut({ uri: './x.png' }, false); - ut({ uri: 'https://jssapp/-/media/myfile.svg&w=180' }, true); - ut({ uri: 'https://jssapp/-/media/myfile.svg?w=180' }, true); - ut({ uri: 'https://jssapp/-/media/myfile.png?w=180' }, false); - }) + ut({ uri: './x.svg' }, true); + ut({ uri: './x.png' }, false); + ut({ uri: 'https://jssapp/-/media/myfile.svg&w=180' }, true); + ut({ uri: 'https://jssapp/-/media/myfile.svg?w=180' }, true); + ut({ uri: 'https://jssapp/-/media/myfile.png?w=180' }, false); + }); }); diff --git a/packages/sitecore-jss-react-native/src/components/Image.tsx b/packages/sitecore-jss-react-native/src/components/Image.tsx index c926ad3845..4a01858830 100644 --- a/packages/sitecore-jss-react-native/src/components/Image.tsx +++ b/packages/sitecore-jss-react-native/src/components/Image.tsx @@ -6,8 +6,11 @@ import { mediaApi } from '@sitecore-jss/sitecore-jss'; export interface ImageFieldValue { src?: string | number; + width?: number; + height?: number; + style?: unknown; /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: any; + [attributeName: string]: unknown; } export interface ImageField { @@ -18,19 +21,19 @@ export interface ImageField { export interface ImageProps { /** The image field data. */ media: ImageField | ImageFieldValue | null; + field?: ImageField | ImageFieldValue | null; /** * Parameters that will be attached to Sitecore media URLs */ imageUrlParams?: - | { - [paramName: string]: string; - } - | object - | null; + | { + [paramName: string]: string; + } + | null; /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: any; + [attributeName: string]: unknown; } const getImageAttrs = ( @@ -41,23 +44,23 @@ const getImageAttrs = ( style, ...otherAttrs }: { - src: string | number; - width: number | undefined; - height: number | undefined; - style: any; - otherAttrs: any[]; + src?: string | number; + width?: number | undefined; + height?: number | undefined; + style?: unknown; + [attr: string]: unknown; }, - imageUrlParams: any + imageUrlParams?: { [paramName: string]: string } | null ) => { if (!src) { return null; } - const newAttrs: any = { ...otherAttrs }; + const newAttrs: { [key: string]: unknown } = { ...otherAttrs }; // for network images, "width" and "height" are required as style properties, otherwise the image likely won't display. // for static images, "width" and "height" are not required, but if they are passed in then add them to the style prop. - const imgStyles: any = {}; + const imgStyles: { [attr: string]: unknown } = {}; // react-native doesn't seem to like `&&` assignment, so use if statements instead if (width) { imgStyles.width = typeof width !== 'number' ? Number(width) : width; @@ -86,37 +89,35 @@ const getImageAttrs = ( }; export const isSvgImage = (source: ImageSourcePropType) => { - const isSvg = /\.svg($|\?|\&)/g; - const src = NativeImage.resolveAssetSource(source); + const isSvg = /\.svg($|\?|\&)/g; + const src = NativeImage.resolveAssetSource(source); - return src && isSvg.test(src.uri); -} + return src && isSvg.test(src.uri); +}; export const Image: React.SFC<ImageProps> = ({ media, imageUrlParams, field, ...otherProps }) => { - let dynamicMedia: any = media; + let dynamicMedia = media; // allows the mistake of using 'field' prop instead of 'media' (consistent with other helpers) if (field && !media) { dynamicMedia = field; } - if (!dynamicMedia || (!dynamicMedia.value && !dynamicMedia.src)) { + if (!dynamicMedia || (!dynamicMedia.value && !(dynamicMedia as ImageFieldValue).src)) { return null; } // some wise-guy/gal might pass in a 'raw' image object value - const img = dynamicMedia.src ? dynamicMedia : dynamicMedia.value; + const img = (dynamicMedia as ImageFieldValue).src ? dynamicMedia : (dynamicMedia as ImageField).value; if (!img) { return null; } - const attrs = getImageAttrs({ ...img, ...otherProps }, imageUrlParams); - - if (attrs && isSvgImage(attrs.source)) - return <SvgUri {...attrs} />; + const attrs = getImageAttrs({ ...(img as ImageFieldValue), ...otherProps }, imageUrlParams); + + if (attrs && isSvgImage(attrs.source as ImageSourcePropType)) return <SvgUri {...attrs} />; - if (attrs) - return <NativeImage {...attrs} />; + if (attrs) return <NativeImage {...attrs} source={attrs.source as ImageSourcePropType} />; return null; // we can't handle the truth }; @@ -130,7 +131,7 @@ Image.propTypes = { value: PropTypes.object, }), ]), - imageUrlParams: PropTypes.object, + imageUrlParams: PropTypes.any, }; Image.displayName = 'Image'; diff --git a/packages/sitecore-jss-react-native/src/components/Link.tsx b/packages/sitecore-jss-react-native/src/components/Link.tsx index 6a33d3303a..f3b832fe50 100644 --- a/packages/sitecore-jss-react-native/src/components/Link.tsx +++ b/packages/sitecore-jss-react-native/src/components/Link.tsx @@ -1,107 +1,116 @@ -import React, { ReactElement } from 'react' -import PropTypes from 'prop-types' -import HtmlView from 'react-native-htmlview' +import React, { ReactElement } from 'react'; +import PropTypes from 'prop-types'; +import HtmlView from 'react-native-htmlview'; import { Text, View, Linking, TouchableWithoutFeedback } from 'react-native'; export interface LinkFieldValue { - href?: string; - [attributeName: string]: any; + href?: string; + text?: string; + [attributeName: string]: unknown; } export interface LinkField { - value: LinkFieldValue; - editableFirstPart?: string; - editableLastPart?: string; + value: LinkFieldValue; + editableFirstPart?: string; + editableLastPart?: string; } export type LinkProps = { - /** The link field data. */ - field: LinkField | LinkFieldValue; + /** The link field data. */ + field: LinkField | LinkFieldValue; /** * Can be used to explicitly disable inline editing. * If true and `field.editable` has a value, then `field.editable` will be processed and rendered as component output. If false, `field.editable` value will be ignored and not rendered. * @default true */ - editable?: boolean; + editable?: boolean; /** * Displays a link text ('description' in Sitecore) even when children exist * NOTE: when in Sitecore Experience Editor, this setting is ignored due to technical limitations, and the description is always rendered. */ - showLinkTextWithChildrenPresent?: boolean; + showLinkTextWithChildrenPresent?: boolean; - style?: object, - textStyle?: object + style?: { [attr: string]: unknown }; + textStyle?: { [attr: string]: unknown }; }; -export const Link: React.FunctionComponent<LinkProps> = ({ field, editable, children, showLinkTextWithChildrenPresent, style, textStyle, ...otherProps }) => { - const dynamicField: any = field; - - if (!field || (!dynamicField.editableFirstPart && !dynamicField.value && !dynamicField.href)) { - return null; - } - - const resultTags: ReactElement<any>[] = []; - - // EXPERIENCE EDITOR RENDERING - if (editable && dynamicField.editableFirstPart) { - const markup: string = dynamicField.editableFirstPart + dynamicField.editableLastPart; - - // in an ideal world, we'd pre-render React children here and inject them between editableFirstPart and editableLastPart. - // However, we cannot combine arbitrary unparsed HTML (innerHTML) based components with actual vDOM components (the children) - // because the innerHTML is not parsed - it'd make a discontinuous vDOM. So, we'll go for the next best compromise of rendering the link field and children separately - // as siblings. Should be "good enough" for most cases - and write your own helper if it isn't. Or bring xEditor out of 2006. - - resultTags.push(<HtmlView value={markup} />); - - // don't render normal link tag when editing, if no children exist - // this preserves normal-ish behavior if not using a link body (no hacks required) - if (!children) { - return resultTags[0]; - } - } - - // handle link directly on field for forgetful devs - const link = dynamicField.href ? field : dynamicField.value; - if (!link) { - return null; - } - - const linkText = showLinkTextWithChildrenPresent || !children - ? (link.text || link.href) - : null; - - resultTags.push( - <TouchableWithoutFeedback - onPress={() => Linking.openURL(link.href)} - key='link' - {...otherProps}> - <View style={style}> - {linkText && <Text style={textStyle}>{linkText}</Text>} - {children} - </View> - </TouchableWithoutFeedback> - ) - - return <View>{resultTags}</View>; -} +export const Link: React.FunctionComponent<LinkProps> = ({ + field, + editable, + children, + showLinkTextWithChildrenPresent, + style, + textStyle, + ...otherProps +}) => { + const dynamicField = field; + + if (!field || (!dynamicField.editableFirstPart && !dynamicField.value && !(dynamicField as LinkFieldValue).href)) { + return null; + } + + const resultTags: ReactElement<unknown>[] = []; + + const { editableFirstPart, editableLastPart } = dynamicField as LinkField; + + // EXPERIENCE EDITOR RENDERING + if (editable && editableFirstPart) { + const markup: string = editableFirstPart + editableLastPart; + + // in an ideal world, we'd pre-render React children here and inject them between editableFirstPart and editableLastPart. + // However, we cannot combine arbitrary unparsed HTML (innerHTML) based components with actual vDOM components (the children) + // because the innerHTML is not parsed - it'd make a discontinuous vDOM. So, we'll go for the next best compromise of rendering the link field and children separately + // as siblings. Should be "good enough" for most cases - and write your own helper if it isn't. Or bring xEditor out of 2006. + + resultTags.push(<HtmlView value={markup} />); + + // don't render normal link tag when editing, if no children exist + // this preserves normal-ish behavior if not using a link body (no hacks required) + if (!children) { + return resultTags[0]; + } + } + + // handle link directly on field for forgetful devs + const link = ((dynamicField as LinkFieldValue).href + ? field + : (dynamicField as LinkField).value) as LinkFieldValue; + + if (!link) { + return null; + } + + const linkText = showLinkTextWithChildrenPresent || !children ? link.text || link.href : null; + + resultTags.push( + <TouchableWithoutFeedback onPress={() => link.href && Linking.openURL(link.href)} key="link" {...otherProps}> + <View style={style}> + {linkText && <Text style={textStyle}>{linkText}</Text>} + {children} + </View> + </TouchableWithoutFeedback> + ); + + return <View>{resultTags}</View>; +}; Link.propTypes = { - field: PropTypes.oneOfType([ - PropTypes.shape({ - href: PropTypes.string, - }), - PropTypes.shape({ - value: PropTypes.object, - editableFirstPart: PropTypes.string, - editableLastPart: PropTypes.string, - }), - ]).isRequired, - editable: PropTypes.bool, + field: PropTypes.oneOfType([ + PropTypes.shape({ + href: PropTypes.string, + }), + PropTypes.shape({ + value: PropTypes.object, + editableFirstPart: PropTypes.string, + editableLastPart: PropTypes.string, + }), + ]).isRequired, + editable: PropTypes.bool, }; Link.defaultProps = { - editable: true, + editable: true, }; Link.displayName = 'Link'; diff --git a/packages/sitecore-jss-react-native/src/components/MissingComponent.test.tsx b/packages/sitecore-jss-react-native/src/components/MissingComponent.test.tsx index ce26824306..789ebdd83b 100644 --- a/packages/sitecore-jss-react-native/src/components/MissingComponent.test.tsx +++ b/packages/sitecore-jss-react-native/src/components/MissingComponent.test.tsx @@ -1,28 +1,27 @@ import React from 'react'; import renderer from 'react-test-renderer'; -import { View, Text } from 'react-native'; import { MissingComponent } from './MissingComponent'; describe('<MissingComponent />', () => { - test('should render without component name', () => { - const p = { - rendering: {} - } + test('should render without component name', () => { + const p = { + rendering: {}, + }; - const c = renderer.create(<MissingComponent {...p} />); + const c = renderer.create(<MissingComponent {...p} />); - expect(c).toMatchSnapshot(); - }) + expect(c).toMatchSnapshot(); + }); - test('should render with component name', () => { - const p = { - rendering: { - componentName: 'TestComponent' - } - } + test('should render with component name', () => { + const p = { + rendering: { + componentName: 'TestComponent', + }, + }; - const c = renderer.create(<MissingComponent {...p} />); + const c = renderer.create(<MissingComponent {...p} />); - expect(c).toMatchSnapshot(); - }) -}) + expect(c).toMatchSnapshot(); + }); +}); diff --git a/packages/sitecore-jss-react-native/src/components/Placeholder.test.tsx b/packages/sitecore-jss-react-native/src/components/Placeholder.test.tsx index 13184ed6c1..e26090736b 100644 --- a/packages/sitecore-jss-react-native/src/components/Placeholder.test.tsx +++ b/packages/sitecore-jss-react-native/src/components/Placeholder.test.tsx @@ -2,17 +2,18 @@ import { View } from 'react-native'; import React from 'react'; import PropTypes from 'prop-types'; import renderer from 'react-test-renderer'; -import { ComponentRendering } from '@sitecore-jss/sitecore-jss'; -import { Placeholder } from './Placeholder'; +import { ComponentRendering, RouteData } from '@sitecore-jss/sitecore-jss'; +import { Placeholder, PlaceholderComponentProps } from './Placeholder'; import { SitecoreContext } from './SitecoreContext'; import { devData } from '../../testData/dev-data'; import { lsDataEeOff } from '../../testData/LS-data-EE-off'; +import {ComponentFactory} from './sharedTypes'; const componentFactory = (componentName: string) => { const components = new Map(); // pass otherProps to page-content to test property cascading through the Placeholder - const Home: React.SFC<any> = ({ rendering, ...otherProps }) => ( + const Home: React.SFC<PlaceholderComponentProps> = ({ rendering, ...otherProps }) => ( <View testID="home-mock"> <Placeholder name="page-header" rendering={rendering} /> <Placeholder name="page-content" rendering={rendering} {...otherProps} /> @@ -20,20 +21,26 @@ const componentFactory = (componentName: string) => { ); Home.propTypes = { placeholders: PropTypes.object, - rendering: PropTypes.object, + rendering: PropTypes.any, }; components.set('Home', Home); - const DownloadCallout: React.SFC<any> = (props) => ( + type DownloadCalloutProps = { + fields: { + message?: { + value: string; + } + } + } + + const DownloadCallout: React.SFC<DownloadCalloutProps> = (props) => ( <View testID="download-callout-mock"> {props.fields.message ? props.fields.message.value : null} </View> ); DownloadCallout.propTypes = { - fields: PropTypes.shape({ - message: PropTypes.object, - }), + fields: PropTypes.any }; components.set('DownloadCallout', DownloadCallout); @@ -51,7 +58,7 @@ describe('<Placeholder />', () => { testData.forEach((dataSet) => { describe(`with ${dataSet.label}`, () => { test('should render a placeholder with given key', () => { - const phData: any = dataSet.data.sitecore.route.placeholders.main; + const phData = dataSet.data.sitecore.route.placeholders.main as unknown as ComponentRendering[]; const component = phData.find((c: ComponentRendering) => c.componentName); const phKey = 'page-content'; @@ -59,7 +66,7 @@ describe('<Placeholder />', () => { // you'll need to visually inspect the snapshot to ensure expected rendering. const renderedComponent = renderer .create( - <Placeholder name={phKey} rendering={component} componentFactory={componentFactory} /> + <Placeholder name={phKey} rendering={component as ComponentRendering} componentFactory={componentFactory} /> ) .toJSON(); @@ -68,7 +75,7 @@ describe('<Placeholder />', () => { }); test('should render nested placeholders and props correctly', () => { - const component: any = dataSet.data.sitecore.route; + const component = dataSet.data.sitecore.route as unknown as RouteData; const phKey = 'main'; const renderedComponent = renderer @@ -90,9 +97,9 @@ describe('<Placeholder />', () => { // use local mocks to avoid console warnings from Placeholder about unknown nested placeholders const Home = () => <View testID="home-mock" />; - const factory: any = (componentName: string) => (componentName === 'Home' ? Home : null); + const factory: ComponentFactory = (componentName: string) => (componentName === 'Home' ? Home : null); - const route: any = { + const route = { placeholders: { main: [ { @@ -107,7 +114,7 @@ describe('<Placeholder />', () => { const phKey = 'main'; const renderedComponent = renderer - .create(<Placeholder name={phKey} rendering={route} componentFactory={factory} />) + .create(<Placeholder name={phKey} rendering={route as unknown as RouteData} componentFactory={factory} />) .toJSON(); // placeholder should only render "Home" component @@ -119,7 +126,8 @@ describe('<Placeholder />', () => { it('should render null for unknown placeholder', () => { const warnSpy = jest.spyOn(console, 'warn'); warnSpy.mockImplementation(() => {}); - const route: any = { + const route: RouteData = { + name: '', placeholders: { main: [ { diff --git a/packages/sitecore-jss-react-native/src/components/Placeholder.tsx b/packages/sitecore-jss-react-native/src/components/Placeholder.tsx index 2c8c4e3ae6..22be4f7455 100644 --- a/packages/sitecore-jss-react-native/src/components/Placeholder.tsx +++ b/packages/sitecore-jss-react-native/src/components/Placeholder.tsx @@ -13,17 +13,26 @@ export interface PlaceholderComponentProps extends PlaceholderProps { components: React.ReactNode[], data: (ComponentRendering | HtmlElementRendering)[], props: PlaceholderProps - ) => React.ComponentClass<any> | React.SFC<any>; + ) => React.ComponentClass<unknown> | React.SFC<unknown>; /** - * Render props function that is called for each non-system component added to the placeholder. - * Mutually exclusive with `render`. System components added during Experience Editor are automatically rendered as-is. + * Render props function that is called when the placeholder contains no content components. + * Can be used to wrap the Sitecore EE empty placeholder markup in something that's visually correct */ - renderEach?: ( + renderEmpty?: ( components: React.ReactNode[], data: (ComponentRendering | HtmlElementRendering)[], props: PlaceholderProps - ) => React.ComponentClass<any> | React.SFC<any>; + ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; + + /** + * Render props function that is called for each non-system component added to the placeholder. + * Mutually exclusive with `render`. System components added during Experience Editor are automatically rendered as-is. + */ + renderEach?: ( + component: React.ReactNode, + index: number + ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; } function isRawRendering( @@ -38,14 +47,17 @@ function isRawRendering( class PlaceholderComponent extends PlaceholderCommon { static propTypes = PlaceholderCommon.propTypes; - constructor(props: PlaceholderProps) { + constructor(props: PlaceholderComponentProps) { super(props); } render() { - let childProps: any = { ...this.props }; + const props: PlaceholderComponentProps = this.props; + const childProps: PlaceholderComponentProps = { ...this.props }; delete childProps.componentFactory; + delete childProps.render; + delete childProps.renderEach; if (this.state.error) { return <View>A rendering error occurred: {this.state.error.message}.</View>; @@ -55,20 +67,20 @@ class PlaceholderComponent extends PlaceholderCommon { const placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData( renderingData, - this.props.name + props.name ); const components = this.getComponentsForRenderingData(placeholderData); if ( - this.props.renderEmpty && + props.renderEmpty && placeholderData.every((rendering: ComponentRendering | HtmlElementRendering) => isRawRendering(rendering) ) ) { - return this.props.renderEmpty(components, placeholderData, childProps); - } else if (this.props.render) { - return this.props.render(components, placeholderData, childProps); - } else if (this.props.renderEach) { + return components && props.renderEmpty(components, placeholderData, childProps); + } else if (props.render) { + return components && props.render(components, placeholderData, childProps); + } else if (props.renderEach) { return ( components && components.map((component, index) => { @@ -76,7 +88,7 @@ class PlaceholderComponent extends PlaceholderCommon { return component; } - return this.props.renderEach(component, index); + return props.renderEach && props.renderEach(component, index); }) ); } else { diff --git a/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx b/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx index 1887eebaa0..707747c156 100644 --- a/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx +++ b/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx @@ -40,21 +40,21 @@ export interface PlaceholderProps { * A component that is rendered in place of any components that are in this placeholder, * but do not have a definition in the componentFactory (i.e. don't have a React implementation) */ - missingComponentComponent?: React.ComponentClass<any> | React.SFC<any> | null; + missingComponentComponent?: React.ComponentClass<unknown> | React.SFC<unknown> | null; /** * A component that is rendered in place of the placeholder when an error occurs rendering * the placeholder */ - errorComponent?: React.ComponentClass<any> | React.SFC<any> | null; + errorComponent?: React.ComponentClass<unknown> | React.SFC<unknown> | null; /** * A component that is rendered in place of any components that are in this placeholder, * but are not renderable by react-native (i.e. DOM elements) */ - unrenderableComponentComponent?: React.ComponentClass<any> | React.SFC<any> | null; + unrenderableComponentComponent?: React.ComponentClass<unknown> | React.SFC<unknown> | null; - [key: string]: any; + [key: string]: unknown; } export class PlaceholderCommon extends React.Component<PlaceholderProps> { @@ -69,7 +69,7 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { unrenderableComponentComponent: PropTypes.any, }; - nodeRefs: any[]; + nodeRefs: unknown[]; state: Readonly<{ error?: Error }>; static getPlaceholderDataFromRenderingData( @@ -120,17 +120,20 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { return ( placeholderData && placeholderData - .map((rendering: any, index: number) => { - const key = rendering.uid ? rendering.uid : `component-${index}`; + .map((rendering: ComponentRendering | HtmlElementRendering, index: number) => { + const componentRendering = rendering as ComponentRendering; + const htmlElementRendering = rendering as HtmlElementRendering; + + const key = componentRendering.uid ? componentRendering.uid : `component-${index}`; const commonProps = { key }; let component: React.ReactNode | null; // if the element is not a 'component rendering', we can't render it 'raw' like with react-dom // register a warning instead. - if (!rendering.componentName && rendering.name) { + if (!componentRendering.componentName && htmlElementRendering.name) { console.error( `Placeholder ${name} contains a rendering that cannot be rendered in React Native '${ - rendering.name + htmlElementRendering.name }'. This is likely the result of including Experience Editor output in rendering data or using non-JSON renderings in an item's presentation details / layout. React Native is not able to render DOM elements, your Sitecore renderings must map to React components @@ -140,11 +143,11 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { } if (!component) { - component = this.getComponentForRendering(rendering); + component = this.getComponentForRendering(componentRendering); if (!component) { console.error( `Placeholder ${name} contains unknown component ${ - rendering.componentName + componentRendering.componentName }. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.` ); @@ -155,18 +158,18 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { const finalProps = { ...commonProps, ...placeholderProps, - ...((placeholderFields || rendering.fields) && { - fields: { ...placeholderFields, ...rendering.fields }, + ...((placeholderFields || componentRendering.fields) && { + fields: { ...placeholderFields, ...componentRendering.fields }, }), - ...((placeholderParams || rendering.params) && { - params: { ...placeholderParams, ...rendering.params }, + ...((placeholderParams || componentRendering.params) && { + params: { ...placeholderParams, ...componentRendering.params }, }), rendering, }; - return React.createElement(component as any, finalProps); + return React.createElement<{ [attr: string]: unknown }>(component as React.ComponentType, finalProps); }) - .filter((element: any) => element) + .filter((element: React.ReactNode) => element) ); // remove nulls } diff --git a/packages/sitecore-jss-react-native/src/components/RichText.test.tsx b/packages/sitecore-jss-react-native/src/components/RichText.test.tsx index 9e60a18604..ecde2c8aa9 100644 --- a/packages/sitecore-jss-react-native/src/components/RichText.test.tsx +++ b/packages/sitecore-jss-react-native/src/components/RichText.test.tsx @@ -5,7 +5,7 @@ import { RichText } from './RichText'; describe('<RichText />', () => { test('should render nothing with missing field', () => { - const field: any = null; + const field = null; const rendered = renderer.create(<RichText field={field} />); expect(rendered).toMatchSnapshot(); }); @@ -47,8 +47,10 @@ describe('<RichText />', () => { editable: 'value with <p>markup</p>', }; const rawTextStyles = StyleSheet.create({ - fontSize: 22, - } as any); + style: { + fontSize: 22, + } + }); const markupStyles = StyleSheet.create({ p: { fontSize: 16, @@ -65,7 +67,7 @@ describe('<RichText />', () => { field={field} style={{ flex: 1 }} stylesheet={markupStyles} - textComponentProps={{ style: rawTextStyles }} + textComponentProps={rawTextStyles} /> ); expect(rendered).toMatchSnapshot(); diff --git a/packages/sitecore-jss-react-native/src/components/RichText.tsx b/packages/sitecore-jss-react-native/src/components/RichText.tsx index 3f8a6a6ad4..6cc3c41bda 100644 --- a/packages/sitecore-jss-react-native/src/components/RichText.tsx +++ b/packages/sitecore-jss-react-native/src/components/RichText.tsx @@ -8,7 +8,7 @@ export interface RichTextProps { value?: string; editable?: string; } | null; - [htmlViewProps: string]: any; + [htmlViewProps: string]: unknown; } export const RichText: React.SFC<RichTextProps> = ({ field, ...otherProps }) => { @@ -16,9 +16,9 @@ export const RichText: React.SFC<RichTextProps> = ({ field, ...otherProps }) => return null; } - const htmlValue: any = field.editable ? field.editable : field.value; + const htmlValue = field.editable ? field.editable : field.value; - return <HtmlView value={htmlValue} {...otherProps} />; + return <HtmlView value={htmlValue as string} {...otherProps} />; }; RichText.propTypes = { diff --git a/packages/sitecore-jss-react-native/src/components/SitecoreContext.tsx b/packages/sitecore-jss-react-native/src/components/SitecoreContext.tsx index a3311562ef..d54dc58080 100644 --- a/packages/sitecore-jss-react-native/src/components/SitecoreContext.tsx +++ b/packages/sitecore-jss-react-native/src/components/SitecoreContext.tsx @@ -1,10 +1,10 @@ -import React, { Component, Children } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; import { ComponentFactory } from './sharedTypes'; export interface SitecoreContextProps { componentFactory: ComponentFactory; - children: any; + children: unknown; } export const ComponentFactoryReactContext = React.createContext<ComponentFactory>( @@ -21,7 +21,7 @@ export class SitecoreContext extends React.Component<SitecoreContextProps> { componentFactory: ComponentFactory; - constructor(props: SitecoreContextProps, context: any) { + constructor(props: SitecoreContextProps, context: unknown) { super(props, context); this.componentFactory = props.componentFactory; } diff --git a/packages/sitecore-jss-react-native/src/components/Text.test.tsx b/packages/sitecore-jss-react-native/src/components/Text.test.tsx index 7a361583c1..4a820a0126 100644 --- a/packages/sitecore-jss-react-native/src/components/Text.test.tsx +++ b/packages/sitecore-jss-react-native/src/components/Text.test.tsx @@ -4,7 +4,7 @@ import { Text } from './Text'; describe('<Text />', () => { test('should render nothing with missing field', () => { - const field: any = null; + const field = null; const rendered = renderer.create(<Text field={field} />); expect(rendered).toMatchSnapshot(); }); diff --git a/packages/sitecore-jss-react-native/src/components/Text.tsx b/packages/sitecore-jss-react-native/src/components/Text.tsx index 5520a17ba6..4d50562abb 100644 --- a/packages/sitecore-jss-react-native/src/components/Text.tsx +++ b/packages/sitecore-jss-react-native/src/components/Text.tsx @@ -8,7 +8,7 @@ export interface TextProps { value?: string; editable?: string; } | null; - [nativeTextProps: string]: any; + [nativeTextProps: string]: unknown; } export const Text: React.SFC<TextProps> = ({ field, ...otherProps }) => { diff --git a/packages/sitecore-jss-react-native/src/components/sharedTypes.ts b/packages/sitecore-jss-react-native/src/components/sharedTypes.ts index 46eec0fe73..a3f026b4f2 100644 --- a/packages/sitecore-jss-react-native/src/components/sharedTypes.ts +++ b/packages/sitecore-jss-react-native/src/components/sharedTypes.ts @@ -1,3 +1,3 @@ -import { Component } from 'react'; +import { ComponentType } from 'react'; -export type ComponentFactory = (componentName: string) => Component; +export type ComponentFactory = (componentName: string) => ComponentType | null; diff --git a/packages/sitecore-jss-react-native/src/dataConversion.test.ts b/packages/sitecore-jss-react-native/src/dataConversion.test.ts index 756207aa3d..7fa9980fe5 100644 --- a/packages/sitecore-jss-react-native/src/dataConversion.test.ts +++ b/packages/sitecore-jss-react-native/src/dataConversion.test.ts @@ -3,13 +3,14 @@ import { convertPropDataToLayoutServiceFormat, convertRouteToLayoutServiceFormat, } from './dataConversion'; +import { RouteData } from '@sitecore-jss/sitecore-jss'; import { convertedDevRouteData, devRouteData } from '../testData/dataConversionTestData/dev-data'; describe('data conversion', () => { describe('convertRouteToLayoutServiceFormat', () => { it('should assign "editable" keys to fields and nested component fields and rendering params', () => { const expected = convertedDevRouteData; - const actual = convertRouteToLayoutServiceFormat(devRouteData as any); + const actual = convertRouteToLayoutServiceFormat(devRouteData as unknown as RouteData); expect(actual).toMatchObject(expected); }); @@ -40,6 +41,7 @@ describe('data conversion', () => { const propData = { items: [ { + name: '', fields: { prop0: { value: 'string value' }, prop1: { value: true }, @@ -47,6 +49,7 @@ describe('data conversion', () => { }, }, { + name: '', fields: { prop0: { value: 'string value' }, prop1: { value: true }, @@ -54,6 +57,7 @@ describe('data conversion', () => { }, }, { + name: '', fields: { prop0: [ { @@ -103,7 +107,7 @@ describe('data conversion', () => { ], }; - const actual = convertPropDataToLayoutServiceFormat(propData as any); + const actual = convertPropDataToLayoutServiceFormat(propData); expect(actual).toMatchObject(expected); }); }); diff --git a/packages/sitecore-jss-react-native/src/dataConversion.ts b/packages/sitecore-jss-react-native/src/dataConversion.ts index 53cb9fd60b..9083780a81 100644 --- a/packages/sitecore-jss-react-native/src/dataConversion.ts +++ b/packages/sitecore-jss-react-native/src/dataConversion.ts @@ -6,18 +6,18 @@ import { RouteData, } from '@sitecore-jss/sitecore-jss'; -const isComponentRendering = (element: any): element is ComponentRendering => element.componentName; +const isComponentRendering = (element: unknown) => (element as ComponentRendering).componentName; /** * Receives dev prop data and creates or assigns "value/editable" values where needed to match signature of LayoutService data. */ export const convertPropDataToLayoutServiceFormat = ( propData: - | { - [name: string]: Field | Item | Item[] | undefined; - } - | undefined -): { [name: string]: Field } | {} => { + | { + [name: string]: Field | Item | Item[] | undefined; + } + | undefined +): { [name: string]: Field } => { if (!propData) { return {}; } @@ -29,7 +29,7 @@ export const convertPropDataToLayoutServiceFormat = ( return { ...result, [propName]: propValue }; } - const newResult: { [name: string]: any } = { ...result }; + const newResult: { [name: string]: unknown } = { ...result }; // field value might be an array, in which case we need to iterate the array entries for more prop values if (Array.isArray(propValue)) { @@ -103,15 +103,16 @@ export const convertRouteToLayoutServiceFormat = (routeData: RouteData) => { const placeholder = placeholders[placeholderName]; const elements = placeholder.map((element) => { if (isComponentRendering(element)) { + const componentRendering = element as ComponentRendering; // https://stackoverflow.com/a/40560953/9324 return { - ...element, - ...(element.placeholders && { - placeholders: transformPlaceholders(element.placeholders), + ...componentRendering, + ...(componentRendering.placeholders && { + placeholders: transformPlaceholders(componentRendering.placeholders), }), - ...(element.params && { params: element.params }), - ...(element.fields && { - fields: convertPropDataToLayoutServiceFormat(element.fields), + ...(componentRendering.params && { params: componentRendering.params }), + ...(componentRendering.fields && { + fields: convertPropDataToLayoutServiceFormat(componentRendering.fields), }), }; } diff --git a/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx b/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx index d2c654ef96..ce9b436d13 100644 --- a/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx +++ b/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx @@ -6,67 +6,83 @@ import { ComponentFactory } from '../components/sharedTypes'; import { ComponentFactoryReactContext } from '../components/SitecoreContext'; describe('withComponentFactory()', () => { - test('should pass factory to wrapped component from context', () => { - const components = new Map(); - - components.set('xxx', () => <Text>I'm component from factory</Text>) - - const componentFactory: ComponentFactory = componentName => components.get(componentName); - - const TestComponent = (props: any) => { - const ComponentFromFactory = props.componentFactory('xxx'); - - return ( - <View> - <Text>Hello world...</Text> - <Text>Custom property:{props.customProperty}</Text> - <ComponentFromFactory /> - </View> - ) - } - - const TestComponentWithFactory = withComponentFactory(TestComponent) - - const c = renderer.create( - <ComponentFactoryReactContext.Provider value={componentFactory}> - <TestComponentWithFactory customProperty="yyy"/> - </ComponentFactoryReactContext.Provider> - ) - - expect(c).toMatchSnapshot(); - }) - - test('should pass factory to wrapped component from props', () => { - const propsFactoryComponents = new Map(); - const contextFactoryComponents = new Map(); - - contextFactoryComponents.set('xxx', () => <Text>I'm component from context factory</Text>) - - propsFactoryComponents.set('xxx', () => <Text>I'm component from props factory</Text>) - - const propsComponentFactory: ComponentFactory = componentName => propsFactoryComponents.get(componentName); - const contextComponentFactory: ComponentFactory = componentName => contextFactoryComponents.get(componentName); - - const TestComponent = (props: any) => { - const ComponentFromFactory = props.componentFactory('xxx'); - - return ( - <View> - <Text>Hello world...</Text> - <Text>Custom property:{props.customProperty}</Text> - <ComponentFromFactory /> - </View> - ) - } - - const TestComponentWithFactory = withComponentFactory(TestComponent) - - const c = renderer.create( - <ComponentFactoryReactContext.Provider value={contextComponentFactory}> - <TestComponentWithFactory componentFactory={propsComponentFactory} customProperty="yyy" /> - </ComponentFactoryReactContext.Provider> - ) - - expect(c).toMatchSnapshot(); - }) -}) + test('should pass factory to wrapped component from context', () => { + const components = new Map(); + + components.set('xxx', () => <Text>I'm component from factory</Text>); + + const componentFactory: ComponentFactory = (componentName) => components.get(componentName); + + type TestComponentProps = { + customProperty?: string; + componentFactory?: ComponentFactory | null; + } + + const TestComponent = (props: TestComponentProps) => { + if (!props.componentFactory) return null; + + const ComponentFromFactory = props.componentFactory('xxx'); + + return ( + <View> + <Text>Hello world...</Text> + <Text>Custom property:{props.customProperty}</Text> + <ComponentFromFactory /> + </View> + ); + }; + + const TestComponentWithFactory = withComponentFactory<TestComponentProps>(TestComponent); + + const c = renderer.create( + <ComponentFactoryReactContext.Provider value={componentFactory}> + <TestComponentWithFactory customProperty="yyy" /> + </ComponentFactoryReactContext.Provider> + ); + + expect(c).toMatchSnapshot(); + }); + + test('should pass factory to wrapped component from props', () => { + const propsFactoryComponents = new Map(); + const contextFactoryComponents = new Map(); + + type TestComponentProps = { + customProperty?: string; + componentFactory?: ComponentFactory | null; + } + + contextFactoryComponents.set('xxx', () => <Text>I'm component from context factory</Text>); + + propsFactoryComponents.set('xxx', () => <Text>I'm component from props factory</Text>); + + const propsComponentFactory: ComponentFactory = (componentName) => + propsFactoryComponents.get(componentName); + const contextComponentFactory: ComponentFactory = (componentName) => + contextFactoryComponents.get(componentName); + + const TestComponent = (props: TestComponentProps) => { + if (!props.componentFactory) return null; + + const ComponentFromFactory = props.componentFactory('xxx'); + + return ( + <View> + <Text>Hello world...</Text> + <Text>Custom property:{props.customProperty}</Text> + <ComponentFromFactory /> + </View> + ); + }; + + const TestComponentWithFactory = withComponentFactory<TestComponentProps>(TestComponent); + + const c = renderer.create( + <ComponentFactoryReactContext.Provider value={contextComponentFactory}> + <TestComponentWithFactory componentFactory={propsComponentFactory} customProperty="yyy" /> + </ComponentFactoryReactContext.Provider> + ); + + expect(c).toMatchSnapshot(); + }); +}); diff --git a/packages/sitecore-jss/src/mediaApi.ts b/packages/sitecore-jss/src/mediaApi.ts index f7c1e4ba20..1ef9ba7b0a 100644 --- a/packages/sitecore-jss/src/mediaApi.ts +++ b/packages/sitecore-jss/src/mediaApi.ts @@ -55,7 +55,7 @@ export const getRequiredParams = (qs: { */ export const updateImageUrl = ( url: string, - params?: { [key: string]: string | number | undefined }, + params?: { [key: string]: string | number | undefined } | null, mediaUrlPrefix: RegExp = mediaUrlPrefixRegex ) => { // polyfill node `global` in browser to workaround https://github.com/unshiftio/url-parse/issues/150 From 0d964306df02653e7751ef0a2d0b6b386bae32c6 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 12:36:26 +0200 Subject: [PATCH 05/37] push --- packages/sitecore-jss-nextjs/.eslintrc | 70 +- packages/sitecore-jss-react/.eslintrc | 69 +- packages/sitecore-jss/package-lock.json | 635 ++++++++++++++++++ packages/sitecore-jss/package.json | 5 +- .../sitecore-jss/src/data-fetcher.test.ts | 22 +- packages/sitecore-jss/src/data-fetcher.ts | 59 +- packages/sitecore-jss/src/dataApi.test.ts | 5 +- packages/sitecore-jss/src/dataApi.ts | 21 +- packages/sitecore-jss/src/dataModels.ts | 12 +- .../sitecore-jss/src/httpClientInterface.ts | 3 +- packages/sitecore-jss/src/index.ts | 6 +- .../sitecore-jss/src/layout-service.test.ts | 29 +- packages/sitecore-jss/src/layout-service.ts | 81 +-- packages/sitecore-jss/src/layoutDataUtils.ts | 20 +- packages/sitecore-jss/src/mediaApi.test.ts | 74 +- packages/sitecore-jss/src/mediaApi.ts | 39 +- packages/sitecore-jss/src/util.test.ts | 6 +- packages/sitecore-jss/src/util.ts | 2 + 18 files changed, 854 insertions(+), 304 deletions(-) diff --git a/packages/sitecore-jss-nextjs/.eslintrc b/packages/sitecore-jss-nextjs/.eslintrc index 60e38b769a..3d8eb496f9 100644 --- a/packages/sitecore-jss-nextjs/.eslintrc +++ b/packages/sitecore-jss-nextjs/.eslintrc @@ -1,81 +1,15 @@ { - "root": true, "extends": [ - "eslint:recommended", "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" + "../../.eslintrc" ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": 2020, - "sourceType": "module" - }, - "plugins": ["@typescript-eslint", "react"], + "plugins": ["react"], "settings": { "react": { "version": "detect" } }, - "env": { - "browser": true, - "node": true, - "es6": true - }, "globals": { "React": "writable" - }, - "ignorePatterns": ["src/**/*.test.*", "src/tests/*", "src/testData/*"], - "rules": { - "@typescript-eslint/indent": ["error", 2], - "no-restricted-globals": "off", - "no-restricted-properties": "off", - "@typescript-eslint/naming-convention": [ - "error", - { - "format": ["PascalCase"], - "selector": "typeLike", - "custom": { - "regex": "^I[A-Z]", - "match": false - } - } - ], - "spaced-comment": "error", - "curly": ["error", "multi-line"], - "eol-last": ["error", "always"], - "guard-for-in": "error", - "valid-jsdoc": "error", - "no-unused-labels": "error", - "max-len": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/member-ordering": "error", - "@typescript-eslint/no-explicit-any": "error", - "no-caller": "error", - "no-bitwise": "error", - "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], - "no-multiple-empty-lines": "error", - "no-new-wrappers": "error", - "no-debugger": "error", - "no-redeclare": "error", - "no-empty": "error", - "no-eval": "error", - "no-shadow": "error", - "dot-notation": "error", - "no-fallthrough": "error", - "no-trailing-spaces": "error", - "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], - "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "variables": false }], - "brace-style": "error", - "quotes": ["error", "single"], - "radix": "error", - "@typescript-eslint/semi": "error", - "default-case": "error", - "comma-dangle": ["error", { "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline" }], - "eqeqeq": "error", - "@typescript-eslint/typedef": "error", - "@typescript-eslint/type-annotation-spacing": "error" } } diff --git a/packages/sitecore-jss-react/.eslintrc b/packages/sitecore-jss-react/.eslintrc index 4d070e012d..3d8eb496f9 100644 --- a/packages/sitecore-jss-react/.eslintrc +++ b/packages/sitecore-jss-react/.eslintrc @@ -1,80 +1,15 @@ { - "root": true, "extends": [ "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" + "../../.eslintrc" ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": 2020, - "sourceType": "module" - }, - "plugins": ["@typescript-eslint", "react"], + "plugins": ["react"], "settings": { "react": { "version": "detect" } }, - "env": { - "browser": true, - "node": true, - "es6": true - }, "globals": { "React": "writable" - }, - "ignorePatterns": ["src/**/*.test.*", "src/tests/*", "src/testData/*"], - "rules": { - "@typescript-eslint/indent": ["error", 2], - "no-restricted-globals": "off", - "no-restricted-properties": "off", - "@typescript-eslint/naming-convention": [ - "error", - { - "format": ["PascalCase"], - "selector": "typeLike", - "custom": { - "regex": "^I[A-Z]", - "match": false - } - } - ], - "spaced-comment": "error", - "curly": "error", - "eol-last": ["error", "always"], - "guard-for-in": "error", - "valid-jsdoc": "error", - "no-unused-labels": "error", - "max-len": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/member-ordering": "error", - "@typescript-eslint/no-explicit-any": "error", - "no-caller": "error", - "no-bitwise": "error", - "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], - "no-multiple-empty-lines": "error", - "no-new-wrappers": "error", - "no-debugger": "error", - "no-redeclare": "error", - "no-empty": "error", - "no-eval": "error", - "no-shadow": "error", - "dot-notation": "error", - "no-fallthrough": "error", - "no-trailing-spaces": "error", - "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], - "@typescript-eslint/no-use-before-define": "error", - "brace-style": "error", - "quotes": ["error", "single"], - "radix": "error", - "@typescript-eslint/semi": "error", - "default-case": "error", - "comma-dangle": ["error", { "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline" }], - "eqeqeq": "error", - "@typescript-eslint/typedef": "error", - "@typescript-eslint/type-annotation-spacing": "error" } } diff --git a/packages/sitecore-jss/package-lock.json b/packages/sitecore-jss/package-lock.json index 7b4b4f6996..4d0f4a10c6 100644 --- a/packages/sitecore-jss/package-lock.json +++ b/packages/sitecore-jss/package-lock.json @@ -248,6 +248,68 @@ "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 + }, + "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 + }, + "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 + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -414,6 +476,18 @@ "integrity": "sha512-4kHAkbV/OfW2kb5BLVUuUMoumB3CP8rHqlw48aHvFy5tf9ER0AfOonBlX29l/DD68G70DmyhRlSYfQPSYpC5Vw==", "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", @@ -424,6 +498,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", @@ -511,6 +597,12 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "axios": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", @@ -569,6 +661,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", @@ -796,6 +894,12 @@ "regexp.prototype.flags": "^1.2.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 + }, "default-require-extensions": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", @@ -872,12 +976,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", @@ -958,12 +1080,263 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.15.0.tgz", + "integrity": "sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==", + "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": "^5.2.3", + "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" + } + }, + "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" + } + }, + "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 + }, + "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": "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 + }, + "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", @@ -1047,6 +1420,18 @@ } } }, + "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", @@ -1056,6 +1441,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" + } + }, "find-cache-dir": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", @@ -1102,6 +1496,22 @@ } } }, + "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.5.10", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", @@ -1139,6 +1549,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 + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -1177,6 +1593,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" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -1280,6 +1705,24 @@ "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true }, + "import-fresh": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", + "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", @@ -1332,12 +1775,27 @@ "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-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "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-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", @@ -1565,6 +2023,18 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "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": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", @@ -1580,6 +2050,16 @@ "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", "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", @@ -1663,6 +2143,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-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -1992,6 +2481,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", @@ -2216,6 +2711,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", @@ -2261,6 +2770,15 @@ "release-zalgo": "^1.0.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": "5.1.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", @@ -2341,6 +2859,12 @@ "find-up": "^4.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 + }, "process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", @@ -2350,6 +2874,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.allsettled": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", @@ -2363,6 +2893,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 + }, "querystringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", @@ -2442,6 +2978,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 + }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -2584,6 +3126,17 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -2737,6 +3290,46 @@ } } }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -2748,6 +3341,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 + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -2787,6 +3386,15 @@ "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", @@ -2814,6 +3422,15 @@ "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "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" + } + }, "url-parse": { "version": "1.4.7", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", @@ -2829,6 +3446,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", @@ -2863,6 +3486,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", @@ -2932,6 +3561,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/package.json b/packages/sitecore-jss/package.json index 1071d21aba..e515902418 100644 --- a/packages/sitecore-jss/package.json +++ b/packages/sitecore-jss/package.json @@ -5,10 +5,10 @@ "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" + "coverage": "nyc npm test" }, "engines": { "node": ">=8.1" @@ -36,6 +36,7 @@ "chai-spies": "^1.0.0", "chai-string": "^1.5.0", "del-cli": "^3.0.1", + "eslint": "^7.15.0", "mocha": "^8.1.3", "nyc": "^15.1.0", "sinon": "^7.5.0", diff --git a/packages/sitecore-jss/src/data-fetcher.test.ts b/packages/sitecore-jss/src/data-fetcher.test.ts index 9e9adfdd81..e6f309e7cd 100644 --- a/packages/sitecore-jss/src/data-fetcher.test.ts +++ b/packages/sitecore-jss/src/data-fetcher.test.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-expressions */ + import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; import MockAdapter from 'axios-mock-adapter'; import { expect, use, spy } from 'chai'; @@ -30,7 +32,7 @@ describe('AxiosDataFetcher', () => { const fetcher = new AxiosDataFetcher(); - return fetcher.fetch('/styleguide', { x: 'val1', y: 'val2' }).then((res: any) => { + return fetcher.fetch('/styleguide', { x: 'val1', y: 'val2' }).then((res: AxiosResponse) => { expect(res.status).to.equal(200); expect(res.data.data).to.equal('{"x":"val1","y":"val2"}'); expect(res.data.url).to.equal('/styleguide'); @@ -46,7 +48,7 @@ describe('AxiosDataFetcher', () => { const fetcher = new AxiosDataFetcher(); - return fetcher.fetch('/home').then((res: any) => { + return fetcher.fetch('/home').then((res: AxiosResponse) => { expect(res.status).to.equal(200); expect(res.data.data).to.equal(undefined); expect(res.data.url).to.equal('/home'); @@ -84,7 +86,7 @@ describe('AxiosDataFetcher', () => { const fetcher = new AxiosDataFetcher(config); - return fetcher.fetch('/home').then((res: any) => { + return fetcher.fetch('/home').then((res: AxiosResponse) => { expect(res.status).to.equal(204); expect(res.data.auth).to.deep.equal({ username: 'xxx', @@ -107,7 +109,7 @@ describe('AxiosDataFetcher', () => { }, { 'set-cookie': 'test-set-cookie-value', - }, + } ]; }); @@ -122,7 +124,7 @@ describe('AxiosDataFetcher', () => { }, } as IncomingMessage; - const setHeaderSpy: any = spy(); + const setHeaderSpy: (name: string, value: number | string | string[]) => void = spy(); const res = { setHeader: setHeaderSpy, @@ -134,8 +136,8 @@ describe('AxiosDataFetcher', () => { 'test-req-header': 'test-req-header-value', }; - expect(config.headers.common['cookie']).to.equal('test-cookie-value'); - expect(config.headers.common['referer']).to.equal('http://sctest'); + expect(config.headers.common.cookie).to.equal('test-cookie-value'); + expect(config.headers.common.referer).to.equal('http://sctest'); expect(config.headers.common['user-agent']).to.equal('test-user-agent-value'); expect(config.headers.common['X-Forwarded-For']).to.equal('192.168.1.10'); expect(config.headers.common['test-req-header']).to.equal('test-req-header-value'); @@ -161,10 +163,10 @@ describe('AxiosDataFetcher', () => { const fetcher = new AxiosDataFetcher(config); - return fetcher.fetch('/home', undefined, req, res).then((res: any) => { + return fetcher.fetch('/home', undefined, req, res).then((res: AxiosResponse) => { expect(res.status).to.equal(200); - expect(res.data.headers['cookie']).to.equal('test-cookie-value'); - expect(res.data.headers['referer']).to.equal('http://sctest'); + expect(res.data.headers.cookie).to.equal('test-cookie-value'); + expect(res.data.headers.referer).to.equal('http://sctest'); expect(res.data.headers['user-agent']).to.equal('test-user-agent-value'); expect(res.data.headers['X-Forwarded-For']).to.equal('192.168.1.10'); expect(res.data.headers['test-req-header']).to.equal('test-req-header-value'); diff --git a/packages/sitecore-jss/src/data-fetcher.ts b/packages/sitecore-jss/src/data-fetcher.ts index ac1d5f4d4d..4b5b2853f1 100644 --- a/packages/sitecore-jss/src/data-fetcher.ts +++ b/packages/sitecore-jss/src/data-fetcher.ts @@ -42,40 +42,13 @@ export class AxiosDataFetcher { this.instance = axios.create(axiosConfig); } - /** - * Setup request headers - * @param {IncomingMessage} req - * @param {AxiosRequestConfig} reqConfig - */ - private setupReqHeaders(req: IncomingMessage, reqConfig: AxiosRequestConfig) { - reqConfig.headers.common = { - ...reqConfig.headers.common, - ...(req.headers.cookie && { cookie: req.headers.cookie }), - ...(req.headers.referer && { referer: req.headers.referer }), - ...(req.headers['user-agent'] && { 'user-agent': req.headers['user-agent'] }), - ...(req.connection.remoteAddress && { 'X-Forwarded-For': req.connection.remoteAddress }), - }; - - return reqConfig; - } - - /** - * Setup response headers based on response from layout service - * @param {ServerResponse} res - * @param {AxiosResponse} serverRes - */ - private setupResHeaders(res: ServerResponse, serverRes: AxiosResponse) { - serverRes.headers['set-cookie'] && res.setHeader('set-cookie', serverRes.headers['set-cookie']); - - return serverRes; - } - /** * Implements a data fetcher. @see HttpJsonFetcher<T> type for implementation details/notes. * @param {string} url The URL to request; may include query string * @param {any} [data] Optional data to POST with the request. * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance + * @returns {Promise<AxiosResponse>} response */ fetch( url: string, @@ -108,4 +81,34 @@ export class AxiosDataFetcher { withCredentials: true, }); } + + /** + * Setup request headers + * @param {IncomingMessage} req + * @param {AxiosRequestConfig} reqConfig + * @returns {AxiosRequestConfig} axios request config + */ + private setupReqHeaders(req: IncomingMessage, reqConfig: AxiosRequestConfig) { + reqConfig.headers.common = { + ...reqConfig.headers.common, + ...(req.headers.cookie && { cookie: req.headers.cookie }), + ...(req.headers.referer && { referer: req.headers.referer }), + ...(req.headers['user-agent'] && { 'user-agent': req.headers['user-agent'] }), + ...(req.connection.remoteAddress && { 'X-Forwarded-For': req.connection.remoteAddress }), + }; + + return reqConfig; + } + + /** + * Setup response headers based on response from layout service + * @param {ServerResponse} res + * @param {AxiosResponse} serverRes + * @returns {AxiosResponse} response + */ + private setupResHeaders(res: ServerResponse, serverRes: AxiosResponse) { + serverRes.headers['set-cookie'] && res.setHeader('set-cookie', serverRes.headers['set-cookie']); + + return serverRes; + } } diff --git a/packages/sitecore-jss/src/dataApi.test.ts b/packages/sitecore-jss/src/dataApi.test.ts index 822507e34c..7f60ff5f09 100644 --- a/packages/sitecore-jss/src/dataApi.test.ts +++ b/packages/sitecore-jss/src/dataApi.test.ts @@ -1,4 +1,5 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable no-unused-expressions */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; @@ -60,7 +61,7 @@ describe('fetchRouteData', () => { { fetcher: axiosFetcher, layoutServiceConfig: { host: 'https://www.myhost.net' }, - querystringParams: { sc_camp: 123456 } + querystringParams: { sc_camp: 123456 }, }) .then((data) => { // testData should contain the 'config' object from the mock request diff --git a/packages/sitecore-jss/src/dataApi.ts b/packages/sitecore-jss/src/dataApi.ts index ae5f27803e..e89ee24814 100644 --- a/packages/sitecore-jss/src/dataApi.ts +++ b/packages/sitecore-jss/src/dataApi.ts @@ -2,17 +2,17 @@ import { LayoutServiceData, PlaceholderData } from './dataModels'; import { HttpJsonFetcher, HttpResponse } from './httpClientInterface'; class ResponseError extends Error { - constructor(message: string, response: HttpResponse<any>) { + response: HttpResponse<unknown>; + + constructor(message: string, response: HttpResponse<unknown>) { super(message); Object.setPrototypeOf(this, ResponseError.prototype); this.response = response; } - - response: HttpResponse<any>; } -function checkStatus(response: HttpResponse<any>) { +function checkStatus<T>(response: HttpResponse<T>) { if (response.status >= 200 && response.status < 300) { return response; } @@ -24,7 +24,7 @@ function checkStatus(response: HttpResponse<any>) { // note: encodeURIComponent is available via browser (window) or natively in node.js // if you use another js engine for server-side rendering you may not have native encodeURIComponent // and would then need to install a package for that functionality -function getQueryString(params: { [key: string]: any }): string { +function getQueryString(params: { [key: string]: string | number | boolean }): string { return Object.keys(params) .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`) .join('&'); @@ -33,7 +33,7 @@ function getQueryString(params: { [key: string]: any }): string { function fetchData<T>( url: string, fetcher: HttpJsonFetcher<T>, - params: { [key: string]: any } = {} + params: { [key: string]: string | number | boolean } = {} ) { const qs = getQueryString(params); const fetchUrl = url.indexOf('?') !== -1 ? `${url}&${qs}` : `${url}?${qs}`; @@ -68,7 +68,7 @@ export interface BaseRequestOptions<T> { /** * An object of key:value pairs to be stringified and used as querystring parameters. */ - querystringParams?: { [key: string]: any }; + querystringParams?: { [key: string]: string | number | boolean }; /** The fetcher that performs the HTTP request and returns a promise to JSON */ fetcher: HttpJsonFetcher<T>; @@ -95,6 +95,9 @@ const resolveLayoutServiceUrl = (options: LayoutServiceConfig = {}, verb: string * Makes a request to Sitecore Layout Service for the specified route item path. * @deprecated Will be removed in a future release. Please use LayoutService.fetchLayoutData instead, * @see {LayoutService} - fetchLayoutData + * @param {string} itemPath + * @param {LayoutServiceRequestOptions<LayoutServiceData>} options + * @returns {Promise<LayoutServiceData>} layout data */ export function fetchRouteData( itemPath: string, @@ -115,6 +118,10 @@ export function fetchRouteData( * a specific route item. Allows you to retrieve rendered data for individual placeholders instead of entire routes. * @deprecated Will be removed in a future release. Please use LayoutService.fetchPlaceholderData instead, * @see {LayoutService} - fetchPlaceholderData + * @param {string} placeholderName + * @param {string} itemPath + * @param {LayoutServiceRequestOptions<PlaceholderData>} options + * @returns {Promise<PlaceholderData>} placeholder data */ export function fetchPlaceholderData( placeholderName: string, diff --git a/packages/sitecore-jss/src/dataModels.ts b/packages/sitecore-jss/src/dataModels.ts index a0e1071a6f..3999e11f72 100644 --- a/packages/sitecore-jss/src/dataModels.ts +++ b/packages/sitecore-jss/src/dataModels.ts @@ -36,6 +36,7 @@ export enum LayoutServicePageState { * Shape of context data from the Sitecore Layout Service */ export interface LayoutServiceContext { + [key: string]: unknown; pageEditing?: boolean; language?: string; pageState?: LayoutServicePageState; @@ -43,8 +44,7 @@ export interface LayoutServiceContext { site?: { name?: string; }; - [key: string]: any; -}; +} /** * Context information from the Sitecore Layout Service @@ -79,7 +79,7 @@ export interface RouteData { */ export type PlaceholdersData<TYPEDNAME extends string = string> = { [P in TYPEDNAME]: Array<ComponentRendering | HtmlElementRendering>; -} +}; /** * Content field data passed to a component @@ -122,11 +122,11 @@ export interface HtmlElementRendering { /** * Field value data on a component */ -export type GenericFieldValue = string | boolean | number | { [key: string]: any } | Array<{ [key: string]: any }>; +export type GenericFieldValue = string | boolean | number | { [key: string]: unknown } | Array<{ [key: string]: unknown }>; export interface Field<T = GenericFieldValue> { - value: T; - editable?: string; + value: T; + editable?: string; } /** diff --git a/packages/sitecore-jss/src/httpClientInterface.ts b/packages/sitecore-jss/src/httpClientInterface.ts index 5efd97a190..a728175f86 100644 --- a/packages/sitecore-jss/src/httpClientInterface.ts +++ b/packages/sitecore-jss/src/httpClientInterface.ts @@ -4,7 +4,7 @@ export interface HttpResponse<T> { /** HTTP status text i.e. 'OK', 'Bad Request' */ statusText: string; /** Parsed JSON response data from server */ - data?: T; + data: T; } /** @@ -16,4 +16,5 @@ export interface HttpResponse<T> { * - Parse response values as JSON and return them into <T> * - Send HTTP POST requests if `data` param is specified; GET is suggested but not required for data-less requests */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type HttpJsonFetcher<T> = (url: string, data?: { [key: string]: any }) => Promise<HttpResponse<T>>; diff --git a/packages/sitecore-jss/src/index.ts b/packages/sitecore-jss/src/index.ts index daa4b8b342..c45790b743 100644 --- a/packages/sitecore-jss/src/index.ts +++ b/packages/sitecore-jss/src/index.ts @@ -4,7 +4,7 @@ import * as mediaApi from './mediaApi'; export { dataApi, mediaApi }; export { - LayoutServiceRequestOptions + LayoutServiceRequestOptions, } from './dataApi'; export { AxiosDataFetcher, AxiosDataFetcherConfig } from './data-fetcher'; @@ -28,12 +28,12 @@ export { Item, PlaceholdersData, ComponentFields, - ComponentParams + ComponentParams, } from './dataModels'; export { getFieldValue, - getChildPlaceholder + getChildPlaceholder, } from './layoutDataUtils'; export { HttpJsonFetcher, HttpResponse } from './httpClientInterface'; diff --git a/packages/sitecore-jss/src/layout-service.test.ts b/packages/sitecore-jss/src/layout-service.test.ts index cf2d7d1cc1..954b7d7fd5 100644 --- a/packages/sitecore-jss/src/layout-service.test.ts +++ b/packages/sitecore-jss/src/layout-service.test.ts @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-unused-expressions */ + import { expect, spy, use } from 'chai'; import spies from 'chai-spies'; import { LayoutService } from './layout-service'; @@ -58,7 +61,7 @@ describe('LayoutService', () => { }, { 'set-cookie': 'test-set-cookie-value', - }, + } ]; }); @@ -87,8 +90,8 @@ describe('LayoutService', () => { }); return service.fetchLayoutData('/home', 'da-DK', req, res).then((layoutServiceData: any) => { - expect(layoutServiceData.headers['cookie']).to.equal('test-cookie-value'); - expect(layoutServiceData.headers['referer']).to.equal('http://sctest'); + expect(layoutServiceData.headers.cookie).to.equal('test-cookie-value'); + expect(layoutServiceData.headers.referer).to.equal('http://sctest'); expect(layoutServiceData.headers['user-agent']).to.equal('test-user-agent-value'); expect(layoutServiceData.headers['X-Forwarded-For']).to.equal('192.168.1.10'); @@ -115,7 +118,7 @@ describe('LayoutService', () => { }, { 'set-cookie': 'test-set-cookie-value', - }, + } ]; }); @@ -144,8 +147,8 @@ describe('LayoutService', () => { }); return service.fetchLayoutData('/home', 'da-DK', req, res).then((layoutServiceData: any) => { - expect(layoutServiceData.headers['cookie']).to.equal('test-cookie-value'); - expect(layoutServiceData.headers['referer']).to.equal('http://sctest'); + expect(layoutServiceData.headers.cookie).to.equal('test-cookie-value'); + expect(layoutServiceData.headers.referer).to.equal('http://sctest'); expect(layoutServiceData.headers['user-agent']).to.equal('test-user-agent-value'); expect(layoutServiceData.headers['X-Forwarded-For']).to.equal('192.168.1.10'); @@ -200,11 +203,11 @@ describe('LayoutService', () => { { name: 'x1', path: 'x1/x2', - elements: [] + elements: [], }, { 'set-cookie': 'test-set-cookie-value', - }, + } ]; }); @@ -236,11 +239,11 @@ describe('LayoutService', () => { expect(placeholderData).to.deep.equal({ name: 'x1', path: 'x1/x2', - elements: [] + elements: [], }); expect(setHeaderSpy).to.be.called.with('set-cookie', 'test-set-cookie-value'); }); - }) + }); it('should fetch placeholder data using custom fetcher resolver', () => { const fetcherSpy = spy((url: string) => { @@ -251,7 +254,7 @@ describe('LayoutService', () => { return [200, { name: 'x1', path: 'x1/x2', - elements: [] + elements: [], }]; }); @@ -266,7 +269,7 @@ describe('LayoutService', () => { expect(placeholderData).to.deep.equal({ name: 'x1', path: 'x1/x2', - elements: [] + elements: [], }); expect(fetcherSpy).to.be.called.once; @@ -274,5 +277,5 @@ describe('LayoutService', () => { 'http://sctest/sitecore/api/layout/placeholder/jss?placeholderName=superPh&item=%2Fxxx&sc_apikey=0FBFF61E-267A-43E3-9252-B77E71CEE4BA&sc_site=supersite&sc_lang=da-DK&tracking=true' ); }); - }) + }); }); diff --git a/packages/sitecore-jss/src/layout-service.ts b/packages/sitecore-jss/src/layout-service.ts index aa58103644..24607fdf5b 100644 --- a/packages/sitecore-jss/src/layout-service.ts +++ b/packages/sitecore-jss/src/layout-service.ts @@ -29,9 +29,10 @@ export type LayoutServiceInstanceConfig = { }; interface FetchParams { + [param: string]: string | number | boolean; sc_apikey: string; sc_site: string; - sc_lang?: string; + sc_lang: string; tracking: boolean; } @@ -43,47 +44,13 @@ interface FetchOptions { export class LayoutService { constructor(private serviceConfig: LayoutServiceInstanceConfig) {} - /** - * Provides fetch options in order to fetch route data - * @param {string} [language] language will be applied to `sc_lang` param - */ - private getFetchOptions = (language?: string): FetchOptions => { - const params: FetchParams = { - sc_apikey: this.serviceConfig.apiKey, - sc_site: this.serviceConfig.siteName, - sc_lang: language, - tracking: this.serviceConfig.tracking ?? true, - }; - - return { - layoutServiceConfig: { - host: this.serviceConfig.apiHost, - }, - querystringParams: { ...params }, - }; - }; - - /** - * Provides default @see AxiosDataFetcher data fetcher - * @param {IncomingMessage} [req] Request instance - * @param {ServerResponse} [res] Response instance - */ - private getDefaultFetcher = (req?: IncomingMessage, res?: ServerResponse) => { - const axiosFetcher = new AxiosDataFetcher(); - - const fetcher = (url: string, data?: unknown) => { - return axiosFetcher.fetch(url, data, req, res); - }; - - return fetcher; - }; - /** * Fetch route data from LayoutService using @see dataApi.fetchRouteData * @param {string} itemPath * @param {string} [language] * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance + * @returns {Promise<LayoutServiceData>} layout service data */ fetchLayoutData( itemPath: string, @@ -109,6 +76,7 @@ export class LayoutService { * @param {string} [language] * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance + * @returns {Promise<PlaceholderData>} placeholder data */ fetchPlaceholderData( placeholderName: string, @@ -120,9 +88,46 @@ export class LayoutService { const fetchOptions = this.getFetchOptions(language); const fetcher = this.serviceConfig.dataFetcherResolver - ? this.serviceConfig.dataFetcherResolver<PlaceholderData>(req, res) - : this.getDefaultFetcher(req, res); + ? this.serviceConfig.dataFetcherResolver<PlaceholderData>(req, res) + : this.getDefaultFetcher(req, res); return fetchPlaceholderData(placeholderName, itemPath, { fetcher, ...fetchOptions }); } + + /** + * Provides fetch options in order to fetch route data + * @param {string} [language] language will be applied to `sc_lang` param + * @returns {FetchOptions} fetch options + */ + private getFetchOptions = (language?: string): FetchOptions => { + const params: FetchParams = { + sc_apikey: this.serviceConfig.apiKey, + sc_site: this.serviceConfig.siteName, + sc_lang: language || '', + tracking: this.serviceConfig.tracking ?? true, + }; + + return { + layoutServiceConfig: { + host: this.serviceConfig.apiHost, + }, + querystringParams: { ...params }, + }; + }; + + /** + * Provides default @see AxiosDataFetcher data fetcher + * @param {IncomingMessage} [req] Request instance + * @param {ServerResponse} [res] Response instance + * @returns default fetcher + */ + private getDefaultFetcher = (req?: IncomingMessage, res?: ServerResponse) => { + const axiosFetcher = new AxiosDataFetcher(); + + const fetcher = (url: string, data?: unknown) => { + return axiosFetcher.fetch(url, data, req, res); + }; + + return fetcher; + }; } diff --git a/packages/sitecore-jss/src/layoutDataUtils.ts b/packages/sitecore-jss/src/layoutDataUtils.ts index f3997136c4..ba71150eaa 100644 --- a/packages/sitecore-jss/src/layoutDataUtils.ts +++ b/packages/sitecore-jss/src/layoutDataUtils.ts @@ -1,18 +1,20 @@ import { ComponentRendering, Field, HtmlElementRendering, Item } from './dataModels'; +type Fields = { [name: string]: Field | Item[] }; + /** * Safely extracts a field value from a rendering or fields object. * Null will be returned if the field is not defined. */ export function getFieldValue<T>( - renderingOrFields: ComponentRendering | { [name: string]: Field | Item[] }, + renderingOrFields: ComponentRendering | Fields, fieldName: string): T | undefined; export function getFieldValue<T>( - renderingOrFields: ComponentRendering | { [name: string]: Field | Item[] }, + renderingOrFields: ComponentRendering | Fields, fieldName: string, defaultValue: T): T; export function getFieldValue<T>( - renderingOrFields: ComponentRendering | { [name: string]: Field | Item[] }, + renderingOrFields: ComponentRendering | Fields, fieldName: string, defaultValue?: T) { @@ -20,8 +22,8 @@ export function getFieldValue<T>( return defaultValue; } - const fields = renderingOrFields as any; - const field = fields[fieldName] as Field<T>; + const fields = renderingOrFields as Fields; + const field = fields[fieldName] as unknown as Field<T>; if (field && typeof field.value !== 'undefined') { return field.value; } @@ -35,14 +37,16 @@ export function getFieldValue<T>( return defaultValue; } - return (rendering.fields[fieldName] as Field<T>).value; + return (rendering.fields[fieldName] as unknown as Field<T>).value; } /** * Gets rendering definitions in a given child placeholder under a current rendering. + * @param {ComponentRendering} rendering + * @param {string} placeholderName + * @returns {Array<ComponentRendering | HtmlElementRendering>} child placeholder */ -export function getChildPlaceholder(rendering: ComponentRendering, placeholderName: string) -: Array<ComponentRendering | HtmlElementRendering> { +export function getChildPlaceholder(rendering: ComponentRendering, placeholderName: string): Array<ComponentRendering | HtmlElementRendering> { if ( !rendering || !placeholderName || diff --git a/packages/sitecore-jss/src/mediaApi.test.ts b/packages/sitecore-jss/src/mediaApi.test.ts index 341a659bb0..9dab28dd39 100644 --- a/packages/sitecore-jss/src/mediaApi.test.ts +++ b/packages/sitecore-jss/src/mediaApi.test.ts @@ -1,4 +1,4 @@ -/* tslint:disable:no-unused-expression max-line-length */ +/* eslint-disable no-unused-expressions */ // what is `import x = require('x');`? great question: https://github.com/Microsoft/TypeScript/issues/5073 import chai = require('chai'); @@ -16,48 +16,50 @@ describe('findEditorImageTag', () => { const imgTag = '<img src=\"http:\/\/jssadvancedapp\/sitecore\/shell\/-\/media\/JssAdvancedApp\/assets\/img\/portfolio\/1.ashx?h=350&la=en&w=650&hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D\" alt=\"\" width=\"650\" height=\"350\" \/>'; /* eslint-enable no-useless-escape */ - const imgMatch = findEditorImageTag(editableField) as any; + const imgMatch = findEditorImageTag(editableField); - expect(imgMatch.imgTag).to.equal(imgTag); - expect(Object.keys(imgMatch.attrs).length).to.equal(4); - expect(imgMatch.attrs['width']).to.equal('650'); - expect(imgMatch.attrs['height']).to.equal('350'); - expect(imgMatch.attrs['alt']).to.be.empty; // eslint-disable-line no-unused-expressions - expect(imgMatch.attrs['src']).to.startsWith('http://jssadvancedapp'); - expect(imgMatch.attrs['src']).to.endsWith('CC5043DC03C6C27F40EDB08CF84AB8670C05D63D'); - expect(imgMatch.attrs['src']).to.not.contain('&'); + expect(imgMatch).to.not.be.undefined; + + expect(imgMatch?.imgTag).to.equal(imgTag); + expect(imgMatch && Object.keys(imgMatch.attrs).length).to.equal(4); + expect(imgMatch?.attrs.width).to.equal('650'); + expect(imgMatch?.attrs.height).to.equal('350'); + expect(imgMatch?.attrs.alt).to.be.empty; // eslint-disable-line no-unused-expressions + expect(imgMatch?.attrs.src).to.startsWith('http://jssadvancedapp'); + expect(imgMatch?.attrs.src).to.endsWith('CC5043DC03C6C27F40EDB08CF84AB8670C05D63D'); + expect(imgMatch?.attrs.src).to.not.contain('&'); }); it('should decode html entities', () => { const editableField = '<input><code><img lorem="&><" /></code></input>'; - const imgMatch = findEditorImageTag(editableField) as any; - expect(imgMatch.attrs['lorem']).to.equal('&><'); + const imgMatch = findEditorImageTag(editableField); + expect(imgMatch?.attrs.lorem).to.equal('&><'); }); }); describe('getRequiredParams', () => { it('should return required query string params', () => { - const parsedQs = { + const parsedQs = { rev: '11', db: '22', xxx: 'ppp', la: '33', vs: '44', ts: '55', - yyy: 'vvv' - } + yyy: 'vvv', + }; const params = getRequiredParams(parsedQs); - + expect(params).to.deep.equal({ rev: '11', db: '22', la: '33', vs: '44', - ts: '55' - }) - }) -}) + ts: '55', + }); + }); +}); describe('updateImageUrl', () => { it('should override parameters with those provided', () => { @@ -90,7 +92,7 @@ describe('updateImageUrl', () => { const updated = updateImageUrl(original, undefined, mediaUrlPrefix); const url = URL(updated); expect(url.pathname).to.startsWith('/-/jssmedia/'); - }) + }); it('should replace /~assets/ with /~/jssmedia', () => { const original = 'http://sitecore/~assets/lorem/ipsum.jpg'; @@ -98,7 +100,7 @@ describe('updateImageUrl', () => { const updated = updateImageUrl(original, undefined, mediaUrlPrefix); const url = URL(updated); expect(url.pathname).to.startsWith('/~/jssmedia/'); - }) + }); it('should replace /-/assets/ with /-/jssmedia/', () => { const original = 'http://sitecore/-/assets/lorem/ipsum.jpg'; @@ -106,7 +108,7 @@ describe('updateImageUrl', () => { const updated = updateImageUrl(original, undefined, mediaUrlPrefix); const url = URL(updated); expect(url.pathname).to.startsWith('/-/jssmedia/'); - }) + }); it('should replace /~/assets/ with /~/jssmedia/', () => { const original = 'http://sitecore/~/assets/lorem/ipsum.jpg'; @@ -114,7 +116,7 @@ describe('updateImageUrl', () => { const updated = updateImageUrl(original, undefined, mediaUrlPrefix); const url = URL(updated); expect(url.pathname).to.startsWith('/~/jssmedia/'); - }) + }); }); it('should merge querystring and params', () => { @@ -123,17 +125,17 @@ describe('updateImageUrl', () => { const parsed = updateImageUrl(src, params); const url = URL(parsed, {}, true); - expect(url.toString()).equal('/media/lorem/ipsum.jpg?y=valueY&z=valueZ&rev=109010&db=333&la=444&vs=555&ts=666') + expect(url.toString()).equal('/media/lorem/ipsum.jpg?y=valueY&z=valueZ&rev=109010&db=333&la=444&vs=555&ts=666'); expect(url.query).deep.equal({ y: 'valueY', - z: 'valueZ', - rev: "109010", + z: 'valueZ', + rev: '109010', db: '333', la: '444', vs: '555', - ts: '666' + ts: '666', }); - }) + }); }); describe('getSrcSet', () => { @@ -144,7 +146,7 @@ describe('getSrcSet', () => { { h: '1000', w: '1000' }, { h: '500', w: '500' }, { mh: '250', mw: '250' }, - { h: '100' }, + { h: '100' } ]; const srcSet = getSrcSet(original, params); expect(srcSet).to.equal(expected); @@ -155,7 +157,7 @@ describe('getSrcSet', () => { const expected = '/ipsum.jpg?as=1&w=1000 1000w, /ipsum.jpg?as=1&w=500 500w'; const params = [ { w: '1000' }, - { w: '500' }, + { w: '500' } ]; const srcSet = getSrcSet(original, params, { as: '1', w: '9999' }); expect(srcSet).to.equal(expected); @@ -164,7 +166,7 @@ describe('getSrcSet', () => { describe('should replace url using custom mediaUrlPrefix', () => { const params = [ { w: '1000' }, - { w: '500' }, + { w: '500' } ]; it('should replace /-assets/ with /-/jssmedia', () => { @@ -173,7 +175,7 @@ describe('getSrcSet', () => { const mediaUrlPrefix = /\/([-~]{1})assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); - }) + }); it('should replace /~assets/ with /~/jssmedia', () => { const original = '/~assets/lorem/ipsum.jpg'; @@ -181,7 +183,7 @@ describe('getSrcSet', () => { const mediaUrlPrefix = /\/([-~]{1})assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); - }) + }); it('should replace /-/assets/ with /-/jssmedia/', () => { const original = '/-/assets/lorem/ipsum.jpg'; @@ -189,7 +191,7 @@ describe('getSrcSet', () => { const mediaUrlPrefix = /\/([-~]{1})\/assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); - }) + }); it('should replace /~/assets/ with /~/jssmedia/', () => { const original = '/~/assets/lorem/ipsum.jpg'; @@ -197,6 +199,6 @@ describe('getSrcSet', () => { const mediaUrlPrefix = /\/([-~]{1})\/assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); - }) + }); }); }); diff --git a/packages/sitecore-jss/src/mediaApi.ts b/packages/sitecore-jss/src/mediaApi.ts index 1ef9ba7b0a..f6f26ef3f7 100644 --- a/packages/sitecore-jss/src/mediaApi.ts +++ b/packages/sitecore-jss/src/mediaApi.ts @@ -13,6 +13,8 @@ const mediaUrlPrefixRegex = /\/([-~]{1})\/media\//i; /** * Makes a request to Sitecore Content Service for the specified item path. + * @param {string} editorMarkup + * @returns {Object | null} found image tag */ export const findEditorImageTag = (editorMarkup: string) => { // match the tag @@ -24,7 +26,7 @@ export const findEditorImageTag = (editorMarkup: string) => { // find the attrs and turn them into a Map const attrs = {} as { [key: string]: string }; let match = htmlAttrsRegex.exec(tagMatch[1]); - while (match != null) { + while (match !== null) { attrs[match[1]] = unescape(match[3]); match = htmlAttrsRegex.exec(tagMatch[1]); } @@ -37,21 +39,26 @@ export const findEditorImageTag = (editorMarkup: string) => { /** * Get required query string params which should be merged with user params - * @param qs layout service parsed query string + * @param {object} qs layout service parsed query string + * @returns {object} requiredParams */ -export const getRequiredParams = (qs: { - [key: string]: string | undefined +export const getRequiredParams = (qs: { + [key: string]: string | undefined }) => { const { rev, db, la, vs, ts } = qs; - - return { rev, db, la, vs, ts } -} + + return { rev, db, la, vs, ts }; +}; /** * Receives a Sitecore media URL and replaces `/~/media` or `/-/media` with `/~/jssmedia` or `/-/jssmedia`, respectively. * Can use `mediaUrlPrefix` in order to use custom checker. * This replacement allows the JSS media handler to be used for JSS app assets. * Also, any provided `params` are used as the querystring parameters for the media URL. + * @param {string} url + * @param {Object} [params] + * @param {RegExp} [mediaUrlPrefix=mediaUrlPrefixRegex] + * @returns {string} url */ export const updateImageUrl = ( url: string, @@ -59,22 +66,24 @@ export const updateImageUrl = ( mediaUrlPrefix: RegExp = mediaUrlPrefixRegex ) => { // polyfill node `global` in browser to workaround https://github.com/unshiftio/url-parse/issues/150 + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (typeof window !== 'undefined' && !(window as any).global) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any (window as any).global = {}; } - const parsed = URL(url, {}, true); - - const query = { ...(params || parsed.query) } + const parsed = URL(url, {}, true); + + const query = { ...(params || parsed.query) }; // In case if imageParams provided if (params) { const requiredParams = getRequiredParams(parsed.query); - + Object.entries(requiredParams).forEach(([key, param]) => { if (param) { query[key] = param; } - }) + }); } parsed.set('query', query); @@ -98,6 +107,12 @@ export const updateImageUrl = ( * getSrcSet('/ipsum.jpg', [{ h: 1000, w: 1000 }, { mh: 250, mw: 250 } ]) * * More information about `srcSet`: {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img} + * + * @param {string} url + * @param {Array} srcSet + * @param {Object} [imageParams] + * @param {RegExp} [mediaUrlPrefix] + * @returns {string} src set */ export const getSrcSet = ( url: string, diff --git a/packages/sitecore-jss/src/util.test.ts b/packages/sitecore-jss/src/util.test.ts index 12f2105dba..edaf7c6e6d 100644 --- a/packages/sitecore-jss/src/util.test.ts +++ b/packages/sitecore-jss/src/util.test.ts @@ -1,4 +1,4 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { isExperienceEditorActive, isServer } from './util'; @@ -6,8 +6,8 @@ import { isExperienceEditorActive, isServer } from './util'; // must make TypeScript happy with `global` variable modification interface CustomWindow { - document: any; - [key: string]: any; + [key: string]: unknown; + document: unknown; } interface Global { diff --git a/packages/sitecore-jss/src/util.ts b/packages/sitecore-jss/src/util.ts index 0b0dd4b42a..66618db3c6 100644 --- a/packages/sitecore-jss/src/util.ts +++ b/packages/sitecore-jss/src/util.ts @@ -4,12 +4,14 @@ export const isExperienceEditorActive = (): boolean => { if (isServer()) { return false; } + // eslint-disable-next-line const sc = (window as any).Sitecore; return Boolean(sc && sc.PageModes && sc.PageModes.ChromeManager); }; export const resetExperienceEditorChromes = (): void => { if (isExperienceEditorActive()) { + // eslint-disable-next-line (window as any).Sitecore.PageModes.ChromeManager.resetChromes(); } }; From 49c7155ca5931c246f324a9df6c2e0d1f9d94251 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 14:27:56 +0200 Subject: [PATCH 06/37] lint cli --- packages/sitecore-jss-cli/package.json | 3 +- packages/sitecore-jss-cli/src/cli-shared.ts | 1 + packages/sitecore-jss-cli/src/cli.global.ts | 1 + packages/sitecore-jss-cli/src/cli.ts | 1 + .../src/create/create.source.folder.ts | 2 + .../src/create/create.source.github.ts | 47 ++++++++++--------- .../sitecore-jss-cli/src/micro-manifest.ts | 18 +++++-- .../sitecore-jss-cli/src/resolve-package.ts | 2 + .../sitecore-jss-cli/src/scripts/clean.ts | 1 + .../sitecore-jss-cli/src/scripts/create.ts | 3 +- .../src/scripts/deploy.app.ts | 1 + .../src/scripts/deploy.component.ts | 9 ++-- .../src/scripts/deploy.config.ts | 15 +++--- .../src/scripts/deploy.files.ts | 15 +++--- .../src/scripts/deploy.items.ts | 18 +++---- .../src/scripts/deploy.template.ts | 17 +++---- .../sitecore-jss-cli/src/scripts/deploy.ts | 3 ++ .../src/scripts/index.global.ts | 2 +- .../sitecore-jss-cli/src/scripts/index.ts | 2 +- .../sitecore-jss-cli/src/scripts/manifest.ts | 1 + .../sitecore-jss-cli/src/scripts/package.ts | 3 +- .../sitecore-jss-cli/src/scripts/setup.ts | 1 + 22 files changed, 100 insertions(+), 66 deletions(-) diff --git a/packages/sitecore-jss-cli/package.json b/packages/sitecore-jss-cli/package.json index cbf0f6f94a..5cced4b15e 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..d85f0c5a5f 100644 --- a/packages/sitecore-jss-cli/src/cli-shared.ts +++ b/packages/sitecore-jss-cli/src/cli-shared.ts @@ -12,6 +12,7 @@ export default function cli(commands: { [key: string]: CommandModule & { disable // 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..e1de4ac418 100644 --- a/packages/sitecore-jss-cli/src/cli.global.ts +++ b/packages/sitecore-jss-cli/src/cli.global.ts @@ -4,5 +4,6 @@ import * as commands from './scripts/index.global'; // 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..0da3a4b582 100644 --- a/packages/sitecore-jss-cli/src/cli.ts +++ b/packages/sitecore-jss-cli/src/cli.ts @@ -23,6 +23,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)); } 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..0ad09c1c98 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<void>((resolve, reject) => { tmp.setGracefulCleanup(); // unsafeCleanup just means it'll kill any files left in the temp folder @@ -52,24 +54,24 @@ export class GitHubSource { 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)) { + 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) => { @@ -82,7 +84,7 @@ export class GitHubSource { process.exit(1); } - resolve(apiResult); + resolve(apiResult); }); }); } @@ -106,17 +108,18 @@ export class GitHubSource { fs.mkdirSync(this.destinationPath); - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { fs.readFile(zipFile, (err, data) => { if (err) { reject(err); } const jszip = new JSZip(); - const writePromises: Array<Promise<any>> = []; + const writePromises: Array<Promise<unknown>> = []; jszip.loadAsync(data).then(async (zip) => { 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); diff --git a/packages/sitecore-jss-cli/src/micro-manifest.ts b/packages/sitecore-jss-cli/src/micro-manifest.ts index 44329f284c..5bad8070fb 100644 --- a/packages/sitecore-jss-cli/src/micro-manifest.ts +++ b/packages/sitecore-jss-cli/src/micro-manifest.ts @@ -6,6 +6,7 @@ import resolvePackage from './resolve-package'; import { handler as manifestHandler } from './scripts/manifest'; import { handler as packageHandler } from './scripts/package'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export default async function microManifest(argv: { [key: string]: any }, manifestContents: string) { verifySetup(); @@ -18,9 +19,10 @@ 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 @@ -44,13 +46,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<void>((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 +72,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<any> => new Promise((resolvePromise, rejectPromise) => { resolve('./package.json', { basedir: process.cwd() }, (error, packageJson) => { @@ -7,6 +8,7 @@ export default (): Promise<any> => 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/scripts/clean.ts b/packages/sitecore-jss-cli/src/scripts/clean.ts index d39403141d..e344d568e0 100644 --- a/packages/sitecore-jss-cli/src/scripts/clean.ts +++ b/packages/sitecore-jss-cli/src/scripts/clean.ts @@ -13,6 +13,7 @@ export const builder = { }, }; +// 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..9865f52270 100644 --- a/packages/sitecore-jss-cli/src/scripts/create.ts +++ b/packages/sitecore-jss-cli/src/scripts/create.ts @@ -61,6 +61,7 @@ export function builder(yargs: 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,7 +89,7 @@ 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( diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.app.ts b/packages/sitecore-jss-cli/src/scripts/deploy.app.ts index e6a51ec458..5bb223059d 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.app.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.app.ts @@ -11,6 +11,7 @@ export const builder = { ...filesBuilder, }; +// 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..7345e88bee 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts @@ -31,6 +31,7 @@ export function args(yargs: 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 }> = []; @@ -70,11 +71,11 @@ ${chalk.green('Your component has been created (or updated)!')} ${chalk.green('NEXT STEPS FOR NEW COMPONENTS')} * Create a component in your JSS application called ${chalk.green(argv.name)} (${chalk.green( - `jss scaffold ${argv.name}` - )}) + `jss scaffold ${argv.name}` +)}) * Deploy your app with the new component to Sitecore (${chalk.green( - 'jss deploy:watch' - )} or ${chalk.green('jss deploy files')}) + 'jss deploy:watch' + )} or ${chalk.green('jss deploy files')}) * Add the new component to a route item using the Experience Editor `); } diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts index 047ae4afb8..cb8d817948 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts @@ -20,15 +20,16 @@ export const builder = { 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', + }, }; +// 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..0fc5122238 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts @@ -23,13 +23,13 @@ export const builder = { 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', @@ -60,6 +60,7 @@ export const builder = { }, }; +// 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..eea9d39c1e 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts @@ -35,13 +35,13 @@ export const builder = { // 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', @@ -55,6 +55,7 @@ export const builder = { ...packageBuilder, }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function handler(argv: any) { verifySetup(); @@ -70,6 +71,7 @@ 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 @@ -93,7 +95,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<any> = Promise.resolve(); + let continuation: Promise<unknown> = Promise.resolve(); if (!argv.skipPackage) { continuation = packageHandler(argv); diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts index 8848bc48e9..71caddf404 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts @@ -39,13 +39,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,10 +63,11 @@ 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.', }); } +// 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 }> = []; diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.ts b/packages/sitecore-jss-cli/src/scripts/deploy.ts index d2ca3dd01b..9b85d8d333 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'; @@ -27,6 +29,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/index.global.ts b/packages/sitecore-jss-cli/src/scripts/index.global.ts index 6a74ef3546..1d18712624 100644 --- a/packages/sitecore-jss-cli/src/scripts/index.global.ts +++ b/packages/sitecore-jss-cli/src/scripts/index.global.ts @@ -8,5 +8,5 @@ import * as elephant from './elephant'; export { easterEgg, elephant, - create as any + 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..938892c528 100644 --- a/packages/sitecore-jss-cli/src/scripts/index.ts +++ b/packages/sitecore-jss-cli/src/scripts/index.ts @@ -17,5 +17,5 @@ export { deploy, pkg, manifest, - clean + clean, }; diff --git a/packages/sitecore-jss-cli/src/scripts/manifest.ts b/packages/sitecore-jss-cli/src/scripts/manifest.ts index 5e55d021bf..ecf935fe5a 100644 --- a/packages/sitecore-jss-cli/src/scripts/manifest.ts +++ b/packages/sitecore-jss-cli/src/scripts/manifest.ts @@ -102,6 +102,7 @@ export const builder = { }, }; +// 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/package.ts b/packages/sitecore-jss-cli/src/scripts/package.ts index 93b41a71b0..b601a30c4e 100644 --- a/packages/sitecore-jss-cli/src/scripts/package.ts +++ b/packages/sitecore-jss-cli/src/scripts/package.ts @@ -27,6 +27,7 @@ export const builder = { ...manifestBuilder, }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function handler(argv: any) { const packageJson = await resolvePackage(); @@ -37,7 +38,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<any> = Promise.resolve(); + let continuation: Promise<unknown> = 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..28b60dd671 100644 --- a/packages/sitecore-jss-cli/src/scripts/setup.ts +++ b/packages/sitecore-jss-cli/src/scripts/setup.ts @@ -50,6 +50,7 @@ export const builder = { }, }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function handler(argv: any) { setup(!argv.nonInteractive, argv.outputFile, argv); } From 5ad0b78fc783e551b973579d6026e288f7684933 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 16:51:05 +0200 Subject: [PATCH 07/37] Push dev-tools --- packages/sitecore-jss-dev-tools/package.json | 3 ++- packages/sitecore-jss-dev-tools/src/bin/deploy.ts | 2 +- packages/sitecore-jss-dev-tools/src/deploy.ts | 4 ++-- packages/sitecore-jss-dev-tools/src/digest.ts | 2 +- .../DisconnectedLayoutServiceOptions.ts | 2 ++ .../create-default-disconnected-server.ts | 2 ++ .../src/disconnected-server/default-document.ts | 4 +++- .../src/disconnected-server/dictionary-service.ts | 10 ++++++---- .../src/disconnected-server/layout-service.ts | 10 +++++++--- .../src/disconnected-server/media-service.ts | 3 ++- packages/sitecore-jss-dev-tools/src/index.ts | 2 +- .../sitecore-jss-dev-tools/src/manifest-manager.ts | 3 ++- packages/sitecore-jss-dev-tools/src/mergeFs.test.ts | 2 ++ packages/sitecore-jss-dev-tools/src/mergeFs.ts | 12 ++++++++---- .../sitecore-jss-dev-tools/src/package-deploy.ts | 6 +++--- .../src/resolve-scjssconfig.ts | 6 +++--- packages/sitecore-jss-dev-tools/src/setup/setup.ts | 10 +++++----- .../sitecore-jss-dev-tools/src/setup/verify-setup.ts | 4 ++-- 18 files changed, 54 insertions(+), 33 deletions(-) diff --git a/packages/sitecore-jss-dev-tools/package.json b/packages/sitecore-jss-dev-tools/package.json index 2077e05437..e48bf8bca4 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/deploy.ts b/packages/sitecore-jss-dev-tools/src/deploy.ts index f5d83fe78b..83e9866ed6 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 { @@ -19,7 +19,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) => { diff --git a/packages/sitecore-jss-dev-tools/src/digest.ts b/packages/sitecore-jss-dev-tools/src/digest.ts index f2dc0dff4a..5b34631e4a 100644 --- a/packages/sitecore-jss-dev-tools/src/digest.ts +++ b/packages/sitecore-jss-dev-tools/src/digest.ts @@ -8,7 +8,7 @@ export function digest(path: string): Promise<string> { 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)); }); } 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..c80bda9913 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 @@ -34,6 +34,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 +51,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; /** 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..accbc5fabe 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 */ @@ -7,7 +9,7 @@ export interface DefaultDocumentMiddlewareOptions { } export function createDefaultDocumentMiddleware({ indexFilePath }: DefaultDocumentMiddlewareOptions) { - return function defaultDocumentMiddleware(req: any, res: any, next: any) { + 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..925be23c30 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) { 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..3af24925cf 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,5 +1,8 @@ +/* eslint-disable */ + import { ManifestInstance, RouteDefinition } from '@sitecore-jss/sitecore-jss-manifest'; import chalk from 'chalk'; +import {Request, Response} from 'express'; import { CustomizeRenderFunction, DisconnectedLayoutServiceOptions } from './DisconnectedLayoutServiceOptions'; /* @@ -219,6 +222,7 @@ export function remapFieldsArrayToFieldsObject(input: any) { }, {}); } +// eslint-disable-next-line @typescript-eslint/no-explicit-any function convertManifestLayoutDataToLayoutServiceFormat(manifestLayout: any, placeholders: string[], currentManifest: ManifestInstance, request: any, response: any, customizeHook?: CustomizeRenderFunction) { const result: any = {}; @@ -312,8 +316,8 @@ 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 @@ -349,7 +353,7 @@ export function createDisconnectedLayoutService({ } // lookup route data - const rawRoute = getRouteData(routePath, currentManifest); + const rawRoute = getRouteData(routePath as string, currentManifest); let route; if (rawRoute) { 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..82b96c1c0a 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'; @@ -11,7 +12,7 @@ export interface DisconnectedAssetMiddlewareOptions { } export function createDisconnectedAssetMiddleware({ manifestPath, staticRootPath }: DisconnectedAssetMiddlewareOptions) { - return function disconnectedAssetMiddleware(request: any, response: any) { + 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..e3c55c7972 100644 --- a/packages/sitecore-jss-dev-tools/src/index.ts +++ b/packages/sitecore-jss-dev-tools/src/index.ts @@ -12,7 +12,7 @@ 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'; diff --git a/packages/sitecore-jss-dev-tools/src/manifest-manager.ts b/packages/sitecore-jss-dev-tools/src/manifest-manager.ts index eb1803a4c8..9c0de2701a 100644 --- a/packages/sitecore-jss-dev-tools/src/manifest-manager.ts +++ b/packages/sitecore-jss-dev-tools/src/manifest-manager.ts @@ -27,13 +27,14 @@ export class ManifestManager { rootPath: string; watcher?: FSWatcher; watcherSourcePaths: string[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any manifestArgs: any; constructor({ rootPath = process.cwd(), sourceFiles = [ './sitecore/definitions/**/*.sitecore.js', - './sitecore/definitions/**/*.sitecore.ts', + './sitecore/definitions/**/*.sitecore.ts' ], watchOnlySourceFiles = [], requireArg = './sitecore/definitions/config.js', 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..83c409ee12 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,17 @@ 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 => { // 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 +64,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 +76,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); diff --git a/packages/sitecore-jss-dev-tools/src/package-deploy.ts b/packages/sitecore-jss-dev-tools/src/package-deploy.ts index 8bc57e012c..c0f9c267f1 100644 --- a/packages/sitecore-jss-dev-tools/src/package-deploy.ts +++ b/packages/sitecore-jss-dev-tools/src/package-deploy.ts @@ -39,7 +39,7 @@ function applyCertPinning(req: request.Request, options: PackageDeployOptions) { 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 @@ -54,7 +54,7 @@ function normalizeFingerprint(fp: string): string { // function implements the logic for that conversion. return fp.toLowerCase().replace(new RegExp(':', 'g'),''); } -function doFingerprintsMatch(fp1:string, fp2:string): boolean { +function doFingerprintsMatch(fp1: string, fp2: string): boolean { return normalizeFingerprint(fp1) === normalizeFingerprint(fp2); } async function watchJobStatus(options: PackageDeployOptions, taskName: string) { @@ -266,5 +266,5 @@ export async function packageDeploy(options: PackageDeployOptions) { applyCertPinning(req, options); }) - .then((taskName) => watchJobStatus(options, taskName)); + .then((taskName) => watchJobStatus(options, taskName)); } diff --git a/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts b/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts index 1c744ac39d..0c130ad3b8 100644 --- a/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts +++ b/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts @@ -10,14 +10,14 @@ export interface JssConfiguration { } export interface ScJssConfig { - sitecore: JssConfiguration; [configName: string]: JssConfiguration; + sitecore: JssConfiguration; } -export function resolveScJssConfig({ +export function resolveScJssConfig({ configPath = './scjssconfig.json', configName = 'sitecore', - assert = true + assert = true, } = {}): Promise<ScJssConfig> { return new Promise((resolvePromise, rejectPromise) => { resolve(configPath, { basedir: process.cwd() }, (error, jssConfigJson) => { diff --git a/packages/sitecore-jss-dev-tools/src/setup/setup.ts b/packages/sitecore-jss-dev-tools/src/setup/setup.ts index 63543a5925..ee7ecd065f 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/setup.ts @@ -22,7 +22,7 @@ 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.`); @@ -191,7 +191,7 @@ export function setup(interactive: boolean, outputFile?: string, initialData?: J + 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.`); + console.log('Deployment secret has been generated. Ensure the JSS app config on the Sitecore end has the same secret set.'); } if (configObject.deploySecret) { @@ -207,13 +207,13 @@ 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('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('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(''); } 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..20ea254e31 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts @@ -5,7 +5,7 @@ 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)`)); + 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?'); if (!runSetup) { @@ -15,7 +15,7 @@ export const verifySetup = () => { setup(true); - console.warn(chalk.yellow(`JSS app configuration must be deployed to Sitecore before continuing.`)); + 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) { From 229ac17f8b179e0cc911c1d18d6a97fb7a0f90cb Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 18:02:03 +0200 Subject: [PATCH 08/37] push sitecore-jss-forms --- packages/sitecore-jss-forms/package.json | 3 +- packages/sitecore-jss-forms/src/FormField.ts | 1 + .../sitecore-jss-forms/src/FormTracker.ts | 22 ++- .../src/JssFormData.test.ts | 154 +++++++++--------- .../sitecore-jss-forms/src/JssFormData.ts | 24 ++- .../sitecore-jss-forms/src/SitecoreForm.ts | 1 + .../src/getFieldValueFromModel.ts | 7 +- packages/sitecore-jss-forms/src/index.ts | 2 +- .../sitecore-jss-forms/src/serializeForm.ts | 9 +- packages/sitecore-jss-forms/src/submitForm.ts | 4 +- 10 files changed, 129 insertions(+), 98 deletions(-) diff --git a/packages/sitecore-jss-forms/package.json b/packages/sitecore-jss-forms/package.json index ac601f4c4c..56888ed795 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..2fff161366 100644 --- a/packages/sitecore-jss-forms/src/FormField.ts +++ b/packages/sitecore-jss-forms/src/FormField.ts @@ -5,6 +5,7 @@ export interface FormField<TViewModel extends ViewModel = ViewModel> { model: TViewModel; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function instanceOfFormField<T extends ViewModel>(object: any): object is FormField<T> { return 'model' in object; } diff --git a/packages/sitecore-jss-forms/src/FormTracker.ts b/packages/sitecore-jss-forms/src/FormTracker.ts index 6f298cd46b..bff56da275 100644 --- a/packages/sitecore-jss-forms/src/FormTracker.ts +++ b/packages/sitecore-jss-forms/src/FormTracker.ts @@ -19,7 +19,8 @@ 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<any> | void; export interface FormTrackerOptions { endpoint: string; @@ -49,7 +50,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; @@ -157,12 +163,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..8cffcd6ff7 100644 --- a/packages/sitecore-jss-forms/src/JssFormData.test.ts +++ b/packages/sitecore-jss-forms/src/JssFormData.test.ts @@ -3,81 +3,81 @@ 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..c7db237fd2 100644 --- a/packages/sitecore-jss-forms/src/JssFormData.ts +++ b/packages/sitecore-jss-forms/src/JssFormData.ts @@ -6,18 +6,29 @@ export class JssFormData { 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,6 +72,7 @@ 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, '+'); 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<FormField<any>>; } diff --git a/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts b/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts index 7f2e092e52..389a492583 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<any>) { +/** 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..02686ec78d 100644 --- a/packages/sitecore-jss-forms/src/index.ts +++ b/packages/sitecore-jss-forms/src/index.ts @@ -38,7 +38,7 @@ export { 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..e8f41dde51 100644 --- a/packages/sitecore-jss-forms/src/serializeForm.ts +++ b/packages/sitecore-jss-forms/src/serializeForm.ts @@ -15,13 +15,15 @@ import { FileInputViewModel, instanceOfInputViewModel } from './ViewModel'; export interface SerializeFormOptions { submitButtonName?: string | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any fieldValueParser?: (field: FormField<any>) => 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 +45,14 @@ export function serializeForm(form: SitecoreForm, options?: SerializeFormOptions return result; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any function pushFields(result: JssFormData, fields: Array<FormField<any>>, 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)) { diff --git a/packages/sitecore-jss-forms/src/submitForm.ts b/packages/sitecore-jss-forms/src/submitForm.ts index 227f170a62..1068556e20 100644 --- a/packages/sitecore-jss-forms/src/submitForm.ts +++ b/packages/sitecore-jss-forms/src/submitForm.ts @@ -16,8 +16,8 @@ export function createFetchBasedFormFetcher(options?: RequestInit): FormFetcher // Browser set 'Content-Type' automatically with multipart/form-data; boundary ...options, }) - .then((res) => res.json()) - .then((res) => res as FormResult); + .then((res) => res.json()) + .then((res) => res as FormResult); } export function submitForm(formData: JssFormData, endpoint: string, options?: FormSubmitOptions): Promise<FormResult> { From a76588b56e7fc3c540f1094e7cf094a0daafbd04 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 18:26:18 +0200 Subject: [PATCH 09/37] push sitecore-jss-manifest --- packages/sitecore-jss-manifest/package.json | 3 +- .../src/generator/dynamicPlaceholders.ts | 2 +- .../src/generator/generate.ts | 10 ++--- .../src/generator/manifest.types.ts | 33 +++++++------- .../generateContentItem/generateItem.ts | 4 +- .../expandReferencedContent.ts | 4 +- .../generateManifest/generateRouteItems.ts | 4 +- .../pipelines/generateMedia/utils.ts | 4 +- .../checkBlacklistedKeys.ts | 2 +- .../extractPlaceholdersFromItems.test.ts | 2 +- .../extractPlaceholdersFromRenderings.test.ts | 2 +- .../mergePlaceholders.test.ts | 4 +- .../removeDuplicates.test.ts | 2 +- .../generateRouteItem/pipeline.config.ts | 4 +- .../processRenderings.test.ts | 10 ++--- .../generateRouteItem/processRenderings.ts | 8 ++-- .../src/generator/utils.ts | 43 +++++++++++++------ .../testData/components/Welcome.sitecore.ts | 2 +- .../src/testData/components/async.sitecore.ts | 2 +- .../components/component0.sitecore.ts | 8 ++-- .../components/component1.sitecore.ts | 2 +- .../folder0/component0-0.sitecore.ts | 6 +-- .../src/testData/content/content.sitecore.ts | 2 +- .../src/testData/routes/route.ts | 2 +- .../src/testData/routes/routes.sitecore.ts | 2 +- .../sitecore-jss-manifest/src/typings.d.ts | 2 +- 26 files changed, 95 insertions(+), 74 deletions(-) diff --git a/packages/sitecore-jss-manifest/package.json b/packages/sitecore-jss-manifest/package.json index 1b71fc3ea9..5f71157713 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/dynamicPlaceholders.ts b/packages/sitecore-jss-manifest/src/generator/dynamicPlaceholders.ts index 10e6693668..ca4c36393f 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..d950fbbb74 100644 --- a/packages/sitecore-jss-manifest/src/generator/generate.ts +++ b/packages/sitecore-jss-manifest/src/generator/generate.ts @@ -112,7 +112,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 }); @@ -134,10 +134,10 @@ const getPipelineConfig = async ({ patchGlobs }: { patchGlobs: string[] }) => { }); const patchedConfig = patchGlobs ? await configLoader({ - fileGlobs: patchGlobs, - existingConfig: manifestConfig, - allowEmptyGlobs: true, - }) + fileGlobs: patchGlobs, + existingConfig: manifestConfig, + allowEmptyGlobs: true, + }) : manifestConfig; return patchedConfig; }; diff --git a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts index efeb605662..2bc1bdf5ce 100644 --- a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts +++ b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts @@ -157,8 +157,7 @@ export interface FieldDefinition { * 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. @@ -365,6 +364,7 @@ export interface ComponentInstanceDefinition extends ItemDefinition { } export interface GeneratePipelineArgs { + [key: string]: any; debug: boolean; skipPlaceholderBlacklist: boolean; components: ComponentDefinition[]; @@ -377,8 +377,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 +395,23 @@ 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..0cc1dabd75 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts @@ -24,7 +24,9 @@ export default (args: GenerateContentItemArgs) => { 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.`); }; + 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); } 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..ddae5403ba 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/expandReferencedContent.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/expandReferencedContent.ts @@ -27,7 +27,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/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/generateMedia/utils.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts index b1ccc23aeb..4678a454e0 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts @@ -27,7 +27,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); @@ -40,7 +40,7 @@ function getAllTemplateFields(template: any, templateCollection: any) { if (!inheritedTemplate || !inheritedTemplate.fields || !Array.isArray(inheritedTemplate.fields)) { return; } - + const inheritedFields = getAllTemplateFields(inheritedTemplate, templateCollection); if (inheritedFields) { allFields.push(...inheritedFields); 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..82b1c28306 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts @@ -28,7 +28,7 @@ export default (args: GeneratePlaceholdersPipelineArgs) => { 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.'); diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts index 786a0dc519..76df716a2f 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts @@ -16,7 +16,7 @@ describe('generatePlaceholders pipeline', () => { layout: { placeholders: expected.slice(2, 5), }, - }, + } ], placeholderNames: expected.slice(5, 7), }; diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts index deb4220c25..4f1873707e 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts @@ -13,7 +13,7 @@ describe('generatePlaceholders pipeline', () => { }, { exposedPlaceholders: expected.slice(2, 5), - }, + } ], placeholderNames: expected.slice(5, 7), }; 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..575a593106 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 @@ -5,7 +5,7 @@ describe('generatePlaceholders pipeline', () => { describe('mergePlaceholders processor', () => { it('should add placeholders that are not already in the collection', () => { const root = [ - 'porg', + 'porg' ]; const existing = [ @@ -20,7 +20,7 @@ describe('generatePlaceholders pipeline', () => { { name: 'ash', displayName: 'Ash', - }, + } ]; const additional = ['oak', 'maple']; const discovered = [...additional, ...existing.slice(0, 2).map((ph) => ph.name)]; diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts index 50c97c6c72..4a2587638e 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts @@ -14,7 +14,7 @@ describe('generatePlaceholders pipeline', () => { 'maple', '/lorem/ipsum/maple', '/sycamore', - 'poplar', + 'poplar' ], }; const result = removeDuplicates(args); 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..f0fb69770c 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 @@ -44,10 +44,10 @@ const defaultDatasourceDisplayNamer = ({ rendering: any, index: number }) => -`${rendering.componentName}-${index + 1}`; + `${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/processRenderings.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.test.ts index a0aeaa56fd..35411aff0e 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 @@ -16,7 +16,7 @@ const args = { }, { name: 'dolor', - }, + } ], componentFactory: (components: any, componentName: string) => components.find((component: any) => component.name === componentName), @@ -44,7 +44,7 @@ describe('generateRouteItem pipeline', () => { }, { componentName: 'dolor', - }, + } ], }, }; @@ -65,7 +65,7 @@ describe('generateRouteItem pipeline', () => { main: [ { componentName: 'lorem', - }, + } ], }, }; @@ -88,7 +88,7 @@ describe('generateRouteItem pipeline', () => { name: expectedName, displayName: expectedDisplayName, componentName: 'lorem', - }, + } ], }, }; @@ -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..44ad98d3f2 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts @@ -23,7 +23,7 @@ const generateRenderingParams = (component: any, rendering: any) => { { name: paramName, value: rendering.params[paramName], - }, + } ]; }, []); @@ -59,7 +59,9 @@ 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.`); }; + 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); } @@ -91,6 +93,7 @@ const createDataSourceItem = ({ datasourceDisplayNamer, ...context }: { + [key: string]: any rendering: any, datasourceNamer: (options: { item: any, @@ -103,7 +106,6 @@ const createDataSourceItem = ({ rendering: any, index: number }) => string, - [key: string]: any }) => { // 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 diff --git a/packages/sitecore-jss-manifest/src/generator/utils.ts b/packages/sitecore-jss-manifest/src/generator/utils.ts index f920c2e36e..7d28098029 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) => { @@ -15,12 +18,12 @@ export const filterObject = (obj: any, filter: (key: string, value: any) => bool }, {}); export const convertComponentDataToFields = ({ data, context: { item = {} as ItemDefinition } = {} }: - { - data: any, - context: { - item?: ItemDefinition, - } - }) => { +{ + data: any, + context: { + item?: ItemDefinition, + } +}) => { if (!data) { return; } @@ -147,19 +150,26 @@ 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<Array<TemplateDefinition | ComponentDefinition>>) -: TemplateDefinition | ComponentDefinition | null { +/** + * Finds a template definition by name in one or more arrays of template/component definitions + * @param {string} templateName + * @returns {TemplateDefinition | ComponentDefinition | null} template + */ +export function findTemplate(templateName: string, ...templates: Array<Array<TemplateDefinition | ComponentDefinition>>): 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) { + if (template && templateResult !== null) { // tslint:disable-next-line:no-string-throw throw `Template ${templateName} was defined more than once with the same name.`; } @@ -172,13 +182,20 @@ export function findTemplate(templateName: string, ...templates: Array<Array<Tem return templateResult; } -/** Validates that a set of field values are defined on their template definitions */ +/** + * Validates that a set of field values are defined on their template definitions + * @param {Object} fields + * @param {TemplateDefinition | ComponentDefinition} template + * @param {Function} handleError + * @returns {Object} validated fields + */ export function validateFieldDefinitions( fields: { [key: string]: any }, template: TemplateDefinition | ComponentDefinition, handleError: (fieldName: string) => void, ...inheritedTemplates: Array<Array<TemplateDefinition | ComponentDefinition>> ) { + // eslint-disable-next-line @typescript-eslint/no-empty-function inheritedTemplates.forEach(() => {}); return filterObject( diff --git a/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts index 3e98dd0e32..f9f7c3081d 100644 --- a/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts @@ -8,7 +8,7 @@ export default (manifest: Manifest) => { fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, { name: 'text', displayName: 'Text', type: CommonFieldTypes.RichText }, - { name: 'logoImage', displayName: 'LogoImage', type: CommonFieldTypes.Image }, + { name: 'logoImage', displayName: 'LogoImage', type: CommonFieldTypes.Image } ], placeholders: [], params: [], 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..a453835dc0 100644 --- a/packages/sitecore-jss-manifest/src/testData/components/async.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/components/async.sitecore.ts @@ -5,7 +5,7 @@ export default (manifest: Manifest) => { manifest1.addComponent({ name: 'AsyncComponent', placeholders: [ - { name: 'ph1' }, + { 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..8d065b1fb8 100644 --- a/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts @@ -7,13 +7,13 @@ export default (manifest: Manifest) => { displayName: 'Component0', fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, - { name: 'relatedItems', displayName: 'Related Items', type: CommonFieldTypes.ContentList }, + { name: 'relatedItems', displayName: 'Related Items', type: CommonFieldTypes.ContentList } ], placeholders: [ - { name: 'page-header' }, + { name: 'page-header' } ], params: [ - { name: 'param0' }, + { name: 'param0' } ], }); @@ -22,7 +22,7 @@ export default (manifest: Manifest) => { displayName: 'Related Item', fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, - { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image }, + { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image } ], }); }; 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..09f36738b0 100644 --- a/packages/sitecore-jss-manifest/src/testData/components/component1.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/components/component1.sitecore.ts @@ -6,7 +6,7 @@ export default (manifest: Manifest) => { displayName: 'Component1', placeholders: [ { name: 'page-header' }, - { name: 'page-content' }, + { 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..2564553d51 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 @@ -6,13 +6,13 @@ export default (manifest: Manifest) => { name: 'Component0-0', displayName: 'Component0-0', fields: [ - { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, + { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText } ], placeholders: [ - { name: 'page-header' }, + { name: 'page-header' } ], params: [ - { name: 'param1' }, + { name: 'param1' } ], }); }; diff --git a/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts index b64d4ed72d..e5addc6684 100644 --- a/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts @@ -9,7 +9,7 @@ export default (manifest: Manifest) => { fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, { name: 'body', displayName: 'Body', type: CommonFieldTypes.RichText }, - { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image }, + { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image } ], }); }; diff --git a/packages/sitecore-jss-manifest/src/testData/routes/route.ts b/packages/sitecore-jss-manifest/src/testData/routes/route.ts index 4eed983668..d3f7f0a2d4 100644 --- a/packages/sitecore-jss-manifest/src/testData/routes/route.ts +++ b/packages/sitecore-jss-manifest/src/testData/routes/route.ts @@ -20,7 +20,7 @@ export default { }, }, }, - }, + } ], }, }; 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..89f022b5a8 100644 --- a/packages/sitecore-jss-manifest/src/testData/routes/routes.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/routes/routes.sitecore.ts @@ -4,7 +4,7 @@ import data from './route'; export default (manifest: Manifest) => { json.children = [ - data, + 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; } From 92f545f855306a9fbaf5f5bc2957d2dd73feae82 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 18:32:24 +0200 Subject: [PATCH 10/37] push proxy --- packages/sitecore-jss-manifest/.eslintrc | 7 +++++++ packages/sitecore-jss-proxy/.eslintrc | 7 +++++++ packages/sitecore-jss-proxy/package.json | 3 ++- packages/sitecore-jss-proxy/src/ProxyConfig.ts | 1 + packages/sitecore-jss-proxy/src/index.test.ts | 2 +- packages/sitecore-jss-proxy/src/index.ts | 11 +++++------ packages/sitecore-jss-proxy/src/util.test.ts | 1 + 7 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 packages/sitecore-jss-manifest/.eslintrc create mode 100644 packages/sitecore-jss-proxy/.eslintrc diff --git a/packages/sitecore-jss-manifest/.eslintrc b/packages/sitecore-jss-manifest/.eslintrc new file mode 100644 index 0000000000..9126f7b2a2 --- /dev/null +++ b/packages/sitecore-jss-manifest/.eslintrc @@ -0,0 +1,7 @@ +{ + "extends": "../../.eslintrc", + "rules": { + // TODO: around 190 errors + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/packages/sitecore-jss-proxy/.eslintrc b/packages/sitecore-jss-proxy/.eslintrc new file mode 100644 index 0000000000..9126f7b2a2 --- /dev/null +++ b/packages/sitecore-jss-proxy/.eslintrc @@ -0,0 +1,7 @@ +{ + "extends": "../../.eslintrc", + "rules": { + // TODO: around 190 errors + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/packages/sitecore-jss-proxy/package.json b/packages/sitecore-jss-proxy/package.json index 30c444a1a0..00cf3b3c02 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..2585a3c05f 100644 --- a/packages/sitecore-jss-proxy/src/ProxyConfig.ts +++ b/packages/sitecore-jss-proxy/src/ProxyConfig.ts @@ -43,6 +43,7 @@ export interface ProxyConfig { response: ServerResponse, proxyResponse: IncomingMessage, layoutServiceData: any + // eslint-disable-next-line @typescript-eslint/ban-types ) => Promise<object>; /** Hook to alter HTTP headers in a custom way. */ setHeaders?: ( diff --git a/packages/sitecore-jss-proxy/src/index.test.ts b/packages/sitecore-jss-proxy/src/index.test.ts index 784d985ade..5729dbe43f 100644 --- a/packages/sitecore-jss-proxy/src/index.test.ts +++ b/packages/sitecore-jss-proxy/src/index.test.ts @@ -7,7 +7,7 @@ describe('removeEmptyAnalyticsCookie', () => { const mockResponse = { headers: { 'set-cookie': [ - 'SC_ANALYTICS_GLOBAL_COOKIE=; expires=Wed, 17-Mar-2027 14:28:58 GMT; path=/; HttpOnly', + 'SC_ANALYTICS_GLOBAL_COOKIE=; expires=Wed, 17-Mar-2027 14:28:58 GMT; path=/; HttpOnly' ], }, }; diff --git a/packages/sitecore-jss-proxy/src/index.ts b/packages/sitecore-jss-proxy/src/index.ts index 645c510145..6fca590539 100644 --- a/packages/sitecore-jss-proxy/src/index.ts +++ b/packages/sitecore-jss-proxy/src/index.ts @@ -53,7 +53,7 @@ async function renderAppToResponse( proxyResponse.headers['content-type'] = 'text/html; charset=utf-8'; // remove IIS server header for security - delete proxyResponse.headers['server']; + delete proxyResponse.headers.server; if (config.setHeaders) { config.setHeaders(request, serverResponse, proxyResponse); @@ -89,7 +89,6 @@ async function renderAppToResponse( }; - async function extractLayoutServiceDataFromProxyResponse(): Promise<any> { if ( proxyResponse.statusCode === HttpStatus.OK || @@ -187,7 +186,7 @@ async function renderAppToResponse( result.status = 302; } - proxyResponse.headers['location'] = result.redirect; + proxyResponse.headers.location = result.redirect; } const finalStatusCode = result.status || proxyResponse.statusCode || HttpStatus.OK; @@ -355,7 +354,7 @@ export function rewriteRequestPath( } if (config.debug) { - console.log(`DEBUG: parseRouteUrl() result`, routeParams); + console.log('DEBUG: parseRouteUrl() result', routeParams); } } } @@ -375,7 +374,7 @@ export function rewriteRequestPath( return path; } -function isUrlIgnored(originalUrl: string, config: ProxyConfig, noDebug: boolean = false): boolean { +function isUrlIgnored(originalUrl: string, config: ProxyConfig, noDebug = false): boolean { if (config.pathRewriteExcludePredicate && config.pathRewriteExcludeRoutes) { console.error( 'ERROR: pathRewriteExcludePredicate and pathRewriteExcludeRoutes were both provided in config. Provide only one.' @@ -431,7 +430,7 @@ function isUrlIgnored(originalUrl: string, config: ProxyConfig, noDebug: boolean function handleProxyRequest(proxyReq: any, req: any, res: ServerResponse, config: ProxyConfig, customOnProxyReq: ((proxyReq: ClientRequest, req: IncomingMessage, res: ServerResponse) => void) | undefined) { - + // if a HEAD request, we still need to issue a GET so we can return accurate headers // proxyReq defined as 'any' to allow us to mutate this if (proxyReq.method === 'HEAD' && !isUrlIgnored(req.originalUrl, config, true)) { diff --git a/packages/sitecore-jss-proxy/src/util.test.ts b/packages/sitecore-jss-proxy/src/util.test.ts index ba21305a84..3133eb1ddb 100644 --- a/packages/sitecore-jss-proxy/src/util.test.ts +++ b/packages/sitecore-jss-proxy/src/util.test.ts @@ -9,6 +9,7 @@ describe('tryParseJson', () => { }); it('should return false when the string is not json', () => { + // eslint-disable-next-line no-unused-expressions expect(tryParseJson('<html />')).to.be.null; }); }); From 43ef4ac77106a785ad2557a42afe9151d8a4b8ff Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Thu, 17 Dec 2020 18:32:47 +0200 Subject: [PATCH 11/37] Push default eslintrc --- .eslintrc | 83 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 22 deletions(-) diff --git a/.eslintrc b/.eslintrc index 1957d779a7..1e3a7d078e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,31 +1,70 @@ { "root": true, - "parser": "babel-eslint", - "extends": ["airbnb-base", "prettier", "plugin:import/errors", "plugin:import/warnings"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "env": { + "browser": true, + "node": true, + "es6": true + }, "rules": { - "prettier/prettier": "error", - "import/prefer-default-export": "off", - "import/no-extraneous-dependencies": [ + "@typescript-eslint/indent": ["error", 2], + "@typescript-eslint/naming-convention": [ "error", { - "devDependencies": true, - "optionalDependencies": true + "format": ["PascalCase"], + "selector": "typeLike", + "custom": { + "regex": "^I[A-Z]", + "match": false + } } ], - "linebreak-style": ["error", "windows"], - "arrow-body-style": ["warn", "as-needed"], - "arrow-parens": ["error", "always"], - "no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "radix": ["error", "as-needed"], - "prefer-destructuring": "off" - }, - "plugins": ["import", "prettier"], - "settings": { - "import/ignore": ["node_modules", ".png$", ".jpg$"] + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/member-ordering": "error", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "variables": false }], + "@typescript-eslint/typedef": "error", + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/semi": "error", + "@typescript-eslint/no-var-requires": "off", + "no-restricted-globals": "off", + "no-restricted-properties": "off", + "spaced-comment": "error", + "curly": ["error", "multi-line"], + "eol-last": ["error", "always"], + "guard-for-in": "error", + "valid-jsdoc": ["error", { "requireParamDescription": false, "requireReturn": false, "requireReturnType": false }], + "no-unused-labels": "error", + "max-len": "off", + "no-caller": "error", + "no-bitwise": "error", + "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-debugger": "error", + "no-empty": "error", + "no-eval": "error", + "dot-notation": "error", + "no-fallthrough": "error", + "no-trailing-spaces": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], + "brace-style": "error", + "quotes": ["error", "single"], + "radix": "error", + "default-case": "error", + "comma-dangle": ["error", { "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline" }], + "eqeqeq": "error" } } From 9ce1ded0bfdbdca3e955a1bb8322ae6c14e7047d Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 10:29:03 +0200 Subject: [PATCH 12/37] push react-forms --- packages/sitecore-jss-react-forms/.eslintrc | 18 ++++ .../sitecore-jss-react-forms/package.json | 5 +- .../src/FieldProps.ts | 1 + .../src/ValidationDataModels.ts | 8 +- .../components/field-templates/checkbox.tsx | 1 + .../field-templates/dropdown-list.tsx | 2 +- .../field-validation-errors.tsx | 1 + .../field-templates/file-upload.test.tsx | 25 +++-- .../field-templates/file-upload.tsx | 4 +- .../src/components/field-templates/label.tsx | 1 + .../components/field-templates/list-box.tsx | 2 +- .../field-templates/radio-button-list.tsx | 2 +- .../src/components/field-templates/text.tsx | 2 +- .../src/components/form.tsx | 18 +++- .../src/field-factory.tsx | 2 + .../src/tests/enzyme-setup.ts | 2 +- .../src/tests/jsdom-setup.ts | 19 ++-- .../src/tests/shim.ts | 6 +- packages/sitecore-jss-react-forms/tslint.json | 100 ------------------ 19 files changed, 79 insertions(+), 140 deletions(-) create mode 100644 packages/sitecore-jss-react-forms/.eslintrc delete mode 100644 packages/sitecore-jss-react-forms/tslint.json diff --git a/packages/sitecore-jss-react-forms/.eslintrc b/packages/sitecore-jss-react-forms/.eslintrc new file mode 100644 index 0000000000..80c5b66b75 --- /dev/null +++ b/packages/sitecore-jss-react-forms/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": [ + "plugin:react/recommended", + "../../.eslintrc" + ], + "plugins": ["react"], + "settings": { + "react": { + "version": "detect" + } + }, + "globals": { + "React": "writable" + }, + "rules": { + "react/prop-types": "off" // TODO: fix errors + } +} diff --git a/packages/sitecore-jss-react-forms/package.json b/packages/sitecore-jss-react-forms/package.json index 07aa544dbb..412b214baf 100644 --- a/packages/sitecore-jss-react-forms/package.json +++ b/packages/sitecore-jss-react-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/**/*.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.tsx\"", "prepublishOnly": "npm run build" }, @@ -35,13 +35,14 @@ "del-cli": "^3.0.1", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2", + "eslint": "^7.15.0", + "eslint-plugin-react": "^7.21.5", "jsdom": "^16.2.2", "mocha": "^7.2.0", "react": "^16.10.2", "react-dom": "^16.10.2", "sinon": "^9.0.2", "ts-node": "^8.4.1", - "tslint-react": "^4.1.0", "typescript": "^3.6.3" }, "peerDependencies": { diff --git a/packages/sitecore-jss-react-forms/src/FieldProps.ts b/packages/sitecore-jss-react-forms/src/FieldProps.ts index c7bb4d0c5d..3b6547a24f 100644 --- a/packages/sitecore-jss-react-forms/src/FieldProps.ts +++ b/packages/sitecore-jss-react-forms/src/FieldProps.ts @@ -45,4 +45,5 @@ export type FieldChangeCallback = (fieldName: string, newValue: string | string[ export type ListFieldProps<TViewModel extends ListViewModel = ListViewModel> = FieldWithValueProps<ValueFormField<TViewModel>, string[]>; export type ValueFieldProps<TViewModel extends InputViewModel = InputViewModel> = FieldWithValueProps<ValueFormField<TViewModel>>; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type LabelProps<TViewModel extends InputViewModel = InputViewModel> = FieldWithValueProps<ValueFormField<TViewModel>, any>; diff --git a/packages/sitecore-jss-react-forms/src/ValidationDataModels.ts b/packages/sitecore-jss-react-forms/src/ValidationDataModels.ts index 106a0eeae8..f4c2fb763e 100644 --- a/packages/sitecore-jss-react-forms/src/ValidationDataModels.ts +++ b/packages/sitecore-jss-react-forms/src/ValidationDataModels.ts @@ -1,5 +1,5 @@ export enum ValidationDataModels { - FileSizeValidator = '{8F2B6077-FE63-4FB2-8740-EF3807BBDB84}', - FileTypeValidator = '{D81E056F-6C2E-4414-BD46-BA464AC05202}', - FileCountValidator = '{F42833A6-F364-4721-ABFC-337E0CC3FD75}', -} \ No newline at end of file + FileSizeValidator = '{8F2B6077-FE63-4FB2-8740-EF3807BBDB84}', + FileTypeValidator = '{D81E056F-6C2E-4414-BD46-BA464AC05202}', + FileCountValidator = '{F42833A6-F364-4721-ABFC-337E0CC3FD75}', +} diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx index 0416502d0c..b4a72b0887 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx @@ -28,6 +28,7 @@ const Checkbox: React.FunctionComponent<ValueFieldProps> = (props) => { function handleOnChange(field: ValueFormField, fieldValue: boolean, callback: FieldChangeCallback) { // (fieldName, fieldValue, isValid, validationErrors) + // eslint-disable-next-line @typescript-eslint/no-explicit-any callback(field.valueField.name, fieldValue as any, true, []); } diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx index 72c8fd75b5..e02e30f747 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx @@ -13,7 +13,7 @@ const DropdownList: React.FunctionComponent<ListFieldProps<DropdownListViewModel value, onChange, tracker, - errors + errors, } = props; return ( diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/field-validation-errors.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/field-validation-errors.tsx index cf5d9633f2..ac310330ee 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/field-validation-errors.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/field-validation-errors.tsx @@ -7,6 +7,7 @@ const FieldValidationErrors: React.FunctionComponent<LabelProps> = (props) => { // strip the errors component from the custom component props // (prevents infinite loop rendering if someone reuses this component as a custom error component) + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { fieldValidationErrorsComponent, ...errorsComponentProps } = props; return <CustomError {...errorsComponentProps} />; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx index f471e1d184..db4d53123a 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx @@ -1,3 +1,6 @@ +/* eslint-disable no-unused-expressions */ +/* eslint-disable react/display-name */ + import { expect } from 'chai'; import sinon from 'sinon'; import { shallow } from 'enzyme'; @@ -12,7 +15,7 @@ describe('<FileUpload />', () => { valueField: { id: 'value_field_id_xxx', name: 'value_field_name_xxx', - value: 'value_field_name_xxx' + value: 'value_field_name_xxx', }, model: { itemId: 'model_item_id', @@ -35,18 +38,18 @@ describe('<FileUpload />', () => { { itemId: 'xxx', message: 'xxx_message', name: 'xxx_name' }, { itemId: 'yyy', message: 'yyy_message', name: 'yyy_name' }, { itemId: 'zzz', message: 'zzz_message', name: 'zzz_name' } - ] + ], }, indexField: { id: 'index_field_id_xxx', name: 'index_field_name_xxx', - value: 'index_field_name_xxx' + value: 'index_field_name_xxx', }, fieldIdField: { id: 'field_id_field_id_xxx', name: 'field_id_field_name_xxx', - value: 'field_id_field_name_xxx' - } + value: 'field_id_field_name_xxx', + }, }, value: 'val', isValid: true, @@ -54,7 +57,7 @@ describe('<FileUpload />', () => { fieldFactory: () => <div>xxx</div>, onChange: sinon.spy(), onButtonClick: sinon.spy(), - tracker: new FormTracker({ endpoint: 'xxx_endpoint' }) + tracker: new FormTracker({ endpoint: 'xxx_endpoint' }), }; it('should file input', () => { @@ -76,17 +79,17 @@ describe('<FileUpload />', () => { expect(inst.getEnabledValidation('yyy')).to.deep.equal({ itemId: 'yyy', message: 'yyy_message', - name: 'yyy_name' + name: 'yyy_name', }); - expect(inst.getEnabledValidation('zzz')).to.deep.equal({ + expect(inst.getEnabledValidation('zzz')).to.deep.equal({ itemId: 'zzz', message: 'zzz_message', - name: 'zzz_name' + name: 'zzz_name', }); - expect(inst.getEnabledValidation('xxx')).to.deep.equal({ + expect(inst.getEnabledValidation('xxx')).to.deep.equal({ itemId: 'xxx', message: 'xxx_message', - name: 'xxx_name' + name: 'xxx_name', }); expect(inst.getEnabledValidation('ggg')).to.equal(undefined); }); diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx index 95b7e7e1c9..138d76a1e1 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx @@ -12,7 +12,7 @@ class FileUpload extends Component<ValueFieldProps<FileInputViewModel>> { '1': 'Bytes', '1024': 'KB', '1048576': 'MB', - '1073741824': 'GB' + '1073741824': 'GB', }; componentDidUpdate(prevProps: ValueFieldProps<FileInputViewModel>) { @@ -85,7 +85,7 @@ class FileUpload extends Component<ValueFieldProps<FileInputViewModel>> { } cb(field.valueField.name, list, valid, errorMessages); - } + }; render() { const { field, value, onChange, errors, tracker } = this.props; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/label.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/label.tsx index 5889b58651..b125bd50b8 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/label.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/label.tsx @@ -7,6 +7,7 @@ const Label: React.FunctionComponent<LabelProps> = (props) => { // strip the label component from the custom component props // (prevents infinite loop rendering if someone reuses this component as a custom label component) + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { labelComponent, ...labelComponentProps } = props; return <CustomLabel {...labelComponentProps} />; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx index f831669fc4..eef54bd9b8 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx @@ -13,7 +13,7 @@ const ListBox: React.FunctionComponent<ListFieldProps<ListBoxViewModel>> = (prop value, onChange, tracker, - errors + errors, } = props; let finalValue: string | string[] = value; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx index 7a6760f458..630405fcf6 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx @@ -13,7 +13,7 @@ const RadioButtonList: React.FunctionComponent<ListFieldProps> = (props) => { value, onChange, tracker, - errors + errors, } = props; return ( diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx index f3585447fa..0c53c3861a 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx @@ -3,7 +3,7 @@ import { FieldWithValueProps } from '../../FieldProps'; import { FormField, TextViewModel } from '@sitecore-jss/sitecore-jss-forms'; const TextField: React.FunctionComponent<FieldWithValueProps<FormField<TextViewModel>, string>> = ({ field }) => { - const Tag: any = field.model.htmlTag || 'p'; + const Tag = (field.model.htmlTag || 'p') as keyof JSX.IntrinsicElements; return <Tag className={field.model.cssClass}>{field.model.text}</Tag>; }; diff --git a/packages/sitecore-jss-react-forms/src/components/form.tsx b/packages/sitecore-jss-react-forms/src/components/form.tsx index eae6fff072..2be3cc67ed 100644 --- a/packages/sitecore-jss-react-forms/src/components/form.tsx +++ b/packages/sitecore-jss-react-forms/src/components/form.tsx @@ -28,6 +28,7 @@ export interface FormProps { sitecoreApiKey: string; onRedirect?: (url: string) => void; errorComponent?: ComponentType<ErrorComponentProps>; + // eslint-disable-next-line @typescript-eslint/no-explicit-any fieldWrapperComponent?: ComponentType<FieldWithValueProps<any>>; /** Optionally override the label component for any field components that render a label */ @@ -72,6 +73,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> // the form passed in from props if present nextForm: null, submitButton: null, + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any; // workaround index type limitations in TS this.createFieldComponent = this.createFieldComponent.bind(this); @@ -113,6 +115,8 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> /** * Creates a field component to render a field based on the form schema data + * @param {FormField} field + * @returns {React.ReactNode} field component */ createFieldComponent(field: FormField): React.ReactNode { const props = { @@ -125,7 +129,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> labelComponent: this.props.labelComponent, tracker: this._tracker, ...this.getCurrentFieldState(field), - } as FieldWithValueProps<any>; + } as FieldWithValueProps; const component = (this.props.fieldFactory || DefaultFieldFactory).get(field, props); @@ -143,6 +147,8 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> * - The form schema/current data (default values, previously saved steps in multistep) * - This component's state (the mutated state of the field after user changes) * The field state includes both current value as well as current validity. + * @param {FormField} field + * @returns {Object | null} field state */ getCurrentFieldState(field: FormField) { // non-valued fields, i.e. text, section, do not have a value or validity state @@ -186,6 +192,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> /** * Handler triggered by child components that informs us which button triggered a submit. * This is important for multistep forms to disambiguate between back and next/submit buttons. + * @param {string} buttonName */ onButtonClick(buttonName: string) { this.setState({ submitButton: buttonName }); @@ -194,10 +201,10 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> /** * Handler triggered by child components that updates a given field's current value * (which we then push back down to the child via prop) - * @param key Field's name attribute - * @param value New field value - * @param isValid Whether the field is valid or not - * @param errors Validation error message(s) if field is invalid + * @param {string} key Field's name attribute + * @param {string | string[] | File[]} value New field value + * @param {boolean} isValid Whether the field is valid or not + * @param {string[]} errors Validation error message(s) if field is invalid */ onFieldChange(key: string, value: string | string[] | File[], isValid: boolean, errors: string[]) { this.setState({ @@ -208,6 +215,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> /** * Handler triggered when the form is submitted. May transition its state between * steps in a multistep form or handle a final submit. + * @param {FormEvent} e */ onSubmit(e: FormEvent) { e.preventDefault(); diff --git a/packages/sitecore-jss-react-forms/src/field-factory.tsx b/packages/sitecore-jss-react-forms/src/field-factory.tsx index 40292a0a63..fdcd87f551 100644 --- a/packages/sitecore-jss-react-forms/src/field-factory.tsx +++ b/packages/sitecore-jss-react-forms/src/field-factory.tsx @@ -12,10 +12,12 @@ export type FormFieldComponent<TProps extends FieldProps> = React.ComponentType< * but it maps form element components instead of layout components */ class FieldFactory { + // eslint-disable-next-line @typescript-eslint/no-explicit-any private _fieldMap = new Map<string, React.ComponentType<any>>(); private _defaultComponent: React.ComponentType<FormField>; constructor() { + // eslint-disable-next-line react/display-name this._defaultComponent = (props: FormField) => ( <div key={props.model.fieldTypeItemId}>{props.model.name}: No renderer for form element type {props.model.fieldTypeItemId}</div> ); diff --git a/packages/sitecore-jss-react-forms/src/tests/enzyme-setup.ts b/packages/sitecore-jss-react-forms/src/tests/enzyme-setup.ts index 7a1fee7e80..82edfc9e5a 100644 --- a/packages/sitecore-jss-react-forms/src/tests/enzyme-setup.ts +++ b/packages/sitecore-jss-react-forms/src/tests/enzyme-setup.ts @@ -1,4 +1,4 @@ import { configure } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; -configure({ adapter: new Adapter() }); \ No newline at end of file +configure({ adapter: new Adapter() }); diff --git a/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts b/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts index 76663a9b88..a160ddd7d1 100644 --- a/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts @@ -1,7 +1,8 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ // https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md declare module 'style-attr'; -declare var global: any; +declare let global: any; const { JSDOM } = require('jsdom'); @@ -9,20 +10,20 @@ const jsdom = new JSDOM('<!doctype html><html><body></body></html>'); const jsDomWindow = jsdom.window; 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), - }), {}); + const props = Object.getOwnPropertyNames(src) + .filter(prop => typeof target[prop] === 'undefined') + .reduce((result, prop) => ({ + ...result, + [prop]: Object.getOwnPropertyDescriptor(src, prop), + }), {}); - Object.defineProperties(target, props); + Object.defineProperties(target, props); } global.window = jsDomWindow; global.document = jsDomWindow.document; global.navigator = { - userAgent: 'node.js', + userAgent: 'node.js', }; global.HTMLElement = jsDomWindow.HTMLElement; // makes chai "happy" https://github.com/chaijs/chai/issues/1029 diff --git a/packages/sitecore-jss-react-forms/src/tests/shim.ts b/packages/sitecore-jss-react-forms/src/tests/shim.ts index d3edff7b90..01004c2437 100644 --- a/packages/sitecore-jss-react-forms/src/tests/shim.ts +++ b/packages/sitecore-jss-react-forms/src/tests/shim.ts @@ -1,8 +1,10 @@ +/* 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 -declare var global: any; +declare let global: any; global.requestAnimationFrame = (callback: any) => { - setTimeout(callback, 0); + setTimeout(callback, 0); }; diff --git a/packages/sitecore-jss-react-forms/tslint.json b/packages/sitecore-jss-react-forms/tslint.json deleted file mode 100644 index 4b5c71f249..0000000000 --- a/packages/sitecore-jss-react-forms/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" - ] - } -} From 215fa8f22d0903d2072747d1c1e87799632aa099 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 11:15:01 +0200 Subject: [PATCH 13/37] push sitecore-jss-react-native --- packages/sitecore-jss-react-native/.eslintrc.json | 3 +-- packages/sitecore-jss-react-native/package.json | 3 +-- .../src/components/Date.tsx | 4 ++-- .../src/components/Image.tsx | 14 +++++++------- .../src/components/Link.tsx | 8 ++++---- .../src/components/PlaceholderCommon.tsx | 15 +++++++-------- .../src/components/RichText.tsx | 2 +- .../src/components/Text.tsx | 2 +- .../src/dataConversion.ts | 8 ++++++-- .../src/enhancers/withComponentFactory.test.tsx | 8 ++++---- packages/sitecore-jss-react-native/tslint.json | 13 ------------- 11 files changed, 34 insertions(+), 46 deletions(-) delete mode 100644 packages/sitecore-jss-react-native/tslint.json diff --git a/packages/sitecore-jss-react-native/.eslintrc.json b/packages/sitecore-jss-react-native/.eslintrc.json index 714c2897c1..43263a11ad 100644 --- a/packages/sitecore-jss-react-native/.eslintrc.json +++ b/packages/sitecore-jss-react-native/.eslintrc.json @@ -1,6 +1,5 @@ { - "root": true, - "extends": ["plugin:@typescript-eslint/recommended"], + "extends": ["../../.eslintrc"], "parser": "@typescript-eslint/parser", "plugins": ["react-native", "@typescript-eslint"], "parserOptions": { diff --git a/packages/sitecore-jss-react-native/package.json b/packages/sitecore-jss-react-native/package.json index 36bf1e1346..27c39e70fc 100644 --- a/packages/sitecore-jss-react-native/package.json +++ b/packages/sitecore-jss-react-native/package.json @@ -49,13 +49,12 @@ "@types/react-native": "^0.60.17", "@types/react-native-htmlview": "^0.12.2", "@types/react-test-renderer": "^16.9.0", - "@typescript-eslint/eslint-plugin": "^4.10.0", - "@typescript-eslint/parser": "^4.10.0", "babel-core": "6.26.3", "babel-jest": "^24.9.0", "babel-preset-env": "^1.7.0", "del-cli": "^3.0.1", "eslint": "^7.15.0", + "eslint-plugin-react-native": "^3.10.0", "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "react": "16.13.1", diff --git a/packages/sitecore-jss-react-native/src/components/Date.tsx b/packages/sitecore-jss-react-native/src/components/Date.tsx index 173f810dc6..2c7355c93b 100644 --- a/packages/sitecore-jss-react-native/src/components/Date.tsx +++ b/packages/sitecore-jss-react-native/src/components/Date.tsx @@ -4,6 +4,7 @@ import { Text } from 'react-native'; import HtmlView from 'react-native-htmlview'; export interface DateFieldProps { + [htmlAttributes: string]: unknown; /** The date field data. */ field: { value?: string; @@ -16,7 +17,6 @@ export interface DateFieldProps { */ editable?: boolean; render?: (date: Date | null) => React.ComponentType | React.ReactNode; - [htmlAttributes: string]: unknown; } export const DateField: React.FunctionComponent<DateFieldProps> = ({ @@ -40,7 +40,7 @@ export const DateField: React.FunctionComponent<DateFieldProps> = ({ if (field.editable && editable) { return <HtmlView value={children as string} {...otherProps} />; } - return render + return render ? <>{children}</> : <Text>{children}</Text>; }; diff --git a/packages/sitecore-jss-react-native/src/components/Image.tsx b/packages/sitecore-jss-react-native/src/components/Image.tsx index 4a01858830..633648babb 100644 --- a/packages/sitecore-jss-react-native/src/components/Image.tsx +++ b/packages/sitecore-jss-react-native/src/components/Image.tsx @@ -5,12 +5,12 @@ import SvgUri from 'react-native-svg-uri'; import { mediaApi } from '@sitecore-jss/sitecore-jss'; export interface ImageFieldValue { + /** HTML attributes that will be appended to the rendered <img /> tag. */ + [attributeName: string]: unknown; src?: string | number; width?: number; height?: number; style?: unknown; - /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: unknown; } export interface ImageField { @@ -19,6 +19,9 @@ export interface ImageField { } export interface ImageProps { + /** HTML attributes that will be appended to the rendered <img /> tag. */ + + [attributeName: string]: unknown; /** The image field data. */ media: ImageField | ImageFieldValue | null; field?: ImageField | ImageFieldValue | null; @@ -31,9 +34,6 @@ export interface ImageProps { [paramName: string]: string; } | null; - - /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: unknown; } const getImageAttrs = ( @@ -44,11 +44,11 @@ const getImageAttrs = ( style, ...otherAttrs }: { + [attr: string]: unknown; src?: string | number; width?: number | undefined; height?: number | undefined; style?: unknown; - [attr: string]: unknown; }, imageUrlParams?: { [paramName: string]: string } | null ) => { @@ -129,7 +129,7 @@ Image.propTypes = { }), PropTypes.shape({ value: PropTypes.object, - }), + }) ]), imageUrlParams: PropTypes.any, }; diff --git a/packages/sitecore-jss-react-native/src/components/Link.tsx b/packages/sitecore-jss-react-native/src/components/Link.tsx index f3b832fe50..ce791e832f 100644 --- a/packages/sitecore-jss-react-native/src/components/Link.tsx +++ b/packages/sitecore-jss-react-native/src/components/Link.tsx @@ -4,9 +4,9 @@ import HtmlView from 'react-native-htmlview'; import { Text, View, Linking, TouchableWithoutFeedback } from 'react-native'; export interface LinkFieldValue { + [attributeName: string]: unknown; href?: string; text?: string; - [attributeName: string]: unknown; } export interface LinkField { @@ -73,10 +73,10 @@ export const Link: React.FunctionComponent<LinkProps> = ({ } // handle link directly on field for forgetful devs - const link = ((dynamicField as LinkFieldValue).href + const link = ((dynamicField as LinkFieldValue).href ? field : (dynamicField as LinkField).value) as LinkFieldValue; - + if (!link) { return null; } @@ -104,7 +104,7 @@ Link.propTypes = { value: PropTypes.object, editableFirstPart: PropTypes.string, editableLastPart: PropTypes.string, - }), + }) ]).isRequired, editable: PropTypes.bool, }; diff --git a/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx b/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx index 707747c156..b3b5696897 100644 --- a/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx +++ b/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx @@ -12,6 +12,7 @@ import { import { UnrenderableComponent } from './UnrenderableComponent'; export interface PlaceholderProps { + [key: string]: unknown; /** Name of the placeholder to render. */ name: string; /** Rendering data to be used when rendering the placeholder. */ @@ -53,8 +54,6 @@ export interface PlaceholderProps { * but are not renderable by react-native (i.e. DOM elements) */ unrenderableComponentComponent?: React.ComponentClass<unknown> | React.SFC<unknown> | null; - - [key: string]: unknown; } export class PlaceholderCommon extends React.Component<PlaceholderProps> { @@ -72,6 +71,12 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { nodeRefs: unknown[]; state: Readonly<{ error?: Error }>; + constructor(props: PlaceholderProps) { + super(props); + this.nodeRefs = []; + this.state = {}; + } + static getPlaceholderDataFromRenderingData( rendering: ComponentRendering | RouteData, name: string @@ -95,12 +100,6 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { return result; } - constructor(props: PlaceholderProps) { - super(props); - this.nodeRefs = []; - this.state = {}; - } - componentDidCatch(error: Error) { this.setState({ error }); } diff --git a/packages/sitecore-jss-react-native/src/components/RichText.tsx b/packages/sitecore-jss-react-native/src/components/RichText.tsx index 6cc3c41bda..d55e4977cc 100644 --- a/packages/sitecore-jss-react-native/src/components/RichText.tsx +++ b/packages/sitecore-jss-react-native/src/components/RichText.tsx @@ -3,12 +3,12 @@ import HtmlView from 'react-native-htmlview'; import PropTypes from 'prop-types'; export interface RichTextProps { + [htmlViewProps: string]: unknown; /** The rich text field data. */ field: { value?: string; editable?: string; } | null; - [htmlViewProps: string]: unknown; } export const RichText: React.SFC<RichTextProps> = ({ field, ...otherProps }) => { diff --git a/packages/sitecore-jss-react-native/src/components/Text.tsx b/packages/sitecore-jss-react-native/src/components/Text.tsx index 4d50562abb..716217a402 100644 --- a/packages/sitecore-jss-react-native/src/components/Text.tsx +++ b/packages/sitecore-jss-react-native/src/components/Text.tsx @@ -3,12 +3,12 @@ import PropTypes from 'prop-types'; import { Text as NativeText } from 'react-native'; export interface TextProps { + [nativeTextProps: string]: unknown; /** The text field data. */ field: { value?: string; editable?: string; } | null; - [nativeTextProps: string]: unknown; } export const Text: React.SFC<TextProps> = ({ field, ...otherProps }) => { diff --git a/packages/sitecore-jss-react-native/src/dataConversion.ts b/packages/sitecore-jss-react-native/src/dataConversion.ts index 9083780a81..4ebdc0ef2d 100644 --- a/packages/sitecore-jss-react-native/src/dataConversion.ts +++ b/packages/sitecore-jss-react-native/src/dataConversion.ts @@ -10,6 +10,8 @@ const isComponentRendering = (element: unknown) => (element as ComponentRenderin /** * Receives dev prop data and creates or assigns "value/editable" values where needed to match signature of LayoutService data. + * @param {Object | undefined} propData + * @returns {Object} prop data in layout service format */ export const convertPropDataToLayoutServiceFormat = ( propData: @@ -46,8 +48,8 @@ export const convertPropDataToLayoutServiceFormat = ( if (!('value' in propValue) && !('editable' in propValue)) { return { ...propValue, - fields: convertPropDataToLayoutServiceFormat(propValue.fields) - } + fields: convertPropDataToLayoutServiceFormat(propValue.fields), + }; } // assume propValue _should_ always contain a 'value' key. if it doesn't then bail. @@ -89,6 +91,8 @@ export const convertPropDataToLayoutServiceFormat = ( /** * Receives dev route data and creates or assigns "value/editable" values where needed * for all fields and rendering props to match signature of LayoutService data. + * @param {RouteData} routeData + * @returns {Object} route data in layout service format */ export const convertRouteToLayoutServiceFormat = (routeData: RouteData) => { const fields = convertPropDataToLayoutServiceFormat(routeData.fields); diff --git a/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx b/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx index ce9b436d13..abe44f1562 100644 --- a/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx +++ b/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.test.tsx @@ -7,7 +7,7 @@ import { ComponentFactoryReactContext } from '../components/SitecoreContext'; describe('withComponentFactory()', () => { test('should pass factory to wrapped component from context', () => { - const components = new Map(); + const components = new Map(); components.set('xxx', () => <Text>I'm component from factory</Text>); @@ -19,9 +19,9 @@ describe('withComponentFactory()', () => { } const TestComponent = (props: TestComponentProps) => { - if (!props.componentFactory) return null; + if (!props.componentFactory) return null; - const ComponentFromFactory = props.componentFactory('xxx'); + const ComponentFromFactory = props.componentFactory('xxx') as React.ComponentType; return ( <View> @@ -64,7 +64,7 @@ describe('withComponentFactory()', () => { const TestComponent = (props: TestComponentProps) => { if (!props.componentFactory) return null; - const ComponentFromFactory = props.componentFactory('xxx'); + const ComponentFromFactory = props.componentFactory('xxx') as React.ComponentType; return ( <View> diff --git a/packages/sitecore-jss-react-native/tslint.json b/packages/sitecore-jss-react-native/tslint.json deleted file mode 100644 index 41ce6c4a02..0000000000 --- a/packages/sitecore-jss-react-native/tslint.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": ["tslint-react"], - "rules": { - "no-unused-variable": [ - true, - { - "ignore-pattern": "^_" - } - ], - "jsx-no-multiline-js": false, - "quotemark": [true, "single", "jsx-double"] - } -} From 7d63616d866005594f8b3196c8212b6fe4594643 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 11:22:45 +0200 Subject: [PATCH 14/37] push jss-rendering-host --- .../sitecore-jss-rendering-host/.eslintrc | 6 ++ .../sitecore-jss-rendering-host/package.json | 3 +- .../src/defaultAppInvocationInfoResolver.ts | 2 + .../src/devServer.ts | 14 +-- .../src/renderingHostServer.ts | 9 +- .../src/ssrMiddleware.ts | 4 +- .../sitecore-jss-rendering-host/src/tunnel.ts | 2 +- .../sitecore-jss-rendering-host/tslint.json | 100 ------------------ 8 files changed, 26 insertions(+), 114 deletions(-) create mode 100644 packages/sitecore-jss-rendering-host/.eslintrc delete mode 100644 packages/sitecore-jss-rendering-host/tslint.json diff --git a/packages/sitecore-jss-rendering-host/.eslintrc b/packages/sitecore-jss-rendering-host/.eslintrc new file mode 100644 index 0000000000..02a6039f22 --- /dev/null +++ b/packages/sitecore-jss-rendering-host/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "../../.eslintrc", + "rules": { + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/packages/sitecore-jss-rendering-host/package.json b/packages/sitecore-jss-rendering-host/package.json index 8b1bfddd8d..90fa30f146 100644 --- a/packages/sitecore-jss-rendering-host/package.json +++ b/packages/sitecore-jss-rendering-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" @@ -41,6 +41,7 @@ "@types/webpack-dev-server": "3.1.7", "chai": "^4.2.0", "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-rendering-host/src/defaultAppInvocationInfoResolver.ts b/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts index 786774401a..8033bb3429 100644 --- a/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts +++ b/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts @@ -14,9 +14,11 @@ import { AppInvocationInfoResolver } from './ssrMiddleware'; * `serverBundleName` is the name of the JavaScript file (typically a bundle) that contains the function for rendering your app. * * @param {string} [baseAppPath='./dist'] The base path to your JSS app(s), defaults to `./dist` + * @returns {AppInvocationInfoResolver} resolver */ export function getDefaultAppInvocationInfoResolver({ appPathResolver = (requestJson: any) => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define return path.resolve(baseAppPath, requestJson.id, serverBundleName); }, baseAppPath = './dist', diff --git a/packages/sitecore-jss-rendering-host/src/devServer.ts b/packages/sitecore-jss-rendering-host/src/devServer.ts index 3ebcbcaf37..57834594d5 100644 --- a/packages/sitecore-jss-rendering-host/src/devServer.ts +++ b/packages/sitecore-jss-rendering-host/src/devServer.ts @@ -1,8 +1,9 @@ import { sync as delSync } from 'del'; import { Application } from 'express'; import { PathParams } from 'express-serve-static-core'; -// @ts-ignore -import openBrowser from 'opn'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import openBrowser from 'opn'; import path from 'path'; import webpack from 'webpack'; import WebpackDevMiddleware from 'webpack-dev-middleware'; @@ -202,11 +203,11 @@ export function startDevServer({ serverOptions.after = (app: Application, server: WebpackDevServer) => { const middleware = ssrMiddleware ? ssrMiddleware({ - appInvocationInfoResolver, - }) + appInvocationInfoResolver, + }) : defaultSSRMiddleware({ - appInvocationInfoResolver, - }); + appInvocationInfoResolver, + }); // Give devs a chance to add custom middleware before the SSR middleware is registered, // but after all WDS middleware. @@ -251,6 +252,7 @@ export function startDevServer({ }); } +// eslint-disable-next-line @typescript-eslint/ban-types function invokeHook(hook: Function | undefined, ...args: any[]) { if (hook && typeof hook === 'function') { hook(...args); diff --git a/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts b/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts index c73aec0530..aad8e7f15a 100644 --- a/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts +++ b/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts @@ -66,11 +66,11 @@ export function startRenderingHostServer({ const middleware = ssrMiddleware ? ssrMiddleware({ - appInvocationInfoResolver, - }) + appInvocationInfoResolver, + }) : defaultSSRMiddleware({ - appInvocationInfoResolver, - }); + appInvocationInfoResolver, + }); // Give devs a chance to add custom middleware before the SSR middleware is registered. invokeHook(hooks.beforeSSRMiddlewareRegistered, server); @@ -95,6 +95,7 @@ export function startRenderingHostServer({ }); } +// eslint-disable-next-line @typescript-eslint/ban-types function invokeHook(hook: Function | undefined, ...args: any[]) { if (hook && typeof hook === 'function') { hook(...args); diff --git a/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts b/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts index f77d7538ff..4d612b6709 100644 --- a/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts +++ b/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts @@ -35,7 +35,7 @@ export const ssrMiddleware: SSRMiddleware = ({ appInvocationInfoResolver, }: SSRMiddlewareOptions) => { if (!appInvocationInfoResolver) { - throw new Error(`No AppInvocationInfo resolver was provided for SSR middleware`); + throw new Error('No AppInvocationInfo resolver was provided for SSR middleware'); } return (req: IncomingMessage, res: ServerResponse) => { let callback: RenderCallback; @@ -116,7 +116,7 @@ export function onReadableStreamDataHandler(dataWriter: { output: Buffer }) { }; } -export function extractJsonFromStreamData(data: Buffer, contentEncoding?: string): Promise<object> { +export function extractJsonFromStreamData(data: Buffer, contentEncoding?: string): Promise<any> { let responseString: Promise<string>; if ( diff --git a/packages/sitecore-jss-rendering-host/src/tunnel.ts b/packages/sitecore-jss-rendering-host/src/tunnel.ts index 4e92a4a999..85027b6736 100644 --- a/packages/sitecore-jss-rendering-host/src/tunnel.ts +++ b/packages/sitecore-jss-rendering-host/src/tunnel.ts @@ -20,7 +20,7 @@ export function startRenderHostTunnel( ...options, host_header: 'rewrite', addr: rewriteHost, - } + }; return ngrok .connect(finalOptions) diff --git a/packages/sitecore-jss-rendering-host/tslint.json b/packages/sitecore-jss-rendering-host/tslint.json deleted file mode 100644 index 4b5c71f249..0000000000 --- a/packages/sitecore-jss-rendering-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" - ] - } -} From 14f51fbf921cd1977b5539789004567120fb26ca Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 11:43:08 +0200 Subject: [PATCH 15/37] push jss-tracking --- packages/sitecore-jss-tracking/package.json | 3 ++- .../sitecore-jss-tracking/src/dataModels.ts | 10 ++++----- packages/sitecore-jss-tracking/src/index.ts | 2 +- .../src/trackingApi.test.ts | 9 +++++--- .../sitecore-jss-tracking/src/trackingApi.ts | 21 ++++++++++++------- .../src/trackingRequestOptions.ts | 2 +- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/packages/sitecore-jss-tracking/package.json b/packages/sitecore-jss-tracking/package.json index 422b4d3037..4e47e9ffee 100644 --- a/packages/sitecore-jss-tracking/package.json +++ b/packages/sitecore-jss-tracking/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": "^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-tracking/src/dataModels.ts b/packages/sitecore-jss-tracking/src/dataModels.ts index 80f8093e1a..2c9f3786d3 100644 --- a/packages/sitecore-jss-tracking/src/dataModels.ts +++ b/packages/sitecore-jss-tracking/src/dataModels.ts @@ -1,35 +1,35 @@ export interface CampaignInstance { + [key: string]: unknown; /** GUID or alias (name) of campaign to trigger */ campaignId: string; - [key: string]: any; } export interface GoalInstance { + [key: string]: unknown; /** GUID or alias (name) of goal to trigger */ goalId: string; - [key: string]: any; } export interface EventInstance { + [key: string]: unknown; /** GUID or alias (name) of event to trigger */ eventId: string; - [key: string]: any; } export interface OutcomeInstance { + [key: string]: unknown; /** GUID or alias (name) of outcome to trigger */ outcomeId: string; /** Currency code of outcome monetary value */ currencyCode?: string; /** Revenue from outcome */ monetaryValue?: number; - [key: string]: any; } export interface PageViewInstance { + [key: string]: unknown; /** GUID of Sitecore page item to track (i.e. context item ID) */ pageId: string; /** URL of page to track - should be absolute route path but can accept any value */ url: string; - [key: string]: any; } diff --git a/packages/sitecore-jss-tracking/src/index.ts b/packages/sitecore-jss-tracking/src/index.ts index d4c62369f1..4227ad52e8 100644 --- a/packages/sitecore-jss-tracking/src/index.ts +++ b/packages/sitecore-jss-tracking/src/index.ts @@ -7,5 +7,5 @@ export { GoalInstance, OutcomeInstance, EventInstance, - PageViewInstance + PageViewInstance, } from './dataModels'; diff --git a/packages/sitecore-jss-tracking/src/trackingApi.test.ts b/packages/sitecore-jss-tracking/src/trackingApi.test.ts index 093dc92dc0..cfe592e1e2 100644 --- a/packages/sitecore-jss-tracking/src/trackingApi.test.ts +++ b/packages/sitecore-jss-tracking/src/trackingApi.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ /* tslint:disable:no-unused-expression */ import { HttpJsonFetcher } from '@sitecore-jss/sitecore-jss'; @@ -8,7 +9,7 @@ import { trackEvent } from './trackingApi'; // note: axios needs to use `withCredentials: true` in order for Sitecore cookies to be included in CORS requests // which is necessary for analytics and such -const axiosFetcher: HttpJsonFetcher<any> = (url, data) => axios({ +const axiosFetcher: HttpJsonFetcher<void> = (url, data) => axios({ url, method: data ? 'POST' : 'GET', data, @@ -39,7 +40,7 @@ describe('trackEvent', () => { }); return trackEvent([ - { eventId: 'porgs' }, + { eventId: 'porgs' } ], { host: 'https://www.myhost.net', @@ -48,6 +49,7 @@ describe('trackEvent', () => { }) .then((data) => { // testData should contain the 'config' object from the mock request + // eslint-disable-next-line @typescript-eslint/no-explicit-any const testData = data as any; expect(testData.url).to.equal(expectedUrl); expect(testData.withCredentials, 'with credentials is not true').to.be.true; @@ -64,7 +66,7 @@ describe('trackEvent', () => { }); return trackEvent([ - { campaignId: '123456' }, + { campaignId: '123456' } ], { host: 'https://www.myhost.net', @@ -74,6 +76,7 @@ describe('trackEvent', () => { }) .then((data) => { // testData should contain the 'config' object from the mock request + // eslint-disable-next-line @typescript-eslint/no-explicit-any const testData = data as any; expect(testData.url).to.equal(expectedUrl); expect(testData.withCredentials, 'with credentials is not true').to.be.true; diff --git a/packages/sitecore-jss-tracking/src/trackingApi.ts b/packages/sitecore-jss-tracking/src/trackingApi.ts index 71b6ccc209..997c6943d0 100644 --- a/packages/sitecore-jss-tracking/src/trackingApi.ts +++ b/packages/sitecore-jss-tracking/src/trackingApi.ts @@ -3,17 +3,17 @@ import { CampaignInstance, EventInstance, GoalInstance, OutcomeInstance, PageVie import { TrackingRequestOptions } from './trackingRequestOptions'; class ResponseError extends Error { - constructor(message: string, response: HttpResponse<any>) { + response: HttpResponse<unknown>; + + constructor(message: string, response: HttpResponse<unknown>) { super(message); Object.setPrototypeOf(this, ResponseError.prototype); this.response = response; } - - response: HttpResponse<any>; } -function checkStatus(response: HttpResponse<any>) { +function checkStatus(response: HttpResponse<unknown>) { if (response.status >= 200 && response.status < 300) { return response; } @@ -25,9 +25,9 @@ function checkStatus(response: HttpResponse<any>) { // note: encodeURIComponent is available via browser (window) or natively in node.js // if you use another js engine for server-side rendering you may not have native encodeURIComponent // and would then need to install a package for that functionality -function getQueryString(params: { [key: string]: any }) { +function getQueryString(params: { [key: string]: unknown }) { return Object.keys(params) - .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`) + .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k] as string)}`) .join('&'); } @@ -35,8 +35,10 @@ function getQueryString(params: { [key: string]: any }) { // which is necessary for analytics and such function fetchData<T>( url: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any, fetcher: HttpJsonFetcher<T>, + // eslint-disable-next-line @typescript-eslint/no-explicit-any params: { [key: string]: any } = {}) { const qs = getQueryString(params); @@ -44,9 +46,9 @@ function fetchData<T>( return fetcher(fetchUrl, data) .then(checkStatus) - .then((response: HttpResponse<T>) => { + .then(response => { // axios auto-parses JSON responses, don't need to JSON.parse - return response.data; + return response.data as T; }); } @@ -58,6 +60,9 @@ function resolveTrackingUrl(options: TrackingRequestOptions) { /** * Makes a request to Sitecore Layout Service for the specified route item path. + * @param {Array<EventInstance | GoalInstance | OutcomeInstance | CampaignInstance | PageViewInstance>} events + * @param {TrackingRequestOptions} options + * @returns {Promise<void>} void */ export function trackEvent( events: Array<EventInstance | GoalInstance | OutcomeInstance | CampaignInstance | PageViewInstance>, diff --git a/packages/sitecore-jss-tracking/src/trackingRequestOptions.ts b/packages/sitecore-jss-tracking/src/trackingRequestOptions.ts index 6b4d10779d..c4ae127a7e 100644 --- a/packages/sitecore-jss-tracking/src/trackingRequestOptions.ts +++ b/packages/sitecore-jss-tracking/src/trackingRequestOptions.ts @@ -13,7 +13,7 @@ export interface TrackingRequestOptions { /** * An object of key:value pairs to be stringified and used as querystring parameters. */ - querystringParams?: { [key: string]: any }; + querystringParams?: { [key: string]: unknown }; /** Type of tracking request action. Default: 'event' */ action?: string; From 4ddb0b4695450f986f2094ff9aaf17d336971ec2 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 11:46:29 +0200 Subject: [PATCH 16/37] push update-package --- packages/sitecore-jss-update-package/package.json | 3 ++- packages/sitecore-jss-update-package/src/index.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/sitecore-jss-update-package/package.json b/packages/sitecore-jss-update-package/package.json index 9b17a35e84..b71d97c037 100644 --- a/packages/sitecore-jss-update-package/package.json +++ b/packages/sitecore-jss-update-package/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" @@ -32,6 +32,7 @@ "@types/node": "^12.7.11", "chai": "^4.2.0", "del-cli": "^3.0.1", + "eslint": "^7.15.0", "fetch-mock": "^7.4.0", "mocha": "^8.1.3", "sinon": "^7.5.0", diff --git a/packages/sitecore-jss-update-package/src/index.ts b/packages/sitecore-jss-update-package/src/index.ts index 00f1f5eaa4..ac905a3710 100644 --- a/packages/sitecore-jss-update-package/src/index.ts +++ b/packages/sitecore-jss-update-package/src/index.ts @@ -22,7 +22,7 @@ interface FileEntry { const getEntries = (folder: string): FileEntry[] => { const files = walkSync(folder); - const entries: any = []; + const entries: { path: string, name: string }[] = []; files.forEach((entry) => { const entryPath = path.join('.', entry); // remove initial folder and convert to fwd slash @@ -40,7 +40,9 @@ export const createPackage = (contentsPath: string, outputPath: string, callback const zip = new JSZip(); const contents = getEntries(contentsPath); contents.forEach((entry) => { - if (entry.name.endsWith('/')) { return; } + if (entry.name.endsWith('/')) { + return; + } console.log(`Adding ${entry.name}`); zip.file(entry.name, fs.readFileSync(path.normalize(entry.path)), { createFolders: false }); }); @@ -48,7 +50,7 @@ export const createPackage = (contentsPath: string, outputPath: string, callback zip .generateNodeStream({ type: 'nodebuffer' }) .pipe(fs.createWriteStream(outputPath)) - .on('error', (error: any) => { + .on('error', error => { console.error(error); }) .on('finish', () => { From aad748df26b80865828eb8931a072c9ecb6cf6e2 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 12:28:24 +0200 Subject: [PATCH 17/37] push sitecore-jss-vue --- packages/sitecore-jss-vue/.eslintrc | 7 +++++++ packages/sitecore-jss-vue/package.json | 4 +++- .../src/components/Date.test.ts | 9 +++++---- .../src/components/File.test.ts | 1 + .../sitecore-jss-vue/src/components/File.ts | 2 +- .../src/components/Image.test.ts | 3 ++- .../sitecore-jss-vue/src/components/Image.ts | 7 +++---- .../src/components/Link.test.ts | 1 + .../sitecore-jss-vue/src/components/Link.ts | 4 ++-- .../src/components/MissingComponent.test.ts | 1 + .../src/components/MissingComponent.ts | 2 +- .../src/components/Placeholder.test.ts | 19 ++++++++++--------- .../src/components/Placeholder.ts | 10 +++++----- .../src/components/PlaceholderCommon.ts | 15 +++++++++++++-- .../src/components/RichText.test.ts | 1 + .../src/components/SitecoreContext.ts | 10 +++++----- .../src/components/Text.test.ts | 1 + .../src/enhancers/providePlaceholders.ts | 17 +++++++++-------- .../src/test/data/LS-data-EE-off.ts | 6 +++--- .../src/test/data/LS-data-EE-on.ts | 6 +++--- .../src/test/data/dev-data.ts | 10 +++++----- 21 files changed, 82 insertions(+), 54 deletions(-) create mode 100644 packages/sitecore-jss-vue/.eslintrc diff --git a/packages/sitecore-jss-vue/.eslintrc b/packages/sitecore-jss-vue/.eslintrc new file mode 100644 index 0000000000..824106128e --- /dev/null +++ b/packages/sitecore-jss-vue/.eslintrc @@ -0,0 +1,7 @@ +{ + "extends": ["plugin:vue/recommended", "../../.eslintrc"], + "rules": { + // TODO: fix errors + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/packages/sitecore-jss-vue/package.json b/packages/sitecore-jss-vue/package.json index 5cfdba7a32..0218ef78c1 100644 --- a/packages/sitecore-jss-vue/package.json +++ b/packages/sitecore-jss-vue/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": "jest", "prepublishOnly": "npm run build", "coverage": "jest --config ./jest.config.coverage.js" @@ -29,6 +29,8 @@ "@vue/test-utils": "^1.0.0-beta.29", "babel-core": "^6.26.3", "del-cli": "^3.0.1", + "eslint": "^7.15.0", + "eslint-plugin-vue": "^7.3.0", "jest": "^26.4.2", "jest-serializer-html": "^7.0.0", "ts-jest": "24.1.0", diff --git a/packages/sitecore-jss-vue/src/components/Date.test.ts b/packages/sitecore-jss-vue/src/components/Date.test.ts index 47e58b89d7..2a43844c66 100644 --- a/packages/sitecore-jss-vue/src/components/Date.test.ts +++ b/packages/sitecore-jss-vue/src/components/Date.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-unused-expressions */ import { mount } from '@vue/test-utils'; @@ -41,10 +42,10 @@ describe('<Date />', () => { }); it('should render formatted value with formatter', () => { - const formatter: FormatterFunction = () => 'rendered val' - const props = { + const formatter: FormatterFunction = () => 'rendered val'; + const props = { field: { value: 'value' }, - formatter + formatter, }; const rendered = mount(DateField, { @@ -65,7 +66,7 @@ describe('<Date />', () => { context: { props }, }).find('span'); expect(rendered.element.innerHTML).toBe('rendered val null'); - }) + }); it('should render other attributes with other props provided', () => { const field = { value: 'value' }; diff --git a/packages/sitecore-jss-vue/src/components/File.test.ts b/packages/sitecore-jss-vue/src/components/File.test.ts index 84e851d659..d682d0bbb2 100644 --- a/packages/sitecore-jss-vue/src/components/File.test.ts +++ b/packages/sitecore-jss-vue/src/components/File.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-unused-expressions */ import { mount } from '@vue/test-utils'; diff --git a/packages/sitecore-jss-vue/src/components/File.ts b/packages/sitecore-jss-vue/src/components/File.ts index b781888c8e..4cc19c5332 100644 --- a/packages/sitecore-jss-vue/src/components/File.ts +++ b/packages/sitecore-jss-vue/src/components/File.ts @@ -1,10 +1,10 @@ import { CreateElement, FunctionalComponentOptions, RenderContext } from 'vue'; export interface FileFieldValue { + [propName: string]: any; src?: string; title?: string; displayName?: string; - [propName: string]: any; } export interface FileField { diff --git a/packages/sitecore-jss-vue/src/components/Image.test.ts b/packages/sitecore-jss-vue/src/components/Image.test.ts index ca363984c7..9de5356294 100644 --- a/packages/sitecore-jss-vue/src/components/Image.test.ts +++ b/packages/sitecore-jss-vue/src/components/Image.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ import { mount } from '@vue/test-utils'; import URL from 'url-parse'; @@ -199,7 +200,7 @@ describe('<Image />', () => { imageParams: { h: '100', w: '150', - } + }, }; const rendered = mount(Image, { context: { props, attrs } }).find('img'); diff --git a/packages/sitecore-jss-vue/src/components/Image.ts b/packages/sitecore-jss-vue/src/components/Image.ts index 0643a52f39..1eba43622e 100644 --- a/packages/sitecore-jss-vue/src/components/Image.ts +++ b/packages/sitecore-jss-vue/src/components/Image.ts @@ -1,12 +1,11 @@ -/* eslint-disable jsx-a11y/alt-text */ import { mediaApi } from '@sitecore-jss/sitecore-jss'; import { CreateElement, FunctionalComponentOptions, RenderContext } from 'vue'; import { generateHtmlTag } from '../utils'; export interface ImageFieldValue { + [attributeName: string]: any; src?: string; /** HTML attributes that will be appended to the rendered <img /> tag. */ - [attributeName: string]: any; } export interface ImageField { @@ -88,8 +87,8 @@ export const Image: FunctionalComponentOptions<ImageProps> = { props: { media: { type: Object, required: true }, editable: { type: Boolean, default: true }, - imageParams: { type: Object }, - mediaUrlPrefix: { type: RegExp }, + imageParams: { type: Object, default: () => ({}) }, + mediaUrlPrefix: { type: RegExp, default: undefined }, }, // Need to assign `any` return type because Vue type definitions are inaccurate. // The Vue type definitions set `render` to a return type of VNode and that's it. diff --git a/packages/sitecore-jss-vue/src/components/Link.test.ts b/packages/sitecore-jss-vue/src/components/Link.test.ts index 6771a46d08..71bed0f05b 100644 --- a/packages/sitecore-jss-vue/src/components/Link.test.ts +++ b/packages/sitecore-jss-vue/src/components/Link.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-unused-expressions */ import { mount } from '@vue/test-utils'; diff --git a/packages/sitecore-jss-vue/src/components/Link.ts b/packages/sitecore-jss-vue/src/components/Link.ts index a55fa4472e..40f76db81b 100644 --- a/packages/sitecore-jss-vue/src/components/Link.ts +++ b/packages/sitecore-jss-vue/src/components/Link.ts @@ -1,11 +1,11 @@ import { CreateElement, FunctionalComponentOptions, RenderContext } from 'vue'; export interface LinkFieldValue { + [attributeName: string]: any; href?: string; className?: string; title?: string; target?: string; - [attributeName: string]: any; } export interface LinkField { @@ -95,7 +95,7 @@ export const Link: FunctionalComponentOptions<LinkProps> = { return createElement('span', { class: 'sc-link-editable-wrapper' }, [ xEditorElement, - childElements, + childElements ]); } diff --git a/packages/sitecore-jss-vue/src/components/MissingComponent.test.ts b/packages/sitecore-jss-vue/src/components/MissingComponent.test.ts index 8d6cdd4e68..fc8dcffb4f 100644 --- a/packages/sitecore-jss-vue/src/components/MissingComponent.test.ts +++ b/packages/sitecore-jss-vue/src/components/MissingComponent.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ import { mount } from '@vue/test-utils'; import { MissingComponent } from './MissingComponent'; diff --git a/packages/sitecore-jss-vue/src/components/MissingComponent.ts b/packages/sitecore-jss-vue/src/components/MissingComponent.ts index 7440face54..486d28382f 100644 --- a/packages/sitecore-jss-vue/src/components/MissingComponent.ts +++ b/packages/sitecore-jss-vue/src/components/MissingComponent.ts @@ -36,7 +36,7 @@ export const MissingComponent: FunctionalComponentOptions<MissingComponentProps> createElement( 'p', 'JSS component is missing Vue implementation. See the developer console for more information.' - ), + ) ] ); }, diff --git a/packages/sitecore-jss-vue/src/components/Placeholder.test.ts b/packages/sitecore-jss-vue/src/components/Placeholder.test.ts index 39d32ed050..3f5282e332 100644 --- a/packages/sitecore-jss-vue/src/components/Placeholder.test.ts +++ b/packages/sitecore-jss-vue/src/components/Placeholder.test.ts @@ -1,6 +1,7 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-unused-expressions */ -import { CreateElement, RenderContext } from 'vue' +import { CreateElement, RenderContext } from 'vue'; import { Placeholder } from './Placeholder'; import { SitecoreContext } from './SitecoreContext'; @@ -58,7 +59,7 @@ const testComponents: any = { arbitrary: arbitraryProp, ...otherProps, }, - }), + }) ]); }, }, @@ -79,7 +80,7 @@ const testComponents: any = { createElement('br'), `arbitrary function: ${ props.arbitrary.withFunction ? props.arbitrary.withFunction() : 'no function' - }`, + }` ]); }, }, @@ -113,7 +114,7 @@ describe('<Placeholder />', () => { const testData = [ { label: 'Dev data', data: devData }, { label: 'LayoutService data - EE off', data: lsDataEeOff }, - { label: 'LayoutService data - EE on', data: lsDataEeOn }, + { label: 'LayoutService data - EE on', data: lsDataEeOn } ]; testData.forEach(dataSet => { @@ -158,7 +159,7 @@ describe('<Placeholder />', () => { rendering: component, componentFactory, }, - }), + }) ] ); }, @@ -176,7 +177,7 @@ describe('<Placeholder />', () => { const testComponent = { render(createElement: CreateElement) { return createElement(SitecoreContext, { props: { componentFactory } }, [ - createElement(Placeholder, { props: { name: phKey, rendering: component } }), + createElement(Placeholder, { props: { name: phKey, rendering: component } }) ]); }, }; @@ -195,7 +196,7 @@ describe('<Placeholder />', () => { return createElement(SitecoreContext, { props: { componentFactory } }, [ createElement(SampleScopedSlotPlaceholder, { props: { name: phKey, rendering: component }, - }), + }) ]); }, }; @@ -217,7 +218,7 @@ describe('<Placeholder />', () => { main: [ { componentName: 'Home' }, { componentName: 'SfcHome' }, - { componentName: 'whatisthis' }, + { componentName: 'whatisthis' } ], }, }; @@ -312,7 +313,7 @@ describe('<Placeholder />', () => { type: 'text/sitecore', contents: 'this is the only element that should render within the "li" element', attributes: { type: 'text/sitecore' }, - }, + } ], }, }; diff --git a/packages/sitecore-jss-vue/src/components/Placeholder.ts b/packages/sitecore-jss-vue/src/components/Placeholder.ts index 902f4746a7..bad3671217 100644 --- a/packages/sitecore-jss-vue/src/components/Placeholder.ts +++ b/packages/sitecore-jss-vue/src/components/Placeholder.ts @@ -42,11 +42,11 @@ export { PlaceholderProps }; // e.g. $router, $apollo export const Placeholder: ThisTypedComponentOptionsWithRecordProps< - Vue, - any, - any, - any, - PlaceholderProps +Vue, +any, +any, +any, +PlaceholderProps > = { name: 'Placeholder', diff --git a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts index f1f9d6192f..61eba303be 100644 --- a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts +++ b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts @@ -11,6 +11,7 @@ import { MissingComponent } from './MissingComponent'; import { ComponentFactory } from './sharedTypes'; export interface PlaceholderProps { + [key: string]: any; /** Name of the placeholder to render. */ name: string; /** Rendering data to be used when rendering the placeholder. */ @@ -46,8 +47,6 @@ export interface PlaceholderProps { * the placeholder */ errorComponent?: Component; - - [key: string]: any; } export type JssDynamicComponent = Component & { isxEditorComponent?: boolean }; @@ -80,6 +79,11 @@ export const getPlaceholderDataFromRenderingData = ( * and createVueElement to create VNodes for use in a Vue `render` function. Note: you can't use VNodes in * component templates. You'll need to convert the VNodes to "renderable" components, a.k.a. dynamic components. * @see convertVNodesToDynamicComponents or @see getDynamicComponentsFromRenderingData for options. + * @param {Array<ComponentRendering | HtmlElementRendering>} placeholderData + * @param {PlaceholderProps} placeholderProps + * @param {CreateElement} createVueElement + * @param {ComponentFactory} [componentFactory] + * @returns {VNode[]} vnodes */ export function getVNodesForRenderingData( placeholderData: Array<ComponentRendering | HtmlElementRendering>, @@ -131,6 +135,11 @@ export function getVNodesForRenderingData( /** * Convenience method that calls {@link getVNodesForRenderingData} and {@link convertVNodesToDynamicComponents} * to return "renderable" components, i.e. components that can be rendered in a Vue template, a.k.a. dynamic components. + * @param {Array<ComponentRendering | HtmlElementRendering>} placeholderData + * @param {PlaceholderProps} placeholderProps + * @param {CreateElement} createVueElement + * @param {ComponentFactory} componentFactory + * @returns {JssDynamicComponent[]} dynamic components */ export function getDynamicComponentsFromRenderingData( placeholderData: Array<ComponentRendering | HtmlElementRendering>, @@ -147,6 +156,8 @@ export function getDynamicComponentsFromRenderingData( * Converts VNodes to simple functional components that render the vnode. * Also evaluates VNodes to determine if they are Experience Editor components/elements and if so, * adds an identifying property to the component. + * @param {VNode[]} vnodes + * @returns {JssDynamicComponent[]} dynamic components */ export function convertVNodesToDynamicComponents(vnodes: VNode[]) { return vnodes.map((vnode) => { diff --git a/packages/sitecore-jss-vue/src/components/RichText.test.ts b/packages/sitecore-jss-vue/src/components/RichText.test.ts index 0477f72be8..8566f29568 100644 --- a/packages/sitecore-jss-vue/src/components/RichText.test.ts +++ b/packages/sitecore-jss-vue/src/components/RichText.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-unused-expressions */ import { mount } from '@vue/test-utils'; import { richTextField as eeRichTextData } from '../test/data/field-data-EE-on'; diff --git a/packages/sitecore-jss-vue/src/components/SitecoreContext.ts b/packages/sitecore-jss-vue/src/components/SitecoreContext.ts index 9da2114da8..b7031d032f 100644 --- a/packages/sitecore-jss-vue/src/components/SitecoreContext.ts +++ b/packages/sitecore-jss-vue/src/components/SitecoreContext.ts @@ -9,11 +9,11 @@ export interface SitecoreContextProps { // For an explanation of why `ThisTypedComponentOptionsWithRecordProps` // is used here, see the `Placeholder.ts` component file. export const SitecoreContext: ThisTypedComponentOptionsWithRecordProps< - Vue, - any, - any, - any, - SitecoreContextProps +Vue, +any, +any, +any, +SitecoreContextProps > = { props: { componentFactory: { diff --git a/packages/sitecore-jss-vue/src/components/Text.test.ts b/packages/sitecore-jss-vue/src/components/Text.test.ts index 960526c6d8..6d621984c6 100644 --- a/packages/sitecore-jss-vue/src/components/Text.test.ts +++ b/packages/sitecore-jss-vue/src/components/Text.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-unused-expressions */ import { mount } from '@vue/test-utils'; diff --git a/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts b/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts index 19927b0171..984ac1d628 100644 --- a/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts +++ b/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts @@ -26,16 +26,17 @@ export interface WithPlaceholderOptions { } declare module 'vue/types/options' { + // eslint-disable-next-line @typescript-eslint/no-unused-vars interface ComponentOptions<V extends Vue> { withPlaceholder?: - | (() => { - placeholders: WithPlaceholderSpec; - options?: WithPlaceholderOptions; - }) - | { - placeholders: WithPlaceholderSpec; - options?: WithPlaceholderOptions; - }; + | (() => { + placeholders: WithPlaceholderSpec; + options?: WithPlaceholderOptions; + }) + | { + placeholders: WithPlaceholderSpec; + options?: WithPlaceholderOptions; + }; } } diff --git a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts index 8feaa2388c..5ece49d532 100644 --- a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts +++ b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts @@ -45,7 +45,7 @@ export const lsDataEeOff = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -58,10 +58,10 @@ export const lsDataEeOff = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - }, + } ], }, - }, + } ], }, fields: { diff --git a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts index 8549fd4530..b73fdcbde0 100644 --- a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts +++ b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts @@ -126,7 +126,7 @@ export const lsDataEeOn = { hintname: 'page-header', class: 'scpm', }, - }, + } ], 'page-content': [ { @@ -209,7 +209,7 @@ export const lsDataEeOn = { hintname: 'page-content', class: 'scpm', }, - }, + } ], }, }, @@ -238,7 +238,7 @@ export const lsDataEeOn = { hintname: 'main', class: 'scpm', }, - }, + } ], }, fields: { diff --git a/packages/sitecore-jss-vue/src/test/data/dev-data.ts b/packages/sitecore-jss-vue/src/test/data/dev-data.ts index 94baceaee8..180ec2f097 100644 --- a/packages/sitecore-jss-vue/src/test/data/dev-data.ts +++ b/packages/sitecore-jss-vue/src/test/data/dev-data.ts @@ -24,7 +24,7 @@ export const devData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -38,7 +38,7 @@ export const devData = { fields: { linkText: { value: 'Download' } }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: {}, - }, + } ], }, }, @@ -60,7 +60,7 @@ export const devData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -74,10 +74,10 @@ export const devData = { fields: { linkText: { value: 'Download' } }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: {}, - }, + } ], }, - }, + } ], }, fields: { From 588a3e9b44db444f1f8033213e389e2d3f9d5f22 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 12:47:47 +0200 Subject: [PATCH 18/37] push sitecore-pipelines --- packages/sitecore-pipelines/.eslintrc | 7 +++++++ packages/sitecore-pipelines/package.json | 3 ++- .../src/configLoader.test.ts | 5 +++-- .../sitecore-pipelines/src/configLoader.ts | 5 ++--- packages/sitecore-pipelines/src/index.ts | 2 +- .../sitecore-pipelines/src/pipeline.test.ts | 4 ++-- packages/sitecore-pipelines/src/pipeline.ts | 21 ++++++++++--------- .../sitecore-pipelines/src/pipelineFactory.ts | 2 ++ 8 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 packages/sitecore-pipelines/.eslintrc diff --git a/packages/sitecore-pipelines/.eslintrc b/packages/sitecore-pipelines/.eslintrc new file mode 100644 index 0000000000..54be84938a --- /dev/null +++ b/packages/sitecore-pipelines/.eslintrc @@ -0,0 +1,7 @@ +{ + "extends": "../../.eslintrc", + "rules": { + // TODO: fix errors + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/packages/sitecore-pipelines/package.json b/packages/sitecore-pipelines/package.json index 6e6405cd6f..51898a04cb 100644 --- a/packages/sitecore-pipelines/package.json +++ b/packages/sitecore-pipelines/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", "runner": "npm run build && node ./dist/runner", @@ -37,6 +37,7 @@ "cross-env": "^6.0.3", "del": "^5.1.0", "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-pipelines/src/configLoader.test.ts b/packages/sitecore-pipelines/src/configLoader.test.ts index 1fc630d42e..e1b28c8654 100644 --- a/packages/sitecore-pipelines/src/configLoader.test.ts +++ b/packages/sitecore-pipelines/src/configLoader.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ import { expect } from 'chai'; import 'mocha'; import * as sinon from 'sinon'; @@ -21,7 +22,7 @@ describe('configLoader', () => { const fakeImportModules = () => { const mockModules = [ { import: () => Promise.resolve({ config: spy1 }) }, - { import: () => Promise.resolve({ config: spy2 }) }, + { import: () => Promise.resolve({ config: spy2 }) } ]; return mockModules; }; @@ -53,7 +54,7 @@ describe('configLoader', () => { const fakeImportModules = () => { const mockModules = [ { import: () => Promise.resolve({ config: () => {} }) }, - { import: () => Promise.resolve({ config: () => {} }) }, + { import: () => Promise.resolve({ config: () => {} }) } ]; return mockModules; }; diff --git a/packages/sitecore-pipelines/src/configLoader.ts b/packages/sitecore-pipelines/src/configLoader.ts index d4c8edb098..347364951f 100644 --- a/packages/sitecore-pipelines/src/configLoader.ts +++ b/packages/sitecore-pipelines/src/configLoader.ts @@ -1,4 +1,3 @@ -import { Pipeline } from './pipelineFactory'; import { createPipelinesRegistry } from './pipelinesRegistry'; import { importModules } from './utils'; @@ -22,8 +21,8 @@ const config = async ({ throw new Error('no pipeline config file search patterns specified'); } const pipelinesRegistry = createPipelinesRegistryImplementation - ? createPipelinesRegistryImplementation(existingConfig) - : createPipelinesRegistry(existingConfig); + ? createPipelinesRegistryImplementation(existingConfig) + : createPipelinesRegistry(existingConfig); const moduleWrappers = importModulesImplementation ? importModulesImplementation({ fileGlobs, workingDirectory, allowEmptyGlobs }) diff --git a/packages/sitecore-pipelines/src/index.ts b/packages/sitecore-pipelines/src/index.ts index 3a844d23a4..358b85a809 100644 --- a/packages/sitecore-pipelines/src/index.ts +++ b/packages/sitecore-pipelines/src/index.ts @@ -3,7 +3,7 @@ export { processorFactory, Processor, Pipeline, - ExecutablePipeline + ExecutablePipeline, } from './pipelineFactory'; export { configLoader } from './configLoader'; export { run as runPipeline, runWithCompilers as runPipelineWithCompilers } from './pipeline'; diff --git a/packages/sitecore-pipelines/src/pipeline.test.ts b/packages/sitecore-pipelines/src/pipeline.test.ts index 831be4540d..2a5e5c136d 100644 --- a/packages/sitecore-pipelines/src/pipeline.test.ts +++ b/packages/sitecore-pipelines/src/pipeline.test.ts @@ -17,7 +17,7 @@ describe('runProcessors', () => { { name: 'proc1', process: (args: any) => ({ ...args, proc1result: true }), - }, + } ]; const fileProcessors = () => [ @@ -35,7 +35,7 @@ describe('runProcessors', () => { { name: 'proc2', modulePath: './src/test/pipelines/pipeline0/proc2.ts', - }, + } ]; it('should execute function-based processors', () => { diff --git a/packages/sitecore-pipelines/src/pipeline.ts b/packages/sitecore-pipelines/src/pipeline.ts index 9d9fee6dea..dee187c6b4 100644 --- a/packages/sitecore-pipelines/src/pipeline.ts +++ b/packages/sitecore-pipelines/src/pipeline.ts @@ -21,12 +21,12 @@ const enhanceProcessors = (processors: Processor[]) => }); const runProcessor = async ({ - processor, - args, - }: { - processor: Processor, - args: any - }) => { + processor, + args, +}: { + processor: Processor, + args: any +}) => { if (args && args.debug) { console.log(`executing processor ${processor.name}`); } @@ -62,8 +62,8 @@ const runProcessor = async ({ }; /** - * @param args.processors the processors to run (optional but must be specified if pipeline is not specified) - * @param args.pipelineArgs arguments to pass to the pipeline processors + * @param {Processor[]} args.processors the processors to run (optional but must be specified if pipeline is not specified) + * @param {any} args.pipelineArgs arguments to pass to the pipeline processors */ export const runProcessors = async ({ processors, @@ -90,7 +90,7 @@ export const runProcessors = async ({ }; /** - * @param pipeline the pipeline to run (optional but must be specified if processors is not specified) + * @param {ExecutablePipeline} pipeline the pipeline to run (optional but must be specified if processors is not specified) */ export const run = async (pipeline: ExecutablePipeline) => { if (!pipeline || !pipeline.processors() || pipeline.processors().length === 0) { @@ -117,7 +117,8 @@ export const run = async (pipeline: ExecutablePipeline) => { /** * Run a pipeline, loading specified compilers first - * + * @param {any} compilers + * @returns {any} pipeline result */ export const runWithCompilers = (compilers: any) => async (pipeline: any) => { await initCompilers(compilers); diff --git a/packages/sitecore-pipelines/src/pipelineFactory.ts b/packages/sitecore-pipelines/src/pipelineFactory.ts index 553180fda0..d19dde2c7b 100644 --- a/packages/sitecore-pipelines/src/pipelineFactory.ts +++ b/packages/sitecore-pipelines/src/pipelineFactory.ts @@ -73,6 +73,8 @@ export interface Pipeline extends ExecutablePipeline { export const pipelineFactory = { /** * Create a pipeline + * @param {string} [name] + * @returns {Pipeline} pipeline */ create: (name = '') => { const processors: Processor[] = []; From 8f4f3833d15736c1d15116bfd6235aed99e94ecd Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 13:24:02 +0200 Subject: [PATCH 19/37] push sitecore-jss-angular --- packages/sitecore-jss-angular/.eslintrc | 10 + packages/sitecore-jss-angular/package.json | 4 +- .../src/components/date.directive.ts | 2 +- .../src/components/file.directive.ts | 4 +- .../components/generic-link.directive.spec.ts | 8 +- .../src/components/generic-link.directive.ts | 2 +- .../src/components/image.directive.spec.ts | 16 +- .../src/components/image.directive.ts | 4 +- .../src/components/link.directive.ts | 6 +- .../components/placeholder.component.spec.ts | 42 +-- .../src/components/placeholder.component.ts | 11 +- .../src/components/raw.component.ts | 3 +- .../components/render-component.component.ts | 8 +- .../src/components/rendering-field.ts | 4 +- .../src/components/rich-text.directive.ts | 4 +- .../components/router-link.directive.spec.ts | 4 +- .../src/components/text.directive.ts | 2 +- .../src/jss-component-factory.service.ts | 72 ++--- .../sitecore-jss-angular/src/lib.module.ts | 32 +- .../sitecore-jss-angular/src/public_api.ts | 2 +- packages/sitecore-jss-angular/src/test.ts | 2 +- .../src/testData/ee-data.ts | 294 +++++++++--------- .../src/testData/non-ee-data.ts | 92 +++--- 23 files changed, 325 insertions(+), 303 deletions(-) create mode 100644 packages/sitecore-jss-angular/.eslintrc diff --git a/packages/sitecore-jss-angular/.eslintrc b/packages/sitecore-jss-angular/.eslintrc new file mode 100644 index 0000000000..35ffa3bab9 --- /dev/null +++ b/packages/sitecore-jss-angular/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": [ + "plugin:@angular-eslint/recommended", + "../../.eslintrc" + ], + "rules": { + // TODO: fix errors + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/packages/sitecore-jss-angular/package.json b/packages/sitecore-jss-angular/package.json index 41ba91131a..294d30baae 100644 --- a/packages/sitecore-jss-angular/package.json +++ b/packages/sitecore-jss-angular/package.json @@ -4,7 +4,7 @@ "description": "", "scripts": { "build": "ng-packagr -p ng-package.json", - "lint": "tslint -p . -c tslint.json \"src/**/*.ts\"", + "lint": "eslint --fix ./src/**/*.ts", "test": "karma start", "test:watch": "karma start --no-single-run --browsers Chrome", "coverage": "npm test" @@ -19,6 +19,7 @@ "url": "https://github.com/sitecore/jss/issues" }, "devDependencies": { + "@angular-eslint/eslint-plugin": "^0.8.0-beta.6", "@angular/common": "~10.0.11", "@angular/compiler": "~10.0.11", "@angular/compiler-cli": "~10.0.11", @@ -29,6 +30,7 @@ "@types/jasmine": "^3.4.1", "@types/node": "^12.7.8", "codelyzer": "^4.5.0", + "eslint": "^7.15.0", "jasmine-core": "^3.5.0", "karma": "^5.1.0", "karma-chrome-launcher": "^3.1.0", diff --git a/packages/sitecore-jss-angular/src/components/date.directive.ts b/packages/sitecore-jss-angular/src/components/date.directive.ts index 10aa7d5351..e4bcc9fb3a 100644 --- a/packages/sitecore-jss-angular/src/components/date.directive.ts +++ b/packages/sitecore-jss-angular/src/components/date.directive.ts @@ -30,7 +30,7 @@ export class DateDirective implements OnChanges { ) { } ngOnChanges(changes: SimpleChanges) { - if (changes['field'] || changes['format']) { + if (changes.field || changes.format) { if (!this.viewRef) { this.viewContainer.clear(); this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef); diff --git a/packages/sitecore-jss-angular/src/components/file.directive.ts b/packages/sitecore-jss-angular/src/components/file.directive.ts index 8c91ed8ba7..93e7f9db67 100644 --- a/packages/sitecore-jss-angular/src/components/file.directive.ts +++ b/packages/sitecore-jss-angular/src/components/file.directive.ts @@ -13,11 +13,11 @@ export class FileDirective implements OnChanges { constructor( private viewContainer: ViewContainerRef, - private templateRef: TemplateRef<any>, + private templateRef: TemplateRef<any> ) { } ngOnChanges(changes: SimpleChanges): void { - if (changes['field']) { + if (changes.field) { if (!this.viewRef) { this.viewContainer.clear(); this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef); diff --git a/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts index 5cf360ee94..963a24b137 100644 --- a/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts @@ -28,7 +28,7 @@ describe('<a *scGenericLink />', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [GenericLinkDirective, TestComponent], - imports: [RouterTestingModule] + imports: [RouterTestingModule], }); fixture = TestBed.createComponent(TestComponent); @@ -189,7 +189,7 @@ describe('<a *scGenericLink>children</a>', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [GenericLinkDirective, TestWithChildrenComponent], - imports: [ RouterTestingModule ] + imports: [ RouterTestingModule ], }); fixture = TestBed.createComponent(TestWithChildrenComponent); @@ -232,7 +232,7 @@ describe('<a *scGenericLink></a>', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [GenericLinkDirective, TestComponent], - imports: [ RouterTestingModule.withRoutes([{ path: 'lorem', component: TestComponent }])] + imports: [ RouterTestingModule.withRoutes([{ path: 'lorem', component: TestComponent }])], }); router = TestBed.get(Router); @@ -265,7 +265,7 @@ describe('<a *scGenericLink></a>', () => { href: 'lorem', text: 'ipsum', }; - const queryParams = { queryParams: { foo: 'bar' } } + const queryParams = { queryParams: { foo: 'bar' } }; comp.field = field; comp.extras = queryParams; fixture.detectChanges(); diff --git a/packages/sitecore-jss-angular/src/components/generic-link.directive.ts b/packages/sitecore-jss-angular/src/components/generic-link.directive.ts index 24baa3f8fc..71d620f9ff 100644 --- a/packages/sitecore-jss-angular/src/components/generic-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/generic-link.directive.ts @@ -52,7 +52,7 @@ export class GenericLinkDirective extends LinkDirective { } private isAbsoluteUrl(url?: string) { - if (url == null) { + if (url === null) { return false; } if (typeof url !== 'string') { diff --git a/packages/sitecore-jss-angular/src/components/image.directive.spec.ts b/packages/sitecore-jss-angular/src/components/image.directive.spec.ts index ef7be29a64..4bc643801a 100644 --- a/packages/sitecore-jss-angular/src/components/image.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/image.directive.spec.ts @@ -165,14 +165,14 @@ describe('<img *scImage />', () => { }; beforeEach(() => { - fixture2 = TestBed.createComponent(AnotherTestComponent); - de = fixture2.debugElement; - comp2 = fixture2.componentInstance; - fixture2.detectChanges(); - - comp2.params = imageParams; - comp2.imageAttrs = imageAttrs; - fixture2.detectChanges(); + fixture2 = TestBed.createComponent(AnotherTestComponent); + de = fixture2.debugElement; + comp2 = fixture2.componentInstance; + fixture2.detectChanges(); + + comp2.params = imageParams; + comp2.imageAttrs = imageAttrs; + fixture2.detectChanges(); }); it('should render img with addtional props', () => { diff --git a/packages/sitecore-jss-angular/src/components/image.directive.ts b/packages/sitecore-jss-angular/src/components/image.directive.ts index 79d090f346..24380d8086 100644 --- a/packages/sitecore-jss-angular/src/components/image.directive.ts +++ b/packages/sitecore-jss-angular/src/components/image.directive.ts @@ -36,7 +36,7 @@ export class ImageDirective implements OnChanges { ) { } ngOnChanges(changes: SimpleChanges) { - if (changes['field'] || changes['editable'] || changes['urlParams'] || changes['attrs']) { + if (changes.field || changes.editable || changes.urlParams || changes.attrs) { this.viewContainer.clear(); if (this.inlineRef) { this.inlineRef.remove(); @@ -95,7 +95,7 @@ export class ImageDirective implements OnChanges { ...fieldAttrs, ...parsedAttrs, }; - // tslint:disable-next-line:prefer-const + // eslint-disable-next-line prefer-const let { src, srcSet, ...otherAttrs } = combinedAttrs; if (!src) { return null; diff --git a/packages/sitecore-jss-angular/src/components/link.directive.ts b/packages/sitecore-jss-angular/src/components/link.directive.ts index 3fdc1851a4..7bed3beeab 100644 --- a/packages/sitecore-jss-angular/src/components/link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/link.directive.ts @@ -22,7 +22,7 @@ export class LinkDirective implements OnChanges { ) { } ngOnChanges(changes: SimpleChanges) { - if (changes['field'] || changes['editable'] || changes['attrs']) { + if (changes.field || changes.editable || changes.attrs) { this.viewContainer.clear(); if (this.inlineRef) { this.inlineRef.remove(); @@ -66,7 +66,7 @@ export class LinkDirective implements OnChanges { propValue += ` ${node.className}`; } - this.renderer.setAttribute(node, key, propValue) + this.renderer.setAttribute(node, key, propValue); }); if (node.childNodes && node.childNodes.length === 0 && linkText) { @@ -85,7 +85,7 @@ export class LinkDirective implements OnChanges { ...this.getElementAttrs(), ...this.attrs, }; - Object.entries(attrs).forEach(([key, attrValue]: [string, any]) => + Object.entries(attrs).forEach(([key, attrValue]: [string, any]) => this.renderer.setAttribute(span, key, attrValue) ); diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts index 8e2145e3d0..7483aeab9f 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts @@ -46,7 +46,7 @@ class TestHomeComponent { @Component({ selector: 'test-jumbotron', - template: ``, + template: '', }) class TestJumbotronComponent { } @@ -61,17 +61,17 @@ describe('<sc-placeholder />', () => { TestPlaceholderComponent, TestDownloadCalloutComponent, TestHomeComponent, - TestJumbotronComponent, + TestJumbotronComponent ], imports: [ JssModule.withComponents([ { name: 'DownloadCallout', type: TestDownloadCalloutComponent }, { name: 'Home', type: TestHomeComponent }, - { name: 'Jumbotron', type: TestJumbotronComponent }, - ]), + { name: 'Jumbotron', type: TestJumbotronComponent } + ]) ], providers: [ - { provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader }, + { provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader } ], }).compileComponents(); })); @@ -97,7 +97,7 @@ describe('<sc-placeholder />', () => { const testData = [ { label: 'Dev data', data: nonEeDevData }, { label: 'LayoutService data - EE off', data: nonEeLsData }, - { label: 'LayoutService data - EE on', data: eeData }, + { label: 'LayoutService data - EE on', data: eeData } ]; testData.forEach((dataSet: any) => { @@ -110,16 +110,16 @@ describe('<sc-placeholder />', () => { fixture.detectChanges(); fixture.whenStable() - .then(() => { - fixture.detectChanges(); + .then(() => { + fixture.detectChanges(); - const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); - expect(downloadCallout).not.toBeNull(); - expect(downloadCallout.nativeElement.innerHTML).toContain('Download'); + const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); + expect(downloadCallout).not.toBeNull(); + expect(downloadCallout.nativeElement.innerHTML).toContain('Download'); - const img = de.nativeElement.getElementsByTagName('img')[0]; - expect(img).not.toBeDefined(); - }); + const img = de.nativeElement.getElementsByTagName('img')[0]; + expect(img).not.toBeDefined(); + }); })); it('should render nested placeholders', async(() => { @@ -300,16 +300,16 @@ describe('<sc-placeholder /> with input/ouput binding', () => { TestBed.configureTestingModule({ declarations: [ TestParentComponent, - TestChildComponent, + TestChildComponent ], imports: [ JssModule.withComponents([ { name: 'Parent', type: TestParentComponent }, - { name: 'Child', type: TestChildComponent }, - ]), + { name: 'Child', type: TestChildComponent } + ]) ], providers: [ - { provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader }, + { provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader } ], }); @@ -330,7 +330,7 @@ describe('<sc-placeholder /> with input/ouput binding', () => { children: [ { componentName: 'Child', - }, + } ], }, }; @@ -364,7 +364,7 @@ describe('<sc-placeholder /> with input/ouput binding', () => { }, { componentName: 'Child', - }, + } ], }, }; @@ -389,7 +389,7 @@ describe('<sc-placeholder /> with input/ouput binding', () => { children: [ { componentName: 'Child', - }, + } ], }, }; diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.ts index e419afaaa8..815366e000 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.ts @@ -1,3 +1,4 @@ +/* eslint-disable @angular-eslint/no-conflicting-lifecycle */ import { ChangeDetectorRef, Component, @@ -26,7 +27,7 @@ import { takeWhile } from 'rxjs/operators'; import { ComponentFactoryResult, JssComponentFactoryService } from '../jss-component-factory.service'; import { PlaceholderLoadingDirective } from './placeholder-loading.directive'; import { - PLACEHOLDER_MISSING_COMPONENT_COMPONENT + PLACEHOLDER_MISSING_COMPONENT_COMPONENT, } from './placeholder.token'; import { RenderEachDirective } from './render-each.directive'; import { RenderEmptyDirective } from './render-empty.directive'; @@ -51,7 +52,7 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr private _differ: KeyValueDiffer<string, any>; private _componentInstances: any[] = []; private destroyed = false; - private parentStyleAttribute: string = ''; + private parentStyleAttribute = ''; public isLoading = true; @Input() name?: string; @@ -94,7 +95,7 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr for (let i = 0; i < attributes.length; i++) { const attr: Attr | null = attributes.item(i); if (attr && attr.name.indexOf('_ngcontent') !== -1) { - this.parentStyleAttribute = attr.name; + this.parentStyleAttribute = attr.name; } } } @@ -106,7 +107,7 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr } ngOnChanges(changes: SimpleChanges) { - if (changes['rendering'] || changes['renderings']) { + if (changes.rendering || changes.renderings) { this._render(); } } @@ -151,7 +152,7 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr if (!this.name && !this.renderings) { // tslint:disable-next-line:max-line-length - console.warn(`Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.`); + console.warn('Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.'); this.isLoading = false; return; } diff --git a/packages/sitecore-jss-angular/src/components/raw.component.ts b/packages/sitecore-jss-angular/src/components/raw.component.ts index af45cae0aa..6c63aa14d7 100644 --- a/packages/sitecore-jss-angular/src/components/raw.component.ts +++ b/packages/sitecore-jss-angular/src/components/raw.component.ts @@ -3,7 +3,7 @@ import { HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; @Component({ selector: 'sc-raw', - template: ``, + template: '', }) export class RawComponent implements OnInit { @Input() rendering: HtmlElementRendering; @@ -18,6 +18,7 @@ export class RawComponent implements OnInit { const contents = this.renderer.createText(this.rendering.contents || ''); const attributes = this.rendering.attributes; for (const attr in attributes) { + // eslint-disable-next-line no-prototype-builtins if ((attributes as any).hasOwnProperty(attr)) { const value = attributes[attr]; this.renderer.setAttribute(el, attr, value || ''); diff --git a/packages/sitecore-jss-angular/src/components/render-component.component.ts b/packages/sitecore-jss-angular/src/components/render-component.component.ts index 6d4fad54db..7ab1a34e9c 100644 --- a/packages/sitecore-jss-angular/src/components/render-component.component.ts +++ b/packages/sitecore-jss-angular/src/components/render-component.component.ts @@ -54,7 +54,7 @@ export class RenderComponentComponent implements OnChanges { ) { } ngOnChanges(changes: SimpleChanges) { - if (changes['rendering']) { + if (changes.rendering) { this._render(); } } @@ -68,9 +68,9 @@ export class RenderComponentComponent implements OnChanges { .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable) .forEach((output) => (componentInstance[output] as Observable<any>) .pipe( - takeWhile(() => !this.destroyed) - ) - .subscribe(outputs[output])); + takeWhile(() => !this.destroyed) + ) + .subscribe(outputs[output])); } private _render() { diff --git a/packages/sitecore-jss-angular/src/components/rendering-field.ts b/packages/sitecore-jss-angular/src/components/rendering-field.ts index 0bd913435d..e8d0bfd99a 100644 --- a/packages/sitecore-jss-angular/src/components/rendering-field.ts +++ b/packages/sitecore-jss-angular/src/components/rendering-field.ts @@ -19,7 +19,7 @@ export interface LinkField extends RenderingField { } // tslint:disable-next-line:no-empty-interface -export interface RichTextField extends RenderingField { } +export type RichTextField = RenderingField; // tslint:disable-next-line:no-empty-interface -export interface TextField extends RenderingField { } +export type TextField = RenderingField; diff --git a/packages/sitecore-jss-angular/src/components/rich-text.directive.ts b/packages/sitecore-jss-angular/src/components/rich-text.directive.ts index 40604a3d01..bc30f8cbfa 100644 --- a/packages/sitecore-jss-angular/src/components/rich-text.directive.ts +++ b/packages/sitecore-jss-angular/src/components/rich-text.directive.ts @@ -15,11 +15,11 @@ export class RichTextDirective implements OnChanges { constructor( private viewContainer: ViewContainerRef, - private templateRef: TemplateRef<any>, + private templateRef: TemplateRef<any> ) { } ngOnChanges(changes: SimpleChanges) { - if (changes['field'] || changes['editable']) { + if (changes.field || changes.editable) { if (!this.viewRef) { this.viewContainer.clear(); this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef); diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts index 5b18335d8c..6ca5e2e8e2 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts @@ -26,7 +26,7 @@ describe('<a *scRouterLink />', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [RouterLinkDirective, TestComponent], - imports: [RouterTestingModule] + imports: [RouterTestingModule], }); fixture = TestBed.createComponent(TestComponent); @@ -186,7 +186,7 @@ describe('<a *scRouterLink>children</a>', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [RouterLinkDirective, TestWithChildrenComponent], - imports: [RouterTestingModule] + imports: [RouterTestingModule], }); fixture = TestBed.createComponent(TestWithChildrenComponent); diff --git a/packages/sitecore-jss-angular/src/components/text.directive.ts b/packages/sitecore-jss-angular/src/components/text.directive.ts index 151df47cca..870ee9eb03 100644 --- a/packages/sitecore-jss-angular/src/components/text.directive.ts +++ b/packages/sitecore-jss-angular/src/components/text.directive.ts @@ -22,7 +22,7 @@ export class TextDirective implements OnChanges { ) { } ngOnChanges(changes: SimpleChanges) { - if (changes['field'] || changes['editable'] || changes['encode']) { + if (changes.field || changes.editable || changes.encode) { if (!this.viewRef) { this.viewContainer.clear(); this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef); diff --git a/packages/sitecore-jss-angular/src/jss-component-factory.service.ts b/packages/sitecore-jss-angular/src/jss-component-factory.service.ts index effdb1a9c8..781f886b53 100644 --- a/packages/sitecore-jss-angular/src/jss-component-factory.service.ts +++ b/packages/sitecore-jss-angular/src/jss-component-factory.service.ts @@ -5,7 +5,7 @@ import { Injector, Type, Compiler, - NgModuleFactory + NgModuleFactory, } from '@angular/core'; import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; import { @@ -13,7 +13,7 @@ import { ComponentNameAndType, DYNAMIC_COMPONENT, PLACEHOLDER_COMPONENTS, - PLACEHOLDER_LAZY_COMPONENTS + PLACEHOLDER_LAZY_COMPONENTS, } from './components/placeholder.token'; import { RawComponent } from './components/raw.component'; import { isRawRendering } from './components/rendering'; @@ -35,24 +35,24 @@ export class JssComponentFactoryService { @Inject(PLACEHOLDER_COMPONENTS) private components: ComponentNameAndType[], @Inject(PLACEHOLDER_LAZY_COMPONENTS) private lazyComponents: ComponentNameAndModule[] ) { - this.componentMap = new Map(); - this.lazyComponentMap = new Map(); + this.componentMap = new Map(); + this.lazyComponentMap = new Map(); - this.components.forEach((c) => this.componentMap.set(c.name, c.type)); + this.components.forEach((c) => this.componentMap.set(c.name, c.type)); - if (this.lazyComponents) { - this.lazyComponents.forEach((c) => this.lazyComponentMap.set(c.path, c)); - } - } + if (this.lazyComponents) { + this.lazyComponents.forEach((c) => this.lazyComponentMap.set(c.path, c)); + } + } private loadModuleFactory(lazyComponent: ComponentNameAndModule): Promise<NgModuleFactory<any>> { return lazyComponent.loadChildren().then(loaded => { if (loaded instanceof NgModuleFactory) { - return loaded + return loaded; } else { - return this.compiler.compileModuleAsync(loaded) + return this.compiler.compileModuleAsync(loaded); } - }) + }); } getComponent(component: ComponentRendering): Promise<ComponentFactoryResult> { @@ -69,36 +69,36 @@ export class JssComponentFactoryService { if (lazyComponent) { return this.loadModuleFactory(lazyComponent) - .then((ngModuleFactory) => { - let componentType = null; - const moduleRef = ngModuleFactory.create(this.injector); - const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT); - if (!dynamicComponentType) { - throw new Error( + .then((ngModuleFactory) => { + let componentType = null; + const moduleRef = ngModuleFactory.create(this.injector); + const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT); + if (!dynamicComponentType) { + throw new Error( // tslint:disable-next-line:max-line-length - `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` - ); - } + `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` + ); + } - if (component.componentName in dynamicComponentType) { - componentType = (dynamicComponentType as {[s: string]: any})[component.componentName]; - } else { - if (typeof dynamicComponentType === 'function') { - componentType = dynamicComponentType; + if (component.componentName in dynamicComponentType) { + componentType = (dynamicComponentType as {[s: string]: any})[component.componentName]; } else { - throw new Error( + if (typeof dynamicComponentType === 'function') { + componentType = dynamicComponentType; + } else { + throw new Error( // tslint:disable-next-line:max-line-length - `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` - ); + `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` + ); + } } - } - return { - componentDefinition: component, - componentImplementation: componentType, - componentFactory: moduleRef.componentFactoryResolver.resolveComponentFactory(componentType), - }; - }); + return { + componentDefinition: component, + componentImplementation: componentType, + componentFactory: moduleRef.componentFactoryResolver.resolveComponentFactory(componentType), + }; + }); } return Promise.resolve({ diff --git a/packages/sitecore-jss-angular/src/lib.module.ts b/packages/sitecore-jss-angular/src/lib.module.ts index 4f40e88e07..96a848441c 100644 --- a/packages/sitecore-jss-angular/src/lib.module.ts +++ b/packages/sitecore-jss-angular/src/lib.module.ts @@ -3,7 +3,7 @@ import { ANALYZE_FOR_ENTRY_COMPONENTS, ModuleWithProviders, NgModule, - Type + Type, } from '@angular/core'; import { ROUTES } from '@angular/router'; import { DateDirective } from './components/date.directive'; @@ -20,7 +20,7 @@ import { DYNAMIC_COMPONENT, PLACEHOLDER_COMPONENTS, PLACEHOLDER_LAZY_COMPONENTS, - PLACEHOLDER_MISSING_COMPONENT_COMPONENT + PLACEHOLDER_MISSING_COMPONENT_COMPONENT, } from './components/placeholder.token'; import { RawComponent } from './components/raw.component'; import { RenderComponentComponent } from './components/render-component.component'; @@ -34,7 +34,7 @@ import { LayoutService } from './layout.service'; @NgModule({ imports: [ - CommonModule, + CommonModule ], declarations: [ FileDirective, @@ -51,7 +51,7 @@ import { LayoutService } from './layout.service'; RawComponent, RichTextDirective, TextDirective, - MissingComponentComponent, + MissingComponentComponent ], exports: [ FileDirective, @@ -66,17 +66,18 @@ import { LayoutService } from './layout.service'; PlaceholderComponent, PlaceholderLoadingDirective, RichTextDirective, - TextDirective, + TextDirective ], - entryComponents: [ - RawComponent, - MissingComponentComponent, + entryComponents: [ + RawComponent, + MissingComponentComponent ], }) export class JssModule { /** * Instantiates the JSS module with no component factory. * Useful for using it from libraries. Most of the time you'd want withComponents() + * @returns {ModuleWithProviders<JssModule>} module */ static forRoot(): ModuleWithProviders<JssModule> { return { @@ -84,19 +85,23 @@ export class JssModule { providers: [ LayoutService, DatePipe, - JssComponentFactoryService, + JssComponentFactoryService ], }; } - /** Instantiates a module for a lazy-loaded JSS component */ + /** + * Instantiates a module for a lazy-loaded JSS component + * @param {Type<any>} component + * @returns {ModuleWithProviders<JssModule>} module + */ static forChild(component: Type<any>): ModuleWithProviders<JssModule> { return { ngModule: JssModule, providers: [ { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: component, multi: true }, { provide: ROUTES, useValue: [], multi: true }, - { provide: DYNAMIC_COMPONENT, useValue: component }, + { provide: DYNAMIC_COMPONENT, useValue: component } ], }; } @@ -104,6 +109,9 @@ export class JssModule { /** * Instantiates the JSS module and specifies the mapping from component name to component implementation. * Appropriate when defining the set of JSS components that your app is aware of. + * @param {ComponentNameAndType[]} components + * @param {ComponentNameAndModule[]} [lazyComponents] + * @returns {ModuleWithProviders<JssModule>} module */ static withComponents(components: ComponentNameAndType[], lazyComponents?: ComponentNameAndModule[]): ModuleWithProviders<JssModule> { return { @@ -118,7 +126,7 @@ export class JssModule { { provide: PLACEHOLDER_LAZY_COMPONENTS, useValue: lazyComponents || [] }, { provide: ROUTES, useValue: lazyComponents || [], multi: true }, { provide: PLACEHOLDER_MISSING_COMPONENT_COMPONENT, useValue: MissingComponentComponent }, - ...(JssModule.forRoot().providers as any[]), + ...(JssModule.forRoot().providers as any[]) ], }; } diff --git a/packages/sitecore-jss-angular/src/public_api.ts b/packages/sitecore-jss-angular/src/public_api.ts index 9c6bf829b2..ef61807712 100644 --- a/packages/sitecore-jss-angular/src/public_api.ts +++ b/packages/sitecore-jss-angular/src/public_api.ts @@ -31,5 +31,5 @@ export { ComponentParams, HttpJsonFetcher, HttpResponse, - isServer + isServer, } from '@sitecore-jss/sitecore-jss'; diff --git a/packages/sitecore-jss-angular/src/test.ts b/packages/sitecore-jss-angular/src/test.ts index 073b6583ad..44866e571b 100644 --- a/packages/sitecore-jss-angular/src/test.ts +++ b/packages/sitecore-jss-angular/src/test.ts @@ -7,5 +7,5 @@ import { // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting(), + platformBrowserDynamicTesting() ); diff --git a/packages/sitecore-jss-angular/src/testData/ee-data.ts b/packages/sitecore-jss-angular/src/testData/ee-data.ts index 08554bb55a..13cbae5f27 100644 --- a/packages/sitecore-jss-angular/src/testData/ee-data.ts +++ b/packages/sitecore-jss-angular/src/testData/ee-data.ts @@ -8,240 +8,240 @@ export const convertedData = { pageEditing: true, }, route: { - name: "home", - displayName: "Home", + name: 'home', + displayName: 'Home', placeholders: { main: [ { - 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\":\"main\",\"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":"main","expandedDisplayName":null}', attributes: { - "type": "text/sitecore", - "chrometype": "placeholder", - "kind": "open", - "id": "main", - "key": "main", - "class": "scpm", - "data-selectable": "true", + type: 'text/sitecore', + chrometype: 'placeholder', + kind: 'open', + id: 'main', + key: 'main', + 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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})',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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})',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/{F142E1B0-EFD1-4730-BBC5-C30064AD19D9}?lang=en&ver=1\",\"custom\":{\"renderingID\":\"6CAAAD00D87A4B71BA0E763BA7003FE5\",\"editable\":\"true\"},\"displayName\":\"HomeRendering\",\"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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})\',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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})\',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/{F142E1B0-EFD1-4730-BBC5-C30064AD19D9}?lang=en&ver=1","custom":{"renderingID":"6CAAAD00D87A4B71BA0E763BA7003FE5","editable":"true"},"displayName":"HomeRendering","expandedDisplayName":null}', attributes: { - "type": "text/sitecore", - "chrometype": "rendering", - "kind": "open", - "hintname": "HomeRendering", - "id": "r_2339622D093B4258833495979E41EFA6", - "class": "scpm", - "data-selectable": "true", + type: 'text/sitecore', + chrometype: 'rendering', + kind: 'open', + hintname: 'HomeRendering', + id: 'r_2339622D093B4258833495979E41EFA6', + class: 'scpm', + 'data-selectable': 'true', }, }, { - uid: "2339622d-093b-4258-8334-95979e41efa6", - componentName: "Home", + uid: '2339622d-093b-4258-8334-95979e41efa6', + componentName: 'Home', fields: { message: { - value: "JavaScript all the things!", - editable: "JavaScript all the things!", + value: 'JavaScript all the things!', + editable: 'JavaScript all the things!', }, }, params: {}, placeholders: { - "page-header": [ + 'page-header': [ { - 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-header\",\"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-header","expandedDisplayName":null}', attributes: { - "type": "text/sitecore", - "chrometype": "placeholder", - "kind": "open", - "id": "page_header", - "key": "page-header", - "class": "scpm", - "data-selectable": "true", + type: 'text/sitecore', + chrometype: 'placeholder', + kind: 'open', + id: 'page_header', + key: 'page-header', + 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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})',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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})',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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1\",\"custom\":{\"renderingID\":\"A46171E90E6E4F4CABFD0B2A642A2C11\",\"editable\":\"true\"},\"displayName\":\"JumbotronRendering\",\"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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})\',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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})\',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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{"renderingID":"A46171E90E6E4F4CABFD0B2A642A2C11","editable":"true"},"displayName":"JumbotronRendering","expandedDisplayName":null}', attributes: { - "type": "text/sitecore", - "chrometype": "rendering", - "kind": "open", - "hintname": "JumbotronRendering", - "id": "r_53C31A2A75D543C6A0B866B7C7859C30", - "class": "scpm", - "data-selectable": "true", + type: 'text/sitecore', + chrometype: 'rendering', + kind: 'open', + hintname: 'JumbotronRendering', + id: 'r_53C31A2A75D543C6A0B866B7C7859C30', + class: 'scpm', + 'data-selectable': 'true', }, }, { - uid: "53c31a2a-75d5-43c6-a0b8-66b7c7859c30", - componentName: "Jumbotron", + uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', + componentName: 'Jumbotron', fields: { titleText: { - value: "Your Favorite Source of Free Bootstrap Themes!", - editable: "<input id='fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17' class='scFieldValue' name='fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17' type='hidden' value=\"Your Favorite Source of Free Bootstrap Themes!\" /><span class=\"scChromeData\">{\"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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"TitleText\",\"expandedDisplayName\":null}</span><span id=\"fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17_edit\" sc_parameters=\"prevent-line-break=true\" contenteditable=\"true\" class=\"scWebEditInput\" scFieldType=\"single-line text\" scDefaultText=\"[No text in field]\">Your Favorite Source of Free Bootstrap Themes!</span>", + value: 'Your Favorite Source of Free Bootstrap Themes!', + editable: '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17\' type=\'hidden\' value="Your Favorite Source of Free Bootstrap Themes!" /><span class="scChromeData">{"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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{},"displayName":"TitleText","expandedDisplayName":null}</span><span id="fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Your Favorite Source of Free Bootstrap Themes!</span>', }, body: { - value: "<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>", - editable: "<input id='fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19' class='scFieldValue' name='fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19' type='hidden' value=\"<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>\" /><span class=\"scChromeData\">{\"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}</span><span scFieldType=\"rich text\" scDefaultText=\"[No text in field]\" contenteditable=\"true\" class=\"scWebEditInput\" id=\"fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit\"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>", + value: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', + editable: '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' type=\'hidden\' value="<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>" /><span class="scChromeData">{"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}</span><span scFieldType="rich text" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>', }, }, 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: "<input id='fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20' class='scFieldValue' name='fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20' type='hidden' value=\"Download\" /><span class=\"scChromeData\">{\"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}</span><span id=\"fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20_edit\" sc_parameters=\"prevent-line-break=true\" contenteditable=\"true\" class=\"scWebEditInput\" scFieldType=\"single-line text\" scDefaultText=\"[No text in field]\">Download</span>", + value: 'Download', + editable: '<input id=\'fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20\' class=\'scFieldValue\' name=\'fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20\' type=\'hidden\' value="Download" /><span class="scChromeData">{"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}</span><span id="fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Download</span>', }, }, params: {}, }, { - name: "div", - type: "", - contents: "<div style=\"height:50px;background: transparent url('/sitecore/shell/themes/standard/images/pageeditor/bg_hidden_rendering.png') repeat;\"></div>", + name: 'div', + type: '', + contents: '<div style="height:50px;background: transparent url(\'/sitecore/shell/themes/standard/images/pageeditor/bg_hidden_rendering.png\') repeat;"></div>', 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: "<input id='fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15' class='scFieldValue' name='fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15' type='hidden' value=\"This is a some sample <p>field data</p> o'boy! "wow"\" /><span class=\"scChromeData\">{\"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}</span><span id=\"fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit\" sc_parameters=\"prevent-line-break=true\" contenteditable=\"true\" class=\"scWebEditInput\" scFieldType=\"single-line text\" scDefaultText=\"[No text in field]\">This is a some sample <p>field data</p> o'boy! "wow"</span>", + key: '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', }, }, }, }; -export const imageField = "<input id='fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13' class='scFieldValue' name='fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13' type='hidden' value=\"<image mediaid="{B013777F-C6CA-4880-9562-B9B7688AF63A}" />\" /><code id=\"fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13_edit\" type=\"text/sitecore\" chromeType=\"field\" scFieldType=\"image\" class=\"scpm\" kind=\"open\">{\"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}</code><img src=\"http://jssadvancedapp/sitecore/shell/-/media/JssAdvancedApp/assets/img/portfolio/1.ashx?h=350&la=en&w=650&hash=B973470AA333773341C62A76511361C88897E2D4\" alt=\"\" width=\"650\" height=\"350\" /><code class=\"scpm\" type=\"text/sitecore\" chromeType=\"field\" kind=\"close\"></code>"; -export const richTextField = "<input id='fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19' class='scFieldValue' name='fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19' type='hidden' value=\"<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>\" /><span class=\"scChromeData\">{\"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}</span><span scFieldType=\"rich text\" scDefaultText=\"[No text in field]\" contenteditable=\"true\" class=\"scWebEditInput\" id=\"fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit\"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>"; -export const generalLinkField = "<input id='fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159' class='scFieldValue' name='fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159' type='hidden' value=\"<link text="hello world" anchor="anchor" linktype="internal" class="stylin" title="yo yo" target="_blank" querystring="queryin=true" id="{7BD4252E-F91A-426F-8663-815A6492DDF8}" \/>\" \/><code id=\"fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159_edit\" type=\"text\/sitecore\" chromeType=\"field\" scFieldType=\"general link\" class=\"scpm\" kind=\"open\">{\"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><a class=\"stylin\" title=\"yo yo\" href=\"\/services?queryin=true#anchor\" target=\"_blank\">hello world<\/a><code class=\"scpm\" type=\"text\/sitecore\" chromeType=\"field\" kind=\"close\"><\/code>"; -export const textField = "<input id=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' class=\'scFieldValue\' name=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' type=\'hidden\' value=\"Sturdy Templates\" \/><span class=\"scChromeData\">{\"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><span id=\"fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135_edit\" sc_parameters=\"prevent-line-break=true\" contenteditable=\"true\" class=\"scWebEditInput\" scFieldType=\"single-line text\" scDefaultText=\"[No text in field]\">Sturdy Templates<\/span>"; +export const imageField = '<input id=\'fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13\' class=\'scFieldValue\' name=\'fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13\' type=\'hidden\' value="<image mediaid="{B013777F-C6CA-4880-9562-B9B7688AF63A}" />" /><code id="fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13_edit" type="text/sitecore" chromeType="field" scFieldType="image" class="scpm" kind="open">{"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}</code><img src="http://jssadvancedapp/sitecore/shell/-/media/JssAdvancedApp/assets/img/portfolio/1.ashx?h=350&la=en&w=650&hash=B973470AA333773341C62A76511361C88897E2D4" alt="" width="650" height="350" /><code class="scpm" type="text/sitecore" chromeType="field" kind="close"></code>'; +export const richTextField = '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' type=\'hidden\' value="<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>" /><span class="scChromeData">{"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}</span><span scFieldType="rich text" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>'; +export const generalLinkField = '<input id=\'fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159\' class=\'scFieldValue\' name=\'fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159\' type=\'hidden\' value="<link text="hello world" anchor="anchor" linktype="internal" class="stylin" title="yo yo" target="_blank" querystring="queryin=true" id="{7BD4252E-F91A-426F-8663-815A6492DDF8}" \/>" \/><code id="fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159_edit" type="text\/sitecore" chromeType="field" scFieldType="general link" class="scpm" kind="open">{"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><a class="stylin" title="yo yo" href="\/services?queryin=true#anchor" target="_blank">hello world<\/a><code class="scpm" type="text\/sitecore" chromeType="field" kind="close"><\/code>'; +export const textField = '<input id=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' class=\'scFieldValue\' name=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' type=\'hidden\' value="Sturdy Templates" \/><span class="scChromeData">{"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><span id="fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Sturdy Templates<\/span>'; 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..19f5c6613f 100644 --- a/packages/sitecore-jss-angular/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-angular/src/testData/non-ee-data.ts @@ -8,56 +8,56 @@ export const convertedDevData = { 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: "<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>", + value: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', }, }, - 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: [], - }, + } ], }, - }, + } ], }, 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,66 +69,66 @@ 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: "<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>", - editable: "<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>", + value: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', + editable: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', }, }, 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: [], - }, + } ], }, - }, + } ], }, 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"', }, }, }, From 214905340b4ed7f90717fa155f10fab3770eec6a Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 13:29:36 +0200 Subject: [PATCH 20/37] push root --- .eslintrc | 1 + package.json | 6 ++---- packages/sitecore-jss-angular/tslint.json | 8 -------- 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 packages/sitecore-jss-angular/tslint.json diff --git a/.eslintrc b/.eslintrc index 1e3a7d078e..850b6a6c12 100644 --- a/.eslintrc +++ b/.eslintrc @@ -39,6 +39,7 @@ "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/semi": "error", "@typescript-eslint/no-var-requires": "off", + "no-useless-escape": "off", "no-restricted-globals": "off", "no-restricted-properties": "off", "spaced-comment": "error", diff --git a/package.json b/package.json index 75b5039991..d9aea39d2c 100644 --- a/package.json +++ b/package.json @@ -23,15 +23,13 @@ "url": "https://github.com/sitecore/jss/issues" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^4.10.0", + "@typescript-eslint/parser": "^4.10.0", "babel-eslint": "10.1.0", "eslint": "^6.6.0", "eslint-config-airbnb-base": "^13.1.0", "eslint-config-prettier": "^6.2.0", - "eslint-plugin-import": "^2.14.0", "eslint-plugin-prettier": "^3.1.0", - "eslint-plugin-react": "^7.11.1", - "eslint-plugin-react-native": "^3.3.0", - "eslint-plugin-vue": "^4.7.1", "lerna": "^3.4.0", "metro": "^0.60.0", "nyc": "^14.1.1", 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" - ] -} From 47c1dea3fc9cbfa81bdcdc2520906b9f379f8c4c Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 14:05:13 +0200 Subject: [PATCH 21/37] push sitecore-jss-nextjs --- packages/sitecore-jss-nextjs/global.d.ts | 1 + .../components/ComponentPropsContext.test.tsx | 39 ++++++++++--------- .../src/components/Link.test.tsx | 10 ++--- .../src/components/RichText.test.tsx | 6 ++- packages/sitecore-jss-nextjs/src/index.ts | 6 +-- .../services/component-props-service.test.ts | 23 ++++++----- .../src/services/component-props-service.ts | 1 + .../src/testData/ee-data.ts | 8 ++-- .../src/testData/non-ee-data.ts | 12 +++--- .../src/tests/jsdom-setup.ts | 3 ++ .../sitecore-jss-nextjs/src/tests/shim.ts | 2 + 11 files changed, 63 insertions(+), 48 deletions(-) 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/src/components/ComponentPropsContext.test.tsx b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx index 97d5924c86..84b622981c 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,34 @@ describe('ComponentPropsContext', () => { const VALUE = Object.freeze({ x1: 101, y1: 202 }); const X1Component = () => { - const data = useComponentProps<number>('x1'); - - return ( - <div>First: {data}</div> - ) + const data = useComponentProps<number>('x1'); + + return ( + <div>First: {data}</div> + ); }; const X2Component = () => { - const data = useComponentProps<number>('y1'); - - return ( - <div>Second: {data}</div> - ) + const data = useComponentProps<number>('y1'); + + return ( + <div>Second: {data}</div> + ); }; it('should render', () => { const component = mount(<ComponentPropsContext value={VALUE}> - <> - <X1Component /> - <X2Component /> - </> - </ComponentPropsContext>); + <> + <X1Component /> + <X2Component /> + </> + </ComponentPropsContext>); - const x1Div = component.find(X1Component); - const x2Div = component.find(X2Component); + const x1Div = component.find(X1Component); + const x2Div = component.find(X2Component); - expect(x1Div.contains(<div>First: 101</div>)).to.be.true; + expect(x1Div.contains(<div>First: 101</div>)).to.be.true; - expect(x2Div.contains(<div>Second: 202</div>)).to.be.true; + expect(x2Div.contains(<div>Second: 202</div>)).to.be.true; }); }); diff --git a/packages/sitecore-jss-nextjs/src/components/Link.test.tsx b/packages/sitecore-jss-nextjs/src/components/Link.test.tsx index 2f3a2b40a8..4fe50f1aca 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('<Link />', () => { 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', @@ -201,9 +201,9 @@ describe('<Link />', () => { ); 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/RichText.test.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx index 072c5bfe38..a9e8fe7f4c 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 }) => ( <RouterContext.Provider value={value || Router()}>{children}</RouterContext.Provider> ); @@ -40,7 +42,7 @@ describe('RichText', () => { const props = { field: { - value: `<div id="test"><h1>Hello!</h1><a href="/t10">1</a><a href="/t10">2</a></div>`, + value: '<div id="test"><h1>Hello!</h1><a href="/t10">1</a><a href="/t10">2</a></div>', }, }; @@ -90,7 +92,7 @@ describe('RichText', () => { const props = { field: { - value: `<div id="test"><h1>Hello!</h1><a href="/testpath/t1">t1</a><a href="/t2">t2</a></div>`, + value: '<div id="test"><h1>Hello!</h1><a href="/testpath/t1">t1</a><a href="/t2">t2</a></div>', }, internalLinksSelector: 'a[href^="/testpath"]', }; diff --git a/packages/sitecore-jss-nextjs/src/index.ts b/packages/sitecore-jss-nextjs/src/index.ts index d1e9d7d37f..bf7370638e 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,9 +44,9 @@ export { useComponentProps, } from './components/ComponentPropsContext'; -export { +export { EditingData, - EditingRequest + EditingRequest, } from './sharedTypes/editing-data'; export { Link } from './components/Link'; 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..5ed01fca31 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'; @@ -32,13 +33,13 @@ describe('ComponentPropsService', () => { x14ph: [ rendering('x16', 'MyCustomComponent'), rendering('x161', 'MyCustomComponent'), - rendering('x17'), + rendering('x17') ], }, - }, + } ], }, - }, + } ], x21ph: [ rendering('x21'), @@ -48,7 +49,7 @@ describe('ComponentPropsService', () => { x22ph: [rendering('x23', 'MyCustomComponent')], }, }, - rendering('x24'), + rendering('x24') ], }; @@ -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'), @@ -274,7 +279,7 @@ describe('ComponentPropsService', () => { rendering: { uid: 'x24', componentName: 'namex24' }, layoutData, context, - }, + } ]); }); @@ -283,7 +288,7 @@ describe('ComponentPropsService', () => { const requests: ComponentPropsRequest<CustomContext>[] = [ req(11, 'x1'), req(22, 'x2'), - req(33, 'x3'), + req(33, 'x3') ]; const result = await service.execRequests(requests); @@ -326,7 +331,7 @@ describe('ComponentPropsService', () => { const requests: ComponentPropsRequest<CustomContext>[] = [ req(11, 'x1'), req(null, 'x2', 'You do not have access rights to load data for this component'), - req(33, 'x3'), + req(33, 'x3') ]; const result = await service.execRequests(requests); @@ -371,7 +376,7 @@ describe('ComponentPropsService', () => { const requests: ComponentPropsRequest<CustomContext>[] = [ req(11, 'x1'), req(22, undefined), - req(33, 'x3'), + req(33, 'x3') ]; const result = await service.execRequests(requests); @@ -420,7 +425,7 @@ describe('ComponentPropsService', () => { rendering('22'), rendering('111'), rendering('222'), - rendering('333'), + rendering('333') ]); }); 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 3cf6fa8623..5b227a2b0e 100644 --- a/packages/sitecore-jss-nextjs/src/services/component-props-service.ts +++ b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts @@ -79,6 +79,7 @@ export class ComponentPropsService { /** * Editing mode * Fetch component props using getInitialProps function + * @param {FetchComponentPropsArguments<NextPageContext>} params */ async fetchInitialComponentProps( params: FetchComponentPropsArguments<NextPageContext> diff --git a/packages/sitecore-jss-nextjs/src/testData/ee-data.ts b/packages/sitecore-jss-nextjs/src/testData/ee-data.ts index 8bc5790127..70c6c398ca 100644 --- a/packages/sitecore-jss-nextjs/src/testData/ee-data.ts +++ b/packages/sitecore-jss-nextjs/src/testData/ee-data.ts @@ -126,7 +126,7 @@ export const convertedData = { hintname: 'page-header', class: 'scpm', }, - }, + } ], 'page-content': [ { @@ -209,7 +209,7 @@ export const convertedData = { hintname: 'page-content', class: 'scpm', }, - }, + } ], }, }, @@ -238,14 +238,14 @@ export const convertedData = { hintname: 'main', class: 'scpm', }, - }, + } ], }, fields: { key: { value: '', editable: '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', - } + }, }, }, }, diff --git a/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts b/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts index cd1a7d4a31..3920163289 100644 --- a/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts @@ -35,7 +35,7 @@ export const convertedDevData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -47,10 +47,10 @@ export const convertedDevData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - }, + } ], }, - }, + } ], }, fields: { @@ -107,7 +107,7 @@ export const convertedLayoutServiceData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -120,10 +120,10 @@ export const convertedLayoutServiceData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - }, + } ], }, - }, + } ], }, fields: { diff --git a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts index a75551d697..66661b2e38 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'); 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) => { From 40c8c936058eb6dd1403708230b7dc7e9ec4cd04 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 14:43:58 +0200 Subject: [PATCH 22/37] push sitecore jss next js editing host --- .../package.json | 4 +- .../src/absolutify.ts | 7 +- .../src/config.test.ts | 14 +-- .../src/config.ts | 8 +- .../src/editing-middleware.test.ts | 14 +-- .../src/editing-middleware.ts | 19 ++-- .../src/editing-server.ts | 9 +- .../src/html-processors.test.ts | 10 +- .../src/html-processors.ts | 4 +- .../src/index.ts | 10 +- .../src/testData/ee-data.ts | 2 +- .../tslint.json | 100 ------------------ 12 files changed, 56 insertions(+), 145 deletions(-) delete mode 100644 packages/sitecore-jss-nextjs-editing-host/tslint.json 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..c26fdb6dd0 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,6 +28,9 @@ 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 { return str.replace(captureRx, (_full, prefix, prop, url) => { 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..64a59a5c4a 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 }); @@ -30,13 +30,13 @@ describe('config', () => { const nextConfig = withEditing(); 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); }); - + it('should override existing env.publicUrl', () => { const withEditing = config({ enabled: true }); const nextConfig = withEditing({ env: { publicUrl: 'http://something.else' }}); @@ -58,7 +58,7 @@ describe('config', () => { 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); @@ -93,7 +93,7 @@ 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'); }); diff --git a/packages/sitecore-jss-nextjs-editing-host/src/config.ts b/packages/sitecore-jss-nextjs-editing-host/src/config.ts index 9567ad6ea6..d6dd8db849 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/config.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/config.ts @@ -21,11 +21,13 @@ 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 = {}) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return function plugin(nextConfig: any = {}) { if (!enabled) { return nextConfig; @@ -45,10 +47,10 @@ export function config({ // 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 +60,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..02cce1a846 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,4 +1,6 @@ -/// <reference types="../global" /> +/* eslint-disable no-unused-expressions */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +// / <reference types="../global" /> import chai from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; @@ -14,7 +16,7 @@ chai.use(sinonChai); const EDIT_ROUTE = '_edit'; -const mockRequest = (body?: object) => { +const mockRequest = (body?: any) => { return { method: 'POST', url: '/', @@ -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(); @@ -76,7 +78,7 @@ describe('EditingMiddleware', () => { await handler(req, res); 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(); @@ -127,7 +129,7 @@ describe('EditingMiddleware', () => { const res = mockResponse(); const html = '<html></html>'; const processor = { - processHtml: sinon.stub() + processHtml: sinon.stub(), } as HtmlProcessor; const nextApp = sinon.createStubInstance(Server); @@ -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); 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..644d951082 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts @@ -1,22 +1,25 @@ +// eslint-disable-next-line spaced-comment /// <reference types="../global" /> import { parse } from 'url'; import { Request, Response } from 'express'; import Server from 'next/dist/next-server/server/next-server'; import { EditingData } from '@sitecore-jss/sitecore-jss-nextjs'; import { HtmlProcessor } from './html-processors'; - -/** +export class EditingMiddleware { + /** * Express middleware for handling requests from the Sitecore Experience Editor. * @constructor - * @param {object} nextApp The Next.js app. + * @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. */ -export class EditingMiddleware { constructor(readonly nextApp: Server, readonly editRoute: string, readonly htmlProcessors?: HtmlProcessor[]) {} /** * Returns the Express request handler for Experience Editor POST requests. + * @param {Request} req + * @param {Response} res + * @returns {Promise<void>} request handler */ public getRequestHandler(): (req: Request, res: Response) => Promise<void> { return this.handleRequest; @@ -52,7 +55,7 @@ export class EditingMiddleware { // Run any post-render processing of the html if (this.htmlProcessors) { this.htmlProcessors.forEach(processor => { - html = processor.processHtml(html!); + html = html && processor.processHtml(html); }); } @@ -66,7 +69,7 @@ export class EditingMiddleware { html: `<html><body>${err}</body></html>`, }); } - } + }; } export function extractEditingData(req: Request): EditingData { @@ -88,9 +91,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..8fdd96dda7 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[]; } @@ -63,8 +63,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,6 +72,7 @@ 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 + // eslint-disable-next-line @typescript-eslint/no-explicit-any const editHandlers: any[] = [ bodyParser.json({ limit: '2mb' }), handleEdit ]; if (enableCompression) { editHandlers.unshift(compression()); @@ -83,7 +84,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..7c74af2f0e 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 @@ -22,7 +22,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 +40,7 @@ describe('AbsolutifyHtmlProcessor', () => { `; html = processor.processHtml(html); - + expect(html).contains('http://test.local/dist/styles.css'); }); @@ -56,7 +56,7 @@ describe('AbsolutifyHtmlProcessor', () => { `; html = processor.processHtml(html); - + expect(html).contains('<a href="http://test.local/">'); }); @@ -77,7 +77,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"'); @@ -100,7 +100,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..ffced460bd 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts @@ -18,7 +18,7 @@ export interface HtmlProcessor { */ export class AbsolutifyHtmlProcessor implements HtmlProcessor { constructor(readonly publicUrl: string, readonly ignoredPaths?: string[]) {} - + processHtml(html: string) { return absolutify(html, (relativeUrl) => { @@ -32,4 +32,4 @@ export class AbsolutifyHtmlProcessor implements HtmlProcessor { 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..ddc0228b79 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/index.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/index.ts @@ -1,18 +1,18 @@ -export { +export { EditingServerOptions, - startEditingServer + startEditingServer, } from './editing-server'; export { - EditingMiddleware + EditingMiddleware, } from './editing-middleware'; export { HtmlProcessor, - AbsolutifyHtmlProcessor + AbsolutifyHtmlProcessor, } from './html-processors'; export { ConfigOptions, - config + 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..8ce0b0a2b6 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 @@ -23,7 +23,7 @@ export const EE_DICTIONARY = '{\"entry1\":\"Entry One\",\"entry2\":\"Entry Two\" export const EE_BODY = { id: 'JssApp', args: [ - EE_PATH, + EE_PATH, EE_LAYOUT, `{\"language\":\"${EE_LANGUAGE}\",\"dictionary\":${EE_DICTIONARY}}` ], 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" - ] - } -} From 5eb06b2340a03b1a3e6824903e226a925b2b485c Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 17:58:44 +0200 Subject: [PATCH 23/37] push --- packages/sitecore-jss-forms/src/FormField.ts | 2 + .../src/components/Date.test.tsx | 25 +++---- .../src/components/File.test.tsx | 1 + .../src/components/Image.test.tsx | 14 ++-- .../src/components/Link.test.tsx | 1 + .../src/components/Placeholder.test.tsx | 18 +++-- .../src/components/RichText.test.tsx | 1 + .../src/components/SitecoreContext.test.tsx | 10 +-- .../src/components/Text.test.tsx | 7 +- .../enhancers/withSitecoreContext.test.tsx | 65 ++++++++++--------- .../src/testData/ee-data.ts | 9 ++- .../src/testData/non-ee-data.ts | 13 ++-- .../src/tests/jsdom-setup.ts | 2 + packages/sitecore-jss-react/src/tests/shim.ts | 2 + samples/react-native/__tests__/App.js | 10 --- samples/react-native/babel.config.js | 2 + samples/react-native/index.js | 4 +- .../sitecore/definitions/routes.sitecore.js | 36 +++++----- .../dataService.connected-tunnel.js | 3 +- .../src/dataService/dataService.connected.js | 17 +++-- .../dataService/dataService.disconnected.js | 14 ++-- samples/react/server/server.js | 8 +-- .../src/boot/Root.js | 5 +- samples/vue/server/server.js | 6 +- samples/vue/src/i18n.js | 7 +- samples/vue/src/lib/GraphQLClientFactory.js | 6 +- 26 files changed, 150 insertions(+), 138 deletions(-) delete mode 100644 samples/react-native/__tests__/App.js diff --git a/packages/sitecore-jss-forms/src/FormField.ts b/packages/sitecore-jss-forms/src/FormField.ts index 2fff161366..8770644748 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'; diff --git a/packages/sitecore-jss-react/src/components/Date.test.tsx b/packages/sitecore-jss-react/src/components/Date.test.tsx index 3f01146383..98b0b4d00b 100644 --- a/packages/sitecore-jss-react/src/components/Date.test.tsx +++ b/packages/sitecore-jss-react/src/components/Date.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { shallow } from 'enzyme'; import React from 'react'; @@ -6,7 +7,7 @@ import { DateField } from './Date'; describe('<DateField />', () => { it('should return null if no editable or value', () => { const p = { - field: {} + field: {}, }; const c = shallow(<DateField {...p} />); @@ -17,8 +18,8 @@ describe('<DateField />', () => { it('should render value', () => { const p = { field: { - value: '23-11-2001' - } + value: '23-11-2001', + }, }; const c = shallow(<DateField {...p} />); @@ -30,9 +31,9 @@ describe('<DateField />', () => { const render = (date: Date | null) => <p>{date ? date.toDateString() : ''}</p>; const p = { field: { - value: '11-23-2001' + value: '11-23-2001', }, - render + render, }; const c = shallow(<DateField {...p} />); @@ -44,23 +45,23 @@ describe('<DateField />', () => { const render = (date: Date | null) => <p>{date ? date.toDateString() : ''}</p>; const p = { field: { - editable: 'xxx' + editable: 'xxx', }, editable: false, - render + render, }; const c = shallow(<DateField {...p} />); expect(c.html()).equal('<p></p>'); - }) + }); it('should render value with provided tag', () => { const p = { field: { - value: '11-23-2001' + value: '11-23-2001', }, - tag: 'h3' + tag: 'h3', }; const c = shallow(<DateField {...p} />); @@ -71,9 +72,9 @@ describe('<DateField />', () => { it('should render editable value', () => { const p = { field: { - editable: '<h1 class="super">11-23-2001</h1>' + editable: '<h1 class="super">11-23-2001</h1>', }, - editable: true + editable: true, }; const c = shallow(<DateField {...p} />); diff --git a/packages/sitecore-jss-react/src/components/File.test.tsx b/packages/sitecore-jss-react/src/components/File.test.tsx index 9dccebf72b..380a68176b 100644 --- a/packages/sitecore-jss-react/src/components/File.test.tsx +++ b/packages/sitecore-jss-react/src/components/File.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { expect } from 'chai'; import { mount } from 'enzyme'; import React from 'react'; diff --git a/packages/sitecore-jss-react/src/components/Image.test.tsx b/packages/sitecore-jss-react/src/components/Image.test.tsx index 44bb688e6c..67a37bb983 100644 --- a/packages/sitecore-jss-react/src/components/Image.test.tsx +++ b/packages/sitecore-jss-react/src/components/Image.test.tsx @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-unused-expressions */ import chai from 'chai'; import chaiString from 'chai-string'; import { mount } from 'enzyme'; @@ -178,7 +180,7 @@ describe('<Image />', () => { id: 'some-id', style: { width: '100%' }, className: 'the-dude-abides', - mediaUrlPrefix: /\/([-~]{1})assets\//i + mediaUrlPrefix: /\/([-~]{1})assets\//i, }; const rendered = mount(<Image {...props} />); @@ -204,7 +206,7 @@ describe('<Image />', () => { width: '100%', }, className: 'the-dude-abides', - mediaUrlPrefix: /\/([-~]{1})assets\//i + mediaUrlPrefix: /\/([-~]{1})assets\//i, }; const rendered = mount(<Image {...props} />); @@ -216,12 +218,12 @@ describe('<Image />', () => { src: '/-assets/img/test0.png', width: 8, height: 10, - } + }, }); expect(rendered.find('img').prop('src')).to.equal('/-/jssmedia/img/test0.png'); }); - + it('should transform url with responsive image object', () => { const props = { media: { @@ -231,7 +233,7 @@ describe('<Image />', () => { sizes: '(min-width: 960px) 300px, 100px', id: 'some-id', className: 'the-dude-abides', - mediaUrlPrefix: /\/([-~]{1})assets\//i + mediaUrlPrefix: /\/([-~]{1})assets\//i, }; const rendered = mount(<Image {...props} />); @@ -244,7 +246,7 @@ describe('<Image />', () => { src: '/-assets/img/test0.png', width: 8, height: 10, - } + }, }); expect(rendered.find('img').prop('src')).to.equal('/-/jssmedia/img/test0.png'); diff --git a/packages/sitecore-jss-react/src/components/Link.test.tsx b/packages/sitecore-jss-react/src/components/Link.test.tsx index c4bf4d7865..12d7433809 100644 --- a/packages/sitecore-jss-react/src/components/Link.test.tsx +++ b/packages/sitecore-jss-react/src/components/Link.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import React from 'react'; import { expect } from 'chai'; import { mount } from 'enzyme'; diff --git a/packages/sitecore-jss-react/src/components/Placeholder.test.tsx b/packages/sitecore-jss-react/src/components/Placeholder.test.tsx index 6a67f715b0..6866c561e7 100644 --- a/packages/sitecore-jss-react/src/components/Placeholder.test.tsx +++ b/packages/sitecore-jss-react/src/components/Placeholder.test.tsx @@ -1,3 +1,6 @@ +/* eslint-disable no-unused-expressions */ +/* eslint-disable react/prop-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import React from 'react'; import PropTypes from 'prop-types'; import { expect } from 'chai'; @@ -16,6 +19,7 @@ const componentFactory: ComponentFactory = (componentName: string) => { const components = new Map<string, React.FC>(); // pass otherProps to page-content to test property cascading through the Placeholder + // eslint-disable-next-line @typescript-eslint/no-unused-vars const Home: React.FC<any> = ({ rendering, render, renderEach, renderEmpty, ...otherProps }) => ( <div className="home-mock"> <Placeholder name="page-header" rendering={rendering} /> @@ -55,7 +59,7 @@ describe('<Placeholder />', () => { const testData = [ { label: 'Dev data', data: nonEeDevData }, { label: 'LayoutService data - EE off', data: nonEeLsData }, - { label: 'LayoutService data - EE on', data: eeData }, + { label: 'LayoutService data - EE on', data: eeData } ]; testData.forEach((dataSet) => { @@ -135,14 +139,14 @@ describe('<Placeholder />', () => { </SitecoreContext> ); - const placeholder = renderedComponent.find(Placeholder) + const placeholder = renderedComponent.find(Placeholder); expect(placeholder.length).to.equal(1); expect(placeholder.children()).to.be.empty; }); - }) + }); it('should render output based on the renderEmpty function in case of no renderings', () => { - let component: any = dataSet.data.sitecore.route; + const component: any = dataSet.data.sitecore.route; const renderings = component.placeholders.main.filter(({ componentName }: any) => !componentName); const myComponent = { ...component, @@ -213,8 +217,8 @@ describe('<Placeholder />', () => { placeholders: { main: [ { - componentName: 'Home' - }, + componentName: 'Home', + } ], }, }; @@ -233,7 +237,7 @@ it('should render MissingComponent for unknown rendering', () => { main: [ { componentName: 'Unknown', - }, + } ], }, }; diff --git a/packages/sitecore-jss-react/src/components/RichText.test.tsx b/packages/sitecore-jss-react/src/components/RichText.test.tsx index 0e287c6695..2811fab72f 100644 --- a/packages/sitecore-jss-react/src/components/RichText.test.tsx +++ b/packages/sitecore-jss-react/src/components/RichText.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import React from 'react'; import { expect } from 'chai'; import { mount } from 'enzyme'; diff --git a/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx b/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx index 08ba788b61..1524f273a1 100644 --- a/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx +++ b/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx @@ -4,7 +4,7 @@ import { shallow } from 'enzyme'; import { SitecoreContext } from './SitecoreContext'; import { ComponentFactory } from './sharedTypes'; -import { withSitecoreContext, ComponentConsumerProps } from '../enhancers/withSitecoreContext' +import { withSitecoreContext, ComponentConsumerProps } from '../enhancers/withSitecoreContext'; interface NestedComponentProps extends ComponentConsumerProps { anotherProperty?: string, @@ -17,7 +17,7 @@ const mockComponentFactory: ComponentFactory = name => components.get(name); const mockSitecoreContext = { x: 'test1', - y: 'test2' + y: 'test2', }; describe('SitecoreContext', () => { @@ -32,19 +32,19 @@ describe('SitecoreContext', () => { expect(value).deep.equal({ x: 'test1', - y: 'test2' + y: 'test2', }); component.instance().setContext({ x: 'test11', - y: 'test22' + y: 'test22', }); const updatedValue = component.instance().state.context; expect(updatedValue).deep.equal({ x: 'test11', - y: 'test22' + y: 'test22', }); }); diff --git a/packages/sitecore-jss-react/src/components/Text.test.tsx b/packages/sitecore-jss-react/src/components/Text.test.tsx index b135ae0af7..b2de3175f4 100644 --- a/packages/sitecore-jss-react/src/components/Text.test.tsx +++ b/packages/sitecore-jss-react/src/components/Text.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import React from 'react'; import { expect } from 'chai'; import { mount } from 'enzyme'; @@ -58,7 +59,7 @@ describe('<Text />', () => { it('should render value with just a value that contains line breaks', () => { const field = { - value: 'xxx\n\naa\nbbb\ndd' + value: 'xxx\n\naa\nbbb\ndd', }; const rendered = mount(<Text tag="span" field={field} />).find('span'); expect(rendered).to.have.length(1); @@ -67,7 +68,7 @@ describe('<Text />', () => { it('should render value with just a value that contains only one line break', () => { const field = { - value: '\n' + value: '\n', }; const rendered = mount(<Text tag="span" field={field} />).find('span'); expect(rendered).to.have.length(1); @@ -92,7 +93,7 @@ describe('<Text />', () => { expect(rendered.html()).to.contain('<input'); expect(rendered.html()).to.contain('<span class="scChromeData">'); }); - + it('should render ee HTML with line breaks', () => { const field = { editable: 'xxx\n\naa\nbbb\n', diff --git a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx index 0534dd6c6e..0be4fb1c36 100644 --- a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import React from 'react'; import { expect, use, spy } from 'chai'; import spies from 'chai-spies'; @@ -14,9 +15,9 @@ describe('withSitecoreContext', () => { const testComponentProps = { context: { - text: 'value' + text: 'value', }, - setContext + setContext, }; const TestComponent: React.FC<any> = (props: any) => ( @@ -59,69 +60,69 @@ describe('withSitecoreContext', () => { const testComponentProps = { context: { - text: 'value' + text: 'value', }, - setContext + setContext, }; - + const TestComponent: React.FC<any> = (props: any) => { - const reactContext = useSitecoreContext(); - const context = reactContext.sitecoreContext as { text: string } - + const reactContext = useSitecoreContext(); + const context = reactContext.sitecoreContext as { text: string }; + return ( <div onClick={reactContext.updateSitecoreContext}> {context.text}{props.customProp} </div> - ) - } - - let wrapper = mount( + ); + }; + + const wrapper = mount( <SitecoreContextReactContext.Provider value={testComponentProps}> <TestComponent customProp="xxx" /> </SitecoreContextReactContext.Provider> ); - + expect(wrapper).to.have.length(1); - + expect(wrapper.find('div').text()).equal(testComponentProps.context.text + 'xxx'); wrapper.find('div').simulate('click'); - + expect(testComponentProps.setContext).not.to.be.called(); - }) - + }); + it('updatable', () => { const setContext = spy(); const testComponentProps = { context: { - text: 'value' + text: 'value', }, - setContext + setContext, }; - + const TestComponent: React.FC<any> = (props: any) => { - const reactContext = useSitecoreContext({ updatable: true }); - const context = reactContext.sitecoreContext as { text: string } - + const reactContext = useSitecoreContext({ updatable: true }); + const context = reactContext.sitecoreContext as { text: string }; + return ( <div onClick={reactContext.updateSitecoreContext}> {context.text}{props.customProp} </div> - ) - } - - let wrapper = mount( + ); + }; + + const wrapper = mount( <SitecoreContextReactContext.Provider value={testComponentProps}> <TestComponent customProp="bbb" /> </SitecoreContextReactContext.Provider> ); - + expect(wrapper).to.have.length(1); - + expect(wrapper.find('div').text()).equal(testComponentProps.context.text + 'bbb'); wrapper.find('div').simulate('click'); expect(testComponentProps.setContext).to.be.called(); - }) - }) -}); \ No newline at end of file + }); + }); +}); diff --git a/packages/sitecore-jss-react/src/testData/ee-data.ts b/packages/sitecore-jss-react/src/testData/ee-data.ts index 6e8e9fae15..70c6c398ca 100644 --- a/packages/sitecore-jss-react/src/testData/ee-data.ts +++ b/packages/sitecore-jss-react/src/testData/ee-data.ts @@ -1,4 +1,3 @@ -// @ts-nocheck export const convertedData = { sitecore: { context: { @@ -127,7 +126,7 @@ export const convertedData = { hintname: 'page-header', class: 'scpm', }, - }, + } ], 'page-content': [ { @@ -210,7 +209,7 @@ export const convertedData = { hintname: 'page-content', class: 'scpm', }, - }, + } ], }, }, @@ -239,14 +238,14 @@ export const convertedData = { hintname: 'main', class: 'scpm', }, - }, + } ], }, fields: { key: { value: '', editable: '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', - } + }, }, }, }, diff --git a/packages/sitecore-jss-react/src/testData/non-ee-data.ts b/packages/sitecore-jss-react/src/testData/non-ee-data.ts index 50754cf768..3920163289 100644 --- a/packages/sitecore-jss-react/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-react/src/testData/non-ee-data.ts @@ -1,4 +1,3 @@ -// @ts-nocheck export const convertedDevData = { sitecore: { context: { @@ -36,7 +35,7 @@ export const convertedDevData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -48,10 +47,10 @@ export const convertedDevData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - }, + } ], }, - }, + } ], }, fields: { @@ -108,7 +107,7 @@ export const convertedLayoutServiceData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - }, + } ], 'page-content': [ { @@ -121,10 +120,10 @@ export const convertedLayoutServiceData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - }, + } ], }, - }, + } ], }, fields: { diff --git a/packages/sitecore-jss-react/src/tests/jsdom-setup.ts b/packages/sitecore-jss-react/src/tests/jsdom-setup.ts index a75551d697..fea0c50e1d 100644 --- a/packages/sitecore-jss-react/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-react/src/tests/jsdom-setup.ts @@ -1,6 +1,8 @@ +/* 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'); diff --git a/packages/sitecore-jss-react/src/tests/shim.ts b/packages/sitecore-jss-react/src/tests/shim.ts index 5b3f7f6529..2d0697f584 100644 --- a/packages/sitecore-jss-react/src/tests/shim.ts +++ b/packages/sitecore-jss-react/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/samples/react-native/__tests__/App.js b/samples/react-native/__tests__/App.js deleted file mode 100644 index 5ead013c18..0000000000 --- a/samples/react-native/__tests__/App.js +++ /dev/null @@ -1,10 +0,0 @@ -import 'react-native'; -import React from 'react'; -import App from '../App'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create(<App />); -}); diff --git a/samples/react-native/babel.config.js b/samples/react-native/babel.config.js index f17e4afb8a..f330f650ed 100644 --- a/samples/react-native/babel.config.js +++ b/samples/react-native/babel.config.js @@ -1,3 +1,5 @@ +/* eslint-disable no-underscore-dangle */ +/* eslint-disable global-require */ module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ diff --git a/samples/react-native/index.js b/samples/react-native/index.js index 69303b34d4..752e7ee3c1 100644 --- a/samples/react-native/index.js +++ b/samples/react-native/index.js @@ -2,8 +2,8 @@ * @format */ -import {AppRegistry} from 'react-native'; +import { AppRegistry } from 'react-native'; import App from './src/App'; -import {name as appName} from './app.json'; +import { name as appName } from './app.json'; AppRegistry.registerComponent(appName, () => App); diff --git a/samples/react-native/sitecore/definitions/routes.sitecore.js b/samples/react-native/sitecore/definitions/routes.sitecore.js index adc91e912d..28d36472e6 100644 --- a/samples/react-native/sitecore/definitions/routes.sitecore.js +++ b/samples/react-native/sitecore/definitions/routes.sitecore.js @@ -6,24 +6,6 @@ import { mergeFs } from '@sitecore-jss/sitecore-jss-dev-tools'; // This file may be extended if you wish to store disconnected route data in some way other than the default, // or to preprocess the route data before it is sent to Sitecore to be ingested - for example to add fields to the route type. -export default function(manifest) { - /* - optional: to add a custom route type with fields - manifest.addRouteType({ - name: "My Special Route Type", - fields: [ - { name: 'metaTitle', displayName: 'Meta Title', type: manifest.fieldTypes.singleLineText } - ] - }); - then, set `result.template = "My Special Route Type"` in convertToRoutes() below - */ - return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json) - .then((result) => convertToRoutes({ data: result, language: manifest.language })) - .then((routeData) => { - addRoute(manifest, routeData); - }); -} - const convertToRoutes = ({ data, language }) => { let result; @@ -44,3 +26,21 @@ const convertToRoutes = ({ data, language }) => { return result; }; + +export default function(manifest) { + /* + optional: to add a custom route type with fields + manifest.addRouteType({ + name: "My Special Route Type", + fields: [ + { name: 'metaTitle', displayName: 'Meta Title', type: manifest.fieldTypes.singleLineText } + ] + }); + then, set `result.template = "My Special Route Type"` in convertToRoutes() below + */ + return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json) + .then((result) => convertToRoutes({ data: result, language: manifest.language })) + .then((routeData) => { + addRoute(manifest, routeData); + }); +} diff --git a/samples/react-native/src/dataService/dataService.connected-tunnel.js b/samples/react-native/src/dataService/dataService.connected-tunnel.js index 837bb5b80e..dbb792178d 100644 --- a/samples/react-native/src/dataService/dataService.connected-tunnel.js +++ b/samples/react-native/src/dataService/dataService.connected-tunnel.js @@ -7,7 +7,8 @@ import { } from './dataService.connected'; import { mapNestedJson } from './util'; -global.__SC_API_HOST__ = __SC_API_HOST__ +// eslint-disable-next-line no-underscore-dangle +global.__SC_API_HOST__ = __SC_API_HOST__; const processObjectProperty = (key, value) => { // replace 'jssreactnative' with ngrok URL. diff --git a/samples/react-native/src/dataService/dataService.connected.js b/samples/react-native/src/dataService/dataService.connected.js index aa4c517f05..1096ec6781 100644 --- a/samples/react-native/src/dataService/dataService.connected.js +++ b/samples/react-native/src/dataService/dataService.connected.js @@ -12,6 +12,7 @@ const { fetchRouteData } = dataApi; * in sitecore-jss library for implementation details/notes. * @param {string} url The URL to request; may include query string * @param {any} data Optional data to POST with the request. + * @returns {AxiosPromise} route data */ function routeDataFetcher(url, data) { return axios({ @@ -24,19 +25,17 @@ function routeDataFetcher(url, data) { }); } -const getFetchOptions = (language) => { - return { - layoutServiceConfig: { host: __SC_API_HOST__ }, - querystringParams: { sc_lang: language, sc_apikey: __SC_API_KEY__ }, - fetcher: routeDataFetcher, - }; -}; +const getFetchOptions = (language) => ({ + layoutServiceConfig: { host: __SC_API_HOST__ }, + querystringParams: { sc_lang: language, sc_apikey: __SC_API_KEY__ }, + fetcher: routeDataFetcher, +}); const getRouteData = (route, { options, language } = {}) => { const fetchOptions = options || getFetchOptions(language); - return fetchRouteData(route, fetchOptions).then( - (data) => (data && data.sitecore ? data.sitecore.route : {}) + return fetchRouteData(route, fetchOptions).then((data) => + data && data.sitecore ? data.sitecore.route : {} ); }; diff --git a/samples/react-native/src/dataService/dataService.disconnected.js b/samples/react-native/src/dataService/dataService.disconnected.js index a650f09c81..f87f5827bf 100644 --- a/samples/react-native/src/dataService/dataService.disconnected.js +++ b/samples/react-native/src/dataService/dataService.disconnected.js @@ -8,19 +8,19 @@ import { convertRouteToLayoutServiceFormat } from '@sitecore-jss/sitecore-jss-re import { images } from 'static-assets'; import styleguideEnData from '../../data/routes/styleguide/en.json'; import styleguideDaDkData from '../../data/routes/styleguide/da-DK.json'; -import homeDataEn from '../../data/routes/en.json' +import homeDataEn from '../../data/routes/en.json'; import { mapNestedJson } from './util'; const data = { en: { '/': homeDataEn, - '/styleguide': styleguideEnData + '/styleguide': styleguideEnData, }, 'da-DK': { '/': null, - '/styleguide': styleguideDaDkData - } -} + '/styleguide': styleguideDaDkData, + }, +}; // In react-native, you need to "import" static assets via `require` statements // When the packager builds your app, it (presumably) statically analyzes your code, extracts @@ -33,7 +33,7 @@ const processObjectProperty = (key, value) => (key === 'src' ? images[value] : v const produceData = (route, language) => { const formattedData = convertRouteToLayoutServiceFormat(data[language][route]); return mapNestedJson(formattedData, processObjectProperty); -} +}; const getRouteData = (route, { language } = {}) => new Promise((resolve, reject) => { @@ -41,7 +41,7 @@ const getRouteData = (route, { language } = {}) => reject(new Error(`no data for route "${route}"`)); } - resolve(produceData(route, language)) + resolve(produceData(route, language)); }); export { getRouteData }; diff --git a/samples/react/server/server.js b/samples/react/server/server.js index 0124561454..bb88188002 100644 --- a/samples/react/server/server.js +++ b/samples/react/server/server.js @@ -3,9 +3,9 @@ import React from 'react'; import { StaticRouter, matchPath } from 'react-router-dom'; import { renderToStringWithData } from 'react-apollo'; import Helmet from 'react-helmet'; -import axios from "axios"; -import http from "http"; -import https from "https"; +import axios from 'axios'; +import http from 'http'; +import https from 'https'; import GraphQLClientFactory from '../src/lib/GraphQLClientFactory'; import config from '../src/temp/config'; import i18ninit from '../src/i18n'; @@ -74,7 +74,7 @@ export function renderView(callback, path, data, viewBag) { // is included in the SSR'ed markup instead of whatever the 'loading' state is. // Not using GraphQL? Use ReactDOMServer.renderToString() instead. renderToStringWithData( - <AppRoot + <AppRoot path={path} Router={StaticRouter} graphQLClient={graphQLClient} diff --git a/samples/sitecore-embedded-jss-app/src/boot/Root.js b/samples/sitecore-embedded-jss-app/src/boot/Root.js index 937f3b7064..435ec2865f 100644 --- a/samples/sitecore-embedded-jss-app/src/boot/Root.js +++ b/samples/sitecore-embedded-jss-app/src/boot/Root.js @@ -10,7 +10,10 @@ import App from '../app'; class Root extends Component { render() { return ( - <SitecoreContext componentFactory={componentFactory} context={this.props.initialState.sitecore.context}> + <SitecoreContext + componentFactory={componentFactory} + context={this.props.initialState.sitecore.context} + > <App route={this.props.initialState.sitecore.route} /> </SitecoreContext> ); diff --git a/samples/vue/server/server.js b/samples/vue/server/server.js index dcf4228f23..22ffd98f27 100644 --- a/samples/vue/server/server.js +++ b/samples/vue/server/server.js @@ -1,9 +1,9 @@ import Vue from 'vue'; import { createRenderer } from 'vue-server-renderer'; import serializeJavascript from 'serialize-javascript'; -import axios from "axios"; -import http from "http"; -import https from "https"; +import axios from 'axios'; +import http from 'http'; +import https from 'https'; import i18ninit from '../src/i18n'; import { createApp } from '../src/createApp'; import { createRouter } from '../src/router'; diff --git a/samples/vue/src/i18n.js b/samples/vue/src/i18n.js index a8785ac7aa..c70c2fac30 100644 --- a/samples/vue/src/i18n.js +++ b/samples/vue/src/i18n.js @@ -35,7 +35,8 @@ export default function i18nInit(language, dictionary) { // if we got dictionary passed, that means we're in a SSR context with a server-provided dictionary // so we do not want a backend, because we already know all possible keys - const appendResource = () => i18n.addResourceBundle(language, 'translation', dictionary, true, true); + const appendResource = () => + i18n.addResourceBundle(language, 'translation', dictionary, true, true); if (!i18n.isInitialized) { i18n.init(options, (error) => { @@ -43,7 +44,7 @@ export default function i18nInit(language, dictionary) { appendResource(); - serverI18n = new VueI18n(i18n) + serverI18n = new VueI18n(i18n); resolve(serverI18n); }); @@ -51,7 +52,7 @@ export default function i18nInit(language, dictionary) { const resolveInstance = () => { appendResource(); resolve(serverI18n); - } + }; if (i18n.language === language) { return resolveInstance(); diff --git a/samples/vue/src/lib/GraphQLClientFactory.js b/samples/vue/src/lib/GraphQLClientFactory.js index cf09cc9e62..6de6fd43e9 100644 --- a/samples/vue/src/lib/GraphQLClientFactory.js +++ b/samples/vue/src/lib/GraphQLClientFactory.js @@ -34,12 +34,12 @@ import { createPersistedQueryLink } from 'apollo-link-persisted-queries'; export default function(endpoint, ssr, initialCacheState) { /* HTTP link selection: default to batched + APQ */ const link = createPersistedQueryLink().concat( - new BatchHttpLink({ + new BatchHttpLink({ uri: endpoint, credentials: 'include', headers: { - connection: "keep-alive" - } + connection: 'keep-alive', + }, }) ); // basic HTTP link From 779f67f88d75e41c71d6538632be8724e9e2dd5e Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Fri, 18 Dec 2020 18:00:49 +0200 Subject: [PATCH 24/37] push react-native sample --- .../assets/images.disconnected.js | 6 +- samples/react-native/build/startPlatform.js | 2 +- samples/react-native/package.json | 2 +- .../definitions/components/Home.sitecore.js | 22 ++-- .../Styleguide-FieldUsage-Custom.sitecore.js | 24 ++-- .../Styleguide-FieldUsage-Image.sitecore.js | 24 ++-- ...Styleguide-FieldUsage-ItemLink.sitecore.js | 4 +- .../Styleguide-FieldUsage-Link.sitecore.js | 24 ++-- .../Styleguide-FieldUsage-Number.sitecore.js | 2 +- ...Styleguide-FieldUsage-RichText.sitecore.js | 34 ++--- .../Styleguide-FieldUsage-Text.sitecore.js | 34 ++--- samples/react-native/src/App.js | 29 +++-- samples/react-native/src/componentFactory.js | 28 ++--- .../react-native/src/components/Home/index.js | 64 +++++----- .../src/components/Home/styles.js | 71 ++++++----- .../Styleguide-ComponentParams/index.js | 97 +++++++-------- .../Styleguide-ComponentParams/styles.js | 52 ++++---- .../Styleguide-FIeldUsage-Date/index.js | 115 +++++++++-------- .../Styleguide-FIeldUsage-Date/styles.js | 10 +- .../Styleguide-FieldUsage-Checkbox/index.js | 73 +++++------ .../Styleguide-FieldUsage-Custom/index.js | 51 ++++---- .../Styleguide-FieldUsage-Image/index.js | 81 ++++++------ .../Styleguide-FieldUsage-Link/index.js | 109 ++++++++-------- .../Styleguide-FieldUsage-Link/styles.js | 16 +-- .../Styleguide-FieldUsage-Number/index.js | 84 ++++++------- .../Styleguide-FieldUsage-RichText/index.js | 62 +++++----- .../Styleguide-FieldUsage-Text/index.js | 64 +++++----- .../Styleguide-FieldUsage-Text/styles.js | 10 +- .../Styleguide-Layout-Tabs-Tab/index.js | 21 ++-- .../Styleguide-Layout-Tabs/index.js | 113 +++++++++-------- .../Styleguide-Layout-Tabs/styles.js | 54 ++++---- .../Styleguide-Multilingual/index.js | 32 ++--- .../Styleguide-Multilingual/styles.js | 24 ++-- .../Styleguide-Specimen.js | 37 +++--- .../components/Styleguide-Specimen/styles.js | 46 +++---- samples/react-native/src/screens/Home.js | 12 +- samples/react-native/src/screens/Route.js | 116 +++++++++--------- .../react-native/src/screens/Styleguide.js | 48 ++++---- 38 files changed, 840 insertions(+), 857 deletions(-) diff --git a/samples/react-native/assets/images.disconnected.js b/samples/react-native/assets/images.disconnected.js index 747d35ce6e..6e789e3c64 100644 --- a/samples/react-native/assets/images.disconnected.js +++ b/samples/react-native/assets/images.disconnected.js @@ -2,9 +2,9 @@ const images = { '/assets/img/banner.jpg': require('./img/banner.jpg'), - '/data/media/img/sc_logo.svg': require('../data/media/img/sc_logo.svg'), - '/data/media/img/sc_logo.png': require('../data/media/img/sc_logo.png'), - '/data/media/img/jss_logo.png': require('../data/media/img/jss_logo.png'), + '/data/media/img/sc_logo.svg': require('../data/media/img/sc_logo.svg'), + '/data/media/img/sc_logo.png': require('../data/media/img/sc_logo.png'), + '/data/media/img/jss_logo.png': require('../data/media/img/jss_logo.png'), }; export { images }; diff --git a/samples/react-native/build/startPlatform.js b/samples/react-native/build/startPlatform.js index e01e646180..32f894b4ec 100644 --- a/samples/react-native/build/startPlatform.js +++ b/samples/react-native/build/startPlatform.js @@ -10,7 +10,7 @@ const start = (platform, envVars, port) => { // by default the RN packager will cache resolved dependencies. // but, we're changing dependencies based on environment variable in .babelrc.js. // so, need to reset the cache on start. - const startCommand = `node node_modules/react-native/local-cli/cli.js start --reset-cache`; + const startCommand = 'node node_modules/react-native/local-cli/cli.js start --reset-cache'; // if on MacOS (darwin), we're using "ttab" to launch terminal windows/tabs if (process.platform === 'darwin') { diff --git a/samples/react-native/package.json b/samples/react-native/package.json index 4383f59cb3..4abf4277ba 100644 --- a/samples/react-native/package.json +++ b/samples/react-native/package.json @@ -51,7 +51,7 @@ "babel-preset-react-native": "4.0.0", "cross-env": "^5.1.3", "cross-spawn": "^6.0.3", - "eslint": "^5.4.0", + "eslint": "^7.15.0", "eslint-config-airbnb-base": "^13.1.0", "eslint-config-prettier": "^3.0.1", "eslint-import-resolver-babel-module": "^4.0.0", diff --git a/samples/react-native/sitecore/definitions/components/Home.sitecore.js b/samples/react-native/sitecore/definitions/components/Home.sitecore.js index 692b76f4fb..39f3caa1cb 100644 --- a/samples/react-native/sitecore/definitions/components/Home.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Home.sitecore.js @@ -1,15 +1,15 @@ import { addComponent, CommonFieldTypes } from '@sitecore-jss/sitecore-jss-manifest'; export default (manifest) => { - addComponent(manifest, { - name: 'Home', - displayName: 'Home', - placeholders: ['jss-main'], - fields: [ - { name: 'styleguideLink', type: CommonFieldTypes.SingleLineText }, - { name: 'title', type: CommonFieldTypes.SingleLineText }, - { name: 'text', type: CommonFieldTypes.RichText }, - { name: 'logoImage', type: CommonFieldTypes.Image }, - ], - }); + addComponent(manifest, { + name: 'Home', + displayName: 'Home', + placeholders: ['jss-main'], + fields: [ + { name: 'styleguideLink', type: CommonFieldTypes.SingleLineText }, + { name: 'title', type: CommonFieldTypes.SingleLineText }, + { name: 'text', type: CommonFieldTypes.RichText }, + { name: 'logoImage', type: CommonFieldTypes.Image }, + ], + }); }; diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Custom.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Custom.sitecore.js index 62b351fd65..e14b52c924 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Custom.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Custom.sitecore.js @@ -6,16 +6,16 @@ import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore * This function is invoked by convention (*.sitecore.js) when 'jss manifest' is run. * @param {Manifest} manifest Manifest instance to add components to */ -export default function (manifest) { - manifest.addComponent({ - name: 'Styleguide-FieldUsage-Custom', - icon: SitecoreIcon.Gearwheel, - // NOTE: not using 'CommonFieldTypes' here, because it's a custom field. - // The 'Integer' field ships with Sitecore; something really custom would need to be - // implemented as a Sitecore field type as well. - fields: [{ name: 'customIntField', type: 'Integer' }], - // inherit fields from another template (../templates/Styleguide-Explanatory-Component) - // inheritance adds fields defined on the base template(s) implicitly to this component - inherits: ['styleguide-explanatory-component-template'], - }); +export default function(manifest) { + manifest.addComponent({ + name: 'Styleguide-FieldUsage-Custom', + icon: SitecoreIcon.Gearwheel, + // NOTE: not using 'CommonFieldTypes' here, because it's a custom field. + // The 'Integer' field ships with Sitecore; something really custom would need to be + // implemented as a Sitecore field type as well. + fields: [{ name: 'customIntField', type: 'Integer' }], + // inherit fields from another template (../templates/Styleguide-Explanatory-Component) + // inheritance adds fields defined on the base template(s) implicitly to this component + inherits: ['styleguide-explanatory-component-template'], + }); } diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Image.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Image.sitecore.js index deb6cef43d..ed3a363ef5 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Image.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Image.sitecore.js @@ -6,16 +6,16 @@ import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore * This function is invoked by convention (*.sitecore.js) when 'jss manifest' is run. * @param {Manifest} manifest Manifest instance to add components to */ -export default function (manifest) { - manifest.addComponent({ - name: 'Styleguide-FieldUsage-Image', - icon: SitecoreIcon.PhotoPortrait, - fields: [ - { name: 'sample1', type: CommonFieldTypes.Image }, - { name: 'sample2', type: CommonFieldTypes.Image }, - ], - // inherit fields from another template (../templates/Styleguide-Explanatory-Component) - // inheritance adds fields defined on the base template(s) implicitly to this component - inherits: ['styleguide-explanatory-component-template'], - }); +export default function(manifest) { + manifest.addComponent({ + name: 'Styleguide-FieldUsage-Image', + icon: SitecoreIcon.PhotoPortrait, + fields: [ + { name: 'sample1', type: CommonFieldTypes.Image }, + { name: 'sample2', type: CommonFieldTypes.Image }, + ], + // inherit fields from another template (../templates/Styleguide-Explanatory-Component) + // inheritance adds fields defined on the base template(s) implicitly to this component + inherits: ['styleguide-explanatory-component-template'], + }); } diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-ItemLink.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-ItemLink.sitecore.js index 78688a70d8..3e53c84714 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-ItemLink.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-ItemLink.sitecore.js @@ -19,9 +19,7 @@ export default function(manifest) { // the path is based on the path the shared items are defined in, under /data/content. // Using 'source' is recommended to help content editors find the correct items to refer to, // unless they can refer to any item in the whole site. - source: `dataSource=/sitecore/content/${ - packageJson.config.appName - }/Content/Styleguide/ItemLinkField`, + source: `dataSource=/sitecore/content/${packageJson.config.appName}/Content/Styleguide/ItemLinkField`, }, { name: 'localItemLink', type: CommonFieldTypes.ItemLink }, ], diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Link.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Link.sitecore.js index 31d6cf498d..2b8d1d023d 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Link.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Link.sitecore.js @@ -6,16 +6,16 @@ import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore * This function is invoked by convention (*.sitecore.js) when 'jss manifest' is run. * @param {Manifest} manifest Manifest instance to add components to */ -export default function (manifest) { - manifest.addComponent({ - name: 'Styleguide-FieldUsage-Link', - icon: SitecoreIcon.Link, - fields: [ - { name: 'externalLink', type: CommonFieldTypes.GeneralLink }, - { name: 'emailLink', type: CommonFieldTypes.GeneralLink } - ], - // inherit fields from another template (../templates/Styleguide-Explanatory-Component) - // inheritance adds fields defined on the base template(s) implicitly to this component - inherits: ['styleguide-explanatory-component-template'], - }); +export default function(manifest) { + manifest.addComponent({ + name: 'Styleguide-FieldUsage-Link', + icon: SitecoreIcon.Link, + fields: [ + { name: 'externalLink', type: CommonFieldTypes.GeneralLink }, + { name: 'emailLink', type: CommonFieldTypes.GeneralLink }, + ], + // inherit fields from another template (../templates/Styleguide-Explanatory-Component) + // inheritance adds fields defined on the base template(s) implicitly to this component + inherits: ['styleguide-explanatory-component-template'], + }); } diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Number.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Number.sitecore.js index 8c7673e846..eb1835f503 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Number.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Number.sitecore.js @@ -12,7 +12,7 @@ export default function(manifest) { icon: SitecoreIcon.NumbersField, fields: [ { name: 'sample1', type: CommonFieldTypes.Number }, - { name: 'sample2', type: CommonFieldTypes.Number } + { name: 'sample2', type: CommonFieldTypes.Number }, ], // inherit fields from another template (../templates/Styleguide-Explanatory-Component) // inheritance adds fields defined on the base template(s) implicitly to this component diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-RichText.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-RichText.sitecore.js index 8d5fa7d56f..fc5928fe75 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-RichText.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-RichText.sitecore.js @@ -6,21 +6,21 @@ import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore * This function is invoked by convention (*.sitecore.js) when 'jss manifest' is run. * @param {Manifest} manifest Manifest instance to add components to */ -export default function (manifest) { - manifest.addComponent({ - name: 'Styleguide-FieldUsage-RichText', - icon: SitecoreIcon.TextField, - fields: [ - { name: 'sample', type: CommonFieldTypes.RichText }, - { - name: 'sample2', - displayName: 'Customize Name Shown in Sitecore', - required: true, - type: CommonFieldTypes.RichText, - }, - ], - // inherit fields from another template (../templates/Styleguide-Explanatory-Component) - // inheritance adds fields defined on the base template(s) implicitly to this component - inherits: ['styleguide-explanatory-component-template'], - }); +export default function(manifest) { + manifest.addComponent({ + name: 'Styleguide-FieldUsage-RichText', + icon: SitecoreIcon.TextField, + fields: [ + { name: 'sample', type: CommonFieldTypes.RichText }, + { + name: 'sample2', + displayName: 'Customize Name Shown in Sitecore', + required: true, + type: CommonFieldTypes.RichText, + }, + ], + // inherit fields from another template (../templates/Styleguide-Explanatory-Component) + // inheritance adds fields defined on the base template(s) implicitly to this component + inherits: ['styleguide-explanatory-component-template'], + }); } diff --git a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Text.sitecore.js b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Text.sitecore.js index 7a66d0e947..009a2a7f69 100644 --- a/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Text.sitecore.js +++ b/samples/react-native/sitecore/definitions/components/Styleguide-FieldUsage-Text.sitecore.js @@ -6,21 +6,21 @@ import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore * This function is invoked by convention (*.sitecore.js) when 'jss manifest' is run. * @param {Manifest} manifest Manifest instance to add components to */ -export default function (manifest) { - manifest.addComponent({ - name: 'Styleguide-FieldUsage-Text', - icon: SitecoreIcon.Text, - fields: [ - { name: 'sample', type: CommonFieldTypes.SingleLineText }, - { - name: 'sample2', - displayName: 'Customize Name Shown in Sitecore', - required: true, - type: CommonFieldTypes.SingleLineText, - }, - ], - // inherit fields from another template (../templates/Styleguide-Explanatory-Component) - // inheritance adds fields defined on the base template(s) implicitly to this component - inherits: ['styleguide-explanatory-component-template'], - }); +export default function(manifest) { + manifest.addComponent({ + name: 'Styleguide-FieldUsage-Text', + icon: SitecoreIcon.Text, + fields: [ + { name: 'sample', type: CommonFieldTypes.SingleLineText }, + { + name: 'sample2', + displayName: 'Customize Name Shown in Sitecore', + required: true, + type: CommonFieldTypes.SingleLineText, + }, + ], + // inherit fields from another template (../templates/Styleguide-Explanatory-Component) + // inheritance adds fields defined on the base template(s) implicitly to this component + inherits: ['styleguide-explanatory-component-template'], + }); } diff --git a/samples/react-native/src/App.js b/samples/react-native/src/App.js index c950190432..3d22f30ba4 100644 --- a/samples/react-native/src/App.js +++ b/samples/react-native/src/App.js @@ -1,16 +1,19 @@ -import { createAppContainer } from 'react-navigation' -import { createStackNavigator } from 'react-navigation-stack' -import Styleguide from './screens/Styleguide' -import Home from './screens/Home' +import { createAppContainer } from 'react-navigation'; +import { createStackNavigator } from 'react-navigation-stack'; +import Styleguide from './screens/Styleguide'; +import Home from './screens/Home'; -const Navigator = createStackNavigator({ - Home: { screen: Home }, - Styleguide: { screen: Styleguide } -}, { - initialRouteName: 'Home', - headerMode: 'none' -}) +const Navigator = createStackNavigator( + { + Home: { screen: Home }, + Styleguide: { screen: Styleguide }, + }, + { + initialRouteName: 'Home', + headerMode: 'none', + } +); -const AppNavigator = createAppContainer(Navigator) +const AppNavigator = createAppContainer(Navigator); -export default AppNavigator +export default AppNavigator; diff --git a/samples/react-native/src/componentFactory.js b/samples/react-native/src/componentFactory.js index e2458b54f3..b174d6b115 100644 --- a/samples/react-native/src/componentFactory.js +++ b/samples/react-native/src/componentFactory.js @@ -1,5 +1,5 @@ import Home from './components/Home'; -import StyleguideFieldUsageText from './components/Styleguide-FieldUsage-Text' +import StyleguideFieldUsageText from './components/Styleguide-FieldUsage-Text'; import StyleguideFieldUsageRichText from './components/Styleguide-FieldUsage-RichText'; import StyleguideFieldUsageImage from './components/Styleguide-FieldUsage-Image'; import StyleguideFieldUsageNumber from './components/Styleguide-FieldUsage-Number'; @@ -10,22 +10,22 @@ import StyleguideFieldUsageCustom from './components/Styleguide-FieldUsage-Custo import StyleguideLayoutTabs from './components/Styleguide-Layout-Tabs'; import StyleguideLayoutTabsTab from './components/Styleguide-Layout-Tabs-Tab'; import StyleguideComponentParams from './components/Styleguide-ComponentParams'; -import StyleguideMultilingual from './components/Styleguide-Multilingual' +import StyleguideMultilingual from './components/Styleguide-Multilingual'; const components = new Map(); -components.set('Styleguide-FieldUsage-Text', StyleguideFieldUsageText) -components.set('Styleguide-FieldUsage-RichText', StyleguideFieldUsageRichText) -components.set('Styleguide-FieldUsage-Image', StyleguideFieldUsageImage) -components.set('Styleguide-FieldUsage-Number', StyleguideFieldUsageNumber) -components.set('Styleguide-FieldUsage-Checkbox', StyleguideFieldUsageCheckbox) -components.set('Styleguide-FieldUsage-Date', StyleguideFieldUsageDate) -components.set('Styleguide-FieldUsage-Link', StyleguideFieldUsageLink) -components.set('Styleguide-FieldUsage-Custom', StyleguideFieldUsageCustom) -components.set('Styleguide-Layout-Tabs', StyleguideLayoutTabs) -components.set('Styleguide-Layout-Tabs-Tab', StyleguideLayoutTabsTab) -components.set('Styleguide-ComponentParams', StyleguideComponentParams) -components.set('Styleguide-Multilingual', StyleguideMultilingual) +components.set('Styleguide-FieldUsage-Text', StyleguideFieldUsageText); +components.set('Styleguide-FieldUsage-RichText', StyleguideFieldUsageRichText); +components.set('Styleguide-FieldUsage-Image', StyleguideFieldUsageImage); +components.set('Styleguide-FieldUsage-Number', StyleguideFieldUsageNumber); +components.set('Styleguide-FieldUsage-Checkbox', StyleguideFieldUsageCheckbox); +components.set('Styleguide-FieldUsage-Date', StyleguideFieldUsageDate); +components.set('Styleguide-FieldUsage-Link', StyleguideFieldUsageLink); +components.set('Styleguide-FieldUsage-Custom', StyleguideFieldUsageCustom); +components.set('Styleguide-Layout-Tabs', StyleguideLayoutTabs); +components.set('Styleguide-Layout-Tabs-Tab', StyleguideLayoutTabsTab); +components.set('Styleguide-ComponentParams', StyleguideComponentParams); +components.set('Styleguide-Multilingual', StyleguideMultilingual); components.set('Home', Home); const componentFactory = (componentName) => components.get(componentName); diff --git a/samples/react-native/src/components/Home/index.js b/samples/react-native/src/components/Home/index.js index 18a6637b19..467a04f6ef 100644 --- a/samples/react-native/src/components/Home/index.js +++ b/samples/react-native/src/components/Home/index.js @@ -4,45 +4,45 @@ import { View, ImageBackground, Text as NativeText } from 'react-native'; import { Text, RichText, Image } from '@sitecore-jss/sitecore-jss-react-native'; // eslint-disable-next-line import { images } from 'static-assets'; -import styles, { richTextStyles } from './styles' +import styles, { richTextStyles } from './styles'; const Home = ({ fields, copyright, navigation }) => ( - <View style={styles.container}> - <ImageBackground - source={images['/assets/img/banner.jpg']} - style={styles.bgImage} - resizeMode="cover" - > - <Image media={fields.logoImage} style={styles.logoImage} /> - </ImageBackground> - <View style={styles.body}> - <Text style={styles.title} field={fields.title} /> - <Text - onPress={() => navigation.navigate('Styleguide')} - style={styles.styleguideLink} - field={fields.styleguideLink} - /> - <RichText field={fields.text} stylesheet={richTextStyles}> - {fields.text.editable} - </RichText> - </View> - <View style={styles.footer}> - <NativeText>{copyright}</NativeText> - </View> - </View> + <View style={styles.container}> + <ImageBackground + source={images['/assets/img/banner.jpg']} + style={styles.bgImage} + resizeMode="cover" + > + <Image media={fields.logoImage} style={styles.logoImage} /> + </ImageBackground> + <View style={styles.body}> + <Text style={styles.title} field={fields.title} /> + <Text + onPress={() => navigation.navigate('Styleguide')} + style={styles.styleguideLink} + field={fields.styleguideLink} + /> + <RichText field={fields.text} stylesheet={richTextStyles}> + {fields.text.editable} + </RichText> + </View> + <View style={styles.footer}> + <NativeText>{copyright}</NativeText> + </View> + </View> ); Home.propTypes = { - fields: PropTypes.shape({ - title: PropTypes.object, - text: PropTypes.object, - logoImage: PropTypes.object, - }), - copyright: PropTypes.string, + fields: PropTypes.shape({ + title: PropTypes.object, + text: PropTypes.object, + logoImage: PropTypes.object, + }), + copyright: PropTypes.string, }; Home.defaultProps = { - copyright: 'Copyright Sitecore A/S', + copyright: 'Copyright Sitecore A/S', }; -export default Home +export default Home; diff --git a/samples/react-native/src/components/Home/styles.js b/samples/react-native/src/components/Home/styles.js index 8cc34fdbb4..85bda2a298 100644 --- a/samples/react-native/src/components/Home/styles.js +++ b/samples/react-native/src/components/Home/styles.js @@ -1,41 +1,40 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - container: { - flex: 1 - }, - bgImage: { - width: null, - }, - logoImage: { - margin: 20, - }, - title: { - fontSize: 22, - fontWeight: 'bold' - }, - styleguideLink: { - marginVertical: 15, - color: '#1191db', - fontSize: 18 - }, - body: { - flex: 1, - margin: 20 - }, - footer: { - borderTopWidth: 1, - borderTopColor: '#DCDCDC', - marginVertical: 20, - paddingTop: 20, - paddingHorizontal: 20, - } + container: { + flex: 1, + }, + bgImage: { + width: null, + }, + logoImage: { + margin: 20, + }, + title: { + fontSize: 22, + fontWeight: 'bold', + }, + styleguideLink: { + marginVertical: 15, + color: '#1191db', + fontSize: 18, + }, + body: { + flex: 1, + margin: 20, + }, + footer: { + borderTopWidth: 1, + borderTopColor: '#DCDCDC', + marginVertical: 20, + paddingTop: 20, + paddingHorizontal: 20, + }, }); export const richTextStyles = StyleSheet.create({ - p: { - fontSize: 17, - marginBottom: 10, - }, -}) - + p: { + fontSize: 17, + marginBottom: 10, + }, +}); diff --git a/samples/react-native/src/components/Styleguide-ComponentParams/index.js b/samples/react-native/src/components/Styleguide-ComponentParams/index.js index 8b33dadf2d..dc903be049 100644 --- a/samples/react-native/src/components/Styleguide-ComponentParams/index.js +++ b/samples/react-native/src/components/Styleguide-ComponentParams/index.js @@ -1,64 +1,61 @@ -import React from 'react' -import { View, Text } from 'react-native' -import PropTypes from 'prop-types' +import React from 'react'; +import { View, Text } from 'react-native'; +import PropTypes from 'prop-types'; -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' -import styles from './styles' +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; +import styles from './styles'; const StyleguideComponentParams = ({ fields, rendering, params }) => { - const { cssClass, columns, useCallToAction } = params + const { cssClass, columns, useCallToAction } = params; - const colsArr = columns && [...Array(parseInt(columns))]; + const colsArr = columns && [...Array(parseInt(columns))]; - const renderCol = (_, i) => <Text key={`col-${i}`}>Column {i}</Text> + const renderCol = (_, i) => <Text key={`col-${i}`}>Column {i}</Text>; - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <Text style={styles[cssClass]}> - The CSS class of this paragraph ({cssClass}) is set using a param - </Text> - <Text> - useCallToAction param: {useCallToAction} - param type: {typeof useCallToAction} - </Text> - {useCallToAction && - <Text style={styles.callToAction}>the call to action is shown</Text>} + return ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <Text style={styles[cssClass]}> + The CSS class of this paragraph ({cssClass}) is set using a param + </Text> + <Text> + useCallToAction param: {useCallToAction} + param type: {typeof useCallToAction} + </Text> + {useCallToAction && <Text style={styles.callToAction}>the call to action is shown</Text>} - <Text>columns param: {columns}</Text> + <Text>columns param: {columns}</Text> - {colsArr && <View style={styles.columns}> - {colsArr.map(renderCol)} - </View>} - </StyleguideSpecimen> - ) -} + {colsArr && <View style={styles.columns}>{colsArr.map(renderCol)}</View>} + </StyleguideSpecimen> + ); +}; const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), +}); const ParamsProps = PropTypes.shape({ - cssClass: PropTypes.string, - columns: PropTypes.number, - useCallToAction: PropTypes.bool -}) + cssClass: PropTypes.string, + columns: PropTypes.number, + useCallToAction: PropTypes.bool, +}); StyleguideComponentParams.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired, - params: ParamsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired, - params: ParamsProps.isRequired -} - -export default StyleguideComponentParams + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + params: ParamsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, + params: ParamsProps.isRequired, +}; + +export default StyleguideComponentParams; diff --git a/samples/react-native/src/components/Styleguide-ComponentParams/styles.js b/samples/react-native/src/components/Styleguide-ComponentParams/styles.js index 041698cc71..6f17fa87c6 100644 --- a/samples/react-native/src/components/Styleguide-ComponentParams/styles.js +++ b/samples/react-native/src/components/Styleguide-ComponentParams/styles.js @@ -1,28 +1,28 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - firstParagraph: { - paddingVertical: 10, - paddingHorizontal: 15, - backgroundColor: "#d4edda", - borderColor: "#c3e6cb", - borderWidth: 1, - borderRadius: 5, - color: "#155724", - marginBottom: 10 - }, - callToAction: { - paddingVertical: 10, - paddingHorizontal: 15, - backgroundColor: "#d1ecf1", - borderColor: "#bee5eb", - borderWidth: 1, - borderRadius: 5, - color: "#0c5460", - marginVertical: 10 - }, - columns: { - flexDirection: "row", - justifyContent: "space-between" - } -}) + firstParagraph: { + paddingVertical: 10, + paddingHorizontal: 15, + backgroundColor: '#d4edda', + borderColor: '#c3e6cb', + borderWidth: 1, + borderRadius: 5, + color: '#155724', + marginBottom: 10, + }, + callToAction: { + paddingVertical: 10, + paddingHorizontal: 15, + backgroundColor: '#d1ecf1', + borderColor: '#bee5eb', + borderWidth: 1, + borderRadius: 5, + color: '#0c5460', + marginVertical: 10, + }, + columns: { + flexDirection: 'row', + justifyContent: 'space-between', + }, +}); diff --git a/samples/react-native/src/components/Styleguide-FIeldUsage-Date/index.js b/samples/react-native/src/components/Styleguide-FIeldUsage-Date/index.js index 982c9fc76d..0dd3df68ff 100644 --- a/samples/react-native/src/components/Styleguide-FIeldUsage-Date/index.js +++ b/samples/react-native/src/components/Styleguide-FIeldUsage-Date/index.js @@ -1,66 +1,61 @@ -import React from 'react' -import { Text, View } from 'react-native' -import PropTypes from 'prop-types' -import { DateField } from '@sitecore-jss/sitecore-jss-react-native' -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' -import styles from './styles' +import React from 'react'; +import { Text, View } from 'react-native'; +import PropTypes from 'prop-types'; +import { DateField } from '@sitecore-jss/sitecore-jss-react-native'; +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; +import styles from './styles'; -const StyleguideFieldUsageDate = ({ fields, rendering }) => { - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <View style={styles.field}> - <Text>Date helper: </Text> - <DateField field={fields.date} /> - </View> - <View style={styles.field}> - <Text>Date helper (datetime): </Text> - <DateField field={fields.dateTime} /> - </View> - <View style={styles.field}> - <Text>UTC Date string: </Text> - <DateField field={fields.date} render={date => date.toUTCString()} /> - </View> - <View style={styles.field}> - <Text>Localized Date string (local timezone): </Text> - <DateField field={fields.date} render={(date) => date.toLocaleDateString()} /> - </View> - <View style={styles.field}> - <Text>Localized DateTime string (local timezone): </Text> - <DateField - field={fields.dateTime} - render={date => date.toLocaleString()} - /> - </View> - </StyleguideSpecimen> - ) -} +const StyleguideFieldUsageDate = ({ fields, rendering }) => ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <View style={styles.field}> + <Text>Date helper: </Text> + <DateField field={fields.date} /> + </View> + <View style={styles.field}> + <Text>Date helper (datetime): </Text> + <DateField field={fields.dateTime} /> + </View> + <View style={styles.field}> + <Text>UTC Date string: </Text> + <DateField field={fields.date} render={(date) => date.toUTCString()} /> + </View> + <View style={styles.field}> + <Text>Localized Date string (local timezone): </Text> + <DateField field={fields.date} render={(date) => date.toLocaleDateString()} /> + </View> + <View style={styles.field}> + <Text>Localized DateTime string (local timezone): </Text> + <DateField field={fields.dateTime} render={(date) => date.toLocaleString()} /> + </View> + </StyleguideSpecimen> +); const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - date: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - dateTime: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + date: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + dateTime: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), +}); StyleguideFieldUsageDate.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; -export default StyleguideFieldUsageDate +export default StyleguideFieldUsageDate; diff --git a/samples/react-native/src/components/Styleguide-FIeldUsage-Date/styles.js b/samples/react-native/src/components/Styleguide-FIeldUsage-Date/styles.js index 73b0d6a816..a91779f734 100644 --- a/samples/react-native/src/components/Styleguide-FIeldUsage-Date/styles.js +++ b/samples/react-native/src/components/Styleguide-FIeldUsage-Date/styles.js @@ -1,7 +1,7 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - field: { - marginBottom: 8 - } -}) + field: { + marginBottom: 8, + }, +}); diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Checkbox/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-Checkbox/index.js index 852ff76691..54a3a1d2a9 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Checkbox/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Checkbox/index.js @@ -1,44 +1,47 @@ -import React from 'react' -import { Text } from 'react-native' -import PropTypes from 'prop-types' -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' +import React from 'react'; +import { Text } from 'react-native'; +import PropTypes from 'prop-types'; +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; const StyleguideFieldUsageCheckbox = ({ fields, rendering }) => { + const showState = (field) => ( + <Text> + {field} is {fields[field].value.toString()} + </Text> + ); - const showState = (field) => <Text>{field} is {fields[field].value.toString()}</Text> - - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - {showState('checkbox')} - {showState('checkbox2')} - </StyleguideSpecimen> - ) -} + return ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + {showState('checkbox')} + {showState('checkbox2')} + </StyleguideSpecimen> + ); +}; const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - checkbox: PropTypes.shape({ - value: PropTypes.bool - }), - checkbox2: PropTypes.shape({ - value: PropTypes.bool - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + checkbox: PropTypes.shape({ + value: PropTypes.bool, + }), + checkbox2: PropTypes.shape({ + value: PropTypes.bool, + }), +}); StyleguideFieldUsageCheckbox.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; export default StyleguideFieldUsageCheckbox; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Custom/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-Custom/index.js index 0ec5ee956c..454d5eda31 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Custom/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Custom/index.js @@ -1,42 +1,43 @@ import React from 'react'; import { Text } from '@sitecore-jss/sitecore-jss-react-native'; -import PropTypes from 'prop-types' +import PropTypes from 'prop-types'; import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; /** * Demonstrates usage of a custom content field type within JSS. * See /sitecore/definitions/components/Styleguide-FieldUsage-Custom.sitecore.js * for the definition of the structure of the custom field. This code is just for display. + * @returns {JSX.Element} component */ const StyleguideFieldUsageCustom = ({ fields, rendering }) => ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - {/* Because the integer field is essentially text, we can render it with the Text helper */} - <Text field={fields.customIntField} /> - </StyleguideSpecimen> + <StyleguideSpecimen fields={fields} rendering={rendering}> + {/* Because the integer field is essentially text, we can render it with the Text helper */} + <Text field={fields.customIntField} /> + </StyleguideSpecimen> ); const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - customIntField: PropTypes.shape({ - value: PropTypes.number, - editable: PropTypes.number - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + customIntField: PropTypes.shape({ + value: PropTypes.number, + editable: PropTypes.number, + }), +}); StyleguideFieldUsageCustom.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; export default StyleguideFieldUsageCustom; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Image/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-Image/index.js index 41ea21ae45..a6ffa8efe8 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Image/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Image/index.js @@ -1,51 +1,46 @@ -import React from 'react' -import { Text } from 'react-native' -import PropTypes from 'prop-types' +import React from 'react'; +import { Text } from 'react-native'; +import PropTypes from 'prop-types'; import { Image } from '@sitecore-jss/sitecore-jss-react-native'; import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; -const StyleguideFieldUsageImage = ({ fields, rendering }) => { - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <Text>Plain image</Text> - <Image media={fields.sample1} /> - <Text>Advanced image</Text> - <Image media={fields.sample2} imageUrlParams={{ mw: 120, mh: 80 }} height="120" width="220" /> - <Text>Srcset image</Text> - <Image - media={fields.sample2} - srcSet={[{ mw: 300 }, { mw: 100 }]} - /> - </StyleguideSpecimen> - ) -} +const StyleguideFieldUsageImage = ({ fields, rendering }) => ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <Text>Plain image</Text> + <Image media={fields.sample1} /> + <Text>Advanced image</Text> + <Image media={fields.sample2} imageUrlParams={{ mw: 120, mh: 80 }} height="120" width="220" /> + <Text>Srcset image</Text> + <Image media={fields.sample2} srcSet={[{ mw: 300 }, { mw: 100 }]} /> + </StyleguideSpecimen> +); const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - sample1: PropTypes.shape({ - value: PropTypes.shape({ - src: PropTypes.number, - alt: PropTypes.string - }) - }), - sample2: PropTypes.shape({ - value: PropTypes.shape({ - src: PropTypes.number, - alt: PropTypes.string - }) - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + sample1: PropTypes.shape({ + value: PropTypes.shape({ + src: PropTypes.number, + alt: PropTypes.string, + }), + }), + sample2: PropTypes.shape({ + value: PropTypes.shape({ + src: PropTypes.number, + alt: PropTypes.string, + }), + }), +}); StyleguideFieldUsageImage.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; -export default StyleguideFieldUsageImage +export default StyleguideFieldUsageImage; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Link/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-Link/index.js index cb4f61694c..2c985a7a70 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Link/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Link/index.js @@ -1,62 +1,61 @@ -import React from 'react' -import { View, Text } from 'react-native' -import PropTypes from 'prop-types' -import { Link } from '@sitecore-jss/sitecore-jss-react-native' +import React from 'react'; +import { View, Text } from 'react-native'; +import PropTypes from 'prop-types'; +import { Link } from '@sitecore-jss/sitecore-jss-react-native'; -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' -import styles from './styles' +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; +import styles from './styles'; -const StyleguideFieldUsageLink = ({ fields, rendering }) => { - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <View style={styles.field}> - <Text>External link: </Text> - <Link textStyle={styles.link} field={fields.externalLink} /> - </View> - <View style={styles.field}> - <Text>Email link: </Text> - <Link textStyle={styles.link} field={fields.emailLink} /> - </View> - <View style={styles.field}> - <Text>The link component accepts params of its own:</Text> - <Link textStyle={styles.link} - field={fields.externalLink} - showLinkTextWithChildrenPresent - data-otherattributes="pass-through-to-anchor-tag" - > - <Text>Another text...</Text> - </Link> - </View> - </StyleguideSpecimen> - ) -} +const StyleguideFieldUsageLink = ({ fields, rendering }) => ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <View style={styles.field}> + <Text>External link: </Text> + <Link textStyle={styles.link} field={fields.externalLink} /> + </View> + <View style={styles.field}> + <Text>Email link: </Text> + <Link textStyle={styles.link} field={fields.emailLink} /> + </View> + <View style={styles.field}> + <Text>The link component accepts params of its own:</Text> + <Link + textStyle={styles.link} + field={fields.externalLink} + showLinkTextWithChildrenPresent + data-otherattributes="pass-through-to-anchor-tag" + > + <Text>Another text...</Text> + </Link> + </View> + </StyleguideSpecimen> +); const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - externalLink: PropTypes.shape({ - href: PropTypes.string, - text: PropTypes.string - }), - emailLink: PropTypes.shape({ - href: PropTypes.string, - text: PropTypes.string - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + externalLink: PropTypes.shape({ + href: PropTypes.string, + text: PropTypes.string, + }), + emailLink: PropTypes.shape({ + href: PropTypes.string, + text: PropTypes.string, + }), +}); StyleguideFieldUsageLink.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; -export default StyleguideFieldUsageLink +export default StyleguideFieldUsageLink; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Link/styles.js b/samples/react-native/src/components/Styleguide-FieldUsage-Link/styles.js index a49b433715..46122d82bf 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Link/styles.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Link/styles.js @@ -1,10 +1,10 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - field: { - marginBottom: 10 - }, - link: { - color: '#007bff', - } -}) + field: { + marginBottom: 10, + }, + link: { + color: '#007bff', + }, +}); diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Number/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-Number/index.js index 362da24690..50049d1fb8 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Number/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Number/index.js @@ -1,53 +1,49 @@ -import React from 'react' -import { Text as NText } from 'react-native' -import PropTypes from 'prop-types' -import { Text, getFieldValue } from '@sitecore-jss/sitecore-jss-react-native' -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' +import React from 'react'; +import { Text as NText } from 'react-native'; +import PropTypes from 'prop-types'; +import { Text, getFieldValue } from '@sitecore-jss/sitecore-jss-react-native'; +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; const StyleguideFieldUsageNumber = ({ fields, rendering }) => { - const fieldValue = getFieldValue(fields, 'sample1') + const fieldValue = getFieldValue(fields, 'sample1'); - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <Text field={fields.sample1} /> - <Text field={fields.sample2} /> + return ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <Text field={fields.sample1} /> + <Text field={fields.sample2} /> - <NText> - JS value type: {typeof fieldValue} - </NText> - <NText> - JS value: {fieldValue} - </NText> - </StyleguideSpecimen> - ) -} + <NText>JS value type: {typeof fieldValue}</NText> + <NText>JS value: {fieldValue}</NText> + </StyleguideSpecimen> + ); +}; const FieldsProps = PropTypes.shape({ - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - sample1: PropTypes.shape({ - value: PropTypes.number, - editable: PropTypes.number - }), - sample2: PropTypes.shape({ - value: PropTypes.number, - editable: PropTypes.number - }) -}) + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + sample1: PropTypes.shape({ + value: PropTypes.number, + editable: PropTypes.number, + }), + sample2: PropTypes.shape({ + value: PropTypes.number, + editable: PropTypes.number, + }), +}); StyleguideFieldUsageNumber.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; -export default StyleguideFieldUsageNumber +export default StyleguideFieldUsageNumber; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-RichText/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-RichText/index.js index 6ff5eb6846..20493fcde8 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-RichText/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-RichText/index.js @@ -1,39 +1,37 @@ -import React from 'react' -import { View } from 'react-native' -import PropTypes from 'prop-types' -import { RichText } from '@sitecore-jss/sitecore-jss-react-native' +import React from 'react'; +import { View } from 'react-native'; +import PropTypes from 'prop-types'; +import { RichText } from '@sitecore-jss/sitecore-jss-react-native'; -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; -const StyleguideFieldUsageRichText = ({ fields, rendering }) => { - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <View> - <RichText field={fields.sample} /> - <RichText field={fields.sample2} /> - </View> - </StyleguideSpecimen> - ) -} +const StyleguideFieldUsageRichText = ({ fields, rendering }) => ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <View> + <RichText field={fields.sample} /> + <RichText field={fields.sample2} /> + </View> + </StyleguideSpecimen> +); const FieldsProps = PropTypes.shape({ - sample: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - sample2: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }) -}) + sample: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + sample2: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), +}); StyleguideFieldUsageRichText.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; -export default StyleguideFieldUsageRichText +export default StyleguideFieldUsageRichText; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Text/index.js b/samples/react-native/src/components/Styleguide-FieldUsage-Text/index.js index 3f9466cc36..867bf07df3 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Text/index.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Text/index.js @@ -3,42 +3,40 @@ import { View } from 'react-native'; import { Text } from '@sitecore-jss/sitecore-jss-react-native'; import PropTypes from 'prop-types'; -import styles from './styles' -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' +import styles from './styles'; +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; -const StyleguideFieldUsageText = ({ fields, rendering }) => { - return ( - <StyleguideSpecimen fields={fields} rendering={rendering}> - <View> - <Text style={styles.text} field={fields.sample} /> - <Text style={styles.text} field={fields.sample2} /> - </View> - </StyleguideSpecimen> - ) -} +const StyleguideFieldUsageText = ({ fields, rendering }) => ( + <StyleguideSpecimen fields={fields} rendering={rendering}> + <View> + <Text style={styles.text} field={fields.sample} /> + <Text style={styles.text} field={fields.sample2} /> + </View> + </StyleguideSpecimen> +); const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - sample: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - sample2: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + sample: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + sample2: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), +}); StyleguideFieldUsageText.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; -export default StyleguideFieldUsageText +export default StyleguideFieldUsageText; diff --git a/samples/react-native/src/components/Styleguide-FieldUsage-Text/styles.js b/samples/react-native/src/components/Styleguide-FieldUsage-Text/styles.js index 35e90e6c1a..1b86697790 100644 --- a/samples/react-native/src/components/Styleguide-FieldUsage-Text/styles.js +++ b/samples/react-native/src/components/Styleguide-FieldUsage-Text/styles.js @@ -1,7 +1,7 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - text: { - fontSize: 16 - } -}); \ No newline at end of file + text: { + fontSize: 16, + }, +}); diff --git a/samples/react-native/src/components/Styleguide-Layout-Tabs-Tab/index.js b/samples/react-native/src/components/Styleguide-Layout-Tabs-Tab/index.js index 8b513685d5..3d247a8436 100644 --- a/samples/react-native/src/components/Styleguide-Layout-Tabs-Tab/index.js +++ b/samples/react-native/src/components/Styleguide-Layout-Tabs-Tab/index.js @@ -1,35 +1,36 @@ import React from 'react'; -import PropTypes from 'prop-types' -import { View } from 'react-native' +import PropTypes from 'prop-types'; +import { View } from 'react-native'; import { RichText } from '@sitecore-jss/sitecore-jss-react-native'; /** * This is a single tab within the tabs sample component. These are added to the tabs placeholder. + * @returns {JSX.Element} component */ const StyleguideLayoutTabsTab = ({ fields, rendering }) => ( <View> - <RichText field={fields.content} /> + <RichText field={fields.content} /> </View> ); const FieldsProps = PropTypes.shape({ title: PropTypes.shape({ value: PropTypes.string, - editable: PropTypes.string + editable: PropTypes.string, }), content: PropTypes.shape({ value: PropTypes.string, - editable: PropTypes.string - }) -}) + editable: PropTypes.string, + }), +}); StyleguideLayoutTabsTab.propTypes = { componentFactory: PropTypes.func.isRequired, rendering: PropTypes.shape({ componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired + fields: FieldsProps.isRequired, }).isRequired, - fields: FieldsProps.isRequired -} + fields: FieldsProps.isRequired, +}; export default StyleguideLayoutTabsTab; diff --git a/samples/react-native/src/components/Styleguide-Layout-Tabs/index.js b/samples/react-native/src/components/Styleguide-Layout-Tabs/index.js index 54b80e8455..8d5dc22888 100644 --- a/samples/react-native/src/components/Styleguide-Layout-Tabs/index.js +++ b/samples/react-native/src/components/Styleguide-Layout-Tabs/index.js @@ -1,64 +1,63 @@ -import React, { useState } from 'react' -import { View, TouchableWithoutFeedback } from 'react-native' -import PropTypes from 'prop-types' -import { Text, Placeholder } from '@sitecore-jss/sitecore-jss-react-native' +import React, { useState } from 'react'; +import { View, TouchableWithoutFeedback } from 'react-native'; +import PropTypes from 'prop-types'; +import { Text, Placeholder } from '@sitecore-jss/sitecore-jss-react-native'; -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' -import styles from './styles' +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; +import styles from './styles'; const StyleguideLayoutTabs = ({ rendering, fields }) => { - const [activeTabIndex, setActiveTabIndex] = useState(0) - - const renderTab = (tab, index) => { - const style = index === activeTabIndex - ? styles.tabTitleActive - : styles.tabTitle - - return ( - <TouchableWithoutFeedback key={index} onPress={() => setActiveTabIndex(index)}> - <Text style={style} field={tab.fields.title} /> - </TouchableWithoutFeedback> - ) - } - - const render = (components, data, props) => - <> - <View style={styles.tabs}>{data.map(renderTab)}</View> - <Text style={styles.content} field={data[activeTabIndex].fields.content} /> - </> - - const renderEmpty = components => <View>{components}</View> - - return ( - <StyleguideSpecimen rendering={rendering} fields={fields}> - <Placeholder - rendering={rendering} - name="jss-tabs" - render={render} - renderEmpty={renderEmpty} - /> - </StyleguideSpecimen> - ) -} + const [activeTabIndex, setActiveTabIndex] = useState(0); + + const renderTab = (tab, index) => { + const style = index === activeTabIndex ? styles.tabTitleActive : styles.tabTitle; + + return ( + <TouchableWithoutFeedback key={index} onPress={() => setActiveTabIndex(index)}> + <Text style={style} field={tab.fields.title} /> + </TouchableWithoutFeedback> + ); + }; + + const render = (components, data, props) => ( + <> + <View style={styles.tabs}>{data.map(renderTab)}</View> + <Text style={styles.content} field={data[activeTabIndex].fields.content} /> + </> + ); + + const renderEmpty = (components) => <View>{components}</View>; + + return ( + <StyleguideSpecimen rendering={rendering} fields={fields}> + <Placeholder + rendering={rendering} + name="jss-tabs" + render={render} + renderEmpty={renderEmpty} + /> + </StyleguideSpecimen> + ); +}; const FieldsProps = PropTypes.shape({ - heading: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }), - description: PropTypes.shape({ - value: PropTypes.string, - editable: PropTypes.string - }) -}) + heading: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), + description: PropTypes.shape({ + value: PropTypes.string, + editable: PropTypes.string, + }), +}); StyleguideLayoutTabs.propTypes = { - componentFactory: PropTypes.func.isRequired, - rendering: PropTypes.shape({ - componentName: PropTypes.string.isRequired, - fields: FieldsProps.isRequired - }).isRequired, - fields: FieldsProps.isRequired -} - -export default StyleguideLayoutTabs + componentFactory: PropTypes.func.isRequired, + rendering: PropTypes.shape({ + componentName: PropTypes.string.isRequired, + fields: FieldsProps.isRequired, + }).isRequired, + fields: FieldsProps.isRequired, +}; + +export default StyleguideLayoutTabs; diff --git a/samples/react-native/src/components/Styleguide-Layout-Tabs/styles.js b/samples/react-native/src/components/Styleguide-Layout-Tabs/styles.js index 77733efe7b..4f5309bc45 100644 --- a/samples/react-native/src/components/Styleguide-Layout-Tabs/styles.js +++ b/samples/react-native/src/components/Styleguide-Layout-Tabs/styles.js @@ -1,31 +1,31 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; const tabCommonStyles = { - borderWidth: 1, - padding: 10, - top: 1 -} + borderWidth: 1, + padding: 10, + top: 1, +}; export default StyleSheet.create({ - tabs: { - flexDirection: 'row' - }, - content: { - fontSize: 15, - borderWidth: 1, - borderColor: '#dee2e6', - padding: 15, - paddingBottom: 15 - }, - tabTitle: { - color: '#007bff', - borderColor: '#fff', - ...tabCommonStyles - }, - tabTitleActive: { - borderColor: '#dee2e6', - borderBottomColor: '#fff', - zIndex: 1, - ...tabCommonStyles - } -}) + tabs: { + flexDirection: 'row', + }, + content: { + fontSize: 15, + borderWidth: 1, + borderColor: '#dee2e6', + padding: 15, + paddingBottom: 15, + }, + tabTitle: { + color: '#007bff', + borderColor: '#fff', + ...tabCommonStyles, + }, + tabTitleActive: { + borderColor: '#dee2e6', + borderBottomColor: '#fff', + zIndex: 1, + ...tabCommonStyles, + }, +}); diff --git a/samples/react-native/src/components/Styleguide-Multilingual/index.js b/samples/react-native/src/components/Styleguide-Multilingual/index.js index 7680c1993a..701e523ae9 100644 --- a/samples/react-native/src/components/Styleguide-Multilingual/index.js +++ b/samples/react-native/src/components/Styleguide-Multilingual/index.js @@ -1,17 +1,19 @@ -import React from 'react' -import { View, Text } from 'react-native' -import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen' -import styles from './styles' +import React from 'react'; +import { View, Text } from 'react-native'; +import StyleguideSpecimen from '../Styleguide-Specimen/Styleguide-Specimen'; +import styles from './styles'; -const StyleguideMultilingual = ({ rendering, fields, switchLanguage }) => { - return ( - <StyleguideSpecimen rendering={rendering} fields={fields}> - <View> - <Text style={styles.lang} onPress={() => switchLanguage('en')}>Switch to en</Text> - <Text style={styles.lang} onPress={() => switchLanguage('da-DK')}>Switch to da-DK</Text> - </View> - </StyleguideSpecimen> - ) -} +const StyleguideMultilingual = ({ rendering, fields, switchLanguage }) => ( + <StyleguideSpecimen rendering={rendering} fields={fields}> + <View> + <Text style={styles.lang} onPress={() => switchLanguage('en')}> + Switch to en + </Text> + <Text style={styles.lang} onPress={() => switchLanguage('da-DK')}> + Switch to da-DK + </Text> + </View> + </StyleguideSpecimen> +); -export default StyleguideMultilingual +export default StyleguideMultilingual; diff --git a/samples/react-native/src/components/Styleguide-Multilingual/styles.js b/samples/react-native/src/components/Styleguide-Multilingual/styles.js index cbf8714f81..c7d6eb0072 100644 --- a/samples/react-native/src/components/Styleguide-Multilingual/styles.js +++ b/samples/react-native/src/components/Styleguide-Multilingual/styles.js @@ -1,14 +1,14 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - lang: { - width: '50%', - padding: 10, - marginTop: 5, - marginBottom: 5, - fontSize: 15, - borderRadius: 10, - borderWidth: 1, - borderColor: 'green' - } -}) \ No newline at end of file + lang: { + width: '50%', + padding: 10, + marginTop: 5, + marginBottom: 5, + fontSize: 15, + borderRadius: 10, + borderWidth: 1, + borderColor: 'green', + }, +}); diff --git a/samples/react-native/src/components/Styleguide-Specimen/Styleguide-Specimen.js b/samples/react-native/src/components/Styleguide-Specimen/Styleguide-Specimen.js index dc8329ae47..9bb8a58f63 100644 --- a/samples/react-native/src/components/Styleguide-Specimen/Styleguide-Specimen.js +++ b/samples/react-native/src/components/Styleguide-Specimen/Styleguide-Specimen.js @@ -1,26 +1,27 @@ import React from 'react'; -import { View, Text as NText } from 'react-native' +import { View, Text as NText } from 'react-native'; import { Text, RichText } from '@sitecore-jss/sitecore-jss-react-native'; import styles from './styles'; -const StyleguideSpecimen = ({ fields, children, rendering }) => { - return ( - <View style={styles.wrapper}> - <Text style={styles.heading} field={fields.heading} /> - <RichText field={fields.description} /> +const StyleguideSpecimen = ({ fields, children, rendering }) => ( + <View style={styles.wrapper}> + <Text style={styles.heading} field={fields.heading} /> + <RichText field={fields.description} /> - <NText style={styles.section}> - Implementation: <NText style={styles.filepath}>/src/components/{rendering.componentName}/index.js</NText> - </NText> - <NText style={styles.section}> - Definition:{' '} - <NText style={styles.filepath}>/sitecore/definitions/components/{rendering.componentName}.sitecore.js</NText> - </NText> + <NText style={styles.section}> + Implementation:{' '} + <NText style={styles.filepath}>/src/components/{rendering.componentName}/index.js</NText> + </NText> + <NText style={styles.section}> + Definition:{' '} + <NText style={styles.filepath}> + /sitecore/definitions/components/{rendering.componentName}.sitecore.js + </NText> + </NText> - <View style={styles.example}>{children}</View> - </View> - ) -} + <View style={styles.example}>{children}</View> + </View> +); -export default StyleguideSpecimen; \ No newline at end of file +export default StyleguideSpecimen; diff --git a/samples/react-native/src/components/Styleguide-Specimen/styles.js b/samples/react-native/src/components/Styleguide-Specimen/styles.js index 4a4fe2c017..2d1272d706 100644 --- a/samples/react-native/src/components/Styleguide-Specimen/styles.js +++ b/samples/react-native/src/components/Styleguide-Specimen/styles.js @@ -1,25 +1,25 @@ -import { StyleSheet } from 'react-native' +import { StyleSheet } from 'react-native'; export default StyleSheet.create({ - wrapper: { - flex: 1, - margin: 10, - marginBottom: 15 - }, - heading: { - fontSize: 23, - marginBottom: 10 - }, - filepath: { - color: "#e83e8c" - }, - section: { - marginBottom: 8, - fontSize: 15 - }, - example: { - borderWidth: 1, - borderColor: '#dee2e6', - padding: 10, - } -}) + wrapper: { + flex: 1, + margin: 10, + marginBottom: 15, + }, + heading: { + fontSize: 23, + marginBottom: 10, + }, + filepath: { + color: '#e83e8c', + }, + section: { + marginBottom: 8, + fontSize: 15, + }, + example: { + borderWidth: 1, + borderColor: '#dee2e6', + padding: 10, + }, +}); diff --git a/samples/react-native/src/screens/Home.js b/samples/react-native/src/screens/Home.js index feaef0c6bb..561c768b7f 100644 --- a/samples/react-native/src/screens/Home.js +++ b/samples/react-native/src/screens/Home.js @@ -1,14 +1,12 @@ import React from 'react'; import { Placeholder } from '@sitecore-jss/sitecore-jss-react-native'; -import Route from './Route' +import Route from './Route'; const Home = ({ navigation }) => ( - <Route - path='/' - render={({ data }) => - <Placeholder name='jss-main' rendering={data} navigation={navigation} /> - } + <Route + path="/" + render={({ data }) => <Placeholder name="jss-main" rendering={data} navigation={navigation} />} /> ); -export default Home +export default Home; diff --git a/samples/react-native/src/screens/Route.js b/samples/react-native/src/screens/Route.js index 615810cca7..688e043c15 100644 --- a/samples/react-native/src/screens/Route.js +++ b/samples/react-native/src/screens/Route.js @@ -1,85 +1,85 @@ import React, { Component } from 'react'; -import PropTypes from 'prop-types' +import PropTypes from 'prop-types'; import { Text, View, RefreshControl } from 'react-native'; import { SitecoreContext } from '@sitecore-jss/sitecore-jss-react-native'; // eslint-disable-next-line import { getRouteData } from 'data-service'; import componentFactory from '../componentFactory'; +// eslint-disable-next-line valid-jsdoc /** * Page wrapper. Performs data loading depends on current route */ class Route extends Component { - state = { - loading: true, - lang: 'en', - route: null, - error: null - }; + state = { + loading: true, + lang: 'en', + route: null, + error: null, + }; - switchLanguage = lang => this.setState({ lang }) + switchLanguage = (lang) => this.setState({ lang }); - loadData = () => { - const { lang } = this.state - const { path } = this.props + loadData = () => { + const { lang } = this.state; + const { path } = this.props; - getRouteData(path, { language: lang }) - .then((data) => { - this.setState({ route: data, loading: false }); - }) - .catch((err) => { - console.error(err); - this.setState({ error: err, loading: false }); - }); - } + getRouteData(path, { language: lang }) + .then((data) => { + this.setState({ route: data, loading: false }); + }) + .catch((err) => { + console.error(err); + this.setState({ error: err, loading: false }); + }); + }; - componentDidMount() { - const { path } = this.props - - path && this.loadData(); - } + componentDidMount() { + const { path } = this.props; - componentDidUpdate(_, prevState) { - const { lang } = this.state + path && this.loadData(); + } - if (lang !== prevState.lang) - this.loadData() - } + componentDidUpdate(_, prevState) { + const { lang } = this.state; - render() { - const { render } = this.props + if (lang !== prevState.lang) this.loadData(); + } - if (this.state.loading) { - return ( - <View> - <Text>loading...</Text> - </View> - ); - } + render() { + const { render } = this.props; - if (this.state.error) { - return ( - <View> - <Text>{this.state.error.toString()}</Text> - </View> - ); - } + if (this.state.loading) { + return ( + <View> + <Text>loading...</Text> + </View> + ); + } - const refreshControl = ( - <RefreshControl refreshing={this.state.loading} onRefresh={this.loadData} /> - ); + if (this.state.error) { + return ( + <View> + <Text>{this.state.error.toString()}</Text> + </View> + ); + } - return ( - <SitecoreContext componentFactory={componentFactory}> - {render({ data: this.state.route, refreshControl, switchLanguage: this.switchLanguage })} - </SitecoreContext> - ); - } + const refreshControl = ( + <RefreshControl refreshing={this.state.loading} onRefresh={this.loadData} /> + ); + + return ( + <SitecoreContext componentFactory={componentFactory}> + {render({ data: this.state.route, refreshControl, switchLanguage: this.switchLanguage })} + </SitecoreContext> + ); + } } Route.propTypes = { - path: PropTypes.string.isRequired, - render: PropTypes.func.isRequired -} + path: PropTypes.string.isRequired, + render: PropTypes.func.isRequired, +}; export default Route; diff --git a/samples/react-native/src/screens/Styleguide.js b/samples/react-native/src/screens/Styleguide.js index 4c2527d062..8785fe7baf 100644 --- a/samples/react-native/src/screens/Styleguide.js +++ b/samples/react-native/src/screens/Styleguide.js @@ -1,32 +1,32 @@ import React from 'react'; -import { ScrollView, StyleSheet } from 'react-native' +import { ScrollView, StyleSheet } from 'react-native'; import { Placeholder } from '@sitecore-jss/sitecore-jss-react-native'; -import Route from './Route' +import Route from './Route'; const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: '#fff', - }, - contentContainer: { - alignItems: 'center', - justifyContent: 'center', - }, + container: { + flex: 1, + backgroundColor: '#fff', + }, + contentContainer: { + alignItems: 'center', + justifyContent: 'center', + }, }); const Styleguide = () => ( - <Route - path='/styleguide' - render={({ data, refreshControl, switchLanguage }) => - <ScrollView - style={styles.container} - refreshControl={refreshControl} - contentContainerStyle={styles.contentContainer} - > - <Placeholder name='jss-main' rendering={data} switchLanguage={switchLanguage} /> - </ScrollView> - } - /> -) + <Route + path="/styleguide" + render={({ data, refreshControl, switchLanguage }) => ( + <ScrollView + style={styles.container} + refreshControl={refreshControl} + contentContainerStyle={styles.contentContainer} + > + <Placeholder name="jss-main" rendering={data} switchLanguage={switchLanguage} /> + </ScrollView> + )} + /> +); -export default Styleguide +export default Styleguide; From 592569ff023952a78d54af89f4c9513235dbbbee Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 08:57:00 +0200 Subject: [PATCH 25/37] Update angular sample --- package.json | 4 +- samples/angular/.eslintrc.json | 81 +++++++++++ samples/angular/angular.json | 11 +- samples/angular/package.json | 16 ++- samples/angular/src/app/app.module.ts | 4 +- samples/angular/src/app/app.server.module.ts | 4 +- .../styleguide-specimen.component.ts | 6 +- samples/angular/src/app/jss-graphql.module.ts | 24 ++-- .../angular/src/app/jss-graphql.service.ts | 46 +++--- .../app/routing/jss-route-builder.service.ts | 2 +- .../app/routing/layout/layout.component.ts | 1 + .../angular/src/app/routing/routing.module.ts | 1 + samples/angular/src/graphql-fragment-types.ts | 2 +- samples/angular/src/test.ts | 4 +- samples/angular/src/typings.d.ts | 1 + samples/angular/tslint.json | 134 ------------------ samples/react-native/.eslintrc.json | 33 ++++- samples/react/.eslintrc | 26 +++- samples/react/scripts/eject.js | 2 +- samples/react/scripts/scaffold-component.js | 2 +- samples/react/src/AppRoot.js | 33 +++-- samples/react/src/RouteHandler.js | 24 ++-- samples/react/src/lib/GraphQLClientFactory.js | 6 +- samples/react/src/lib/GraphQLData.js | 3 +- 24 files changed, 244 insertions(+), 226 deletions(-) create mode 100644 samples/angular/.eslintrc.json delete mode 100644 samples/angular/tslint.json diff --git a/package.json b/package.json index 2290c8f982..47c8e3d738 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "bootstrap-react-dom": "cd ./packages/sitecore-jss-react/node_modules/react-dom && npm link && cd ../../../sitecore-jss-nextjs && npm link react-dom && cd ../sitecore-jss-nextjs-editing-host && npm link react-dom && cd ../../samples/nextjs && npm link react-dom && cd ../react && npm link react-dom", "build-packages": "lerna run build --ignore *-sample*", "build-apps": "lerna run build --scope *-sample*", - "lint-packages": "lerna run lint --scope @sitecore-jss/sitecore-jss-nextjs*", - "lint-apps": "lerna run lint --scope jss-sample-nextjs", + "lint-packages": "lerna run lint --ignore *-sample*", + "lint-apps": "lerna run lint --ignore @sitecore-jss/*", "test-packages": "lerna run test --ignore *-sample*", "test": "lerna run test", "coverage-packages": "lerna run coverage --ignore *-sample*" diff --git a/samples/angular/.eslintrc.json b/samples/angular/.eslintrc.json new file mode 100644 index 0000000000..e4d40e25f2 --- /dev/null +++ b/samples/angular/.eslintrc.json @@ -0,0 +1,81 @@ +{ + "root": true, + "ignorePatterns": [ + "projects/**/*" + ], + "overrides": [ + { + "files": [ + "*.ts" + ], + "parserOptions": { + "project": [ + "tsconfig.json", + "e2e/tsconfig.e2e.json" + ], + "createDefaultProgram": true + }, + "extends": [ + "plugin:@angular-eslint/ng-cli-compat", + "plugin:@angular-eslint/ng-cli-compat--formatting-add-on", + "plugin:@angular-eslint/template/process-inline-templates" + ], + "rules": { + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "app", + "style": "kebab-case" + } + ], + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "app", + "style": "camelCase" + } + ], + "@typescript-eslint/consistent-type-definitions": "error", + "@typescript-eslint/dot-notation": "off", + "@typescript-eslint/explicit-member-accessibility": [ + "off", + { + "accessibility": "explicit" + } + ], + "brace-style": [ + "error", + "1tbs" + ], + "id-blacklist": "off", + "id-match": "off", + "no-underscore-dangle": "off" + } + }, + { + "files": [ + "*.html" + ], + "extends": [ + "plugin:@angular-eslint/template/recommended" + ], + "rules": {} + } + ], + "rules": { + "@typescript-eslint/naming-convention": [ + "error", + { + "format": ["PascalCase"], + "selector": "typeLike", + "custom": { + "regex": "^I[A-Z]", + "match": false + } + } + ], + "prefer-arrow/prefer-arrow-functions": "off" + } +} diff --git a/samples/angular/angular.json b/samples/angular/angular.json index e74ad6bd26..53da965ab2 100644 --- a/samples/angular/angular.json +++ b/samples/angular/angular.json @@ -93,14 +93,11 @@ } }, "lint": { - "builder": "@angular-devkit/build-angular:tslint", + "builder": "@angular-eslint/builder:lint", "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" + "lintFilePatterns": [ + "src/**/*.ts", + "src/**/*.html" ] } }, diff --git a/samples/angular/package.json b/samples/angular/package.json index cccf9599fa..b30f8a7c8c 100644 --- a/samples/angular/package.json +++ b/samples/angular/package.json @@ -21,7 +21,7 @@ "scripts": { "ng": "ng", "lint:yml": "ts-node ./scripts/lint-yml.ts", - "lint": "ng lint && npm run lint:yml", + "lint": "ng lint JssAngularWeb && npm run lint:yml", "e2e": "ng e2e", "jss": "jss", "start": "npm-run-all --serial bootstrap:disconnected --parallel start:angular start:proxy start:watch-components", @@ -116,9 +116,19 @@ "protractor": "^7.0.0", "ts-loader": "~6.2.0", "ts-node": "~8.4.1", - "tslint": "~6.1.3", "typescript": "~3.9.7", "webpack-cli": "~3.3.9", - "yaml-lint": "^1.2.4" + "yaml-lint": "^1.2.4", + "eslint": "^7.6.0", + "eslint-plugin-import": "2.22.1", + "eslint-plugin-jsdoc": "30.7.6", + "eslint-plugin-prefer-arrow": "1.2.2", + "@angular-eslint/builder": "0.8.0-beta.6", + "@angular-eslint/eslint-plugin": "0.8.0-beta.6", + "@angular-eslint/eslint-plugin-template": "0.8.0-beta.6", + "@angular-eslint/schematics": "^0.8.0-beta.6", + "@angular-eslint/template-parser": "0.8.0-beta.6", + "@typescript-eslint/eslint-plugin": "4.3.0", + "@typescript-eslint/parser": "4.3.0" } } diff --git a/samples/angular/src/app/app.module.ts b/samples/angular/src/app/app.module.ts index a2a8f2311b..d8dba75b88 100644 --- a/samples/angular/src/app/app.module.ts +++ b/samples/angular/src/app/app.module.ts @@ -25,9 +25,7 @@ import { JssDataFetcherService } from './jss-data-fetcher.service'; TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useFactory: (http: HttpClient) => { - return new JssTranslationClientLoaderService(new JssTranslationLoaderService(http)); - }, + useFactory: (http: HttpClient) => new JssTranslationClientLoaderService(new JssTranslationLoaderService(http)), deps: [HttpClient, TransferState] } }), diff --git a/samples/angular/src/app/app.server.module.ts b/samples/angular/src/app/app.server.module.ts index b39e51a00f..389d716f7d 100644 --- a/samples/angular/src/app/app.server.module.ts +++ b/samples/angular/src/app/app.server.module.ts @@ -18,9 +18,7 @@ import { JssTranslationServerLoaderService } from './i18n/jss-translation-server TranslateModule.forRoot({ // <-- *Important* to get translation values server-side loader: { provide: TranslateLoader, - useFactory: (ssrViewBag: any) => { - return new JssTranslationServerLoaderService(ssrViewBag); - }, + useFactory: (ssrViewBag: any) => new JssTranslationServerLoaderService(ssrViewBag), deps: ['JSS_SERVER_VIEWBAG'] } }), diff --git a/samples/angular/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts b/samples/angular/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts index 37de093cbd..cba4de235d 100644 --- a/samples/angular/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +++ b/samples/angular/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts @@ -1,8 +1,10 @@ import { Component, OnInit, Input } from '@angular/core'; import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular'; +// eslint-disable-next-line prefer-arrow/prefer-arrow-functions function dasherize(str) { - return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, function (s, i) { + // eslint-disable-next-line prefer-arrow/prefer-arrow-functions + return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, function(s, i) { return (i > 0 ? '-' : '') + s.toLowerCase(); }); } @@ -28,8 +30,8 @@ function dasherize(str) { }) export class StyleguideSpecimenComponent implements OnInit { @Input() rendering: ComponentRendering; - id: string; @Input() e2eId: string; + id: string; componentName: string; constructor() { } diff --git a/samples/angular/src/app/jss-graphql.module.ts b/samples/angular/src/app/jss-graphql.module.ts index e79577085c..18e4dfc334 100644 --- a/samples/angular/src/app/jss-graphql.module.ts +++ b/samples/angular/src/app/jss-graphql.module.ts @@ -42,6 +42,16 @@ export class GraphQLModule { this.createApolloClient(); } + onServer(cache: InMemoryCache) { + this.transferState.onSerialize(STATE_KEY, () => cache.extract()); + } + + onBrowser(cache: InMemoryCache) { + const state = this.transferState.get<any>(STATE_KEY, null); + + cache.restore(state); + } + private createApolloClient(): void { /* QUERY LINK SELECTION @@ -73,7 +83,7 @@ export class GraphQLModule { this.apollo.create({ link: automaticPersistHttp, - cache: cache, + cache, ssrMode: isPlatformServer(this.platformId), ssrForceFetchDelay: 100, }); @@ -86,16 +96,4 @@ export class GraphQLModule { this.onServer(cache); } } - - onServer(cache: InMemoryCache) { - this.transferState.onSerialize(STATE_KEY, () => { - return cache.extract(); - }); - } - - onBrowser(cache: InMemoryCache) { - const state = this.transferState.get<any>(STATE_KEY, null); - - cache.restore(state); - } } diff --git a/samples/angular/src/app/jss-graphql.service.ts b/samples/angular/src/app/jss-graphql.service.ts index ed95aa1059..48738637f7 100644 --- a/samples/angular/src/app/jss-graphql.service.ts +++ b/samples/angular/src/app/jss-graphql.service.ts @@ -57,29 +57,6 @@ export class JssGraphQLService { return variableNames as { [key: string]: string }; } - private addJssAmbientVariables<V = R>(query: DocumentNode, variables: V, rendering?: ComponentRendering) { - if (!variables) { - variables = {} as V; - } - - const usedVariables = JssGraphQLService.extractVariableNames(query); - - if (usedVariables.datasource && rendering && rendering.dataSource) { - variables['datasource'] = rendering.dataSource; - } - - if ( - usedVariables.contextItem && - this.sitecoreContext.state.value.sitecore && - this.sitecoreContext.state.value.sitecore.route && - this.sitecoreContext.state.value.sitecore.route.itemId - ) { - variables['contextItem'] = this.sitecoreContext.state.value.sitecore.route.itemId; - } - - return variables; - } - /** * Executes a read query against the GraphQL endpoint */ @@ -131,4 +108,27 @@ export class JssGraphQLService { return this.apollo.subscribe<T, V>(options, extra); } + + private addJssAmbientVariables<V = R>(query: DocumentNode, variables: V, rendering?: ComponentRendering) { + if (!variables) { + variables = {} as V; + } + + const usedVariables = JssGraphQLService.extractVariableNames(query); + + if (usedVariables.datasource && rendering && rendering.dataSource) { + variables['datasource'] = rendering.dataSource; + } + + if ( + usedVariables.contextItem && + this.sitecoreContext.state.value.sitecore && + this.sitecoreContext.state.value.sitecore.route && + this.sitecoreContext.state.value.sitecore.route.itemId + ) { + variables['contextItem'] = this.sitecoreContext.state.value.sitecore.route.itemId; + } + + return variables; + } } diff --git a/samples/angular/src/app/routing/jss-route-builder.service.ts b/samples/angular/src/app/routing/jss-route-builder.service.ts index fc6f85d3d6..671a8003d7 100644 --- a/samples/angular/src/app/routing/jss-route-builder.service.ts +++ b/samples/angular/src/app/routing/jss-route-builder.service.ts @@ -1,5 +1,5 @@ import { environment as env } from '../../environments/environment'; -import { Injectable } from "@angular/core"; +import { Injectable } from '@angular/core'; export class JssRoute { language: string; diff --git a/samples/angular/src/app/routing/layout/layout.component.ts b/samples/angular/src/app/routing/layout/layout.component.ts index 1f20a37c7d..023e92e888 100644 --- a/samples/angular/src/app/routing/layout/layout.component.ts +++ b/samples/angular/src/app/routing/layout/layout.component.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-shadow */ import { Component, OnInit, OnDestroy } from '@angular/core'; import { JssState } from '../../JssState'; import { ActivatedRoute } from '@angular/router'; diff --git a/samples/angular/src/app/routing/routing.module.ts b/samples/angular/src/app/routing/routing.module.ts index efd2d77f9c..07485163b0 100644 --- a/samples/angular/src/app/routing/routing.module.ts +++ b/samples/angular/src/app/routing/routing.module.ts @@ -11,6 +11,7 @@ import { NavigationComponent } from './navigation/navigation.component'; import { TranslateModule } from '@ngx-translate/core'; import { VisitorIdentificationComponent } from './visitor-identification/visitor-identification.component'; +// eslint-disable-next-line prefer-arrow/prefer-arrow-functions export function jssRouteMatcher(url: UrlSegment[]): UrlMatchResult { // use the route builder to parse out language / server route const routeParser = new JssRouteBuilderService(); diff --git a/samples/angular/src/graphql-fragment-types.ts b/samples/angular/src/graphql-fragment-types.ts index 0e7a5a170c..f274196fec 100644 --- a/samples/angular/src/graphql-fragment-types.ts +++ b/samples/angular/src/graphql-fragment-types.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ export default { "__schema": { "types": [ diff --git a/samples/angular/src/test.ts b/samples/angular/src/test.ts index cd612eeb0e..71fa818638 100644 --- a/samples/angular/src/test.ts +++ b/samples/angular/src/test.ts @@ -13,11 +13,13 @@ import { } from '@angular/platform-browser-dynamic/testing'; // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. +// eslint-disable-next-line @typescript-eslint/naming-convention declare const __karma__: any; declare const require: any; // Prevent Karma from running prematurely. -__karma__.loaded = function () {}; +// eslint-disable-next-line prefer-arrow/prefer-arrow-functions +__karma__.loaded = function() {}; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( diff --git a/samples/angular/src/typings.d.ts b/samples/angular/src/typings.d.ts index ef5c7bd620..33ca9f4d71 100644 --- a/samples/angular/src/typings.d.ts +++ b/samples/angular/src/typings.d.ts @@ -1,4 +1,5 @@ /* SystemJS module definition */ +/* eslint-disable no-var */ declare var module: NodeModule; interface NodeModule { id: string; diff --git a/samples/angular/tslint.json b/samples/angular/tslint.json deleted file mode 100644 index 7d6b1b2d80..0000000000 --- a/samples/angular/tslint.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "rulesDirectory": [ - "node_modules/codelyzer" - ], - "rules": { - "arrow-return-shorthand": true, - "callable-types": true, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "eofline": true, - "forin": true, - "import-blacklist": [ - true - ], - "import-spacing": true, - "indent": [ - true, - "spaces" - ], - "interface-over-type-literal": true, - "label-position": true, - "max-line-length": [ - true, - 140 - ], - "member-access": false, - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-arg": true, - "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-super": true, - "no-empty": false, - "no-empty-interface": true, - "no-eval": true, - "no-inferrable-types": [ - true, - "ignore-params" - ], - "no-misused-new": true, - "no-non-null-assertion": true, - "no-redundant-jsdoc": true, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-string-throw": true, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unnecessary-initializer": true, - "no-unused-expression": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "prefer-const": true, - "quotemark": [ - true, - "single" - ], - "radix": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "unified-signatures": true, - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "directive-selector": [ - true, - "attribute", - "app", - "camelCase" - ], - "component-selector": [ - true, - "element", - "app", - "kebab-case" - ], - "no-input-rename": true, - "no-output-rename": true, - "use-life-cycle-interface": true, - "use-pipe-transform-interface": true, - "component-class-suffix": true, - "directive-class-suffix": true - } -} diff --git a/samples/react-native/.eslintrc.json b/samples/react-native/.eslintrc.json index d23bd542d6..7b5c16f50e 100644 --- a/samples/react-native/.eslintrc.json +++ b/samples/react-native/.eslintrc.json @@ -1,4 +1,5 @@ { + "root": true, "parser": "babel-eslint", "extends": [ "airbnb-base", @@ -13,12 +14,16 @@ "import/ignore": ["node_modules", ".png$", ".jpg$"], "import/resolver": { "babel-module": {} + }, + "react": { + "version": "detect" } }, "env": { "jest": true }, "rules": { + "react/prop-types": "off", "prettier/prettier": "error", "import/prefer-default-export": "off", "import/no-extraneous-dependencies": [ @@ -37,7 +42,33 @@ "args": "none" } ], + "func-names": "off", "radix": ["error", "as-needed"], - "prefer-destructuring": "off" + "prefer-destructuring": "off", + "no-useless-escape": "off", + "no-restricted-globals": "off", + "no-restricted-properties": "off", + "spaced-comment": "error", + "curly": ["error", "multi-line"], + "eol-last": ["error", "always"], + "guard-for-in": "error", + "no-unused-labels": "error", + "max-len": "off", + "no-caller": "error", + "no-bitwise": "error", + "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-debugger": "error", + "no-empty": "error", + "no-eval": "error", + "dot-notation": "error", + "no-fallthrough": "error", + "no-trailing-spaces": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], + "brace-style": "error", + "quotes": ["error", "single"], + "default-case": "error", + "eqeqeq": "error" } } diff --git a/samples/react/.eslintrc b/samples/react/.eslintrc index 05e802d65e..b8f3d40709 100644 --- a/samples/react/.eslintrc +++ b/samples/react/.eslintrc @@ -54,6 +54,30 @@ "react/no-array-index-key": "off", "no-use-before-define": 0, "global-require": 0, - "no-param-reassign": 0 + "no-param-reassign": 0, + "no-useless-escape": "off", + "no-restricted-globals": "off", + "no-restricted-properties": "off", + "spaced-comment": "error", + "curly": ["error", "multi-line"], + "eol-last": ["error", "always"], + "guard-for-in": "error", + "no-unused-labels": "error", + "no-caller": "error", + "no-bitwise": "error", + "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-debugger": "error", + "no-empty": "error", + "no-eval": "error", + "dot-notation": "error", + "no-fallthrough": "error", + "no-trailing-spaces": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], + "brace-style": "error", + "quotes": ["error", "single"], + "default-case": "error", + "eqeqeq": "error" } } diff --git a/samples/react/scripts/eject.js b/samples/react/scripts/eject.js index 5637449d33..bafd73da59 100644 --- a/samples/react/scripts/eject.js +++ b/samples/react/scripts/eject.js @@ -15,6 +15,6 @@ crossSpawn.sync('git add .', { crossSpawn.sync('git commit -am "Save before eject"', { stdio: 'inherit', }); -crossSpawn.sync(`npm run eject`, { +crossSpawn.sync('npm run eject', { stdio: 'inherit', }); diff --git a/samples/react/scripts/scaffold-component.js b/samples/react/scripts/scaffold-component.js index b7ce6d9cc5..c2bea9a1cb 100644 --- a/samples/react/scripts/scaffold-component.js +++ b/samples/react/scripts/scaffold-component.js @@ -63,7 +63,7 @@ if (manifestOutputPath) { 'jss deploy:watch' )} or ${chalk.green('jss deploy files')})` ); - console.log(`* Add the component to a route using Sitecore Experience Editor, and test it.`); + console.log('* Add the component to a route using Sitecore Experience Editor, and test it.'); } /* diff --git a/samples/react/src/AppRoot.js b/samples/react/src/AppRoot.js index 17ed1b6521..ebf9ec67ba 100644 --- a/samples/react/src/AppRoot.js +++ b/samples/react/src/AppRoot.js @@ -23,29 +23,30 @@ export const routePatterns = [ // Router: provides a basic routing setup that will resolve Sitecore item routes and allow for language URL prefixes. class AppRoot extends React.Component { constructor(props) { - super(props) + super(props); this.state = { - ssrRenderComplete: false - } + ssrRenderComplete: false, + }; if (props.ssrState) { - this.sitecoreContext = props.ssrState.sitecore && props.ssrState.sitecore.route - ? { - route: props.ssrState.sitecore.route, - itemId: props.ssrState.sitecore.route.itemId, - ...props.ssrState.sitecore.context, - } - : props.ssrState.sitecore.context + this.sitecoreContext = + props.ssrState.sitecore && props.ssrState.sitecore.route + ? { + route: props.ssrState.sitecore.route, + itemId: props.ssrState.sitecore.route.itemId, + ...props.ssrState.sitecore.context, + } + : props.ssrState.sitecore.context; } else { this.sitecoreContext = null; } } - setSsrRenderComplete = ssrRenderComplete => + setSsrRenderComplete = (ssrRenderComplete) => this.setState({ - ssrRenderComplete - }) + ssrRenderComplete, + }); componentDidMount() { this.setSsrRenderComplete(true); @@ -60,10 +61,12 @@ class AppRoot extends React.Component { <Router location={path} context={{}}> <Switch> {routePatterns.map((routePattern) => ( - <Route + <Route key={routePattern} path={routePattern} - render={(props) => <RouteHandler route={props} ssrRenderComplete={this.state.ssrRenderComplete} />} + render={(props) => ( + <RouteHandler route={props} ssrRenderComplete={this.state.ssrRenderComplete} /> + )} /> ))} </Switch> diff --git a/samples/react/src/RouteHandler.js b/samples/react/src/RouteHandler.js index 71d3b31b32..ce37de1386 100644 --- a/samples/react/src/RouteHandler.js +++ b/samples/react/src/RouteHandler.js @@ -1,7 +1,11 @@ import React from 'react'; import i18n from 'i18next'; import Helmet from 'react-helmet'; -import { isExperienceEditorActive, dataApi, withSitecoreContext } from '@sitecore-jss/sitecore-jss-react'; +import { + isExperienceEditorActive, + dataApi, + withSitecoreContext, +} from '@sitecore-jss/sitecore-jss-react'; import { dataFetcher } from './dataFetcher'; import { getHostname } from './util'; import config from './temp/config'; @@ -26,7 +30,7 @@ class RouteHandler extends React.Component { }; const routeData = this.extractRouteData(); - + // route data from react-router - if route was resolved, it's not a 404 if (props.route !== null) { this.state.notFound = false; @@ -68,13 +72,13 @@ class RouteHandler extends React.Component { const { route, ...context } = this.props.sitecoreContext; - return { + return { sitecore: { route, - context - } - } - } + context, + }, + }; + }; /** * Loads route data from Sitecore Layout Service into state.routeData @@ -101,8 +105,8 @@ class RouteHandler extends React.Component { this.setState({ notFound: true }, () => { const context = routeData && routeData.sitecore ? routeData.sitecore.context : null; - this.props.updateSitecoreContext(context) - }) + this.props.updateSitecoreContext(context); + }); } }); } @@ -190,4 +194,4 @@ function getRouteData(route, language) { }); } -export default withSitecoreContext({ updatable: true })(RouteHandler) +export default withSitecoreContext({ updatable: true })(RouteHandler); diff --git a/samples/react/src/lib/GraphQLClientFactory.js b/samples/react/src/lib/GraphQLClientFactory.js index 608d523a08..b4e85831a8 100644 --- a/samples/react/src/lib/GraphQLClientFactory.js +++ b/samples/react/src/lib/GraphQLClientFactory.js @@ -39,12 +39,12 @@ import { createPersistedQueryLink } from 'apollo-link-persisted-queries'; export default function (endpoint, ssr, initialCacheState) { /* HTTP link selection: default to batched + APQ */ const link = createPersistedQueryLink().concat( - new BatchHttpLink({ + new BatchHttpLink({ uri: endpoint, credentials: 'include', headers: { - connection: "keep-alive" - } + connection: 'keep-alive', + }, }) ); diff --git a/samples/react/src/lib/GraphQLData.js b/samples/react/src/lib/GraphQLData.js index 14ea151869..a2c0f46219 100644 --- a/samples/react/src/lib/GraphQLData.js +++ b/samples/react/src/lib/GraphQLData.js @@ -78,8 +78,9 @@ function GraphQLData(query, configuration = {}) { resultProps[newConfiguration.name] = innerQuery; // run a user-specified props function too if one exists - if (configuration.props) + if (configuration.props) { resultProps = Object.assign(resultProps, configuration.props(props)); + } return resultProps; }; From 9528e45e1986d23057440f9db83f958a2a721502 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 09:11:31 +0200 Subject: [PATCH 26/37] push package locks --- package-lock.json | 960 ++++------- .../sitecore-jss-angular/package-lock.json | 787 +++++++++ packages/sitecore-jss-cli/package-lock.json | 601 +++++++ .../sitecore-jss-dev-tools/package-lock.json | 616 +++++++ packages/sitecore-jss-forms/package-lock.json | 755 +++++++++ .../sitecore-jss-manifest/package-lock.json | 733 +++++++++ .../package-lock.json | 514 +++++- .../sitecore-jss-nextjs/package-lock.json | 771 ++++++++- packages/sitecore-jss-proxy/package-lock.json | 666 ++++++++ .../package-lock.json | 908 ++++++++++- .../package-lock.json | 705 +++++++- packages/sitecore-jss-react/package-lock.json | 979 +++++++++++- .../package-lock.json | 605 +++++++ .../sitecore-jss-tracking/package-lock.json | 702 ++++++++ .../package-lock.json | 642 ++++++++ packages/sitecore-jss-vue/package-lock.json | 664 ++++++++ packages/sitecore-pipelines/package-lock.json | 627 ++++++++ samples/angular/package-lock.json | 1413 ++++++++++++++++- samples/react-native/package-lock.json | 674 +++++--- samples/vue/package-lock.json | 140 +- 20 files changed, 13437 insertions(+), 1025 deletions(-) diff --git a/package-lock.json b/package-lock.json index c87eee6baf..d92604048f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2100,12 +2100,40 @@ "glob-to-regexp": "^0.3.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + } + } + }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@octokit/auth-token": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", @@ -2332,10 +2360,10 @@ "@types/istanbul-lib-report": "*" } }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "dev": true }, "@types/minimatch": { @@ -2377,6 +2405,294 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.10.0.tgz", + "integrity": "sha512-h6/V46o6aXpKRlarP1AiJEXuCJ7cMQdlpfMDrcllIgX3dFkLwEBTXAoNP98ZoOmqd1xvymMVRAI4e7yVvlzWEg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.10.0", + "@typescript-eslint/scope-manager": "4.10.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "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" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "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" + } + }, + "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" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.10.0.tgz", + "integrity": "sha512-opX+7ai1sdWBOIoBgpVJrH5e89ra1KoLrJTz0UtWAa4IekkKmqDosk5r6xqRaNJfCXEfteW4HXQAwMdx+jjEmw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.10.0", + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/typescript-estree": "4.10.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "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" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.10.0.tgz", + "integrity": "sha512-amBvUUGBMadzCW6c/qaZmfr3t9PyevcSWw7hY2FuevdZVp5QPw/K76VSQ5Sw3BxlgYCHZcK6DjIhSZK0PQNsQg==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.10.0", + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/typescript-estree": "4.10.0", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.10.0.tgz", + "integrity": "sha512-WAPVw35P+fcnOa8DEic0tQUhoJJsgt+g6DEcz257G7vHFMwmag58EfowdVbiNcdfcV27EFR0tUBVXkDoIvfisQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/visitor-keys": "4.10.0" + } + }, + "@typescript-eslint/types": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.10.0.tgz", + "integrity": "sha512-+dt5w1+Lqyd7wIPMa4XhJxUuE8+YF+vxQ6zxHyhLGHJjHiunPf0wSV8LtQwkpmAsRi1lEOoOIR30FG5S2HS33g==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.10.0.tgz", + "integrity": "sha512-mGK0YRp9TOk6ZqZ98F++bW6X5kMTzCRROJkGXH62d2azhghmq+1LNLylkGe6uGUOQzD452NOAEth5VAF6PDo5g==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/visitor-keys": "4.10.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "globby": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "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" + } + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "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" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "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" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.10.0.tgz", + "integrity": "sha512-hPyz5qmDMuZWFtHZkjcCpkAKHX8vdu1G3YsCLEd25ryZgnJfj6FQuJ5/O7R+dB1ueszilJmAFMtlU4CA6se3Jg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.10.0", + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "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 + } + } + }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", @@ -2586,38 +2902,6 @@ "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", "dev": true }, - "array-includes": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", - "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0", - "is-string": "^1.0.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -2639,69 +2923,6 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, - "array.prototype.flat": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", - "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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.prototype.flatmap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.3.tgz", - "integrity": "sha512-OOEk+lkePcg+ODXIpvuU9PAryCikCJyo7GlDG1upleEpQRx6mzL9puEBkozQ5iAx20KV0l3DbyQwqciJtqe5Pg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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", @@ -3457,12 +3678,6 @@ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true - }, "conventional-changelog-angular": { "version": "5.0.11", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", @@ -4465,177 +4680,20 @@ }, "eslint-config-prettier": { "version": "6.12.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", - "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", - "dev": true, - "requires": { - "get-stdin": "^6.0.0" - } - }, - "eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "resolve": "^1.13.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", - "dev": true, - "requires": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", - "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-plugin-prettier": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", - "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", - "dev": true, - "requires": { - "prettier-linter-helpers": "^1.0.0" - } - }, - "eslint-plugin-react": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.21.4.tgz", - "integrity": "sha512-uHeQ8A0hg0ltNDXFu3qSfFqTNPXm1XithH6/SY318UX76CMj7Q599qWpgmMhVQyvhq36pm7qvoN3pb6/3jsTFg==", - "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.17.0", - "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-plugin-react-native": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-3.10.0.tgz", - "integrity": "sha512-4f5+hHYYq5wFhB5eptkPEAR7FfvqbS7AzScUOANfAMZtYw5qgnCxRq45bpfBaQF+iyPMim5Q8pubcpvLv75NAg==", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", + "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", "dev": true, "requires": { - "@babel/traverse": "^7.7.4", - "eslint-plugin-react-native-globals": "^0.1.1" + "get-stdin": "^6.0.0" } }, - "eslint-plugin-react-native-globals": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz", - "integrity": "sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g==", - "dev": true - }, - "eslint-plugin-vue": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-4.7.1.tgz", - "integrity": "sha512-esETKhVMI7Vdli70Wt4bvAwnZBJeM0pxVX9Yb0wWKxdCJc2EADalVYK/q2FzMw8oKN0wPMdqVCKS8kmR89recA==", + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", "dev": true, "requires": { - "vue-eslint-parser": "^2.0.3" + "prettier-linter-helpers": "^1.0.0" } }, "eslint-scope": { @@ -4973,6 +5031,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -6484,38 +6551,6 @@ } } }, - "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" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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" - } - } - } - }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -6733,12 +6768,6 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, - "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true - }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -7307,15 +7336,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -7343,16 +7363,6 @@ "verror": "1.10.0" } }, - "jsx-ast-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.0.0.tgz", - "integrity": "sha512-sPuicm6EPKYI/UnWpOatvg4pI50qaBo4dSOMGUPutmJ26ttedFKXr0It0XXPk4HKnQ/1X0st4eSS2w2jhFk9Ow==", - "dev": true, - "requires": { - "array-includes": "^3.1.1", - "object.assign": "^4.1.1" - } - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -7416,18 +7426,6 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - } - }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -9139,39 +9137,6 @@ } } }, - "object.fromentries": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz", - "integrity": "sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", - "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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" - } - } - } - }, "object.getownpropertydescriptors": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", @@ -9212,39 +9177,6 @@ "isobject": "^3.0.1" } }, - "object.values": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", - "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", - "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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" - } - } - } - }, "octokit-pagination-methods": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", @@ -9516,15 +9448,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -9567,15 +9490,6 @@ "node-modules-regexp": "^1.0.0" } }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -9687,17 +9601,6 @@ "read": "1" } }, - "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", - "dev": true, - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - } - }, "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -9841,27 +9744,6 @@ "util-promisify": "^2.1.0" } }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } - }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -9947,37 +9829,6 @@ "safe-regex": "^1.1.0" } }, - "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" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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" - } - } - } - }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -10157,6 +10008,12 @@ "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -10178,6 +10035,12 @@ "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -10326,16 +10189,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "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" - } - }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -10760,41 +10613,6 @@ } } }, - "string.prototype.matchall": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz", - "integrity": "sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0", - "has-symbols": "^1.0.1", - "internal-slot": "^1.0.2", - "regexp.prototype.flags": "^1.3.0", - "side-channel": "^1.0.2" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -11297,18 +11115,6 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, - "tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", - "dev": true, - "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - } - }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -11641,74 +11447,6 @@ "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", "dev": true }, - "vue-eslint-parser": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz", - "integrity": "sha512-ZezcU71Owm84xVF6gfurBQUGg8WQ+WZGxgDEQu1IHFBZNx7BFZg3L1yHxrCBNNwbwFtE1GuvfJKMtb6Xuwc/Bw==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.2", - "esquery": "^1.0.0", - "lodash": "^4.17.4" - }, - "dependencies": { - "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", - "dev": true - }, - "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } - } - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", - "dev": true, - "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" - } - } - } - }, "walker": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", diff --git a/packages/sitecore-jss-angular/package-lock.json b/packages/sitecore-jss-angular/package-lock.json index 35cec89a15..9b7843452c 100644 --- a/packages/sitecore-jss-angular/package-lock.json +++ b/packages/sitecore-jss-angular/package-lock.json @@ -4,6 +4,15 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@angular-eslint/eslint-plugin": { + "version": "0.8.0-beta.6", + "resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin/-/eslint-plugin-0.8.0-beta.6.tgz", + "integrity": "sha512-yXyNSTUA0Nosh1ZI/iJerbwqeakhI495P5O1luxE9Fw7Vcdmb+JdmE++6Ipq2oO7rEyv2rHpci84tqNTE3wr2g==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.3.0" + } + }, "@angular/common": { "version": "10.0.14", "resolved": "https://registry.npmjs.org/@angular/common/-/common-10.0.14.tgz", @@ -405,12 +414,94 @@ "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 + } + } + }, "@istanbuljs/schema": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@rollup/plugin-commonjs": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz", @@ -486,6 +577,12 @@ "integrity": "sha512-LRJ21f/BO4QNZ3YDaMP0OEurOfE77x8mi8MfEnUsei5IKfmZL0GKl7juhABMdUIJHhVS9OCLotKHfsFNAuJ+DA==", "dev": true }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, "@types/node": { "version": "12.12.26", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.26.tgz", @@ -513,6 +610,88 @@ "@types/node": "*" } }, + "@typescript-eslint/experimental-utils": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.3.0.tgz", + "integrity": "sha512-cmmIK8shn3mxmhpKfzMMywqiEheyfXLV/+yPDnOTvQX/ztngx7Lg/OD26J8gTZfkLKUmaEBxO2jYP3keV7h2OQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.3.0", + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/typescript-estree": "4.3.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.3.0.tgz", + "integrity": "sha512-cTeyP5SCNE8QBRfc+Lgh4Xpzje46kNUhXYfc3pQWmJif92sjrFuHT9hH4rtOkDTo/si9Klw53yIr+djqGZS1ig==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/visitor-keys": "4.3.0" + } + }, + "@typescript-eslint/types": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.3.0.tgz", + "integrity": "sha512-Cx9TpRvlRjOppGsU6Y6KcJnUDOelja2NNCX6AZwtVHRzaJkdytJWMuYiqi8mS35MRNA3cJSwDzXePfmhU6TANw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.3.0.tgz", + "integrity": "sha512-ZAI7xjkl+oFdLV/COEz2tAbQbR3XfgqHEGy0rlUXzfGQic6EBCR4s2+WS3cmTPG69aaZckEucBoTxW9PhzHxxw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/visitor-keys": "4.3.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.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 + }, + "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" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.3.0.tgz", + "integrity": "sha512-xZxkuR7XLM6RhvLkgv9yYlTcBHnTULzfnw4i6+z2TGBLy9yljAypQaZl9c3zFvy7PNI7fYWyvKYtohyF8au3cw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.3.0", + "eslint-visitor-keys": "^2.0.0" + } + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -529,6 +708,12 @@ "integrity": "sha512-dmKn4pqZ29iQl2Pvze1zTrps2luvls2PBY//neO2WJ0s10B3AxJXshN+Ph7B4GrhfGhHXrl4dnUwyNNXQcnWGQ==", "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 + }, "acorn-walk": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.0.0.tgz", @@ -620,6 +805,12 @@ "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", "dev": true }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", @@ -658,6 +849,12 @@ "util": "^0.12.0" } }, + "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": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -974,6 +1171,12 @@ "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", "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", @@ -1341,6 +1544,28 @@ "sha.js": "^2.4.8" } }, + "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" + }, + "dependencies": { + "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" + } + } + } + }, "crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", @@ -1603,6 +1828,12 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "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 + }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -1680,6 +1911,24 @@ } } }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "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-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -1889,6 +2138,15 @@ "has-binary2": "~1.0.2" } }, + "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" + } + }, "ent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", @@ -1982,18 +2240,239 @@ "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": { + "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" + } + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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": "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": { + "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", + "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 + }, "estree-walker": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", "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.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -2028,18 +2507,56 @@ "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", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "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 + }, "fastparse": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", "dev": true }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "dev": true, + "requires": { + "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", @@ -2080,6 +2597,24 @@ "path-exists": "^4.0.0" } }, + "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": { + "flatted": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz", + "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", + "dev": true + } + } + }, "flatted": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", @@ -2128,6 +2663,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 + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -2169,6 +2710,20 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "globby": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", @@ -2338,6 +2893,12 @@ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", "dev": true }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, "image-size": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", @@ -2345,6 +2906,22 @@ "dev": true, "optional": 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 + }, "indexes-of": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", @@ -2716,6 +3293,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", @@ -2923,6 +3506,16 @@ } } }, + "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", @@ -2986,6 +3579,15 @@ } } }, + "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" + } + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -3035,6 +3637,22 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -3123,6 +3741,12 @@ "dev": true, "optional": 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 + }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -3354,6 +3978,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", @@ -3399,6 +4037,15 @@ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "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-asn1": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", @@ -3466,12 +4113,24 @@ "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", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", @@ -4022,12 +4681,24 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "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": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "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 + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -4226,6 +4897,12 @@ "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "regexpu-core": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", @@ -4279,12 +4956,24 @@ "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 + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rfdc": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.1.4.tgz", @@ -4341,6 +5030,12 @@ "source-map-resolve": "^0.6.0" } }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, "rxjs": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", @@ -4420,6 +5115,21 @@ "safe-buffer": "^5.0.1" } }, + "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 + }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -4429,6 +5139,23 @@ "is-arrayish": "^0.3.1" } }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "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" + } + }, "socket.io": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", @@ -4789,6 +5516,12 @@ "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 + }, "stylehacks": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", @@ -4888,6 +5621,18 @@ "util.promisify": "~1.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" + } + }, "terser": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.3.tgz", @@ -4913,6 +5658,12 @@ } } }, + "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 + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -4982,12 +5733,30 @@ "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, + "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.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", "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-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", @@ -5127,6 +5896,12 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "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", @@ -5193,6 +5968,12 @@ "is-typed-array": "^1.1.3" } }, + "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 + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -5243,6 +6024,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": "15.3.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.0.tgz", 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-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-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-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-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/package-lock.json b/packages/sitecore-jss-nextjs/package-lock.json index ef5559fdb8..4c92eab994 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", @@ -963,6 +985,12 @@ "@types/react": "*" } }, + "@types/url-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/url-parse/-/url-parse-1.4.3.tgz", + "integrity": "sha512-4kHAkbV/OfW2kb5BLVUuUMoumB3CP8rHqlw48aHvFy5tf9ER0AfOonBlX29l/DD68G70DmyhRlSYfQPSYpC5Vw==", + "dev": true + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -1195,6 +1223,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 +1470,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 +1537,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 +1657,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 +2092,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 +2153,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 +3195,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 +3411,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 +3608,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 +3789,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 +4130,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 +4175,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 +4404,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 +4926,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 +4991,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 +5489,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 +5522,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 +5626,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 +6161,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 +6908,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 +7456,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 +7847,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 +8364,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 +8465,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 +8907,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 +9079,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 +9151,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 +9395,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 +9568,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 +9809,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-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-react-forms/package-lock.json b/packages/sitecore-jss-react-forms/package-lock.json index 7348bfb68a..25cf579ac4 100644 --- a/packages/sitecore-jss-react-forms/package-lock.json +++ b/packages/sitecore-jss-react-forms/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", @@ -237,6 +284,12 @@ "acorn-walk": "^7.1.1" } }, + "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": "7.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", @@ -342,6 +395,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", @@ -368,6 +456,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", @@ -395,6 +517,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", @@ -477,6 +605,22 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "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", @@ -659,6 +803,28 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "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" + }, + "dependencies": { + "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" + } + } + } + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -842,6 +1008,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", @@ -910,6 +1085,23 @@ "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" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -1053,12 +1245,324 @@ "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 + }, + "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 + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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" + } + } + } + }, + "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" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "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", @@ -1124,6 +1628,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", @@ -1160,6 +1673,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", @@ -1207,6 +1736,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", @@ -1225,6 +1760,17 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -1257,6 +1803,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", @@ -1398,6 +1961,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", @@ -1420,6 +1999,17 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": 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", @@ -1459,6 +2049,15 @@ "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", @@ -1663,6 +2262,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", @@ -1681,6 +2286,30 @@ "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" + }, + "dependencies": { + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, "just-extend": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz", @@ -1771,6 +2400,15 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "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", @@ -2011,6 +2649,12 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "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 + }, "nearley": { "version": "2.19.7", "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.19.7.tgz", @@ -2248,6 +2892,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", @@ -2281,6 +2934,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", @@ -2326,6 +2985,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "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 + }, "prop-types": { "version": "15.7.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", @@ -2523,6 +3188,22 @@ "integrity": "sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=", "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 + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -2616,6 +3297,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 + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -2696,6 +3383,53 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "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 + }, + "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" + } + } + } + }, "sinon": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.3.tgz", @@ -2734,6 +3468,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", @@ -2821,6 +3598,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", @@ -2921,6 +3735,64 @@ "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" + } + } + } + }, + "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", @@ -2969,30 +3841,6 @@ "yn": "3.1.1" } }, - "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", - "dev": true - }, - "tslint-react": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-4.2.0.tgz", - "integrity": "sha512-lO22+FKr9ZZGueGiuALzvZE/8ANoDoCHGCknX1Ge3ALrfcLQHQ1VGdyb1scZXQFdEQEfwBTIU40r5BUlJpn0JA==", - "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" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -3056,6 +3904,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", @@ -3226,6 +4080,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-react-native/package-lock.json b/packages/sitecore-jss-react-native/package-lock.json index 077438d531..a2b42f7c87 100644 --- a/packages/sitecore-jss-react-native/package-lock.json +++ b/packages/sitecore-jss-react-native/package-lock.json @@ -1204,6 +1204,90 @@ "minimist": "^1.2.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": { + "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" + } + }, + "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 + }, + "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" + } + }, + "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 + }, + "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 + }, + "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/address": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz", @@ -2095,6 +2179,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", @@ -4180,6 +4270,15 @@ } } }, + "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.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -4295,6 +4394,23 @@ "once": "^1.4.0" } }, + "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" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -4380,12 +4496,396 @@ "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 + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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 + }, + "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 + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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-plugin-react-native": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-3.10.0.tgz", + "integrity": "sha512-4f5+hHYYq5wFhB5eptkPEAR7FfvqbS7AzScUOANfAMZtYw5qgnCxRq45bpfBaQF+iyPMim5Q8pubcpvLv75NAg==", + "dev": true, + "requires": { + "@babel/traverse": "^7.7.4", + "eslint-plugin-react-native-globals": "^0.1.1" + } + }, + "eslint-plugin-react-native-globals": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz", + "integrity": "sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g==", + "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": { + "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", + "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", @@ -4795,6 +5295,15 @@ "escape-string-regexp": "^1.0.5" } }, + "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" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -4860,6 +5369,22 @@ "locate-path": "^3.0.0" } }, + "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 + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -5485,6 +6010,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 + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -6848,6 +7379,12 @@ "jsonify": "~0.0.0" } }, + "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", @@ -8549,6 +9086,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": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -8765,6 +9311,12 @@ "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": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/promise/-/promise-8.1.0.tgz", @@ -9352,6 +9904,12 @@ "safe-regex": "^1.1.0" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "regexpu-core": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", @@ -10218,6 +10776,12 @@ "min-indent": "^1.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 + }, "sudo-prompt": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-9.2.1.tgz", @@ -10245,6 +10809,111 @@ "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": { + "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-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" + } + }, + "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 + }, + "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 + }, + "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 + }, + "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" + } + }, + "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" + } + } + } + }, "temp": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", @@ -10275,6 +10944,12 @@ "require-main-filename": "^2.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 + }, "throat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", @@ -10421,30 +11096,6 @@ "yargs-parser": "10.x" } }, - "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", - "dev": true - }, - "tslint-react": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-4.2.0.tgz", - "integrity": "sha512-lO22+FKr9ZZGueGiuALzvZE/8ANoDoCHGCknX1Ge3ALrfcLQHQ1VGdyb1scZXQFdEQEfwBTIU40r5BUlJpn0JA==", - "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" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -10675,6 +11326,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-react/package-lock.json b/packages/sitecore-jss-react/package-lock.json index 43a4b876bd..deac8e1d8d 100644 --- a/packages/sitecore-jss-react/package-lock.json +++ b/packages/sitecore-jss-react/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", @@ -154,6 +186,12 @@ "@types/node": "*" } }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -215,6 +253,125 @@ "integrity": "sha512-4kHAkbV/OfW2kb5BLVUuUMoumB3CP8rHqlw48aHvFy5tf9ER0AfOonBlX29l/DD68G70DmyhRlSYfQPSYpC5Vw==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.10.0.tgz", + "integrity": "sha512-h6/V46o6aXpKRlarP1AiJEXuCJ7cMQdlpfMDrcllIgX3dFkLwEBTXAoNP98ZoOmqd1xvymMVRAI4e7yVvlzWEg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.10.0", + "@typescript-eslint/scope-manager": "4.10.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "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" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.10.0.tgz", + "integrity": "sha512-opX+7ai1sdWBOIoBgpVJrH5e89ra1KoLrJTz0UtWAa4IekkKmqDosk5r6xqRaNJfCXEfteW4HXQAwMdx+jjEmw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.10.0", + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/typescript-estree": "4.10.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.10.0.tgz", + "integrity": "sha512-amBvUUGBMadzCW6c/qaZmfr3t9PyevcSWw7hY2FuevdZVp5QPw/K76VSQ5Sw3BxlgYCHZcK6DjIhSZK0PQNsQg==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.10.0", + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/typescript-estree": "4.10.0", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.10.0.tgz", + "integrity": "sha512-WAPVw35P+fcnOa8DEic0tQUhoJJsgt+g6DEcz257G7vHFMwmag58EfowdVbiNcdfcV27EFR0tUBVXkDoIvfisQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/visitor-keys": "4.10.0" + } + }, + "@typescript-eslint/types": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.10.0.tgz", + "integrity": "sha512-+dt5w1+Lqyd7wIPMa4XhJxUuE8+YF+vxQ6zxHyhLGHJjHiunPf0wSV8LtQwkpmAsRi1lEOoOIR30FG5S2HS33g==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.10.0.tgz", + "integrity": "sha512-mGK0YRp9TOk6ZqZ98F++bW6X5kMTzCRROJkGXH62d2azhghmq+1LNLylkGe6uGUOQzD452NOAEth5VAF6PDo5g==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.10.0", + "@typescript-eslint/visitor-keys": "4.10.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "globby": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "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" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.10.0.tgz", + "integrity": "sha512-hPyz5qmDMuZWFtHZkjcCpkAKHX8vdu1G3YsCLEd25ryZgnJfj6FQuJ5/O7R+dB1ueszilJmAFMtlU4CA6se3Jg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.10.0", + "eslint-visitor-keys": "^2.0.0" + } + }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -245,6 +402,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", @@ -354,6 +517,41 @@ "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", "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", @@ -380,6 +578,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" + } + } + } + }, "array.prototype.map": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", @@ -419,6 +651,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", @@ -501,6 +739,22 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "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", @@ -684,6 +938,17 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "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" + } + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -861,6 +1126,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", @@ -921,6 +1195,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" + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -1077,11 +1360,308 @@ "source-map": "~0.6.1" } }, - "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 + "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 + }, + "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" + } + }, + "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" + } + }, + "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" + } + } + } + }, + "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" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "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", @@ -1148,6 +1728,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", @@ -1176,6 +1765,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", @@ -1223,6 +1828,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", @@ -1241,6 +1852,17 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -1273,6 +1895,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", @@ -1414,6 +2053,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", @@ -1436,6 +2091,17 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": 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", @@ -1481,6 +2147,15 @@ "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", @@ -1707,6 +2382,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", @@ -1725,6 +2406,30 @@ "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" + }, + "dependencies": { + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, "just-extend": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz", @@ -1866,6 +2571,15 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "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", @@ -2081,6 +2795,12 @@ "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 + }, "nearley": { "version": "2.19.7", "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.19.7.tgz", @@ -2331,6 +3051,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", @@ -2364,6 +3093,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", @@ -2423,6 +3158,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "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", @@ -2636,6 +3377,22 @@ "integrity": "sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=", "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 + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -2735,6 +3492,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 + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -2824,6 +3587,53 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "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 + }, + "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" + } + } + } + }, "sinon": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", @@ -2853,6 +3663,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", @@ -2940,6 +3793,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", @@ -3045,6 +3935,64 @@ "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" + } + } + } + }, + "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", @@ -3099,15 +4047,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", @@ -3190,6 +4129,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", @@ -3368,6 +4313,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-rendering-host/package-lock.json b/packages/sitecore-jss-rendering-host/package-lock.json index 65f30ba4ef..f0796940bd 100644 --- a/packages/sitecore-jss-rendering-host/package-lock.json +++ b/packages/sitecore-jss-rendering-host/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", @@ -573,6 +620,12 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==" }, + "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", @@ -801,6 +854,12 @@ "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" }, + "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": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -1723,6 +1782,12 @@ "regexp.prototype.flags": "^1.2.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 + }, "default-gateway": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", @@ -1884,6 +1949,15 @@ "buffer-indexof": "^1.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" + } + }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -2045,6 +2119,23 @@ } } }, + "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" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -2150,6 +2241,219 @@ "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" + } + }, + "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" + } + }, + "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 + }, + "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": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -2159,12 +2463,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", @@ -2185,6 +2554,12 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" }, + "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", @@ -2428,6 +2803,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", @@ -2449,6 +2830,15 @@ "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==" }, + "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", @@ -2489,6 +2879,22 @@ "locate-path": "^3.0.0" } }, + "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", @@ -2645,6 +3051,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", @@ -2698,6 +3110,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", @@ -3475,6 +3904,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", @@ -3520,6 +3955,16 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" }, + "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", @@ -4145,6 +4590,12 @@ "to-regex": "^3.0.1" } }, + "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", @@ -4455,6 +4906,20 @@ "is-wsl": "^1.1.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" + } + }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", @@ -4744,6 +5209,12 @@ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, + "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", @@ -4754,6 +5225,12 @@ "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-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -5079,6 +5556,12 @@ } } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -5474,6 +5957,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 + } + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -6089,6 +6615,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" + } + } + } + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -6134,6 +6712,12 @@ } } }, + "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", @@ -6311,6 +6895,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", @@ -6494,6 +7087,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", @@ -7355,6 +7954,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 + }, "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-tracking/package-lock.json b/packages/sitecore-jss-tracking/package-lock.json index 421589ddac..57f78b53dc 100644 --- a/packages/sitecore-jss-tracking/package-lock.json +++ b/packages/sitecore-jss-tracking/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", @@ -168,6 +215,18 @@ "integrity": "sha512-4kHAkbV/OfW2kb5BLVUuUMoumB3CP8rHqlw48aHvFy5tf9ER0AfOonBlX29l/DD68G70DmyhRlSYfQPSYpC5Vw==", "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", @@ -178,6 +237,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", @@ -250,6 +321,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.19.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", @@ -296,6 +373,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", @@ -427,6 +510,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.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -483,6 +577,12 @@ "regexp.prototype.flags": "^1.2.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", @@ -550,12 +650,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", @@ -630,12 +748,248 @@ "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 + }, + "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 + } + } + }, + "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 + }, + "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", @@ -719,6 +1073,18 @@ } } }, + "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", @@ -728,6 +1094,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" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -763,6 +1138,22 @@ } } }, + "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.5.10", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", @@ -784,6 +1175,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", @@ -810,6 +1207,32 @@ "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" + } + }, + "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", @@ -883,6 +1306,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", @@ -929,12 +1368,27 @@ "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-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "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-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", @@ -1033,12 +1487,34 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "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", "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", "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", @@ -1111,6 +1587,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", @@ -1417,6 +1902,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", @@ -1492,6 +1983,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", @@ -1525,6 +2030,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", @@ -1549,6 +2063,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", @@ -1590,6 +2110,18 @@ "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 + }, + "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", @@ -1603,6 +2135,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 + }, "querystringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", @@ -1683,6 +2221,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 + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1710,6 +2254,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", @@ -1758,6 +2308,21 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "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", @@ -1790,6 +2355,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-support": { "version": "0.5.16", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", @@ -1917,6 +2525,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 + }, "trim-newlines": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", @@ -1950,6 +2616,15 @@ "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", @@ -1968,6 +2643,15 @@ "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "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" + } + }, "url-parse": { "version": "1.4.7", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", @@ -1978,6 +2662,12 @@ "requires-port": "^1.0.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", @@ -2012,6 +2702,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", @@ -2069,6 +2765,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-update-package/package-lock.json b/packages/sitecore-jss-update-package/package-lock.json index 435659a18c..59a6010457 100644 --- a/packages/sitecore-jss-update-package/package-lock.json +++ b/packages/sitecore-jss-update-package/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", @@ -141,6 +173,18 @@ "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", "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", @@ -151,6 +195,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", @@ -233,6 +289,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-polyfill": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", @@ -305,6 +367,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", @@ -457,6 +525,17 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "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.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -499,6 +578,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", @@ -548,12 +633,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", @@ -656,12 +759,233 @@ "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 + }, + "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 + }, + "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", @@ -676,6 +1000,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", @@ -699,6 +1035,15 @@ "whatwg-url": "^6.5.0" } }, + "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", @@ -735,6 +1080,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 + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -753,6 +1114,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", @@ -794,6 +1161,23 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "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", @@ -870,6 +1254,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", @@ -1056,6 +1456,18 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "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 + }, "jszip": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.2.2.tgz", @@ -1079,6 +1491,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", @@ -1171,6 +1593,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", @@ -1344,6 +1775,12 @@ "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", @@ -1432,6 +1869,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", @@ -1470,6 +1921,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", @@ -1494,6 +1954,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", @@ -1524,11 +1990,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", @@ -1641,6 +2119,12 @@ "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", "dev": true }, + "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", @@ -1662,6 +2146,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", @@ -1714,6 +2204,21 @@ "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" }, + "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", @@ -1746,6 +2251,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", @@ -1877,6 +2425,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", @@ -1922,6 +2528,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", @@ -1940,11 +2555,26 @@ "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "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" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "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", @@ -1996,6 +2626,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", @@ -2053,6 +2689,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-vue/package-lock.json b/packages/sitecore-jss-vue/package-lock.json index 8e1258a0cb..a07502b30c 100644 --- a/packages/sitecore-jss-vue/package-lock.json +++ b/packages/sitecore-jss-vue/package-lock.json @@ -408,6 +408,68 @@ "minimist": "^1.2.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 + }, + "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 + }, + "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 + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1578,6 +1640,12 @@ "acorn-walk": "^7.1.1" } }, + "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": "7.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", @@ -1606,6 +1674,12 @@ "uri-js": "^4.2.2" } }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-escapes": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", @@ -1714,6 +1788,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "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", @@ -2776,6 +2856,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-event-types": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dom-event-types/-/dom-event-types-1.0.0.tgz", @@ -2891,6 +2980,15 @@ "once": "^1.4.0" } }, + "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", @@ -2934,12 +3032,393 @@ } } }, + "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 + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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-plugin-vue": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.3.0.tgz", + "integrity": "sha512-4rc9xrZgwT4aLz3XE6lrHu+FZtDLWennYvtzVvvS81kW9c65U4DUzQQWAFjDCgCFvN6HYWxi7ueEtxZVSB+f0g==", + "dev": true, + "requires": { + "eslint-utils": "^2.1.0", + "natural-compare": "^1.4.0", + "semver": "^7.3.2", + "vue-eslint-parser": "^7.3.0" + }, + "dependencies": { + "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" + } + }, + "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" + } + }, + "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", @@ -3249,6 +3728,15 @@ "bser": "2.1.1" } }, + "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" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -3292,6 +3780,22 @@ "path-exists": "^4.0.0" } }, + "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 + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -3337,6 +3841,12 @@ "dev": true, "optional": 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 + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -3631,6 +4141,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 + } + } + }, "import-local": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", @@ -6497,6 +7025,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", @@ -7126,6 +7660,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", @@ -7251,6 +7794,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 + }, "prompts": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.2.tgz", @@ -7425,6 +7974,12 @@ } } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -7888,6 +8443,43 @@ "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 + } + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -8308,6 +8900,18 @@ "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" + } + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -8329,6 +8933,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 + }, "throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -8697,6 +9307,12 @@ "dev": true, "optional": 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 + }, "v8-to-istanbul": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz", @@ -8749,6 +9365,54 @@ "integrity": "sha512-+eaQXVrAm/LldalI272PpDe3+i4mPis0ORiMYxF6Ae4hyuCh15W8Idet7wPUEs4N4YptgFHGys4UrgNQOMyO6w==", "dev": true }, + "vue-eslint-parser": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.3.0.tgz", + "integrity": "sha512-n5PJKZbyspD0+8LnaZgpEvNCrjQx1DyDHw8JdWwoxhhC+yRip4TAvSDpXGf9SWX6b0umeB5aR61gwUo6NVvFxw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-scope": "^5.0.0", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.2.1", + "esquery": "^1.0.1", + "lodash": "^4.17.15" + }, + "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" + } + }, + "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 + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.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 + } + } + }, "vue-jest": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/vue-jest/-/vue-jest-3.0.7.tgz", diff --git a/packages/sitecore-pipelines/package-lock.json b/packages/sitecore-pipelines/package-lock.json index 449451b137..7ba7d62637 100644 --- a/packages/sitecore-pipelines/package-lock.json +++ b/packages/sitecore-pipelines/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", @@ -151,6 +183,18 @@ "integrity": "sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ==", "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.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -161,6 +205,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", @@ -243,6 +299,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", @@ -284,6 +346,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", @@ -486,6 +554,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", @@ -535,12 +609,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", @@ -643,12 +735,244 @@ "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" + } + }, + "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 + }, + "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.1.1", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", @@ -662,6 +986,18 @@ "micromatch": "^4.0.2" } }, + "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.6.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", @@ -671,6 +1007,15 @@ "reusify": "^1.0.0" } }, + "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", @@ -707,6 +1052,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 + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -724,6 +1085,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", @@ -758,6 +1125,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", @@ -829,6 +1213,22 @@ "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", "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", @@ -1015,6 +1415,18 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "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", @@ -1027,6 +1439,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", @@ -1099,6 +1521,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", @@ -1271,6 +1702,12 @@ "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", @@ -1343,6 +1780,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", @@ -1376,6 +1827,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", @@ -1438,6 +1898,18 @@ "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", "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 + }, + "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", @@ -1451,6 +1923,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", @@ -1524,6 +2002,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", @@ -1545,6 +2029,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", @@ -1640,6 +2130,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", @@ -1763,6 +2296,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", @@ -1799,6 +2390,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", @@ -1817,6 +2417,21 @@ "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "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", @@ -1851,6 +2466,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", @@ -1907,6 +2528,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/samples/angular/package-lock.json b/samples/angular/package-lock.json index 7f8b32b63b..f2752d344c 100644 --- a/samples/angular/package-lock.json +++ b/samples/angular/package-lock.json @@ -150,6 +150,85 @@ "rxjs": "6.5.5" } }, + "@angular-eslint/builder": { + "version": "0.8.0-beta.6", + "resolved": "https://registry.npmjs.org/@angular-eslint/builder/-/builder-0.8.0-beta.6.tgz", + "integrity": "sha512-Dc6UrI140rqSrbkPP928JbYRlSl9PNdEIuIF/Uh982MR20WvwiCXcBJc4xVHv0Oy/s0n9OQSvhfW0eUNaw2qWQ==", + "dev": true + }, + "@angular-eslint/eslint-plugin": { + "version": "0.8.0-beta.6", + "resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin/-/eslint-plugin-0.8.0-beta.6.tgz", + "integrity": "sha512-yXyNSTUA0Nosh1ZI/iJerbwqeakhI495P5O1luxE9Fw7Vcdmb+JdmE++6Ipq2oO7rEyv2rHpci84tqNTE3wr2g==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.3.0" + } + }, + "@angular-eslint/eslint-plugin-template": { + "version": "0.8.0-beta.6", + "resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-0.8.0-beta.6.tgz", + "integrity": "sha512-iC9YJSqeokMlFFLP0ZyWalzhVU++2bBdY9vfwrTaNC4JNLszAOOlkFRtPXZZQZpJ/3PM0FlVhD4OSZL36Gw6Iw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.3.0", + "aria-query": "^4.2.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "aria-query": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", + "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.10.2", + "@babel/runtime-corejs3": "^7.10.2" + } + } + } + }, + "@angular-eslint/schematics": { + "version": "0.8.0-beta.6", + "resolved": "https://registry.npmjs.org/@angular-eslint/schematics/-/schematics-0.8.0-beta.6.tgz", + "integrity": "sha512-LKQLQryq3oE/mIZNBqfXjtPEPmAr0+C55cd27tvfkMbDk0mfIfORWG7aSI5oLJYycV/30dqH6w31ClA1+BoEjA==", + "dev": true, + "requires": { + "@angular-eslint/eslint-plugin": "^0.8.0-beta.6", + "@angular-eslint/eslint-plugin-template": "^0.8.0-beta.6", + "strip-json-comments": "3.1.1", + "tslint-to-eslint-config": "2.0.1" + } + }, + "@angular-eslint/template-parser": { + "version": "0.8.0-beta.6", + "resolved": "https://registry.npmjs.org/@angular-eslint/template-parser/-/template-parser-0.8.0-beta.6.tgz", + "integrity": "sha512-uyl5PoKDdOrJ9E/rnxqSkFOA8TCzqZpiH5MNnR8TYCrho0fAQkxVVyevgZxV7ocHZAGnl5aZ7tsB/VVX+R2Q2g==", + "dev": true, + "requires": { + "eslint-scope": "^5.1.0" + }, + "dependencies": { + "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" + } + } + } + }, "@angular/animations": { "version": "10.0.14", "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-10.0.14.tgz", @@ -1491,6 +1570,16 @@ "regenerator-runtime": "^0.13.4" } }, + "@babel/runtime-corejs3": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.12.5.tgz", + "integrity": "sha512-roGr54CsTmNPPzZoCP1AmDXuBoNao7tnSA83TXTwt+UK5QVyh1DIJnrgYRPWKCF2flqZQXwa7Yr8v7VmLzF0YQ==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + } + }, "@babel/template": { "version": "7.8.6", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", @@ -1549,6 +1638,75 @@ "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": { + "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" + } + }, + "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 + }, + "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" + } + }, + "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 + }, + "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 + } + } + }, "@istanbuljs/schema": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", @@ -1751,6 +1909,12 @@ "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -1805,6 +1969,135 @@ "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.1.tgz", "integrity": "sha512-wmk0xQI6Yy7Fs/il4EpOcflG4uonUpYGqvZARESLc2oy4u69fkatFLbJOeW4Q6awO15P4rduAe6xkwHevpXcUQ==" }, + "@typescript-eslint/eslint-plugin": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.3.0.tgz", + "integrity": "sha512-RqEcaHuEKnn3oPFislZ6TNzsBLqpZjN93G69SS+laav/I8w/iGMuMq97P0D2/2/kW4SCebHggqhbcCfbDaaX+g==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.3.0", + "@typescript-eslint/scope-manager": "4.3.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "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" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.3.0.tgz", + "integrity": "sha512-cmmIK8shn3mxmhpKfzMMywqiEheyfXLV/+yPDnOTvQX/ztngx7Lg/OD26J8gTZfkLKUmaEBxO2jYP3keV7h2OQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.3.0", + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/typescript-estree": "4.3.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "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" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.3.0.tgz", + "integrity": "sha512-JyfRnd72qRuUwItDZ00JNowsSlpQGeKfl9jxwO0FHK1qQ7FbYdoy5S7P+5wh1ISkT2QyAvr2pc9dAemDxzt75g==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.3.0", + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/typescript-estree": "4.3.0", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.3.0.tgz", + "integrity": "sha512-cTeyP5SCNE8QBRfc+Lgh4Xpzje46kNUhXYfc3pQWmJif92sjrFuHT9hH4rtOkDTo/si9Klw53yIr+djqGZS1ig==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/visitor-keys": "4.3.0" + } + }, + "@typescript-eslint/types": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.3.0.tgz", + "integrity": "sha512-Cx9TpRvlRjOppGsU6Y6KcJnUDOelja2NNCX6AZwtVHRzaJkdytJWMuYiqi8mS35MRNA3cJSwDzXePfmhU6TANw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.3.0.tgz", + "integrity": "sha512-ZAI7xjkl+oFdLV/COEz2tAbQbR3XfgqHEGy0rlUXzfGQic6EBCR4s2+WS3cmTPG69aaZckEucBoTxW9PhzHxxw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.3.0", + "@typescript-eslint/visitor-keys": "4.3.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "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" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.3.0.tgz", + "integrity": "sha512-xZxkuR7XLM6RhvLkgv9yYlTcBHnTULzfnw4i6+z2TGBLy9yljAypQaZl9c3zFvy7PNI7fYWyvKYtohyF8au3cw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.3.0", + "eslint-visitor-keys": "^2.0.0" + } + }, "@webassemblyjs/ast": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", @@ -2066,6 +2359,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": "2.0.0", "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-2.0.0.tgz", @@ -2484,6 +2783,19 @@ "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", "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" + } + }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -2502,6 +2814,17 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, "arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", @@ -2576,6 +2899,12 @@ "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", "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": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -3169,6 +3498,16 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -3450,6 +3789,12 @@ } } }, + "coffeescript": { + "version": "1.12.7", + "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.12.7.tgz", + "integrity": "sha512-pLXHFxQMPklVoEekowk8b3erNynC+DVJzChxS/LCBBgR6/8AJkHivkm//zbowcfc7BTCAjryuhx6gPqPRfsFoA==", + "dev": true + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -3516,6 +3861,12 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "comment-parser": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.6.tgz", + "integrity": "sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg==", + "dev": true + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -3661,6 +4012,12 @@ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -3831,6 +4188,12 @@ } } }, + "core-js-pure": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.1.tgz", + "integrity": "sha512-Se+LaxqXlVXGvmexKGPvnUIYC1jwXu1H6Pkyb3uBM5d8/NELMYCHs/4/roD7721NxrTLyv7e5nXd5/QLBO+10g==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -3986,6 +4349,15 @@ "randomfill": "^1.0.3" } }, + "cson-parser": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/cson-parser/-/cson-parser-4.0.7.tgz", + "integrity": "sha512-BSnAl0gllETWjU9/lb8MmeqhsGaRINPwhoPiBjI/TJBRvKf/24I9EVqnwvmk6R3Gt66cMRSGVktl6QicxIb72g==", + "dev": true, + "requires": { + "coffeescript": "1.12.7" + } + }, "css": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", @@ -4352,6 +4724,12 @@ "regexp.prototype.flags": "^1.2.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 + }, "default-gateway": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", @@ -4621,6 +4999,15 @@ "buffer-indexof": "^1.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-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -4921,6 +5308,23 @@ } } }, + "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" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "ent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", @@ -5053,49 +5457,497 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "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 - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "eslint": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.16.0.tgz", + "integrity": "sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw==", "dev": true, "requires": { - "estraverse": "^5.2.0" + "@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": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "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 - } - } - }, - "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==", + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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 + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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" + } + } + } + }, + "eslint-config-prettier": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-jsdoc": { + "version": "30.7.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.6.tgz", + "integrity": "sha512-w18IOiS/9ahKgRfQOuHbce+EQYx3fwIkZhUZDEK+augNlhJkzgTSZkrBkzaflSbFNZ9/Tk4xzUABEaTbsBSzew==", + "dev": true, + "requires": { + "comment-parser": "^0.7.6", + "debug": "^4.2.0", + "jsdoctypeparser": "^9.0.0", + "lodash": "^4.17.20", + "regextras": "^0.7.1", + "semver": "^7.3.2", + "spdx-expression-parse": "^3.0.1" + } + }, + "eslint-plugin-prefer-arrow": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.2.tgz", + "integrity": "sha512-C8YMhL+r8RMeMdYAw/rQtE6xNdMulj+zGWud/qIGnlmomiPRaLDGLMeskZ3alN6uMBojmooRimtdrXebLN4svQ==", + "dev": true + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.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": { + "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", + "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": { @@ -5438,6 +6290,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 + }, "fastparse": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", @@ -5477,6 +6335,15 @@ "escape-string-regexp": "^1.0.5" } }, + "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" + } + }, "file-loader": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz", @@ -5735,6 +6602,24 @@ } } }, + "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": { + "flatted": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz", + "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", + "dev": true + } + } + }, "flatted": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", @@ -5862,6 +6747,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 + }, "genfun": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", @@ -5880,6 +6771,23 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -7037,6 +7945,12 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-svg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", @@ -7368,6 +8282,12 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsdoctypeparser": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", + "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "dev": true + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -7398,6 +8318,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", @@ -7841,6 +8767,16 @@ "leven": "^3.1.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" + } + }, "license-webpack-plugin": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-2.2.0.tgz", @@ -8526,6 +9462,12 @@ "dev": true, "optional": 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 + }, "nconf": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.10.0.tgz", @@ -9161,6 +10103,20 @@ "@wry/context": "^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" + } + }, "ora": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.4.tgz", @@ -9525,6 +10481,23 @@ "readable-stream": "^2.1.5" } }, + "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" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, "parse-asn1": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", @@ -10395,6 +11368,12 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "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 + }, "prepend-http": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", @@ -10413,6 +11392,12 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "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-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -11057,6 +12042,108 @@ } } }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + } + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -11176,6 +12263,12 @@ } } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "regexpu-core": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", @@ -11190,6 +12283,12 @@ "unicode-match-property-value-ecmascript": "^1.2.0" } }, + "regextras": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", + "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", + "dev": true + }, "regjsgen": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", @@ -11986,6 +13085,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 + } + } + }, "smart-buffer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", @@ -12801,6 +13943,12 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "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 + }, "style-loader": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.2.1.tgz", @@ -12942,6 +14090,70 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, + "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": { + "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-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", @@ -13023,6 +14235,12 @@ } } }, + "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 + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -13234,6 +14452,29 @@ "integrity": "sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==", "dev": true }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, "tslib": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", @@ -13274,6 +14515,87 @@ } } }, + "tslint-to-eslint-config": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/tslint-to-eslint-config/-/tslint-to-eslint-config-2.0.1.tgz", + "integrity": "sha512-RURU/zcBQpW9jKS7H2J6of4+64npTb0nrH7ND8tNhagMwryVjVnUDcucsl8DQuD7tO9RgjFO9bmJfDhyP0yV1w==", + "dev": true, + "requires": { + "chalk": "4.1.0", + "commander": "6.2.0", + "cson-parser": "4.0.7", + "eslint-config-prettier": "6.15.0", + "glob": "7.1.6", + "json5": "2.1.3", + "lodash": "4.17.20", + "minimatch": "3.0.4", + "tslint": "6.1.3", + "typescript": "4.1.2" + }, + "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" + } + }, + "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 + }, + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "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 + }, + "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" + } + }, + "typescript": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz", + "integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==", + "dev": true + } + } + }, "tsutils": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", @@ -13318,6 +14640,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-fest": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", @@ -14706,6 +16037,12 @@ "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", "dev": true }, + "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/samples/react-native/package-lock.json b/samples/react-native/package-lock.json index 6e1505df72..14e86c9649 100644 --- a/samples/react-native/package-lock.json +++ b/samples/react-native/package-lock.json @@ -850,6 +850,84 @@ "@types/hammerjs": "^2.0.36" } }, + "@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": { + "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" + } + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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 + }, + "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/address": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz", @@ -1492,15 +1570,15 @@ } }, "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "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.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "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": { @@ -3784,6 +3862,23 @@ "once": "^1.4.0" } }, + "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" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "entities": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", @@ -3852,131 +3947,175 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "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", - "ajv": "^6.9.1", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "@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", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", - "esquery": "^1.0.1", + "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": "^5.0.1", + "file-entry-cache": "^6.0.0", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.11", + "levn": "^0.4.1", + "lodash": "^4.17.19", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.2.3", - "text-table": "^0.2.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": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "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.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "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.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "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 + }, + "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": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" + "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 + } + } + }, + "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 + }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "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" } }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "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": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "dependencies": { - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } + "yallist": "^4.0.0" } }, "ms": { @@ -3985,43 +4124,80 @@ "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 + }, "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 }, - "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, "requires": { - "tslib": "^1.9.0" + "lru-cache": "^6.0.0" } }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "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": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "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": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - } + "ansi-regex": "^5.0.0" + } + }, + "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" + } + }, + "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 + }, + "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 } } }, @@ -4261,9 +4437,9 @@ } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "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" @@ -4276,14 +4452,22 @@ "dev": true }, "espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "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": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "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": { @@ -4292,12 +4476,20 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "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": "^4.0.0" + "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": { @@ -4610,12 +4802,12 @@ } }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "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": "^2.0.1" + "flat-cache": "^3.0.4" } }, "file-uri-to-path": { @@ -4713,20 +4905,19 @@ } }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "dependencies": { "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "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" @@ -4735,9 +4926,9 @@ } }, "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "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": { @@ -4870,6 +5061,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": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", @@ -5245,6 +5445,12 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, + "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", @@ -5256,6 +5462,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-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -5746,13 +5961,13 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==" }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "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.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "load-json-file": { @@ -6941,17 +7156,17 @@ } }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "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.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "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" } }, "options": { @@ -7060,12 +7275,6 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -7284,9 +7493,9 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prettier": { @@ -7846,9 +8055,9 @@ } }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "regexpu-core": { @@ -8641,9 +8850,9 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "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 }, "sudo-prompt": { @@ -8665,26 +8874,106 @@ "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "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.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^6.12.4", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" }, "dependencies": { + "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-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" + } + }, + "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 + }, + "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 + }, + "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 + }, + "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" + } + }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "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": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "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" } } } @@ -8851,12 +9140,6 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, - "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", - "dev": true - }, "ttab": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/ttab/-/ttab-0.6.1.tgz", @@ -8879,12 +9162,12 @@ "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "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.1.2" + "prelude-ls": "^1.2.1" } }, "type-fest": { @@ -9051,6 +9334,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", @@ -9198,15 +9487,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, "write-file-atomic": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", diff --git a/samples/vue/package-lock.json b/samples/vue/package-lock.json index f4b8b72b96..7d50f3bfdf 100644 --- a/samples/vue/package-lock.json +++ b/samples/vue/package-lock.json @@ -2103,17 +2103,6 @@ "unique-filename": "^1.1.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, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2270,13 +2259,6 @@ "slash": "^2.0.0" } }, - "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, - "optional": true - }, "hash-sum": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", @@ -2315,18 +2297,6 @@ } } }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -2479,16 +2449,6 @@ "ansi-regex": "^5.0.0" } }, - "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, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - }, "terser-webpack-plugin": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz", @@ -2516,18 +2476,6 @@ "repeat-string": "^1.6.1" } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.0.0-rc.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.2.tgz", - "integrity": "sha512-cz8GK4dgIf1UTC+do80pGvh8BHcCRHLIQVHV9ONVQ8wtoqS9t/+H02rKcQP+TVNg7khgLyQV2+8eHUq7/AFq3g==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - } - }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -12571,6 +12519,94 @@ "vue-style-loader": "^4.1.0" } }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.1.2", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz", + "integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.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, + "optional": 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, + "optional": 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, + "optional": 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, + "optional": 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, + "optional": true + }, + "hash-sum": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", + "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", + "dev": true, + "optional": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "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, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "vue-meta": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.2.2.tgz", From 320f0875837c8ced04cfeb02a587970090080fbd Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 10:18:14 +0200 Subject: [PATCH 27/37] push rule --- samples/react/.eslintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/react/.eslintrc b/samples/react/.eslintrc index b8f3d40709..43eeb6a03b 100644 --- a/samples/react/.eslintrc +++ b/samples/react/.eslintrc @@ -34,6 +34,7 @@ "document": true }, "rules": { + "import/no-unresolved": "off", "import/no-duplicates": "off", "import/no-named-as-default": "off", "max-len": "off", From 5d19d0cd710bc09bffa7ad38e2de0b0e1c5e8879 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 11:05:43 +0200 Subject: [PATCH 28/37] push with prettier --- .eslintrc | 8 +- package.json | 7 +- .../src/components/date.directive.spec.ts | 6 +- .../src/components/date.directive.ts | 12 +- .../src/components/file.directive.ts | 15 +- .../components/generic-link.directive.spec.ts | 8 +- .../src/components/generic-link.directive.ts | 10 +- .../src/components/image.directive.spec.ts | 21 +- .../src/components/image.directive.ts | 21 +- .../src/components/link.directive.spec.ts | 4 +- .../src/components/link.directive.ts | 17 +- .../components/missing-component.component.ts | 11 +- .../components/placeholder.component.spec.ts | 244 +++++++++--------- .../src/components/placeholder.component.ts | 112 +++++--- .../src/components/placeholder.token.ts | 16 +- .../src/components/raw.component.ts | 5 +- .../components/render-component.component.ts | 41 ++- .../src/components/rendering.ts | 9 +- .../src/components/rich-text.directive.ts | 17 +- .../components/router-link.directive.spec.ts | 4 +- .../src/components/router-link.directive.ts | 10 +- .../src/components/text.directive.ts | 17 +- .../src/jss-component-factory.service.ts | 63 ++--- .../src/layout.service.ts | 22 +- .../sitecore-jss-angular/src/lib.module.ts | 37 +-- .../sitecore-jss-angular/src/public_api.ts | 9 +- packages/sitecore-jss-angular/src/test.ts | 5 +- .../src/testData/ee-data.ts | 54 ++-- .../src/testData/non-ee-data.ts | 21 +- packages/sitecore-jss-cli/src/cli-shared.ts | 4 +- .../src/create/create.source.github.ts | 119 +++++---- .../sitecore-jss-cli/src/micro-manifest.ts | 17 +- .../src/run-package-script.ts | 10 +- .../sitecore-jss-cli/src/scripts/clean.ts | 1 + .../sitecore-jss-cli/src/scripts/create.ts | 8 +- .../src/scripts/deploy.component.ts | 10 +- .../src/scripts/deploy.config.ts | 1 + .../src/scripts/deploy.files.ts | 1 + .../src/scripts/deploy.items.ts | 14 +- .../src/scripts/deploy.template.ts | 3 +- .../src/scripts/easter-egg.ts | 1 + .../src/scripts/index.global.ts | 6 +- .../sitecore-jss-cli/src/scripts/index.ts | 10 +- .../sitecore-jss-cli/src/scripts/setup.ts | 1 + packages/sitecore-jss-cli/src/spawn.ts | 6 +- packages/sitecore-jss-dev-tools/src/deploy.ts | 4 +- .../sitecore-jss-dev-tools/src/digest.test.ts | 10 +- packages/sitecore-jss-dev-tools/src/digest.ts | 1 - .../create-default-disconnected-server.ts | 16 +- .../disconnected-server/default-document.ts | 4 +- .../src/disconnected-server/media-service.ts | 5 +- packages/sitecore-jss-dev-tools/src/index.ts | 15 +- .../src/manifest-manager.ts | 2 +- .../sitecore-jss-dev-tools/src/mergeFs.ts | 10 +- .../src/package-deploy.ts | 223 +++++++++------- .../src/package-generate.ts | 5 +- .../sitecore-jss-dev-tools/src/setup/setup.ts | 124 ++++++--- .../src/setup/verify-setup.ts | 18 +- packages/sitecore-jss-forms/src/FormField.ts | 3 +- .../sitecore-jss-forms/src/FormTracker.ts | 33 ++- .../src/JssFormData.test.ts | 14 +- .../sitecore-jss-forms/src/JssFormData.ts | 41 +-- .../src/getFieldValueFromModel.ts | 2 +- packages/sitecore-jss-forms/src/index.ts | 7 +- .../sitecore-jss-forms/src/serializeForm.ts | 8 +- packages/sitecore-jss-forms/src/submitForm.ts | 27 +- .../src/generator/createIdMapping.ts | 4 +- .../src/generator/dynamicPlaceholders.ts | 2 +- .../src/generator/generate.ts | 8 +- .../src/generator/manifest.babel-shim.ts | 20 +- .../src/generator/manifest.types.ts | 32 ++- .../generateContentItem/generateItem.ts | 20 +- .../processNestedContent.ts | 2 +- .../generateManifest/generateContentItems.ts | 2 +- .../generateManifest/generatePlaceholders.ts | 11 +- .../generateManifest/generateRenderings.ts | 16 +- .../generateManifest/generateTemplates.ts | 8 +- .../pipelines/generateMedia/utils.ts | 6 +- .../checkBlacklistedKeys.ts | 12 +- .../extractPlaceholdersFromItems.test.ts | 2 +- .../extractPlaceholdersFromRenderings.test.ts | 2 +- .../mergePlaceholders.test.ts | 12 +- .../removeDuplicates.test.ts | 2 +- .../generateRouteItem/pipeline.config.ts | 19 +- .../processRenderings.test.ts | 8 +- .../generateRouteItem/processRenderings.ts | 100 +++++-- .../src/generator/traversal.ts | 5 +- .../src/generator/utils.ts | 62 +++-- .../src/generator/validators.ts | 9 +- .../testData/components/Welcome.sitecore.ts | 2 +- .../src/testData/components/async.sitecore.ts | 4 +- .../components/component0.sitecore.ts | 12 +- .../components/component1.sitecore.ts | 5 +- .../folder0/component0-0.sitecore.ts | 12 +- .../src/testData/content/content.sitecore.ts | 2 +- .../src/testData/content/contentData.ts | 5 +- .../src/testData/routes/route.ts | 5 +- .../src/testData/routes/routes.sitecore.ts | 4 +- packages/sitecore-jss-manifest/src/utils.ts | 19 +- .../src/absolutify.ts | 2 +- .../src/config.test.ts | 65 +++-- .../src/config.ts | 10 +- .../src/editing-middleware.test.ts | 24 +- .../src/editing-middleware.ts | 26 +- .../src/editing-server.ts | 12 +- .../src/html-processors.test.ts | 5 +- .../src/html-processors.ts | 12 +- .../src/index.ts | 19 +- .../src/testData/ee-data.ts | 11 +- .../src/util.ts | 10 +- .../components/ComponentPropsContext.test.tsx | 22 +- .../src/components/Link.test.tsx | 6 +- .../src/components/Link.tsx | 7 +- .../src/components/RichText.test.tsx | 3 +- .../src/components/RichText.tsx | 2 +- packages/sitecore-jss-nextjs/src/index.ts | 5 +- .../services/component-props-service.test.ts | 18 +- .../src/services/component-props-service.ts | 2 +- .../src/sharedTypes/component-module.ts | 6 +- .../src/testData/ee-data.ts | 9 +- .../src/testData/non-ee-data.ts | 12 +- .../src/tests/jsdom-setup.ts | 13 +- .../sitecore-jss-proxy/src/ProxyConfig.ts | 4 +- .../sitecore-jss-proxy/src/RouteUrlParser.ts | 4 +- packages/sitecore-jss-proxy/src/index.test.ts | 5 +- packages/sitecore-jss-proxy/src/index.ts | 16 +- .../src/FieldProps.ts | 36 ++- .../src/components/default-error.tsx | 4 +- .../src/components/field-templates/button.tsx | 5 +- .../field-templates/file-upload.test.tsx | 2 +- .../field-templates/file-upload.tsx | 42 +-- .../components/field-templates/section.tsx | 6 +- .../src/components/field-templates/text.tsx | 4 +- .../src/components/form.tsx | 29 ++- .../src/field-factory.tsx | 4 +- .../sitecore-jss-react-forms/src/index.ts | 11 +- .../src/tests/jsdom-setup.ts | 13 +- .../src/components/Date.tsx | 4 +- .../src/components/Image.tsx | 12 +- .../src/components/Link.tsx | 15 +- .../src/components/PlaceholderCommon.tsx | 13 +- .../src/dataConversion.ts | 53 ++-- .../src/components/Date.tsx | 16 +- .../src/components/File.tsx | 8 +- .../src/components/Image.test.tsx | 4 +- .../src/components/Image.tsx | 39 ++- .../src/components/Link.tsx | 28 +- .../src/components/Placeholder.test.tsx | 20 +- .../src/components/Placeholder.tsx | 21 +- .../src/components/PlaceholderCommon.tsx | 121 +++++---- .../src/components/RichText.tsx | 30 ++- .../src/components/SitecoreContext.test.tsx | 8 +- .../src/components/SitecoreContext.tsx | 8 +- .../src/components/Text.tsx | 10 +- .../src/enhancers/withComponentFactory.tsx | 6 +- .../enhancers/withExperienceEditorChromes.tsx | 7 +- .../src/enhancers/withPlaceholder.tsx | 39 ++- .../enhancers/withSitecoreContext.test.tsx | 9 +- .../src/enhancers/withSitecoreContext.tsx | 18 +- packages/sitecore-jss-react/src/index.ts | 6 +- .../src/testData/ee-data.ts | 9 +- .../src/testData/non-ee-data.ts | 12 +- .../src/tests/jsdom-setup.ts | 13 +- packages/sitecore-jss-react/src/utils.ts | 5 +- .../src/defaultAppInvocationInfoResolver.ts | 4 +- .../src/devServer.ts | 11 +- .../src/renderingHostServer.ts | 8 +- .../sitecore-jss-rendering-host/src/tunnel.ts | 14 +- .../src/trackingApi.test.ts | 53 ++-- .../sitecore-jss-tracking/src/trackingApi.ts | 20 +- .../sitecore-jss-update-package/src/index.ts | 4 +- .../src/components/Image.test.ts | 20 +- .../sitecore-jss-vue/src/components/Image.ts | 6 +- .../sitecore-jss-vue/src/components/Link.ts | 6 +- .../src/components/MissingComponent.ts | 2 +- .../src/components/Placeholder.test.ts | 18 +- .../src/components/Placeholder.ts | 14 +- .../src/components/PlaceholderCommon.ts | 8 +- .../src/components/SitecoreContext.ts | 10 +- .../src/enhancers/providePlaceholders.ts | 16 +- .../src/test/data/LS-data-EE-off.ts | 6 +- .../src/test/data/LS-data-EE-on.ts | 6 +- .../src/test/data/dev-data.ts | 10 +- .../sitecore-jss/src/data-fetcher.test.ts | 2 +- packages/sitecore-jss/src/data-fetcher.ts | 6 +- packages/sitecore-jss/src/dataApi.test.ts | 101 ++++---- packages/sitecore-jss/src/dataApi.ts | 15 +- packages/sitecore-jss/src/dataModels.ts | 17 +- .../sitecore-jss/src/httpClientInterface.ts | 7 +- packages/sitecore-jss/src/index.ts | 9 +- .../sitecore-jss/src/layout-service.test.ts | 85 +++--- packages/sitecore-jss/src/layout-service.ts | 13 +- packages/sitecore-jss/src/layoutDataUtils.ts | 19 +- packages/sitecore-jss/src/mediaApi.test.ts | 43 +-- packages/sitecore-jss/src/mediaApi.ts | 4 +- .../src/configLoader.test.ts | 4 +- .../sitecore-pipelines/src/configLoader.ts | 14 +- .../sitecore-pipelines/src/pipeline.test.ts | 4 +- packages/sitecore-pipelines/src/pipeline.ts | 12 +- .../sitecore-pipelines/src/pipelineFactory.ts | 19 +- .../src/pipelinesRegistry.ts | 10 +- packages/sitecore-pipelines/src/utils.ts | 16 +- tslint.json | 80 ------ 203 files changed, 2189 insertions(+), 1591 deletions(-) delete mode 100644 tslint.json diff --git a/.eslintrc b/.eslintrc index 850b6a6c12..e4093077ed 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,8 @@ "root": true, "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "prettier" ], "parser": "@typescript-eslint/parser", "parserOptions": { @@ -12,14 +13,14 @@ "ecmaVersion": 2020, "sourceType": "module" }, - "plugins": ["@typescript-eslint"], + "plugins": ["@typescript-eslint", "prettier"], "env": { "browser": true, "node": true, "es6": true }, "rules": { - "@typescript-eslint/indent": ["error", 2], + "prettier/prettier": "error", "@typescript-eslint/naming-convention": [ "error", { @@ -65,7 +66,6 @@ "quotes": ["error", "single"], "radix": "error", "default-case": "error", - "comma-dangle": ["error", { "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline" }], "eqeqeq": "error" } } diff --git a/package.json b/package.json index 47c8e3d738..7dda99e4d3 100644 --- a/package.json +++ b/package.json @@ -25,16 +25,13 @@ "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.10.0", "@typescript-eslint/parser": "^4.10.0", - "babel-eslint": "10.1.0", "eslint": "^6.6.0", - "eslint-config-airbnb-base": "^13.1.0", - "eslint-config-prettier": "^6.2.0", - "eslint-plugin-prettier": "^3.1.0", + "eslint-config-prettier": "^6.15.0", + "eslint-plugin-prettier": "^3.3.0", "lerna": "^3.4.0", "metro": "^0.60.0", "nyc": "^14.1.1", "prettier": "^1.14.3", - "tslint": "^5.11.0", "typescript": "^3.9.6" } } diff --git a/packages/sitecore-jss-angular/src/components/date.directive.spec.ts b/packages/sitecore-jss-angular/src/components/date.directive.spec.ts index e74d690951..84dadce095 100644 --- a/packages/sitecore-jss-angular/src/components/date.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/date.directive.spec.ts @@ -15,7 +15,9 @@ const defaultFormattedDate = formatDate(testIsoDateValue, testFormat, testLocale @Component({ selector: 'test-date', template: ` - <span *scDate="field; editable: editable; format: format; locale: locale; timezone: timezone;"></span> + <span + *scDate="field; editable: editable; format: format; locale: locale; timezone: timezone" + ></span> `, }) class TestComponent { @@ -34,7 +36,7 @@ describe('<span *scDate />', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [DateDirective, TestComponent], - providers: [ DatePipe ], + providers: [DatePipe], }); fixture = TestBed.createComponent(TestComponent); diff --git a/packages/sitecore-jss-angular/src/components/date.directive.ts b/packages/sitecore-jss-angular/src/components/date.directive.ts index e4bcc9fb3a..3950691777 100644 --- a/packages/sitecore-jss-angular/src/components/date.directive.ts +++ b/packages/sitecore-jss-angular/src/components/date.directive.ts @@ -1,5 +1,13 @@ import { DatePipe } from '@angular/common'; -import { Directive, EmbeddedViewRef, Input, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + EmbeddedViewRef, + Input, + OnChanges, + SimpleChanges, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { TextField } from './rendering-field'; @Directive({ @@ -27,7 +35,7 @@ export class DateDirective implements OnChanges { private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>, private datePipe: DatePipe - ) { } + ) {} ngOnChanges(changes: SimpleChanges) { if (changes.field || changes.format) { diff --git a/packages/sitecore-jss-angular/src/components/file.directive.ts b/packages/sitecore-jss-angular/src/components/file.directive.ts index 93e7f9db67..8a72cc1a69 100644 --- a/packages/sitecore-jss-angular/src/components/file.directive.ts +++ b/packages/sitecore-jss-angular/src/components/file.directive.ts @@ -1,4 +1,12 @@ -import { Directive, EmbeddedViewRef, Input, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + EmbeddedViewRef, + Input, + OnChanges, + SimpleChanges, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { FileField } from './rendering-field'; /** @@ -11,10 +19,7 @@ export class FileDirective implements OnChanges { // tslint:disable-next-line:no-input-rename @Input('scFile') field: FileField; - constructor( - private viewContainer: ViewContainerRef, - private templateRef: TemplateRef<any> - ) { } + constructor(private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>) {} ngOnChanges(changes: SimpleChanges): void { if (changes.field) { diff --git a/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts index 963a24b137..17304e1e64 100644 --- a/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts @@ -171,7 +171,9 @@ describe('<a *scGenericLink />', () => { @Component({ selector: 'test-router-link-children', template: ` - <a *scGenericLink="field; editable: editable; attrs: attrs; extras: extras" id="my-link"><span *ngIf="true">hello world</span></a> + <a *scGenericLink="field; editable: editable; attrs: attrs; extras: extras" id="my-link" + ><span *ngIf="true">hello world</span></a + > `, }) class TestWithChildrenComponent { @@ -189,7 +191,7 @@ describe('<a *scGenericLink>children</a>', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [GenericLinkDirective, TestWithChildrenComponent], - imports: [ RouterTestingModule ], + imports: [RouterTestingModule], }); fixture = TestBed.createComponent(TestWithChildrenComponent); @@ -232,7 +234,7 @@ describe('<a *scGenericLink></a>', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [GenericLinkDirective, TestComponent], - imports: [ RouterTestingModule.withRoutes([{ path: 'lorem', component: TestComponent }])], + imports: [RouterTestingModule.withRoutes([{ path: 'lorem', component: TestComponent }])], }); router = TestBed.get(Router); diff --git a/packages/sitecore-jss-angular/src/components/generic-link.directive.ts b/packages/sitecore-jss-angular/src/components/generic-link.directive.ts index 71d620f9ff..5d718253d7 100644 --- a/packages/sitecore-jss-angular/src/components/generic-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/generic-link.directive.ts @@ -1,11 +1,17 @@ -import { Directive, ElementRef, Input, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + ElementRef, + Input, + Renderer2, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { Router, NavigationExtras } from '@angular/router'; import { LinkDirective } from './link.directive'; import { LinkField } from './rendering-field'; @Directive({ selector: '[scGenericLink]' }) export class GenericLinkDirective extends LinkDirective { - // tslint:disable-next-line:no-input-rename @Input('scGenericLinkEditable') editable = true; diff --git a/packages/sitecore-jss-angular/src/components/image.directive.spec.ts b/packages/sitecore-jss-angular/src/components/image.directive.spec.ts index 4bc643801a..cf842f1e8b 100644 --- a/packages/sitecore-jss-angular/src/components/image.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/image.directive.spec.ts @@ -21,14 +21,24 @@ class TestComponent { @Component({ selector: 'test-image2', template: ` - <img height="1" width="1" *scImage="field; editable: editable; urlParams: params; attrs: imageAttrs; mediaUrlPrefix: mediaUrlPrefix" /> + <img + height="1" + width="1" + *scImage=" + field; + editable: editable; + urlParams: params; + attrs: imageAttrs; + mediaUrlPrefix: mediaUrlPrefix + " + /> `, }) class AnotherTestComponent { @Input() field: any; @Input() editable = true; @Input() params: any = {}; - @Input() imageAttrs: any = { }; + @Input() imageAttrs: any = {}; @Input() mediaUrlPrefix?: RegExp; } @@ -80,7 +90,6 @@ describe('<img *scImage />', () => { }); describe('with "value" property value', () => { - it('should render <img /> component with "value" properties', () => { const media = { value: { @@ -112,7 +121,6 @@ describe('<img *scImage />', () => { }); describe('with "editable" property value', () => { - it('should render wrapper containing experience editor value', () => { const media = { editable: eeImageData, @@ -274,7 +282,9 @@ describe('<img *scImage />', () => { const img = de.nativeElement.getElementsByTagName('img')[0]; const url = img.getAttribute('srcset'); - expect(url).toBe(`${expectedPrefix}assets/img/test0.png?h=100&w=150&mw=100 150w, ${expectedPrefix}assets/img/test0.png?h=100&w=150&mw=300 150w`); + expect(url).toBe( + `${expectedPrefix}assets/img/test0.png?h=100&w=150&mw=100 150w, ${expectedPrefix}assets/img/test0.png?h=100&w=150&mw=300 150w` + ); }; comp2.imageAttrs = { @@ -318,7 +328,6 @@ describe('<img *scImage />', () => { }); describe('with "editable" property value but editing disabled', () => { - it('should render <img /> component with "value" properties', () => { const media = { editable: eeImageData, diff --git a/packages/sitecore-jss-angular/src/components/image.directive.ts b/packages/sitecore-jss-angular/src/components/image.directive.ts index 24380d8086..a99e36e069 100644 --- a/packages/sitecore-jss-angular/src/components/image.directive.ts +++ b/packages/sitecore-jss-angular/src/components/image.directive.ts @@ -1,4 +1,13 @@ -import { Directive, ElementRef, Input, OnChanges, Renderer2, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + ElementRef, + Input, + OnChanges, + Renderer2, + SimpleChanges, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { mediaApi } from '@sitecore-jss/sitecore-jss'; import { ImageField } from './rendering-field'; @@ -33,7 +42,7 @@ export class ImageDirective implements OnChanges { private templateRef: TemplateRef<any>, private renderer: Renderer2, private elementRef: ElementRef - ) { } + ) {} ngOnChanges(changes: SimpleChanges) { if (changes.field || changes.editable || changes.urlParams || changes.attrs) { @@ -117,17 +126,19 @@ export class ImageDirective implements OnChanges { private renderTemplate(imageProps: any) { const viewRef = this.viewContainer.createEmbeddedView(this.templateRef); viewRef.rootNodes.forEach((node) => { - Object.entries(imageProps).forEach(([key, imgPropVal]: [string, any]) => this.renderer.setAttribute(node, key, imgPropVal)); + Object.entries(imageProps).forEach(([key, imgPropVal]: [string, any]) => + this.renderer.setAttribute(node, key, imgPropVal) + ); }); } - private getElementAttrs(): { [key: string]: any; } { + private getElementAttrs(): { [key: string]: any } { const view = this.templateRef.createEmbeddedView(null); const element: Element = view.rootNodes[0]; if (!element) { return {}; } - const attrs: { [key: string]: any; } = {}; + const attrs: { [key: string]: any } = {}; for (let i = 0; i < element.attributes.length; i++) { const attr = element.attributes.item(i); if (attr) { diff --git a/packages/sitecore-jss-angular/src/components/link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/link.directive.spec.ts index 8c3202d5f5..936d10804d 100644 --- a/packages/sitecore-jss-angular/src/components/link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/link.directive.spec.ts @@ -223,7 +223,9 @@ describe('<a *scLink />', () => { @Component({ selector: 'test-link-children', template: ` - <a *scLink="field; editable: editable; attrs: attrs" id="my-link"><span *ngIf="true">hello world</span></a> + <a *scLink="field; editable: editable; attrs: attrs" id="my-link" + ><span *ngIf="true">hello world</span></a + > `, }) class TestWithChildrenComponent { diff --git a/packages/sitecore-jss-angular/src/components/link.directive.ts b/packages/sitecore-jss-angular/src/components/link.directive.ts index 7bed3beeab..8094b0e9be 100644 --- a/packages/sitecore-jss-angular/src/components/link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/link.directive.ts @@ -1,4 +1,13 @@ -import { Directive, ElementRef, Input, OnChanges, Renderer2, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + ElementRef, + Input, + OnChanges, + Renderer2, + SimpleChanges, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { LinkField } from './rendering-field'; @Directive({ selector: '[scLink]' }) @@ -19,7 +28,7 @@ export class LinkDirective implements OnChanges { protected templateRef: TemplateRef<any>, protected renderer: Renderer2, private elementRef: ElementRef - ) { } + ) {} ngOnChanges(changes: SimpleChanges) { if (changes.field || changes.editable || changes.attrs) { @@ -97,13 +106,13 @@ export class LinkDirective implements OnChanges { this.inlineRef = span; } - private getElementAttrs(): { [key: string]: any; } { + private getElementAttrs(): { [key: string]: any } { const view = this.templateRef.createEmbeddedView(null); const element: Element = view.rootNodes[0]; if (!element) { return {}; } - const attrs: { [key: string]: any; } = {}; + const attrs: { [key: string]: any } = {}; for (let i = 0; i < element.attributes.length; i++) { const attr = element.attributes.item(i); if (attr) { diff --git a/packages/sitecore-jss-angular/src/components/missing-component.component.ts b/packages/sitecore-jss-angular/src/components/missing-component.component.ts index 859520bf3f..fb62ddef84 100644 --- a/packages/sitecore-jss-angular/src/components/missing-component.component.ts +++ b/packages/sitecore-jss-angular/src/components/missing-component.component.ts @@ -3,10 +3,13 @@ import { Component, Input } from '@angular/core'; @Component({ selector: 'sc-missing-component', template: ` -<div style="background: darkorange; outline: 5px solid orange; padding: 10px; color: white; max-width: 500px;"> - <h2>{{ rendering.componentName }}</h2> - <p>JSS component is missing Angular component implementation.</p> -</div>`, + <div + style="background: darkorange; outline: 5px solid orange; padding: 10px; color: white; max-width: 500px;" + > + <h2>{{ rendering.componentName }}</h2> + <p>JSS component is missing Angular component implementation.</p> + </div> + `, }) export class MissingComponentComponent { @Input() rendering: any; diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts index 7483aeab9f..cf45df1d38 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts @@ -1,5 +1,12 @@ // tslint:disable:max-classes-per-file -import { Component, DebugElement, EventEmitter, Input, NgModuleFactoryLoader, Output } from '@angular/core'; +import { + Component, + DebugElement, + EventEmitter, + Input, + NgModuleFactoryLoader, + Output, +} from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { SpyNgModuleFactoryLoader } from '@angular/router/testing'; @@ -7,13 +14,16 @@ import { SpyNgModuleFactoryLoader } from '@angular/router/testing'; import { JssModule } from '../lib.module'; import { convertedData as eeData } from '../testData/ee-data'; -import { convertedDevData as nonEeDevData, convertedLayoutServiceData as nonEeLsData } from '../testData/non-ee-data'; +import { + convertedDevData as nonEeDevData, + convertedLayoutServiceData as nonEeLsData, +} from '../testData/non-ee-data'; @Component({ selector: 'test-placeholder', template: ` <sc-placeholder [name]="name" [rendering]="rendering"> - <img *scPlaceholderLoading src="loading.gif"> + <img *scPlaceholderLoading src="loading.gif" /> </sc-placeholder> `, }) @@ -34,7 +44,7 @@ class TestDownloadCalloutComponent { @Component({ selector: 'test-home', - styles: [ 'sc-placeholder[name="page-content"] { background-color: red }' ], + styles: ['sc-placeholder[name="page-content"] { background-color: red }'], template: ` <sc-placeholder name="page-header" [rendering]="rendering"></sc-placeholder> <sc-placeholder name="page-content" [rendering]="rendering"></sc-placeholder> @@ -48,7 +58,7 @@ class TestHomeComponent { selector: 'test-jumbotron', template: '', }) -class TestJumbotronComponent { } +class TestJumbotronComponent {} describe('<sc-placeholder />', () => { let fixture: ComponentFixture<TestPlaceholderComponent>; @@ -61,18 +71,16 @@ describe('<sc-placeholder />', () => { TestPlaceholderComponent, TestDownloadCalloutComponent, TestHomeComponent, - TestJumbotronComponent + TestJumbotronComponent, ], imports: [ JssModule.withComponents([ { name: 'DownloadCallout', type: TestDownloadCalloutComponent }, { name: 'Home', type: TestHomeComponent }, - { name: 'Jumbotron', type: TestJumbotronComponent } - ]) - ], - providers: [ - { provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader } + { name: 'Jumbotron', type: TestJumbotronComponent }, + ]), ], + providers: [{ provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader }], }).compileComponents(); })); @@ -97,29 +105,30 @@ describe('<sc-placeholder />', () => { const testData = [ { label: 'Dev data', data: nonEeDevData }, { label: 'LayoutService data - EE off', data: nonEeLsData }, - { label: 'LayoutService data - EE on', data: eeData } + { label: 'LayoutService data - EE on', data: eeData }, ]; testData.forEach((dataSet: any) => { describe(`with ${dataSet.label}`, () => { it('should render a placeholder with given key', async(() => { - const component = dataSet.data.sitecore.route.placeholders.main.find((c: any) => c.componentName); + const component = dataSet.data.sitecore.route.placeholders.main.find( + (c: any) => c.componentName + ); const phKey = 'page-content'; comp.name = phKey; comp.rendering = component; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); - const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); - expect(downloadCallout).not.toBeNull(); - expect(downloadCallout.nativeElement.innerHTML).toContain('Download'); + const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); + expect(downloadCallout).not.toBeNull(); + expect(downloadCallout.nativeElement.innerHTML).toContain('Download'); - const img = de.nativeElement.getElementsByTagName('img')[0]; - expect(img).not.toBeDefined(); - }); + const img = de.nativeElement.getElementsByTagName('img')[0]; + expect(img).not.toBeDefined(); + }); })); it('should render nested placeholders', async(() => { @@ -131,18 +140,16 @@ describe('<sc-placeholder />', () => { // because nested placeholders result in additional async loading _after_ whenStable, // we have to check for stability AGAIN internally - fixture.whenStable() - .then(() => { - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); - const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); - expect(downloadCallout).not.toBeNull(); - expect(downloadCallout.nativeElement.innerHTML).toContain('Download'); - }); + fixture.whenStable().then(() => { + fixture.detectChanges(); + const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); + expect(downloadCallout).not.toBeNull(); + expect(downloadCallout.nativeElement.innerHTML).toContain('Download'); }); + }); })); }); }); @@ -155,17 +162,16 @@ describe('<sc-placeholder />', () => { comp.rendering = component; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); - const eeChrome = de.query(By.css(`[chrometype="placeholder"][kind="open"][id="${phKey}"]`)); - expect(eeChrome).not.toBeNull(); + const eeChrome = de.query(By.css(`[chrometype="placeholder"][kind="open"][id="${phKey}"]`)); + expect(eeChrome).not.toBeNull(); - const keyAttribute = eeChrome.nativeElement.getAttribute('key'); - expect(keyAttribute).toBeDefined(); - expect(keyAttribute).toBe(phKey); - }); + const keyAttribute = eeChrome.nativeElement.getAttribute('key'); + expect(keyAttribute).toBeDefined(); + expect(keyAttribute).toBe(phKey); + }); })); it('should copy parent style attribute', async(() => { @@ -175,37 +181,40 @@ describe('<sc-placeholder />', () => { comp.rendering = component; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); - // let's grab the style name from the parent - let parentKey = ''; - const homeComp = de.query(By.directive(TestHomeComponent)); - const homeAttributes = homeComp.nativeElement.attributes; - if (homeAttributes.length) { - const parentAttribute = homeComp.nativeElement.attributes.item(0).name; - parentKey = parentAttribute.replace('_nghost-', ''); - } - - fixture.whenStable() - .then(() => { - fixture.detectChanges(); - const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); - expect(downloadCallout.nativeElement.attributes.item(0).name).toEqual(`_ngcontent-${parentKey}`); - }); + // let's grab the style name from the parent + let parentKey = ''; + const homeComp = de.query(By.directive(TestHomeComponent)); + const homeAttributes = homeComp.nativeElement.attributes; + if (homeAttributes.length) { + const parentAttribute = homeComp.nativeElement.attributes.item(0).name; + parentKey = parentAttribute.replace('_nghost-', ''); + } + + fixture.whenStable().then(() => { + fixture.detectChanges(); + const downloadCallout = de.query(By.directive(TestDownloadCalloutComponent)); + expect(downloadCallout.nativeElement.attributes.item(0).name).toEqual( + `_ngcontent-${parentKey}` + ); }); + }); })); it('should skip rendering unknown components', async(() => { const phKey = 'main'; const route = { placeholders: { - main: [{ - componentName: 'Home', - }, { - componentName: 'whatisthis', - }], + main: [ + { + componentName: 'Home', + }, + { + componentName: 'whatisthis', + }, + ], }, }; @@ -213,24 +222,25 @@ describe('<sc-placeholder />', () => { comp.rendering = route; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); - expect(de.children.length).toBe(1); + expect(de.children.length).toBe(1); - const homeDiv = de.query(By.directive(TestHomeComponent)); - expect(homeDiv).not.toBeNull(); - }); + const homeDiv = de.query(By.directive(TestHomeComponent)); + expect(homeDiv).not.toBeNull(); + }); })); it('should render null for unknown placeholder', async(() => { const phKey = 'unknown'; const route = { placeholders: { - main: [{ - componentName: 'Home', - }], + main: [ + { + componentName: 'Home', + }, + ], }, }; @@ -238,20 +248,24 @@ describe('<sc-placeholder />', () => { comp.rendering = route; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); - const element = de.query(By.css('sc-placeholder')).nativeElement; - expect(element.children.length).toBe(0); - }); + const element = de.query(By.css('sc-placeholder')).nativeElement; + expect(element.children.length).toBe(0); + }); })); }); @Component({ selector: 'test-parent', template: ` - <sc-placeholder [name]="name" [rendering]="rendering" [inputs]="inputs" [outputs]="outputs"></sc-placeholder> + <sc-placeholder + [name]="name" + [rendering]="rendering" + [inputs]="inputs" + [outputs]="outputs" + ></sc-placeholder> {{ clickMessage }} `, }) @@ -298,19 +312,14 @@ describe('<sc-placeholder /> with input/ouput binding', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ - TestParentComponent, - TestChildComponent - ], + declarations: [TestParentComponent, TestChildComponent], imports: [ JssModule.withComponents([ { name: 'Parent', type: TestParentComponent }, - { name: 'Child', type: TestChildComponent } - ]) - ], - providers: [ - { provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader } + { name: 'Child', type: TestChildComponent }, + ]), ], + providers: [{ provide: NgModuleFactoryLoader, value: SpyNgModuleFactoryLoader }], }); fixture = TestBed.createComponent(TestParentComponent); @@ -330,7 +339,7 @@ describe('<sc-placeholder /> with input/ouput binding', () => { children: [ { componentName: 'Child', - } + }, ], }, }; @@ -338,16 +347,15 @@ describe('<sc-placeholder /> with input/ouput binding', () => { comp.childMessage = expectedMessage; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); - const childComponent = de.query(By.directive(TestChildComponent)); - expect(childComponent.nativeElement.innerHTML).toContain(expectedMessage); - expect(childComponent.nativeElement.innerHTML).toContain(functionResult); - comp.childMessage = changedMessage; - fixture.detectChanges(); - expect(childComponent.nativeElement.innerHTML).toContain(changedMessage); - }); + fixture.whenStable().then(() => { + fixture.detectChanges(); + const childComponent = de.query(By.directive(TestChildComponent)); + expect(childComponent.nativeElement.innerHTML).toContain(expectedMessage); + expect(childComponent.nativeElement.innerHTML).toContain(functionResult); + comp.childMessage = changedMessage; + fixture.detectChanges(); + expect(childComponent.nativeElement.innerHTML).toContain(changedMessage); + }); })); it('should bind inputs to multiple', async(() => { @@ -364,7 +372,7 @@ describe('<sc-placeholder /> with input/ouput binding', () => { }, { componentName: 'Child', - } + }, ], }, }; @@ -372,15 +380,14 @@ describe('<sc-placeholder /> with input/ouput binding', () => { comp.childMessage = expectedMessage; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); - const childComponents = de.queryAll(By.directive(TestChildComponent)); - expect(childComponents.length).toBe(3); - childComponents.forEach((childComponent) => { - expect(childComponent.nativeElement.innerHTML).toContain(expectedMessage); - }); + fixture.whenStable().then(() => { + fixture.detectChanges(); + const childComponents = de.queryAll(By.directive(TestChildComponent)); + expect(childComponents.length).toBe(3); + childComponents.forEach((childComponent) => { + expect(childComponent.nativeElement.innerHTML).toContain(expectedMessage); }); + }); })); it('should bind outputs to children', async(() => { @@ -389,20 +396,19 @@ describe('<sc-placeholder /> with input/ouput binding', () => { children: [ { componentName: 'Child', - } + }, ], }, }; comp.name = 'children'; fixture.detectChanges(); - fixture.whenStable() - .then(() => { - fixture.detectChanges(); - const button = de.query(By.css('button')); - button.nativeElement.click(); - fixture.detectChanges(); + fixture.whenStable().then(() => { + fixture.detectChanges(); + const button = de.query(By.css('button')); + button.nativeElement.click(); + fixture.detectChanges(); - expect(de.nativeElement.innerHTML).toContain('dolor'); - }); + expect(de.nativeElement.innerHTML).toContain('dolor'); + }); })); }); diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.ts index 815366e000..951e89d7f7 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.ts @@ -24,11 +24,12 @@ import { import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; import { Observable } from 'rxjs'; import { takeWhile } from 'rxjs/operators'; -import { ComponentFactoryResult, JssComponentFactoryService } from '../jss-component-factory.service'; -import { PlaceholderLoadingDirective } from './placeholder-loading.directive'; import { - PLACEHOLDER_MISSING_COMPONENT_COMPONENT, -} from './placeholder.token'; + ComponentFactoryResult, + JssComponentFactoryService, +} from '../jss-component-factory.service'; +import { PlaceholderLoadingDirective } from './placeholder-loading.directive'; +import { PLACEHOLDER_MISSING_COMPONENT_COMPONENT } from './placeholder.token'; import { RenderEachDirective } from './render-each.directive'; import { RenderEmptyDirective } from './render-empty.directive'; import { isRawRendering } from './rendering'; @@ -43,7 +44,10 @@ function getPlaceholder(rendering: ComponentRendering, name: string) { @Component({ selector: 'sc-placeholder,[sc-placeholder]', template: ` - <ng-template *ngIf="isLoading" [ngTemplateOutlet]="placeholderLoading?.templateRef"></ng-template> + <ng-template + *ngIf="isLoading" + [ngTemplateOutlet]="placeholderLoading?.templateRef" + ></ng-template> <ng-template #view></ng-template> `, }) @@ -66,7 +70,8 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr @ViewChild('view', { read: ViewContainerRef, static: true }) private view: ViewContainerRef; @ContentChild(RenderEachDirective, { static: true }) renderEachTemplate: RenderEachDirective; @ContentChild(RenderEmptyDirective, { static: true }) renderEmptyTemplate: RenderEmptyDirective; - @ContentChild(PlaceholderLoadingDirective, { static: true }) placeholderLoading?: PlaceholderLoadingDirective; + @ContentChild(PlaceholderLoadingDirective, { static: true }) + placeholderLoading?: PlaceholderLoadingDirective; @Input() set inputs(value: { [key: string]: any }) { @@ -84,7 +89,7 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr private elementRef: ElementRef, private renderer: Renderer2, @Inject(PLACEHOLDER_MISSING_COMPONENT_COMPONENT) private missingComponentComponent: Type<any> - ) { } + ) {} ngOnInit() { // just to ensure the element exists @@ -122,24 +127,33 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr return; } const updates: { [key: string]: any } = {}; - changes.forEachRemovedItem((change) => updates[change.key] = null); - changes.forEachAddedItem((change) => updates[change.key] = change.currentValue); - changes.forEachChangedItem((change) => updates[change.key] = change.currentValue); - this._componentInstances.forEach((componentInstance) => this._setComponentInputs(componentInstance, updates)); + changes.forEachRemovedItem((change) => (updates[change.key] = null)); + changes.forEachAddedItem((change) => (updates[change.key] = change.currentValue)); + changes.forEachChangedItem((change) => (updates[change.key] = change.currentValue)); + this._componentInstances.forEach((componentInstance) => + this._setComponentInputs(componentInstance, updates) + ); } private _setComponentInputs(componentInstance: any, inputs: { [key: string]: any }) { - Object.entries(inputs).forEach(([input, inputValue]) => componentInstance[input] = inputValue); + Object.entries(inputs).forEach( + ([input, inputValue]) => (componentInstance[input] = inputValue) + ); } - private _subscribeComponentOutputs(componentInstance: any, outputs: { [k: string]: (eventType: any) => void }) { + private _subscribeComponentOutputs( + componentInstance: any, + outputs: { [k: string]: (eventType: any) => void } + ) { Object.keys(outputs) - .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable) - .forEach((output) => (componentInstance[output] as Observable<any>) - .pipe( - takeWhile(() => !this.destroyed) - ) - .subscribe(outputs[output])); + .filter( + (output) => componentInstance[output] && componentInstance[output] instanceof Observable + ) + .forEach((output) => + (componentInstance[output] as Observable<any>) + .pipe(takeWhile(() => !this.destroyed)) + .subscribe(outputs[output]) + ); } private _render() { @@ -152,7 +166,9 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr if (!this.name && !this.renderings) { // tslint:disable-next-line:max-line-length - console.warn('Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.'); + console.warn( + 'Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.' + ); this.isLoading = false; return; } @@ -160,30 +176,38 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr const placeholder = this.renderings || getPlaceholder(this.rendering, this.name || ''); if (!placeholder) { - console.warn(`Placeholder '${this.name}' was not found in the current rendering data`, JSON.stringify(this.rendering, null, 2)); + console.warn( + `Placeholder '${this.name}' was not found in the current rendering data`, + JSON.stringify(this.rendering, null, 2) + ); this.isLoading = false; return; } // if the placeholder is empty (contains only raw renderings), then we may need to use the empty template if it's defined - const placeholderIsEmpty = placeholder.every((rendering: ComponentRendering | HtmlElementRendering) => isRawRendering(rendering)); + const placeholderIsEmpty = placeholder.every( + (rendering: ComponentRendering | HtmlElementRendering) => isRawRendering(rendering) + ); if (this.renderEmptyTemplate && placeholderIsEmpty) { - this.view.createEmbeddedView(this.renderEmptyTemplate.templateRef, - { - renderings: placeholder, - }); + this.view.createEmbeddedView(this.renderEmptyTemplate.templateRef, { + renderings: placeholder, + }); this.isLoading = false; } else { - this.componentFactory.getComponents(placeholder) - .then((components) => components.forEach((rendering, index) => { - if (this.renderEachTemplate && !isRawRendering(rendering.componentDefinition)) { - this._renderTemplatedComponent(rendering.componentDefinition, index); - } else { - this._renderEmbeddedComponent(rendering, index); - } - this.isLoading = false; - })).then(() => { + this.componentFactory + .getComponents(placeholder) + .then((components) => + components.forEach((rendering, index) => { + if (this.renderEachTemplate && !isRawRendering(rendering.componentDefinition)) { + this._renderTemplatedComponent(rendering.componentDefinition, index); + } else { + this._renderEmbeddedComponent(rendering, index); + } + this.isLoading = false; + }) + ) + .then(() => { this.changeDetectorRef.markForCheck(); this.loaded.emit(this.name); }); @@ -197,11 +221,10 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr // the render-each template takes care of all component mapping etc // generally using <sc-render-component> which is about like _renderEmbeddedComponent() // as a separate component - this.view.createEmbeddedView(this.renderEachTemplate.templateRef, - { - rendering, - index, - }); + this.view.createEmbeddedView(this.renderEachTemplate.templateRef, { + rendering, + index, + }); } private _renderEmbeddedComponent(rendering: ComponentFactoryResult, index: number) { @@ -219,13 +242,18 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr } const componentFactory = - rendering.componentFactory || this.componentFactoryResolver.resolveComponentFactory(rendering.componentImplementation); + rendering.componentFactory || + this.componentFactoryResolver.resolveComponentFactory(rendering.componentImplementation); // apply the parent style attribute _ngcontent // work-around for https://github.com/angular/angular/issues/12215 const createdComponentRef = this.view.createComponent(componentFactory, index); if (this.parentStyleAttribute) { - this.renderer.setAttribute(createdComponentRef.location.nativeElement, this.parentStyleAttribute, ''); + this.renderer.setAttribute( + createdComponentRef.location.nativeElement, + this.parentStyleAttribute, + '' + ); } const componentInstance = createdComponentRef.instance; diff --git a/packages/sitecore-jss-angular/src/components/placeholder.token.ts b/packages/sitecore-jss-angular/src/components/placeholder.token.ts index 4b08bb9c00..cf5f795808 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.token.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.token.ts @@ -25,7 +25,15 @@ export function instanceOfComponentNameAndModule(object: any): object is Compone return 'module' in object; } -export const PLACEHOLDER_COMPONENTS = new InjectionToken<ComponentNameAndType[]>('Sc.placeholder.components'); -export const PLACEHOLDER_LAZY_COMPONENTS = new InjectionToken<ComponentNameAndType[]>('Sc.placeholder.lazyComponents'); -export const PLACEHOLDER_MISSING_COMPONENT_COMPONENT = new InjectionToken<Type<any>>('Sc.placeholder.missingComponentComponent'); -export const DYNAMIC_COMPONENT = new InjectionToken<Type<any> | {[s: string]: any}> ('Sc.placeholder.dynamicComponent'); +export const PLACEHOLDER_COMPONENTS = new InjectionToken<ComponentNameAndType[]>( + 'Sc.placeholder.components' +); +export const PLACEHOLDER_LAZY_COMPONENTS = new InjectionToken<ComponentNameAndType[]>( + 'Sc.placeholder.lazyComponents' +); +export const PLACEHOLDER_MISSING_COMPONENT_COMPONENT = new InjectionToken<Type<any>>( + 'Sc.placeholder.missingComponentComponent' +); +export const DYNAMIC_COMPONENT = new InjectionToken<Type<any> | { [s: string]: any }>( + 'Sc.placeholder.dynamicComponent' +); diff --git a/packages/sitecore-jss-angular/src/components/raw.component.ts b/packages/sitecore-jss-angular/src/components/raw.component.ts index 6c63aa14d7..7582a98f39 100644 --- a/packages/sitecore-jss-angular/src/components/raw.component.ts +++ b/packages/sitecore-jss-angular/src/components/raw.component.ts @@ -8,10 +8,7 @@ import { HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; export class RawComponent implements OnInit { @Input() rendering: HtmlElementRendering; - constructor( - private renderer: Renderer2, - private elementRef: ElementRef - ) { } + constructor(private renderer: Renderer2, private elementRef: ElementRef) {} ngOnInit() { const el = this.renderer.createElement(this.rendering.name); diff --git a/packages/sitecore-jss-angular/src/components/render-component.component.ts b/packages/sitecore-jss-angular/src/components/render-component.component.ts index 7ab1a34e9c..1fe49c9601 100644 --- a/packages/sitecore-jss-angular/src/components/render-component.component.ts +++ b/packages/sitecore-jss-angular/src/components/render-component.component.ts @@ -14,7 +14,10 @@ import { import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; import { Observable } from 'rxjs'; import { takeWhile } from 'rxjs/operators'; -import { ComponentFactoryResult, JssComponentFactoryService } from '../jss-component-factory.service'; +import { + ComponentFactoryResult, + JssComponentFactoryService, +} from '../jss-component-factory.service'; import { PLACEHOLDER_MISSING_COMPONENT_COMPONENT } from './placeholder.token'; import { RawComponent } from './raw.component'; import { isRawRendering } from './rendering'; @@ -51,7 +54,7 @@ export class RenderComponentComponent implements OnChanges { private differs: KeyValueDiffers, private componentFactory: JssComponentFactoryService, @Inject(PLACEHOLDER_MISSING_COMPONENT_COMPONENT) private missingComponentComponent: Type<any> - ) { } + ) {} ngOnChanges(changes: SimpleChanges) { if (changes.rendering) { @@ -60,17 +63,24 @@ export class RenderComponentComponent implements OnChanges { } private _setComponentInputs(componentInstance: any, inputs: { [key: string]: any }) { - Object.entries(inputs).forEach(([input, inputValue]) => componentInstance[input] = inputValue); + Object.entries(inputs).forEach( + ([input, inputValue]) => (componentInstance[input] = inputValue) + ); } - private _subscribeComponentOutputs(componentInstance: any, outputs: { [k: string]: (eventType: any) => void }) { + private _subscribeComponentOutputs( + componentInstance: any, + outputs: { [k: string]: (eventType: any) => void } + ) { Object.keys(outputs) - .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable) - .forEach((output) => (componentInstance[output] as Observable<any>) - .pipe( - takeWhile(() => !this.destroyed) - ) - .subscribe(outputs[output])); + .filter( + (output) => componentInstance[output] && componentInstance[output] instanceof Observable + ) + .forEach((output) => + (componentInstance[output] as Observable<any>) + .pipe(takeWhile(() => !this.destroyed)) + .subscribe(outputs[output]) + ); } private _render() { @@ -81,14 +91,18 @@ export class RenderComponentComponent implements OnChanges { } const resolveComponent: Promise<ComponentFactoryResult> = isRawRendering(this.rendering) - ? Promise.resolve({ componentImplementation: RawComponent, componentDefinition: this.rendering }) + ? Promise.resolve({ + componentImplementation: RawComponent, + componentDefinition: this.rendering, + }) : this.componentFactory.getComponent(this.rendering); resolveComponent.then((rendering) => { if (!rendering.componentImplementation) { const componentName = (rendering.componentDefinition as ComponentRendering).componentName; console.error( - `Attempted to render unknown component ${componentName}.`, `Ensure component is mapped, like: + `Attempted to render unknown component ${componentName}.`, + `Ensure component is mapped, like: JssModule.withComponents([ { name: '${componentName}', type: ${componentName}Component } ])` @@ -98,7 +112,8 @@ export class RenderComponentComponent implements OnChanges { } const componentFactory = - rendering.componentFactory || this.componentFactoryResolver.resolveComponentFactory(rendering.componentImplementation); + rendering.componentFactory || + this.componentFactoryResolver.resolveComponentFactory(rendering.componentImplementation); const componentInstance = this.view.createComponent(componentFactory, 0).instance; componentInstance.rendering = rendering.componentDefinition; diff --git a/packages/sitecore-jss-angular/src/components/rendering.ts b/packages/sitecore-jss-angular/src/components/rendering.ts index a8dc45c47b..5d28ebcb94 100644 --- a/packages/sitecore-jss-angular/src/components/rendering.ts +++ b/packages/sitecore-jss-angular/src/components/rendering.ts @@ -1,5 +1,10 @@ import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; -export function isRawRendering(rendering: HtmlElementRendering | ComponentRendering): rendering is HtmlElementRendering { - return !(rendering as ComponentRendering).componentName && (rendering as HtmlElementRendering).name !== undefined; +export function isRawRendering( + rendering: HtmlElementRendering | ComponentRendering +): rendering is HtmlElementRendering { + return ( + !(rendering as ComponentRendering).componentName && + (rendering as HtmlElementRendering).name !== undefined + ); } diff --git a/packages/sitecore-jss-angular/src/components/rich-text.directive.ts b/packages/sitecore-jss-angular/src/components/rich-text.directive.ts index bc30f8cbfa..1800b4e9e2 100644 --- a/packages/sitecore-jss-angular/src/components/rich-text.directive.ts +++ b/packages/sitecore-jss-angular/src/components/rich-text.directive.ts @@ -1,4 +1,12 @@ -import { Directive, EmbeddedViewRef, Input, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + EmbeddedViewRef, + Input, + OnChanges, + SimpleChanges, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { RichTextField } from './rendering-field'; @Directive({ @@ -13,10 +21,7 @@ export class RichTextDirective implements OnChanges { // tslint:disable-next-line:no-input-rename @Input('scRichText') field: RichTextField; - constructor( - private viewContainer: ViewContainerRef, - private templateRef: TemplateRef<any> - ) { } + constructor(private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>) {} ngOnChanges(changes: SimpleChanges) { if (changes.field || changes.editable) { @@ -35,7 +40,7 @@ export class RichTextDirective implements OnChanges { return; } - const html = (field.editable && this.editable ? field.editable : field.value); + const html = field.editable && this.editable ? field.editable : field.value; this.viewRef.rootNodes.forEach((node) => { node.innerHTML = html; }); diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts index 6ca5e2e8e2..358735209c 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts @@ -169,7 +169,9 @@ describe('<a *scRouterLink />', () => { @Component({ selector: 'test-router-link-children', template: ` - <a *scRouterLink="field; editable: editable; attrs: attrs" id="my-link"><span *ngIf="true">hello world</span></a> + <a *scRouterLink="field; editable: editable; attrs: attrs" id="my-link" + ><span *ngIf="true">hello world</span></a + > `, }) class TestWithChildrenComponent { diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.ts index 30a50326ac..1c02fbf49e 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.ts @@ -1,11 +1,17 @@ -import { Directive, ElementRef, Input, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + ElementRef, + Input, + Renderer2, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { Router } from '@angular/router'; import { LinkDirective } from './link.directive'; import { LinkField } from './rendering-field'; @Directive({ selector: '[scRouterLink]' }) export class RouterLinkDirective extends LinkDirective { - // tslint:disable-next-line:no-input-rename @Input('scRouterLinkEditable') editable = true; diff --git a/packages/sitecore-jss-angular/src/components/text.directive.ts b/packages/sitecore-jss-angular/src/components/text.directive.ts index 870ee9eb03..aea4b1d67c 100644 --- a/packages/sitecore-jss-angular/src/components/text.directive.ts +++ b/packages/sitecore-jss-angular/src/components/text.directive.ts @@ -1,4 +1,12 @@ -import { Directive, EmbeddedViewRef, Input, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; +import { + Directive, + EmbeddedViewRef, + Input, + OnChanges, + SimpleChanges, + TemplateRef, + ViewContainerRef, +} from '@angular/core'; import { TextField } from './rendering-field'; @Directive({ @@ -16,10 +24,7 @@ export class TextDirective implements OnChanges { // tslint:disable-next-line:no-input-rename @Input('scText') field: TextField; - constructor( - private viewContainer: ViewContainerRef, - private templateRef: TemplateRef<any> - ) { } + constructor(private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>) {} ngOnChanges(changes: SimpleChanges) { if (changes.field || changes.editable || changes.encode) { @@ -46,7 +51,7 @@ export class TextDirective implements OnChanges { } const html = field.editable && editable ? field.editable : field.value; - const setDangerously = field.editable && editable || !this.encode; + const setDangerously = (field.editable && editable) || !this.encode; this.viewRef.rootNodes.forEach((node) => { if (setDangerously) { diff --git a/packages/sitecore-jss-angular/src/jss-component-factory.service.ts b/packages/sitecore-jss-angular/src/jss-component-factory.service.ts index 781f886b53..804f17270f 100644 --- a/packages/sitecore-jss-angular/src/jss-component-factory.service.ts +++ b/packages/sitecore-jss-angular/src/jss-component-factory.service.ts @@ -46,7 +46,7 @@ export class JssComponentFactoryService { } private loadModuleFactory(lazyComponent: ComponentNameAndModule): Promise<NgModuleFactory<any>> { - return lazyComponent.loadChildren().then(loaded => { + return lazyComponent.loadChildren().then((loaded) => { if (loaded instanceof NgModuleFactory) { return loaded; } else { @@ -68,37 +68,38 @@ export class JssComponentFactoryService { const lazyComponent = this.lazyComponentMap.get(component.componentName); if (lazyComponent) { - return this.loadModuleFactory(lazyComponent) - .then((ngModuleFactory) => { - let componentType = null; - const moduleRef = ngModuleFactory.create(this.injector); - const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT); - if (!dynamicComponentType) { - throw new Error( + return this.loadModuleFactory(lazyComponent).then((ngModuleFactory) => { + let componentType = null; + const moduleRef = ngModuleFactory.create(this.injector); + const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT); + if (!dynamicComponentType) { + throw new Error( // tslint:disable-next-line:max-line-length - `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` - ); - } + `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` + ); + } - if (component.componentName in dynamicComponentType) { - componentType = (dynamicComponentType as {[s: string]: any})[component.componentName]; + if (component.componentName in dynamicComponentType) { + componentType = (dynamicComponentType as { [s: string]: any })[component.componentName]; + } else { + if (typeof dynamicComponentType === 'function') { + componentType = dynamicComponentType; } else { - if (typeof dynamicComponentType === 'function') { - componentType = dynamicComponentType; - } else { - throw new Error( + throw new Error( // tslint:disable-next-line:max-line-length - `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` - ); - } + `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` + ); } + } - return { - componentDefinition: component, - componentImplementation: componentType, - componentFactory: moduleRef.componentFactoryResolver.resolveComponentFactory(componentType), - }; - }); + return { + componentDefinition: component, + componentImplementation: componentType, + componentFactory: moduleRef.componentFactoryResolver.resolveComponentFactory( + componentType + ), + }; + }); } return Promise.resolve({ @@ -106,12 +107,14 @@ export class JssComponentFactoryService { }); } - getComponents(components: Array<ComponentRendering | HtmlElementRendering>): Promise<ComponentFactoryResult[]> { + getComponents( + components: Array<ComponentRendering | HtmlElementRendering> + ): Promise<ComponentFactoryResult[]> { // acquire all components and keep them in order while handling their potential async-ness return Promise.all( - components.map((component) => isRawRendering(component) - ? this.getRawComponent(component) - : this.getComponent(component)) + components.map((component) => + isRawRendering(component) ? this.getRawComponent(component) : this.getComponent(component) + ) ); } diff --git a/packages/sitecore-jss-angular/src/layout.service.ts b/packages/sitecore-jss-angular/src/layout.service.ts index 4c55108ed0..ffe94254be 100644 --- a/packages/sitecore-jss-angular/src/layout.service.ts +++ b/packages/sitecore-jss-angular/src/layout.service.ts @@ -1,5 +1,10 @@ import { Injectable } from '@angular/core'; -import { dataApi, LayoutServiceData, LayoutServiceRequestOptions, PlaceholderData } from '@sitecore-jss/sitecore-jss'; +import { + dataApi, + LayoutServiceData, + LayoutServiceRequestOptions, + PlaceholderData, +} from '@sitecore-jss/sitecore-jss'; import { from as fromPromise, Observable, throwError as observableThrow } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { LayoutServiceError } from './layout-service-error'; @@ -20,9 +25,13 @@ export class LayoutService { return observableThrow(layoutServiceError); } - getRouteData(route: string, options: LayoutServiceRequestOptions<LayoutServiceData>): Observable<LayoutServiceData | LayoutServiceError> { - return fromPromise(fetchRouteData(route, options)) - .pipe(catchError(LayoutService.getLayoutServiceError)); + getRouteData( + route: string, + options: LayoutServiceRequestOptions<LayoutServiceData> + ): Observable<LayoutServiceData | LayoutServiceError> { + return fromPromise(fetchRouteData(route, options)).pipe( + catchError(LayoutService.getLayoutServiceError) + ); } getPlaceholderData( @@ -30,7 +39,8 @@ export class LayoutService { placeholderName: string, options: LayoutServiceRequestOptions<PlaceholderData> ): Observable<PlaceholderData | LayoutServiceError> { - return fromPromise(fetchPlaceholderData(placeholderName, route, options)) - .pipe(catchError(LayoutService.getLayoutServiceError)); + return fromPromise(fetchPlaceholderData(placeholderName, route, options)).pipe( + catchError(LayoutService.getLayoutServiceError) + ); } } diff --git a/packages/sitecore-jss-angular/src/lib.module.ts b/packages/sitecore-jss-angular/src/lib.module.ts index 96a848441c..a58700c319 100644 --- a/packages/sitecore-jss-angular/src/lib.module.ts +++ b/packages/sitecore-jss-angular/src/lib.module.ts @@ -1,10 +1,5 @@ import { CommonModule, DatePipe } from '@angular/common'; -import { - ANALYZE_FOR_ENTRY_COMPONENTS, - ModuleWithProviders, - NgModule, - Type, -} from '@angular/core'; +import { ANALYZE_FOR_ENTRY_COMPONENTS, ModuleWithProviders, NgModule, Type } from '@angular/core'; import { ROUTES } from '@angular/router'; import { DateDirective } from './components/date.directive'; import { FileDirective } from './components/file.directive'; @@ -33,9 +28,7 @@ import { JssComponentFactoryService } from './jss-component-factory.service'; import { LayoutService } from './layout.service'; @NgModule({ - imports: [ - CommonModule - ], + imports: [CommonModule], declarations: [ FileDirective, ImageDirective, @@ -51,7 +44,7 @@ import { LayoutService } from './layout.service'; RawComponent, RichTextDirective, TextDirective, - MissingComponentComponent + MissingComponentComponent, ], exports: [ FileDirective, @@ -66,12 +59,9 @@ import { LayoutService } from './layout.service'; PlaceholderComponent, PlaceholderLoadingDirective, RichTextDirective, - TextDirective - ], - entryComponents: [ - RawComponent, - MissingComponentComponent + TextDirective, ], + entryComponents: [RawComponent, MissingComponentComponent], }) export class JssModule { /** @@ -82,11 +72,7 @@ export class JssModule { static forRoot(): ModuleWithProviders<JssModule> { return { ngModule: JssModule, - providers: [ - LayoutService, - DatePipe, - JssComponentFactoryService - ], + providers: [LayoutService, DatePipe, JssComponentFactoryService], }; } @@ -94,14 +80,14 @@ export class JssModule { * Instantiates a module for a lazy-loaded JSS component * @param {Type<any>} component * @returns {ModuleWithProviders<JssModule>} module - */ + */ static forChild(component: Type<any>): ModuleWithProviders<JssModule> { return { ngModule: JssModule, providers: [ { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: component, multi: true }, { provide: ROUTES, useValue: [], multi: true }, - { provide: DYNAMIC_COMPONENT, useValue: component } + { provide: DYNAMIC_COMPONENT, useValue: component }, ], }; } @@ -113,7 +99,10 @@ export class JssModule { * @param {ComponentNameAndModule[]} [lazyComponents] * @returns {ModuleWithProviders<JssModule>} module */ - static withComponents(components: ComponentNameAndType[], lazyComponents?: ComponentNameAndModule[]): ModuleWithProviders<JssModule> { + static withComponents( + components: ComponentNameAndType[], + lazyComponents?: ComponentNameAndModule[] + ): ModuleWithProviders<JssModule> { return { ngModule: JssModule, providers: [ @@ -126,7 +115,7 @@ export class JssModule { { provide: PLACEHOLDER_LAZY_COMPONENTS, useValue: lazyComponents || [] }, { provide: ROUTES, useValue: lazyComponents || [], multi: true }, { provide: PLACEHOLDER_MISSING_COMPONENT_COMPONENT, useValue: MissingComponentComponent }, - ...(JssModule.forRoot().providers as any[]) + ...(JssModule.forRoot().providers as any[]), ], }; } diff --git a/packages/sitecore-jss-angular/src/public_api.ts b/packages/sitecore-jss-angular/src/public_api.ts index ef61807712..cd87bda324 100644 --- a/packages/sitecore-jss-angular/src/public_api.ts +++ b/packages/sitecore-jss-angular/src/public_api.ts @@ -7,7 +7,14 @@ export { PlaceholderComponent } from './components/placeholder.component'; export { PlaceholderLoadingDirective } from './components/placeholder-loading.directive'; export { ComponentNameAndType, DYNAMIC_COMPONENT } from './components/placeholder.token'; export { isRawRendering } from './components/rendering'; -export { FileField, ImageField, LinkField, RenderingField, RichTextField, TextField } from './components/rendering-field'; +export { + FileField, + ImageField, + LinkField, + RenderingField, + RichTextField, + TextField, +} from './components/rendering-field'; export { RichTextDirective } from './components/rich-text.directive'; export { TextDirective } from './components/text.directive'; export { LayoutService } from './layout.service'; diff --git a/packages/sitecore-jss-angular/src/test.ts b/packages/sitecore-jss-angular/src/test.ts index 44866e571b..619713f052 100644 --- a/packages/sitecore-jss-angular/src/test.ts +++ b/packages/sitecore-jss-angular/src/test.ts @@ -5,7 +5,4 @@ import { } from '@angular/platform-browser-dynamic/testing'; // First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); +getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); diff --git a/packages/sitecore-jss-angular/src/testData/ee-data.ts b/packages/sitecore-jss-angular/src/testData/ee-data.ts index 13cbae5f27..2051d6f127 100644 --- a/packages/sitecore-jss-angular/src/testData/ee-data.ts +++ b/packages/sitecore-jss-angular/src/testData/ee-data.ts @@ -15,7 +15,8 @@ export const convertedData = { { 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":"main","expandedDisplayName":null}', + 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":"main","expandedDisplayName":null}', attributes: { type: 'text/sitecore', chrometype: 'placeholder', @@ -29,7 +30,8 @@ export const convertedData = { { 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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})\',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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})\',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/{F142E1B0-EFD1-4730-BBC5-C30064AD19D9}?lang=en&ver=1","custom":{"renderingID":"6CAAAD00D87A4B71BA0E763BA7003FE5","editable":"true"},"displayName":"HomeRendering","expandedDisplayName":null}', + 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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})\',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={2339622D-093B-4258-8334-95979E41EFA6},renderingId={6CAAAD00-D87A-4B71-BA0E-763BA7003FE5},id={F142E1B0-EFD1-4730-BBC5-C30064AD19D9})\',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/{F142E1B0-EFD1-4730-BBC5-C30064AD19D9}?lang=en&ver=1","custom":{"renderingID":"6CAAAD00D87A4B71BA0E763BA7003FE5","editable":"true"},"displayName":"HomeRendering","expandedDisplayName":null}', attributes: { type: 'text/sitecore', chrometype: 'rendering', @@ -55,7 +57,8 @@ export const convertedData = { { 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-header","expandedDisplayName":null}', + 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-header","expandedDisplayName":null}', attributes: { type: 'text/sitecore', chrometype: 'placeholder', @@ -69,7 +72,8 @@ export const convertedData = { { 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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})\',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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})\',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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{"renderingID":"A46171E90E6E4F4CABFD0B2A642A2C11","editable":"true"},"displayName":"JumbotronRendering","expandedDisplayName":null}', + 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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})\',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={53C31A2A-75D5-43C6-A0B8-66B7C7859C30},renderingId={A46171E9-0E6E-4F4C-ABFD-0B2A642A2C11},id={362C0651-3686-429C-BB70-6113EDD6ECBD})\',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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{"renderingID":"A46171E90E6E4F4CABFD0B2A642A2C11","editable":"true"},"displayName":"JumbotronRendering","expandedDisplayName":null}', attributes: { type: 'text/sitecore', chrometype: 'rendering', @@ -86,11 +90,14 @@ export const convertedData = { fields: { titleText: { value: 'Your Favorite Source of Free Bootstrap Themes!', - editable: '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17\' type=\'hidden\' value="Your Favorite Source of Free Bootstrap Themes!" /><span class="scChromeData">{"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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{},"displayName":"TitleText","expandedDisplayName":null}</span><span id="fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Your Favorite Source of Free Bootstrap Themes!</span>', + editable: + '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17\' type=\'hidden\' value="Your Favorite Source of Free Bootstrap Themes!" /><span class="scChromeData">{"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/{362C0651-3686-429C-BB70-6113EDD6ECBD}?lang=en&ver=1","custom":{},"displayName":"TitleText","expandedDisplayName":null}</span><span id="fld_362C06513686429CBB706113EDD6ECBD_D094753D077B41BA91CAE1BD228AB249_en_1_b8fbac87effe4fe0923ddcc61a0617fc_17_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Your Favorite Source of Free Bootstrap Themes!</span>', }, body: { - value: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', - editable: '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' type=\'hidden\' value="<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>" /><span class="scChromeData">{"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}</span><span scFieldType="rich text" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>', + value: + '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', + editable: + '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' type=\'hidden\' value="<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>" /><span class="scChromeData">{"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}</span><span scFieldType="rich text" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>', }, }, params: { @@ -123,13 +130,14 @@ export const convertedData = { hintname: 'page-header', class: 'scpm', }, - } + }, ], '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}', + 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', @@ -143,7 +151,8 @@ export const convertedData = { { 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}', + 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', @@ -160,7 +169,8 @@ export const convertedData = { fields: { linkText: { value: 'Download', - editable: '<input id=\'fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20\' class=\'scFieldValue\' name=\'fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20\' type=\'hidden\' value="Download" /><span class="scChromeData">{"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}</span><span id="fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Download</span>', + editable: + '<input id=\'fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20\' class=\'scFieldValue\' name=\'fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20\' type=\'hidden\' value="Download" /><span class="scChromeData">{"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}</span><span id="fld_199C8794311F4B509BDC88AEFB3EE172_B752EEA49E994A239012CD5DE3F9191E_en_1_600c022f8135451ebff5d4f98fa36a8e_20_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Download</span>', }, }, params: {}, @@ -168,7 +178,8 @@ export const convertedData = { { name: 'div', type: '', - contents: '<div style="height:50px;background: transparent url(\'/sitecore/shell/themes/standard/images/pageeditor/bg_hidden_rendering.png\') repeat;"></div>', + contents: + '<div style="height:50px;background: transparent url(\'/sitecore/shell/themes/standard/images/pageeditor/bg_hidden_rendering.png\') repeat;"></div>', attributes: { style: { backgroundColor: 'white', @@ -202,7 +213,7 @@ export const convertedData = { hintname: 'page-content', class: 'scpm', }, - } + }, ], }, }, @@ -231,17 +242,22 @@ export const convertedData = { hintname: 'main', class: 'scpm', }, - } + }, ], }, fields: { - key: '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', + key: + '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', }, }, }, }; -export const imageField = '<input id=\'fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13\' class=\'scFieldValue\' name=\'fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13\' type=\'hidden\' value="<image mediaid="{B013777F-C6CA-4880-9562-B9B7688AF63A}" />" /><code id="fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13_edit" type="text/sitecore" chromeType="field" scFieldType="image" class="scpm" kind="open">{"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}</code><img src="http://jssadvancedapp/sitecore/shell/-/media/JssAdvancedApp/assets/img/portfolio/1.ashx?h=350&la=en&w=650&hash=B973470AA333773341C62A76511361C88897E2D4" alt="" width="650" height="350" /><code class="scpm" type="text/sitecore" chromeType="field" kind="close"></code>'; -export const richTextField = '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' type=\'hidden\' value="<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>" /><span class="scChromeData">{"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}</span><span scFieldType="rich text" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>'; -export const generalLinkField = '<input id=\'fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159\' class=\'scFieldValue\' name=\'fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159\' type=\'hidden\' value="<link text="hello world" anchor="anchor" linktype="internal" class="stylin" title="yo yo" target="_blank" querystring="queryin=true" id="{7BD4252E-F91A-426F-8663-815A6492DDF8}" \/>" \/><code id="fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159_edit" type="text\/sitecore" chromeType="field" scFieldType="general link" class="scpm" kind="open">{"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><a class="stylin" title="yo yo" href="\/services?queryin=true#anchor" target="_blank">hello world<\/a><code class="scpm" type="text\/sitecore" chromeType="field" kind="close"><\/code>'; -export const textField = '<input id=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' class=\'scFieldValue\' name=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' type=\'hidden\' value="Sturdy Templates" \/><span class="scChromeData">{"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><span id="fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Sturdy Templates<\/span>'; +export const imageField = + '<input id=\'fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13\' class=\'scFieldValue\' name=\'fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13\' type=\'hidden\' value="<image mediaid="{B013777F-C6CA-4880-9562-B9B7688AF63A}" />" /><code id="fld_F5201E35767444EBB903E52488A0EB5A_B7F425624A1F4F3F925C4A4381197239_en_1_0f581df6173e468f9c0b36bd730739e4_13_edit" type="text/sitecore" chromeType="field" scFieldType="image" class="scpm" kind="open">{"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}</code><img src="http://jssadvancedapp/sitecore/shell/-/media/JssAdvancedApp/assets/img/portfolio/1.ashx?h=350&la=en&w=650&hash=B973470AA333773341C62A76511361C88897E2D4" alt="" width="650" height="350" /><code class="scpm" type="text/sitecore" chromeType="field" kind="close"></code>'; +export const richTextField = + '<input id=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' class=\'scFieldValue\' name=\'fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19\' type=\'hidden\' value="<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>" /><span class="scChromeData">{"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}</span><span scFieldType="rich text" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_362C06513686429CBB706113EDD6ECBD_F5431BB1D50245B0A007FD141266DA0D_en_1_b8fbac87effe4fe0923ddcc61a0617fc_19_edit"><p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p></span>'; +export const generalLinkField = + '<input id=\'fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159\' class=\'scFieldValue\' name=\'fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159\' type=\'hidden\' value="<link text="hello world" anchor="anchor" linktype="internal" class="stylin" title="yo yo" target="_blank" querystring="queryin=true" id="{7BD4252E-F91A-426F-8663-815A6492DDF8}" />" /><code id="fld_5DE985D8565B4437B6FF0CED110BEDE6_EA0AF81B3ECE46F5BDED4D3AC0877A69_en_1_2b89842ff0f84d258a602c0c7a36ca1a_159_edit" type="text/sitecore" chromeType="field" scFieldType="general link" class="scpm" kind="open">{"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><a class="stylin" title="yo yo" href="/services?queryin=true#anchor" target="_blank">hello world</a><code class="scpm" type="text/sitecore" chromeType="field" kind="close"></code>'; +export const textField = + '<input id=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' class=\'scFieldValue\' name=\'fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135\' type=\'hidden\' value="Sturdy Templates" /><span class="scChromeData">{"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><span id="fld_D0BC9D8D32A34E0BB4A51F9A1DCEC31A_2CCC989D995F49429BE9783029F8B988_en_1_3f75c28d0a43473789fcb43563ed7117_135_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">Sturdy Templates</span>'; 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 19f5c6613f..343d958fd5 100644 --- a/packages/sitecore-jss-angular/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-angular/src/testData/non-ee-data.ts @@ -34,11 +34,12 @@ export const convertedDevData = { value: 'Your Favorite Source of Free Bootstrap Themes!', }, body: { - value: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', + value: + '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -50,10 +51,10 @@ export const convertedDevData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { @@ -93,8 +94,10 @@ export const convertedLayoutServiceData = { editable: 'Your Favorite Source of Free Bootstrap Themes!', }, body: { - value: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', - editable: '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', + value: + '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', + editable: + '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>', }, }, params: { @@ -108,7 +111,7 @@ export const convertedLayoutServiceData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -121,10 +124,10 @@ export const convertedLayoutServiceData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { diff --git a/packages/sitecore-jss-cli/src/cli-shared.ts b/packages/sitecore-jss-cli/src/cli-shared.ts index d85f0c5a5f..ea657cf0d3 100644 --- a/packages/sitecore-jss-cli/src/cli-shared.ts +++ b/packages/sitecore-jss-cli/src/cli-shared.ts @@ -7,7 +7,9 @@ process.on('unhandledRejection', (err) => { throw err; }); -export default function cli(commands: { [key: string]: CommandModule & { disableStrictArgs?: boolean} }) { +export default function cli(commands: { + [key: string]: CommandModule & { disableStrictArgs?: boolean }; +}) { let appCommands = yargs.usage('$0 <command>'); // this prevents yargs from showing help with 'jss.js' as the base command 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 0ad09c1c98..d041a67552 100644 --- a/packages/sitecore-jss-cli/src/create/create.source.github.ts +++ b/packages/sitecore-jss-cli/src/create/create.source.github.ts @@ -53,39 +53,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); - } + 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; + } - 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); - } + console.error(chalk.yellow(result.name)); + }); + 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); + resolve(apiResult); } - - resolve(apiResult); - }); + ); }); } @@ -93,7 +105,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); @@ -118,27 +133,29 @@ export class GitHubSource { const writePromises: Array<Promise<unknown>> = []; jszip.loadAsync(data).then(async (zip) => { - 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); + 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/micro-manifest.ts b/packages/sitecore-jss-cli/src/micro-manifest.ts index 5bad8070fb..45c0bb3135 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,8 +10,11 @@ import resolvePackage from './resolve-package'; import { handler as manifestHandler } from './scripts/manifest'; import { handler as packageHandler } from './scripts/package'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export default async function microManifest(argv: { [key: string]: any }, manifestContents: string) { +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(); @@ -24,9 +31,7 @@ export default async function microManifest(argv: { [key: string]: any }, manife 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'); diff --git a/packages/sitecore-jss-cli/src/run-package-script.ts b/packages/sitecore-jss-cli/src/run-package-script.ts index 5eb56ce202..b09fa2967f 100644 --- a/packages/sitecore-jss-cli/src/run-package-script.ts +++ b/packages/sitecore-jss-cli/src/run-package-script.ts @@ -3,7 +3,10 @@ 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) { +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 +15,10 @@ 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) { +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 e344d568e0..d150685fd8 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'; diff --git a/packages/sitecore-jss-cli/src/scripts/create.ts b/packages/sitecore-jss-cli/src/scripts/create.ts index 9865f52270..d930356824 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'; @@ -54,8 +55,7 @@ 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 ); @@ -94,9 +94,7 @@ async function handler(argv: any) { 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 { diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts index 7345e88bee..66cc7cf103 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts @@ -34,7 +34,7 @@ export function args(yargs: 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) => { @@ -71,11 +71,11 @@ ${chalk.green('Your component has been created (or updated)!')} ${chalk.green('NEXT STEPS FOR NEW COMPONENTS')} * Create a component in your JSS application called ${chalk.green(argv.name)} (${chalk.green( - `jss scaffold ${argv.name}` -)}) + `jss scaffold ${argv.name}` + )}) * Deploy your app with the new component to Sitecore (${chalk.green( - 'jss deploy:watch' - )} or ${chalk.green('jss deploy files')}) + 'jss deploy:watch' + )} or ${chalk.green('jss deploy files')}) * Add the new component to a route item using the Experience Editor `); } diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts index cb8d817948..6b06302d4c 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'; diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts index 0fc5122238..8aa5a3aa25 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'; diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts index eea9d39c1e..48eed10337 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'; @@ -50,7 +55,8 @@ 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, }; @@ -73,9 +79,7 @@ export async function handler(argv: any) { 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'); diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts index 71caddf404..d326cba7bc 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ import chalk from 'chalk'; import { Argv } from '../../node_modules/@types/yargs'; import microManifest from '../micro-manifest'; @@ -70,7 +71,7 @@ export function args(yargs: 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/easter-egg.ts b/packages/sitecore-jss-cli/src/scripts/easter-egg.ts index 57f57b59a5..72706c17b8 100644 --- a/packages/sitecore-jss-cli/src/scripts/easter-egg.ts +++ b/packages/sitecore-jss-cli/src/scripts/easter-egg.ts @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ export const command = 'whats-the-password'; export const describe = false; diff --git a/packages/sitecore-jss-cli/src/scripts/index.global.ts b/packages/sitecore-jss-cli/src/scripts/index.global.ts index 1d18712624..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 938892c528..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/setup.ts b/packages/sitecore-jss-cli/src/scripts/setup.ts index 28b60dd671..e9484ebb99 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'; diff --git a/packages/sitecore-jss-cli/src/spawn.ts b/packages/sitecore-jss-cli/src/spawn.ts index 070f2fb37d..58d844414c 100644 --- a/packages/sitecore-jss-cli/src/spawn.ts +++ b/packages/sitecore-jss-cli/src/spawn.ts @@ -1,7 +1,11 @@ import { SpawnSyncOptionsWithStringEncoding } from 'child_process'; import spawn from 'cross-spawn'; -export default function(command: string, args: string[], options?: SpawnSyncOptionsWithStringEncoding) { +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/src/deploy.ts b/packages/sitecore-jss-dev-tools/src/deploy.ts index 83e9866ed6..d195913e20 100644 --- a/packages/sitecore-jss-dev-tools/src/deploy.ts +++ b/packages/sitecore-jss-dev-tools/src/deploy.ts @@ -58,7 +58,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 5b34631e4a..59a7d16bab 100644 --- a/packages/sitecore-jss-dev-tools/src/digest.ts +++ b/packages/sitecore-jss-dev-tools/src/digest.ts @@ -1,4 +1,3 @@ - import { createHash, createHmac } from 'crypto'; import { createReadStream } from 'fs'; 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 c80bda9913..d831a31987 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 { @@ -101,7 +105,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, '..'); } @@ -110,7 +114,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 @@ -164,7 +170,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 accbc5fabe..6db0fb6033 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 @@ -8,7 +8,9 @@ export interface DefaultDocumentMiddlewareOptions { indexFilePath: string; } -export function createDefaultDocumentMiddleware({ indexFilePath }: DefaultDocumentMiddlewareOptions) { +export function createDefaultDocumentMiddleware({ + indexFilePath, +}: DefaultDocumentMiddlewareOptions) { return function defaultDocumentMiddleware(req: Request, res: Response, next: NextFunction) { if (req.path === '/favicon.ico' || req.path.endsWith('.map')) { next(); 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 82b96c1c0a..44deef5f6e 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 @@ -11,7 +11,10 @@ export interface DisconnectedAssetMiddlewareOptions { staticRootPath: string; } -export function createDisconnectedAssetMiddleware({ manifestPath, staticRootPath }: DisconnectedAssetMiddlewareOptions) { +export function createDisconnectedAssetMiddleware({ + manifestPath, + staticRootPath, +}: DisconnectedAssetMiddlewareOptions) { return function disconnectedAssetMiddleware(request: Request, response: Response) { let localUrl = request.originalUrl; diff --git a/packages/sitecore-jss-dev-tools/src/index.ts b/packages/sitecore-jss-dev-tools/src/index.ts index e3c55c7972..cec5bdb535 100644 --- a/packages/sitecore-jss-dev-tools/src/index.ts +++ b/packages/sitecore-jss-dev-tools/src/index.ts @@ -6,7 +6,10 @@ 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, @@ -14,8 +17,14 @@ export { CustomizeRenderFunction, 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 9c0de2701a..1ed3a8e772 100644 --- a/packages/sitecore-jss-dev-tools/src/manifest-manager.ts +++ b/packages/sitecore-jss-dev-tools/src/manifest-manager.ts @@ -34,7 +34,7 @@ export class ManifestManager { rootPath = process.cwd(), sourceFiles = [ './sitecore/definitions/**/*.sitecore.js', - './sitecore/definitions/**/*.sitecore.ts' + './sitecore/definitions/**/*.sitecore.ts', ], watchOnlySourceFiles = [], requireArg = './sitecore/definitions/config.js', diff --git a/packages/sitecore-jss-dev-tools/src/mergeFs.ts b/packages/sitecore-jss-dev-tools/src/mergeFs.ts index 83c409ee12..7c7276ae6c 100644 --- a/packages/sitecore-jss-dev-tools/src/mergeFs.ts +++ b/packages/sitecore-jss-dev-tools/src/mergeFs.ts @@ -27,7 +27,10 @@ export interface FileResult { 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) { @@ -119,7 +122,10 @@ export interface MergeFsResult { folders: MergeFsResult[]; } -export const mergeFs = (rootPath: string, parseFileContents?: CustomFileParser): Promise<MergeFsResult> => +export const mergeFs = ( + rootPath: string, + parseFileContents?: CustomFileParser +): Promise<MergeFsResult> => 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 c0f9c267f1..305e6e7d8b 100644 --- a/packages/sitecore-jss-dev-tools/src/package-deploy.ts +++ b/packages/sitecore-jss-dev-tools/src/package-deploy.ts @@ -26,10 +26,18 @@ function applyCertPinning(req: request.Request, options: PackageDeployOptions) { 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(); } @@ -52,7 +60,7 @@ 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 { return normalizeFingerprint(fp1) === normalizeFingerprint(fp2); @@ -90,98 +98,108 @@ async function watchJobStatus(options: PackageDeployOptions, taskName: string) { return new Promise((resolve, reject) => { 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) { + // 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)); + } + 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); } @@ -193,12 +211,16 @@ async function watchJobStatus(options: PackageDeployOptions, taskName: string) { 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 +266,30 @@ export async function packageDeploy(options: PackageDeployOptions) { console.log(`Sending package ${packageFile} to ${options.importServiceUrl}...`); return new Promise<string>((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..590458fcd5 100644 --- a/packages/sitecore-jss-dev-tools/src/package-generate.ts +++ b/packages/sitecore-jss-dev-tools/src/package-generate.ts @@ -20,7 +20,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/setup/setup.ts b/packages/sitecore-jss-dev-tools/src/setup/setup.ts index ee7ecd065f..ee0d3b38a7 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/setup.ts @@ -29,14 +29,14 @@ function getInteractiveData( } 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 +52,13 @@ function getInteractiveData( return result; } -export function setup(interactive: boolean, outputFile?: string, initialData?: JssConfiguration, configName = 'sitecore') { - const getValidation = (regexp: RegExp) => initialData?.skipValidation ? undefined : regexp; +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 +76,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 +131,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); @@ -186,16 +207,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 +241,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 +277,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 20ea254e31..8fcdef10e1 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts @@ -5,9 +5,13 @@ 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)')); + 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?'); + 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'; @@ -15,8 +19,14 @@ export const verifySetup = () => { 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 diff --git a/packages/sitecore-jss-forms/src/FormField.ts b/packages/sitecore-jss-forms/src/FormField.ts index 8770644748..290411d3af 100644 --- a/packages/sitecore-jss-forms/src/FormField.ts +++ b/packages/sitecore-jss-forms/src/FormField.ts @@ -12,7 +12,8 @@ export function instanceOfFormField<T extends ViewModel>(object: any): object is return 'model' in object; } -export interface ValueFormField<TViewModel extends InputViewModel = InputViewModel> extends FormField<TViewModel> { +export interface ValueFormField<TViewModel extends InputViewModel = InputViewModel> + extends FormField<TViewModel> { indexField: HtmlFormField; fieldIdField: HtmlFormField; valueField: HtmlFormField; diff --git a/packages/sitecore-jss-forms/src/FormTracker.ts b/packages/sitecore-jss-forms/src/FormTracker.ts index bff56da275..4fd5282d9c 100644 --- a/packages/sitecore-jss-forms/src/FormTracker.ts +++ b/packages/sitecore-jss-forms/src/FormTracker.ts @@ -28,13 +28,14 @@ export interface FormTrackerOptions { } 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 { @@ -51,11 +52,11 @@ export class FormTracker { } /** - * 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 - */ + * 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; @@ -80,11 +81,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; diff --git a/packages/sitecore-jss-forms/src/JssFormData.test.ts b/packages/sitecore-jss-forms/src/JssFormData.test.ts index 8cffcd6ff7..002cb8de59 100644 --- a/packages/sitecore-jss-forms/src/JssFormData.test.ts +++ b/packages/sitecore-jss-forms/src/JssFormData.test.ts @@ -13,7 +13,7 @@ describe('JssFormData', () => { expect(formData.get()).to.deep.equal([ { key: 'xxx', value: 'val-xxx' }, { key: 'xxx', value: 'val-xxx' }, - { key: 'yyy', value: 'val-yyy' } + { key: 'yyy', value: 'val-yyy' }, ]); }); @@ -27,7 +27,7 @@ describe('JssFormData', () => { expect(formData.get()).to.deep.equal([ { key: 'xxx', value: 'val-xxx' }, - { key: 'yyy', value: 'val-yyy' } + { key: 'yyy', value: 'val-yyy' }, ]); }); @@ -42,18 +42,14 @@ describe('JssFormData', () => { expect(x1formData.get()).to.deep.equal([ { key: 'a1', value: 'a1-val' }, - { key: 'a2', value: 'a2-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' - ], + x23: ['x231-arr-val', 'x232-arr-val', 'x233-arr-val'], }; x2formData.mergeOverwritingExisting(x2); @@ -63,7 +59,7 @@ describe('JssFormData', () => { { key: 'x22', value: 'a2-val' }, { key: 'x23', value: 'x231-arr-val' }, { key: 'x23', value: 'x232-arr-val' }, - { key: 'x23', value: 'x233-arr-val' } + { key: 'x23', value: 'x233-arr-val' }, ]); }); diff --git a/packages/sitecore-jss-forms/src/JssFormData.ts b/packages/sitecore-jss-forms/src/JssFormData.ts index c7db237fd2..89721da3b1 100644 --- a/packages/sitecore-jss-forms/src/JssFormData.ts +++ b/packages/sitecore-jss-forms/src/JssFormData.ts @@ -4,31 +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. - * @param {string} key - * @param {string | File} value - */ + * 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. - * @param {string} key - * @param {string | File} value - */ + * 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 - * @param {Object} values - */ + * 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]; @@ -52,16 +52,16 @@ export class JssFormData { } /** - * Gets all key/values in the store. Duplicate keys with different values are possible. - * @returns {Object} data - */ + * 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 + * @returns {FormData} form data */ public toMultipartFormData(): FormData { const formData = new FormData(); @@ -72,9 +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 + * @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/getFieldValueFromModel.ts b/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts index 389a492583..832cbc2666 100644 --- a/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts +++ b/packages/sitecore-jss-forms/src/getFieldValueFromModel.ts @@ -4,7 +4,7 @@ import { instanceOfInputViewModel, instanceOfListViewModel } from './ViewModel'; /** 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) diff --git a/packages/sitecore-jss-forms/src/index.ts b/packages/sitecore-jss-forms/src/index.ts index 02686ec78d..b810d50073 100644 --- a/packages/sitecore-jss-forms/src/index.ts +++ b/packages/sitecore-jss-forms/src/index.ts @@ -31,7 +31,12 @@ 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, diff --git a/packages/sitecore-jss-forms/src/serializeForm.ts b/packages/sitecore-jss-forms/src/serializeForm.ts index e8f41dde51..e0ac61b9b7 100644 --- a/packages/sitecore-jss-forms/src/serializeForm.ts +++ b/packages/sitecore-jss-forms/src/serializeForm.ts @@ -45,8 +45,12 @@ export function serializeForm(form: SitecoreForm, options?: SerializeFormOptions return result; } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function pushFields(result: JssFormData, fields: Array<FormField<any>>, options: SerializeFormOptions) { +function pushFields( + result: JssFormData, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + fields: Array<FormField<any>>, + options: SerializeFormOptions +) { fields.forEach((field) => { if ( instanceOfButtonFormField(field) && diff --git a/packages/sitecore-jss-forms/src/submitForm.ts b/packages/sitecore-jss-forms/src/submitForm.ts index 1068556e20..9d44911099 100644 --- a/packages/sitecore-jss-forms/src/submitForm.ts +++ b/packages/sitecore-jss-forms/src/submitForm.ts @@ -8,19 +8,24 @@ export interface FormSubmitOptions { } 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<FormResult> { +export function submitForm( + formData: JssFormData, + endpoint: string, + options?: FormSubmitOptions +): Promise<FormResult> { options = options || {}; if (!options.fetcher) { diff --git a/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts b/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts index 8782b003d9..f822f4cda3 100644 --- a/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts +++ b/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts @@ -57,9 +57,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 ca4c36393f..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: { [key: string]: any, uid: string }, + 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 d950fbbb74..50a3544126 100644 --- a/packages/sitecore-jss-manifest/src/generator/generate.ts +++ b/packages/sitecore-jss-manifest/src/generator/generate.ts @@ -134,10 +134,10 @@ const getPipelineConfig = async ({ patchGlobs }: { patchGlobs: string[] }) => { }); const patchedConfig = patchGlobs ? await configLoader({ - fileGlobs: patchGlobs, - existingConfig: manifestConfig, - allowEmptyGlobs: true, - }) + fileGlobs: patchGlobs, + existingConfig: manifestConfig, + allowEmptyGlobs: true, + }) : manifestConfig; return patchedConfig; }; 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..8f42997879 100644 --- a/packages/sitecore-jss-manifest/src/generator/manifest.babel-shim.ts +++ b/packages/sitecore-jss-manifest/src/generator/manifest.babel-shim.ts @@ -9,7 +9,10 @@ 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[]) { +export function addComponent( + manifest: Manifest, + ...components: ManifestTypes.ComponentDefinition[] +) { manifest.addComponent(...components); } @@ -17,10 +20,16 @@ export function addTemplate(manifest: Manifest, ...templates: ManifestTypes.Temp manifest.addTemplate(...templates); } -export function addPlaceholder(manifest: Manifest, ...placeholders: ManifestTypes.PlaceholderDefinition[]) { +export function addPlaceholder( + manifest: Manifest, + ...placeholders: ManifestTypes.PlaceholderDefinition[] +) { manifest.addPlaceholder(...placeholders); } -export function addRouteType(manifest: Manifest, ...routeTypes: ManifestTypes.TemplateDefinition[]) { +export function addRouteType( + manifest: Manifest, + ...routeTypes: ManifestTypes.TemplateDefinition[] +) { manifest.addRouteType(...routeTypes); } @@ -32,6 +41,9 @@ export function addContent(manifest: Manifest, ...contents: ManifestTypes.ItemDe manifest.addContent(...contents); } -export function addDictionary(manifest: Manifest, ...entries: Array<{ key: string, value: string }>) { +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 2bc1bdf5ce..c2817e1428 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[]; @@ -331,7 +331,13 @@ export interface LinkFieldValue { } export interface ContentFieldValue { - value: string | number | boolean | ImageFieldValue | LinkFieldValue | Array<ItemDefinition | ItemReference>; + value: + | string + | number + | boolean + | ImageFieldValue + | LinkFieldValue + | Array<ItemDefinition | ItemReference>; editable?: string; } @@ -340,7 +346,7 @@ export interface ItemDefinition { template: string; displayName?: string; id?: string; - fields?: {[key: string]: ContentFieldValue}; + fields?: { [key: string]: ContentFieldValue }; children?: Array<ItemDefinition | ItemReference>; path?: string; insertOptions?: string[]; @@ -355,12 +361,12 @@ export function isItemDefinition(obj: ItemDefinition | ItemReference): obj is It } 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 { @@ -401,13 +407,21 @@ export interface GenerateRouteItemPipelineArgs { pipelines: { [key: string]: ExecutablePipeline }; item: any; dynamicPlaceholderKeyGenerator: (key: string, rendering: any, parentKey: string) => string; - datasourceNamer: ({ item, placeholder, rendering, index }: { + datasourceNamer: ({ + item, + placeholder, + rendering, + index, + }: { item: any; placeholder: any; rendering: any; index: number; }) => string; - datasourceDisplayNamer: ({ rendering, index }: { + datasourceDisplayNamer: ({ + rendering, + index, + }: { item: any; placeholder: any; rendering: 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 0cc1dabd75..8135562783 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; @@ -17,7 +17,11 @@ export default (args: GenerateContentItemArgs) => { 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) { @@ -25,9 +29,17 @@ export default (args: GenerateContentItemArgs) => { 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.`); + 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); + 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/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..85042368c9 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; @@ -73,14 +77,18 @@ export default (args: GeneratePipelineArgs) => { 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/generateTemplates.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts index ecbc385ced..a1f25caacf 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateTemplates.ts @@ -45,14 +45,18 @@ export default (args: any) => { 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 4678a454e0..ab815af209 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateMedia/utils.ts @@ -37,7 +37,11 @@ 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; } 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 82b1c28306..af94bc1192 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts @@ -22,7 +22,9 @@ 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; @@ -31,9 +33,13 @@ export default (args: GeneratePlaceholdersPipelineArgs) => { 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/extractPlaceholdersFromItems.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts index 76df716a2f..786a0dc519 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromItems.test.ts @@ -16,7 +16,7 @@ describe('generatePlaceholders pipeline', () => { layout: { placeholders: expected.slice(2, 5), }, - } + }, ], placeholderNames: expected.slice(5, 7), }; diff --git a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts index 4f1873707e..deb4220c25 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/extractPlaceholdersFromRenderings.test.ts @@ -13,7 +13,7 @@ describe('generatePlaceholders pipeline', () => { }, { exposedPlaceholders: expected.slice(2, 5), - } + }, ], placeholderNames: expected.slice(5, 7), }; 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 575a593106..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 = [ { @@ -20,11 +18,15 @@ describe('generatePlaceholders pipeline', () => { { name: 'ash', displayName: 'Ash', - } + }, ]; 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/generatePlaceholders/removeDuplicates.test.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts index 4a2587638e..50c97c6c72 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/removeDuplicates.test.ts @@ -14,7 +14,7 @@ describe('generatePlaceholders pipeline', () => { 'maple', '/lorem/ipsum/maple', '/sycamore', - 'poplar' + 'poplar', ], }; const result = removeDuplicates(args); 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 f0fb69770c..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,12 +39,11 @@ 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); 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 35411aff0e..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 @@ -16,7 +16,7 @@ const args = { }, { name: 'dolor', - } + }, ], componentFactory: (components: any, componentName: string) => components.find((component: any) => component.name === componentName), @@ -44,7 +44,7 @@ describe('generateRouteItem pipeline', () => { }, { componentName: 'dolor', - } + }, ], }, }; @@ -65,7 +65,7 @@ describe('generateRouteItem pipeline', () => { main: [ { componentName: 'lorem', - } + }, ], }, }; @@ -88,7 +88,7 @@ describe('generateRouteItem pipeline', () => { name: expectedName, displayName: expectedDisplayName, componentName: 'lorem', - } + }, ], }, }; 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 44ad98d3f2..d16015ec43 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts @@ -17,30 +17,54 @@ 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, { name: paramName, value: rendering.params[paramName], - } + }, ]; }, []); 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; @@ -60,9 +84,16 @@ const generateFields = ( 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.`); + 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); + renderingFields = validateFieldDefinitions( + rendering.fields, + component, + handleError, + allComponents + ); } return convertComponentDataToFields({ data: renderingFields, context: { item: dataSourceItem } }); @@ -76,7 +107,10 @@ const generateChildrenFields = (children: Array<ItemDefinition | ItemReference>) } 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) { @@ -93,19 +127,20 @@ const createDataSourceItem = ({ datasourceDisplayNamer, ...context }: { - [key: string]: any - 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, + 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 @@ -144,14 +179,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); @@ -162,7 +201,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); @@ -171,7 +214,8 @@ const processRendering = (rendering: any, index: number, context: GenerateRouteI // (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.` ); } @@ -180,7 +224,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, @@ -219,8 +263,8 @@ const processRendering = (rendering: any, index: number, context: GenerateRouteI const processPlaceholders = ( context: GenerateRouteItemPipelineArgs, - placeholders?: { [key: string]: ComponentInstanceDefinition[] }) => { - + placeholders?: { [key: string]: ComponentInstanceDefinition[] } +) => { if (!placeholders) { return; } @@ -272,7 +316,9 @@ export default (args: GenerateRouteItemPipelineArgs) => { 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..976587d925 100644 --- a/packages/sitecore-jss-manifest/src/generator/traversal.ts +++ b/packages/sitecore-jss-manifest/src/generator/traversal.ts @@ -61,7 +61,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); } }); diff --git a/packages/sitecore-jss-manifest/src/generator/utils.ts b/packages/sitecore-jss-manifest/src/generator/utils.ts index 7d28098029..b725243b1d 100644 --- a/packages/sitecore-jss-manifest/src/generator/utils.ts +++ b/packages/sitecore-jss-manifest/src/generator/utils.ts @@ -17,12 +17,14 @@ export const filterObject = (obj: any, filter: (key: string, value: any) => bool return res; }, {}); -export const convertComponentDataToFields = ({ data, context: { item = {} as ItemDefinition } = {} }: -{ - data: any, +export const convertComponentDataToFields = ({ + data, + context: { item = {} as ItemDefinition } = {}, +}: { + data: any; context: { - item?: ItemDefinition, - } + item?: ItemDefinition; + }; }) => { if (!data) { return; @@ -49,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}`, }; @@ -84,8 +91,8 @@ const mapFieldValueItem = (item: ItemDefinition, fieldValueItem: ItemDefinition, export interface FieldValue { fieldValue: any; context: { - fieldName?: string, - item: any + fieldName?: string; + item: any; }; } @@ -155,7 +162,10 @@ export function checkUnique(input: any[], selector: (element: any) => string) { * @param {string} templateName * @returns {TemplateDefinition | ComponentDefinition | null} template */ -export function findTemplate(templateName: string, ...templates: Array<Array<TemplateDefinition | ComponentDefinition>>): TemplateDefinition | ComponentDefinition | null { +export function findTemplate( + templateName: string, + ...templates: Array<Array<TemplateDefinition | ComponentDefinition>> +): TemplateDefinition | ComponentDefinition | null { let templateResult: TemplateDefinition | ComponentDefinition | null = null; if (!templates) { @@ -198,22 +208,20 @@ export function validateFieldDefinitions( // 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) { + // tslint:disable-next-line:no-string-throw max-line-length + 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/Welcome.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts index f9f7c3081d..3e98dd0e32 100644 --- a/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/components/Welcome.sitecore.ts @@ -8,7 +8,7 @@ export default (manifest: Manifest) => { fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, { name: 'text', displayName: 'Text', type: CommonFieldTypes.RichText }, - { name: 'logoImage', displayName: 'LogoImage', type: CommonFieldTypes.Image } + { name: 'logoImage', displayName: 'LogoImage', type: CommonFieldTypes.Image }, ], placeholders: [], params: [], 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 a453835dc0..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 8d065b1fb8..be47af27b5 100644 --- a/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/components/component0.sitecore.ts @@ -7,14 +7,10 @@ export default (manifest: Manifest) => { displayName: 'Component0', fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, - { name: 'relatedItems', displayName: 'Related Items', type: CommonFieldTypes.ContentList } - ], - placeholders: [ - { name: 'page-header' } - ], - params: [ - { name: 'param0' } + { name: 'relatedItems', displayName: 'Related Items', type: CommonFieldTypes.ContentList }, ], + placeholders: [{ name: 'page-header' }], + params: [{ name: 'param0' }], }); manifest.addComponent({ @@ -22,7 +18,7 @@ export default (manifest: Manifest) => { displayName: 'Related Item', fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, - { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image } + { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image }, ], }); }; 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 09f36738b0..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 2564553d51..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/content.sitecore.ts b/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts index e5addc6684..b64d4ed72d 100644 --- a/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts +++ b/packages/sitecore-jss-manifest/src/testData/content/content.sitecore.ts @@ -9,7 +9,7 @@ export default (manifest: Manifest) => { fields: [ { name: 'title', displayName: 'Title', type: CommonFieldTypes.SingleLineText }, { name: 'body', displayName: 'Body', type: CommonFieldTypes.RichText }, - { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image } + { name: 'image', displayName: 'Image', type: CommonFieldTypes.Image }, ], }); }; 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: '<p> <strong> <em>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.</em> </strong> </p> <p> </p> <p align=\'center\'> <b> <span>Whack Whack Star Solutions License Agreement</span> </b> </p> <p> <b> <span>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. </span> </b> </p> <p> <b> <span lang=\'EN-GB\'>1. <u>License Grant</u></span> </b> <span lang=\'EN-GB\'>: 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,</span> <span lang=\'EN-GB\'>exclusively for the Permitted Usage (as that term is defined in Exhibit A)</span> <span lang=\'EN-GB\'>, 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.</span> <span lang=\'EN-GB\'>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.</span> <span lang=\'EN-GB\'>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).</span> </p>', + value: + // eslint-disable-next-line prettier/prettier + '<p> <strong> <em>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.</em> </strong> </p> <p> </p> <p align=\'center\'> <b> <span>Whack Whack Star Solutions License Agreement</span> </b> </p> <p> <b> <span>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. </span> </b> </p> <p> <b> <span lang=\'EN-GB\'>1. <u>License Grant</u></span> </b> <span lang=\'EN-GB\'>: 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,</span> <span lang=\'EN-GB\'>exclusively for the Permitted Usage (as that term is defined in Exhibit A)</span> <span lang=\'EN-GB\'>, 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.</span> <span lang=\'EN-GB\'>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.</span> <span lang=\'EN-GB\'>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).</span> </p>', }, 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 d3f7f0a2d4..af1d18208f 100644 --- a/packages/sitecore-jss-manifest/src/testData/routes/route.ts +++ b/packages/sitecore-jss-manifest/src/testData/routes/route.ts @@ -11,7 +11,8 @@ export default { }, text: { // tslint:disable-next-line:max-line-length - value: '<p>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.</p><p>For further information, please go to the <a href="https://doc.sitecore.net/" target="_blank" title="Sitecore Documentation site">Sitecore Documentation site</a></p>', + value: + '<p>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.</p><p>For further information, please go to the <a href="https://doc.sitecore.net/" target="_blank" title="Sitecore Documentation site">Sitecore Documentation site</a></p>', }, logoImage: { value: { @@ -20,7 +21,7 @@ export default { }, }, }, - } + }, ], }, }; 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 89f022b5a8..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/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/src/absolutify.ts b/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts index c26fdb6dd0..00f4816a8e 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts @@ -32,7 +32,7 @@ const captureRx = /((href|src|codebase|cite|background|cite|action|profile|forma * @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); }); 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 64a59a5c4a..e7e9ed7952 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/config.test.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/config.test.ts @@ -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'] }, }); - 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"', () => { @@ -95,7 +125,8 @@ describe('config', () => { const nextConfig = withEditing({ 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 d6dd8db849..0e5ec0c4a0 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/config.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/config.ts @@ -23,10 +23,7 @@ export interface ConfigOptions { * @param {ConfigOptions} [options] Configuration options * @returns {ConfigOptions} config */ -export function config({ - enabled = false, - distDir = '.next-editing', -}: ConfigOptions = {}) { +export function config({ enabled = false, distDir = '.next-editing' }: ConfigOptions = {}) { // eslint-disable-next-line @typescript-eslint/no-explicit-any return function plugin(nextConfig: any = {}) { if (!enabled) { @@ -35,7 +32,9 @@ export function config({ 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`); @@ -43,7 +42,6 @@ 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, 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 02cce1a846..b31b67684c 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 @@ -32,14 +32,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('<html></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); @@ -57,7 +56,7 @@ describe('EditingMiddleware', () => { const nextApp = sinon.createStubInstance(Server); nextApp.renderToHTML.resolves('<html></html>'); - 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); @@ -72,11 +71,12 @@ describe('EditingMiddleware', () => { const nextApp = sinon.createStubInstance(Server); nextApp.renderToHTML.resolves('<html></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); - 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 () => { @@ -86,7 +86,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); @@ -101,7 +101,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); @@ -109,14 +109,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); @@ -134,18 +133,18 @@ describe('EditingMiddleware', () => { 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; @@ -176,5 +175,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 644d951082..2d3aa35b65 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts @@ -7,19 +7,23 @@ import { EditingData } from '@sitecore-jss/sitecore-jss-nextjs'; import { HtmlProcessor } from './html-processors'; export class EditingMiddleware { /** - * Express middleware for handling requests from the Sitecore Experience Editor. - * @constructor - * @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[]) {} + * Express middleware for handling requests from the Sitecore Experience Editor. + * @constructor + * @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. - * @param {Request} req - * @param {Response} res - * @returns {Promise<void>} request handler + * @param {Request} req + * @param {Response} res + * @returns {Promise<void>} request handler */ public getRequestHandler(): (req: Request, res: Response) => Promise<void> { return this.handleRequest; @@ -54,7 +58,7 @@ export class EditingMiddleware { // Run any post-render processing of the html if (this.htmlProcessors) { - this.htmlProcessors.forEach(processor => { + this.htmlProcessors.forEach((processor) => { html = html && processor.processHtml(html); }); } 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 8fdd96dda7..4d215be156 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-server.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-server.ts @@ -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}`; @@ -64,7 +70,7 @@ export function startEditingServer({ const server = express(); const handle = app.getRequestHandler(); const handleEdit = new EditingMiddleware(app, editRoute, [ - new AbsolutifyHtmlProcessor(getPublicUrl(), ignoredReplacementPaths) + new AbsolutifyHtmlProcessor(getPublicUrl(), ignoredReplacementPaths), ]).getRequestHandler(); // Disable X-Powered-By header @@ -73,7 +79,7 @@ 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any - const editHandlers: any[] = [ bodyParser.json({ limit: '2mb' }), handleEdit ]; + const editHandlers: any[] = [bodyParser.json({ limit: '2mb' }), handleEdit]; if (enableCompression) { editHandlers.unshift(compression()); } 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 7c74af2f0e..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); @@ -62,7 +61,7 @@ describe('AbsolutifyHtmlProcessor', () => { 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 = ` <html> @@ -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 = ` <html> 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 ffced460bd..e0bf886309 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 { @@ -20,12 +19,13 @@ export class AbsolutifyHtmlProcessor implements HtmlProcessor { constructor(readonly publicUrl: string, readonly ignoredPaths?: string[]) {} processHtml(html: 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; } diff --git a/packages/sitecore-jss-nextjs-editing-host/src/index.ts b/packages/sitecore-jss-nextjs-editing-host/src/index.ts index ddc0228b79..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 8ce0b0a2b6..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\":\"<p>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":"<p>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_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/src/components/ComponentPropsContext.test.tsx b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx index 84b622981c..2f67249708 100644 --- a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx +++ b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.test.tsx @@ -11,26 +11,24 @@ describe('ComponentPropsContext', () => { const X1Component = () => { const data = useComponentProps<number>('x1'); - return ( - <div>First: {data}</div> - ); + return <div>First: {data}</div>; }; const X2Component = () => { const data = useComponentProps<number>('y1'); - return ( - <div>Second: {data}</div> - ); + return <div>Second: {data}</div>; }; it('should render', () => { - const component = mount(<ComponentPropsContext value={VALUE}> - <> - <X1Component /> - <X2Component /> - </> - </ComponentPropsContext>); + const component = mount( + <ComponentPropsContext value={VALUE}> + <> + <X1Component /> + <X2Component /> + </> + </ComponentPropsContext> + ); const x1Div = component.find(X1Component); const x2Div = component.find(X2Component); diff --git a/packages/sitecore-jss-nextjs/src/components/Link.test.tsx b/packages/sitecore-jss-nextjs/src/components/Link.test.tsx index 4fe50f1aca..70f6357c9b 100644 --- a/packages/sitecore-jss-nextjs/src/components/Link.test.tsx +++ b/packages/sitecore-jss-nextjs/src/components/Link.test.tsx @@ -194,7 +194,11 @@ describe('<Link />', () => { }; const rendered = mount( <Page> - <Link field={field} showLinkTextWithChildrenPresent internalLinkMatcher={/^http:\/\/jssreactweb/g}> + <Link + field={field} + showLinkTextWithChildrenPresent + internalLinkMatcher={/^http:\/\/jssreactweb/g} + > <p>Hello world...</p> </Link> </Page> diff --git a/packages/sitecore-jss-nextjs/src/components/Link.tsx b/packages/sitecore-jss-nextjs/src/components/Link.tsx index 0f357a6707..e6f210e3e1 100644 --- a/packages/sitecore-jss-nextjs/src/components/Link.tsx +++ b/packages/sitecore-jss-nextjs/src/components/Link.tsx @@ -39,12 +39,7 @@ export const Link = (props: LinkProps) => { if (internalLinkMatcher.test(href)) { return ( <NextLink href={href} key="link" locale={false}> - <a - title={value.title} - target={value.target} - className={value.class} - {...htmlLinkProps} - > + <a title={value.title} target={value.target} className={value.class} {...htmlLinkProps}> {text} {props.children} </a> diff --git a/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx index a9e8fe7f4c..23fcf665e4 100644 --- a/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx +++ b/packages/sitecore-jss-nextjs/src/components/RichText.test.tsx @@ -92,7 +92,8 @@ describe('RichText', () => { const props = { field: { - value: '<div id="test"><h1>Hello!</h1><a href="/testpath/t1">t1</a><a href="/t2">t2</a></div>', + value: + '<div id="test"><h1>Hello!</h1><a href="/testpath/t1">t1</a><a href="/t2">t2</a></div>', }, 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 8a36d0622e..5b96135498 100644 --- a/packages/sitecore-jss-nextjs/src/components/RichText.tsx +++ b/packages/sitecore-jss-nextjs/src/components/RichText.tsx @@ -10,7 +10,7 @@ import { export type RichTextProps = ReactRichTextProps & { /** * Selector which should be used in order to prefetch it and attach event listeners - * @defaultvalue 'a[href^="/"]' + * @defaultvalue 'a[href^="/"]' */ internalLinksSelector?: string; }; diff --git a/packages/sitecore-jss-nextjs/src/index.ts b/packages/sitecore-jss-nextjs/src/index.ts index bf7370638e..4434f76dec 100644 --- a/packages/sitecore-jss-nextjs/src/index.ts +++ b/packages/sitecore-jss-nextjs/src/index.ts @@ -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 5ed01fca31..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 @@ -33,13 +33,13 @@ describe('ComponentPropsService', () => { x14ph: [ rendering('x16', 'MyCustomComponent'), rendering('x161', 'MyCustomComponent'), - rendering('x17') + rendering('x17'), ], }, - } + }, ], }, - } + }, ], x21ph: [ rendering('x21'), @@ -49,7 +49,7 @@ describe('ComponentPropsService', () => { x22ph: [rendering('x23', 'MyCustomComponent')], }, }, - rendering('x24') + rendering('x24'), ], }; @@ -279,7 +279,7 @@ describe('ComponentPropsService', () => { rendering: { uid: 'x24', componentName: 'namex24' }, layoutData, context, - } + }, ]); }); @@ -288,7 +288,7 @@ describe('ComponentPropsService', () => { const requests: ComponentPropsRequest<CustomContext>[] = [ req(11, 'x1'), req(22, 'x2'), - req(33, 'x3') + req(33, 'x3'), ]; const result = await service.execRequests(requests); @@ -331,7 +331,7 @@ describe('ComponentPropsService', () => { const requests: ComponentPropsRequest<CustomContext>[] = [ req(11, 'x1'), req(null, 'x2', 'You do not have access rights to load data for this component'), - req(33, 'x3') + req(33, 'x3'), ]; const result = await service.execRequests(requests); @@ -376,7 +376,7 @@ describe('ComponentPropsService', () => { const requests: ComponentPropsRequest<CustomContext>[] = [ req(11, 'x1'), req(22, undefined), - req(33, 'x3') + req(33, 'x3'), ]; const result = await service.execRequests(requests); @@ -425,7 +425,7 @@ describe('ComponentPropsService', () => { rendering('22'), rendering('111'), rendering('222'), - rendering('333') + rendering('333'), ]); }); 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 5b227a2b0e..198a21b4a7 100644 --- a/packages/sitecore-jss-nextjs/src/services/component-props-service.ts +++ b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts @@ -79,7 +79,7 @@ export class ComponentPropsService { /** * Editing mode * Fetch component props using getInitialProps function - * @param {FetchComponentPropsArguments<NextPageContext>} params + * @param {FetchComponentPropsArguments<NextPageContext>} params */ async fetchInitialComponentProps( params: FetchComponentPropsArguments<NextPageContext> 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 70c6c398ca..6435d1450c 100644 --- a/packages/sitecore-jss-nextjs/src/testData/ee-data.ts +++ b/packages/sitecore-jss-nextjs/src/testData/ee-data.ts @@ -126,7 +126,7 @@ export const convertedData = { hintname: 'page-header', class: 'scpm', }, - } + }, ], 'page-content': [ { @@ -209,7 +209,7 @@ export const convertedData = { hintname: 'page-content', class: 'scpm', }, - } + }, ], }, }, @@ -238,13 +238,14 @@ export const convertedData = { hintname: 'main', class: 'scpm', }, - } + }, ], }, fields: { key: { value: '', - editable: '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', + editable: + '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', }, }, }, diff --git a/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts b/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts index 3920163289..cd1a7d4a31 100644 --- a/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-nextjs/src/testData/non-ee-data.ts @@ -35,7 +35,7 @@ export const convertedDevData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -47,10 +47,10 @@ export const convertedDevData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { @@ -107,7 +107,7 @@ export const convertedLayoutServiceData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -120,10 +120,10 @@ export const convertedLayoutServiceData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { diff --git a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts index 66661b2e38..8ddb12124c 100644 --- a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts @@ -13,11 +13,14 @@ const jsDomWindow = jsdom.window; 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-proxy/src/ProxyConfig.ts b/packages/sitecore-jss-proxy/src/ProxyConfig.ts index 2585a3c05f..0d4759d235 100644 --- a/packages/sitecore-jss-proxy/src/ProxyConfig.ts +++ b/packages/sitecore-jss-proxy/src/ProxyConfig.ts @@ -43,8 +43,8 @@ export interface ProxyConfig { response: ServerResponse, proxyResponse: IncomingMessage, layoutServiceData: any - // eslint-disable-next-line @typescript-eslint/ban-types - ) => Promise<object>; + ) => // eslint-disable-next-line @typescript-eslint/ban-types + Promise<object>; /** Hook to alter HTTP headers in a custom way. */ setHeaders?: ( request: IncomingMessage, diff --git a/packages/sitecore-jss-proxy/src/RouteUrlParser.ts b/packages/sitecore-jss-proxy/src/RouteUrlParser.ts index 827a7b4ac3..8b6b5e69f5 100644 --- a/packages/sitecore-jss-proxy/src/RouteUrlParser.ts +++ b/packages/sitecore-jss-proxy/src/RouteUrlParser.ts @@ -1 +1,3 @@ -export type RouteUrlParser = (url: string) => { sitecoreRoute?: string; lang?: string; qsParams?: string }; +export type RouteUrlParser = ( + url: string +) => { sitecoreRoute?: string; lang?: string; qsParams?: string }; diff --git a/packages/sitecore-jss-proxy/src/index.test.ts b/packages/sitecore-jss-proxy/src/index.test.ts index 5729dbe43f..d4d0f35d70 100644 --- a/packages/sitecore-jss-proxy/src/index.test.ts +++ b/packages/sitecore-jss-proxy/src/index.test.ts @@ -7,7 +7,7 @@ describe('removeEmptyAnalyticsCookie', () => { const mockResponse = { headers: { 'set-cookie': [ - 'SC_ANALYTICS_GLOBAL_COOKIE=; expires=Wed, 17-Mar-2027 14:28:58 GMT; path=/; HttpOnly' + 'SC_ANALYTICS_GLOBAL_COOKIE=; expires=Wed, 17-Mar-2027 14:28:58 GMT; path=/; HttpOnly', ], }, }; @@ -98,7 +98,8 @@ describe('rewriteRequestPath', () => { it('should return route prefixed with layout service route and with querystring appended that contains percentage symbol', () => { const url = '/styleguide?x=%25'; - const expected = '/sitecore/layoutsvc/render/jss?item=%2Fstyleguide&sc_apikey={GUID}&x=%25&y=test'; + const expected = + '/sitecore/layoutsvc/render/jss?item=%2Fstyleguide&sc_apikey={GUID}&x=%25&y=test'; const mockRequest = { query: { x: '%', diff --git a/packages/sitecore-jss-proxy/src/index.ts b/packages/sitecore-jss-proxy/src/index.ts index 6fca590539..6b2747c034 100644 --- a/packages/sitecore-jss-proxy/src/index.ts +++ b/packages/sitecore-jss-proxy/src/index.ts @@ -88,7 +88,6 @@ async function renderAppToResponse( return true; }; - async function extractLayoutServiceDataFromProxyResponse(): Promise<any> { if ( proxyResponse.statusCode === HttpStatus.OK || @@ -428,9 +427,15 @@ function isUrlIgnored(originalUrl: string, config: ProxyConfig, noDebug = false) return false; } -function handleProxyRequest(proxyReq: any, req: any, res: ServerResponse, config: ProxyConfig, - customOnProxyReq: ((proxyReq: ClientRequest, req: IncomingMessage, res: ServerResponse) => void) | undefined) { - +function handleProxyRequest( + proxyReq: any, + req: any, + res: ServerResponse, + config: ProxyConfig, + customOnProxyReq: + | ((proxyReq: ClientRequest, req: IncomingMessage, res: ServerResponse) => void) + | undefined +) { // if a HEAD request, we still need to issue a GET so we can return accurate headers // proxyReq defined as 'any' to allow us to mutate this if (proxyReq.method === 'HEAD' && !isUrlIgnored(req.originalUrl, config, true)) { @@ -473,7 +478,8 @@ function createOptions( ws: true, pathRewrite: (reqPath, req) => rewriteRequestPath(reqPath, req, config, parseRouteUrl), logLevel: config.debug ? 'debug' : 'info', - onProxyReq: (proxyReq, req, res) => handleProxyRequest(proxyReq, req, res, config, customOnProxyReq), + onProxyReq: (proxyReq, req, res) => + handleProxyRequest(proxyReq, req, res, config, customOnProxyReq), onProxyRes: (proxyRes, req, res) => handleProxyResponse(proxyRes, req, res, renderer, config), }; } diff --git a/packages/sitecore-jss-react-forms/src/FieldProps.ts b/packages/sitecore-jss-react-forms/src/FieldProps.ts index 3b6547a24f..6fe6b739eb 100644 --- a/packages/sitecore-jss-react-forms/src/FieldProps.ts +++ b/packages/sitecore-jss-react-forms/src/FieldProps.ts @@ -1,5 +1,11 @@ import { ReactNode, ComponentType } from 'react'; -import { FormField, ValueFormField, ListViewModel, InputViewModel, FormTracker } from '@sitecore-jss/sitecore-jss-forms'; +import { + FormField, + ValueFormField, + ListViewModel, + InputViewModel, + FormTracker, +} from '@sitecore-jss/sitecore-jss-forms'; export interface FieldProps<TFormField extends FormField = FormField> { /** Form field schema data */ @@ -12,7 +18,10 @@ export interface FieldProps<TFormField extends FormField = FormField> { key?: string; } -export interface FieldWithValueProps<TFormField extends FormField = FormField, TValueType extends string | string[] = string> extends FieldProps<TFormField> { +export interface FieldWithValueProps< + TFormField extends FormField = FormField, + TValueType extends string | string[] = string +> extends FieldProps<TFormField> { /** Form field schema data */ field: TFormField; /** The current value of the form field */ @@ -40,10 +49,23 @@ export interface FieldWithValueProps<TFormField extends FormField = FormField, T key?: string; } -export type FieldChangeCallback = (fieldName: string, newValue: string | string[] | File[], isValid: boolean, errorMessages: string[]) => void; +export type FieldChangeCallback = ( + fieldName: string, + newValue: string | string[] | File[], + isValid: boolean, + errorMessages: string[] +) => void; -export type ListFieldProps<TViewModel extends ListViewModel = ListViewModel> = FieldWithValueProps<ValueFormField<TViewModel>, string[]>; -export type ValueFieldProps<TViewModel extends InputViewModel = InputViewModel> = FieldWithValueProps<ValueFormField<TViewModel>>; +export type ListFieldProps<TViewModel extends ListViewModel = ListViewModel> = FieldWithValueProps< + ValueFormField<TViewModel>, + string[] +>; +export type ValueFieldProps< + TViewModel extends InputViewModel = InputViewModel +> = FieldWithValueProps<ValueFormField<TViewModel>>; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type LabelProps<TViewModel extends InputViewModel = InputViewModel> = FieldWithValueProps<ValueFormField<TViewModel>, any>; +export type LabelProps<TViewModel extends InputViewModel = InputViewModel> = FieldWithValueProps< + ValueFormField<TViewModel>, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + any +>; diff --git a/packages/sitecore-jss-react-forms/src/components/default-error.tsx b/packages/sitecore-jss-react-forms/src/components/default-error.tsx index b8a0f36167..3f6a387595 100644 --- a/packages/sitecore-jss-react-forms/src/components/default-error.tsx +++ b/packages/sitecore-jss-react-forms/src/components/default-error.tsx @@ -10,7 +10,9 @@ const DefaultError = (props: ErrorComponentProps) => ( ))} {props.fieldErrors.map((error, index) => ( <div className="invalid" key={`fieldError-${index}`}> - {error.state.errors.map(message => <div key={message}>{message}</div>)} + {error.state.errors.map((message) => ( + <div key={message}>{message}</div> + ))} </div> ))} </div> diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/button.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/button.tsx index 3ab3a02add..cb12df3526 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/button.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/button.tsx @@ -6,10 +6,7 @@ import { ButtonFormField } from '@sitecore-jss/sitecore-jss-forms'; // it signals to the parent form which button invoked the submit action // (which is important for multi-step forms where multiple submits can occur i.e. back/forward) -const Button: React.FunctionComponent<FieldProps<ButtonFormField>> = ({ - field, - onButtonClick, -}) => ( +const Button: React.FunctionComponent<FieldProps<ButtonFormField>> = ({ field, onButtonClick }) => ( <Fragment> <button type="submit" diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx index db4d53123a..ece0ba5409 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.test.tsx @@ -37,7 +37,7 @@ describe('<FileUpload />', () => { validationDataModels: [ { itemId: 'xxx', message: 'xxx_message', name: 'xxx_name' }, { itemId: 'yyy', message: 'yyy_message', name: 'yyy_name' }, - { itemId: 'zzz', message: 'zzz_message', name: 'zzz_name' } + { itemId: 'zzz', message: 'zzz_message', name: 'zzz_name' }, ], }, indexField: { diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx index 138d76a1e1..f9d5c6fb24 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/file-upload.tsx @@ -22,14 +22,20 @@ class FileUpload extends Component<ValueFieldProps<FileInputViewModel>> { } getEnabledValidation(itemId: string) { - return this.props.field.model.validationDataModels.find(validation => validation.itemId === itemId); + return this.props.field.model.validationDataModels.find( + (validation) => validation.itemId === itemId + ); } getFileSizeUnitName(value: number): string { return this.SIZE_UNITS[value]; } - onChangeField = (files: FileList | null, field: ValueFormField<FileInputViewModel>, cb: FieldChangeCallback) => { + onChangeField = ( + files: FileList | null, + field: ValueFormField<FileInputViewModel>, + cb: FieldChangeCallback + ) => { const fileSizeValidator = this.getEnabledValidation(ValidationDataModels.FileSizeValidator); const fileCountValidator = this.getEnabledValidation(ValidationDataModels.FileCountValidator); const fileTypeValidator = this.getEnabledValidation(ValidationDataModels.FileTypeValidator); @@ -39,24 +45,26 @@ class FileUpload extends Component<ValueFieldProps<FileInputViewModel>> { let valid = true; if (files) { - Array(files.length).fill(null).forEach((_, idx) => { - const fileSize = files[idx].size / field.model.fileSizeUnit; - - if (valid && fileSizeValidator && (fileSize > field.model.maxFileSize)) { - const msg = fileSizeValidator.message - .replace('{0}', field.model.maxFileSize.toString()) - .replace('{1}', this.getFileSizeUnitName(field.model.fileSizeUnit)); - - errorMessages.push(msg); - valid = false; - } - - list.push(files[idx]); - }); + Array(files.length) + .fill(null) + .forEach((_, idx) => { + const fileSize = files[idx].size / field.model.fileSizeUnit; + + if (valid && fileSizeValidator && fileSize > field.model.maxFileSize) { + const msg = fileSizeValidator.message + .replace('{0}', field.model.maxFileSize.toString()) + .replace('{1}', this.getFileSizeUnitName(field.model.fileSizeUnit)); + + errorMessages.push(msg); + valid = false; + } + + list.push(files[idx]); + }); } if (fileTypeValidator) { - list.some(file => { + list.some((file) => { const ext = file.name.split('.').pop() || ''; if (field.model.allowedContentTypes.indexOf(ext) !== -1) { diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/section.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/section.tsx index aac8404d92..c193be6b9a 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/section.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/section.tsx @@ -5,10 +5,6 @@ import { FormFieldSection } from '@sitecore-jss/sitecore-jss-forms'; const Section: React.FunctionComponent<FieldProps<FormFieldSection>> = ({ field, fieldFactory, -}) => ( - <fieldset className={field.model.cssClass}> - {field.fields.map(fieldFactory)} - </fieldset> -); +}) => <fieldset className={field.model.cssClass}>{field.fields.map(fieldFactory)}</fieldset>; export default Section; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx index 0c53c3861a..9ad9c6d463 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/text.tsx @@ -2,7 +2,9 @@ import React from 'react'; import { FieldWithValueProps } from '../../FieldProps'; import { FormField, TextViewModel } from '@sitecore-jss/sitecore-jss-forms'; -const TextField: React.FunctionComponent<FieldWithValueProps<FormField<TextViewModel>, string>> = ({ field }) => { +const TextField: React.FunctionComponent<FieldWithValueProps<FormField<TextViewModel>, string>> = ({ + field, +}) => { const Tag = (field.model.htmlTag || 'p') as keyof JSX.IntrinsicElements; return <Tag className={field.model.cssClass}>{field.model.text}</Tag>; diff --git a/packages/sitecore-jss-react-forms/src/components/form.tsx b/packages/sitecore-jss-react-forms/src/components/form.tsx index 2be3cc67ed..68cc703559 100644 --- a/packages/sitecore-jss-react-forms/src/components/form.tsx +++ b/packages/sitecore-jss-react-forms/src/components/form.tsx @@ -18,7 +18,7 @@ import { DefaultError } from './default-error'; export interface ErrorComponentProps { form: SitecoreForm; formErrors: string[]; - fieldErrors: Array<{ fieldName: string, state: FieldState }>; + fieldErrors: Array<{ fieldName: string; state: FieldState }>; } export interface FormProps { @@ -73,7 +73,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> // the form passed in from props if present nextForm: null, submitButton: null, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any; // workaround index type limitations in TS this.createFieldComponent = this.createFieldComponent.bind(this); @@ -90,20 +90,24 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> const form = this.state.nextForm || this.props.form; if (!form) { - return (<div>No form data was provided. Need to set a datasource?</div>); + return <div>No form data was provided. Need to set a datasource?</div>; } if (!form.metadata) { - return (<div>Form data invalid. Forget to set the rendering contents resolver?</div>); + return <div>Form data invalid. Forget to set the rendering contents resolver?</div>; } const action = `${this.props.sitecoreApiHost}/api/jss/formbuilder?fxb.FormItemId=${form.metadata.itemId}&fxb.HtmlPrefix=${form.htmlPrefix}&sc_apikey=${this.props.sitecoreApiKey}&sc_itemid=${form.contextItemId}`; - this._tracker.setFormData(form.formItemId.value, form.formSessionId.value, form.metadata.isTrackingEnabled); + this._tracker.setFormData( + form.formItemId.value, + form.formSessionId.value, + form.metadata.isTrackingEnabled + ); const fieldComponents = form.fields.map(this.createFieldComponent); const ErrorComponent = this.props.errorComponent || DefaultError; - const fieldErrors = this.collectCurrentFieldValues().filter(field => !field.state.isValid); + const fieldErrors = this.collectCurrentFieldValues().filter((field) => !field.state.isValid); return ( <form action={action} method="POST" onSubmit={this.onSubmit.bind(this)}> @@ -206,7 +210,12 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> * @param {boolean} isValid Whether the field is valid or not * @param {string[]} errors Validation error message(s) if field is invalid */ - onFieldChange(key: string, value: string | string[] | File[], isValid: boolean, errors: string[]) { + onFieldChange( + key: string, + value: string | string[] | File[], + isValid: boolean, + errors: string[] + ) { this.setState({ [key]: { value, isValid, errors }, }); @@ -226,7 +235,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> const currentFieldValues = this.collectCurrentFieldValues(); - currentFieldValues.forEach(field => { + currentFieldValues.forEach((field) => { if (typeof field.state.value !== 'undefined') { fieldValues[field.fieldName] = field.state.value; } @@ -301,7 +310,9 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection> collectCurrentFieldValues() { return Object.keys(this.state) - .filter((fieldName) => this.state[fieldName] && typeof this.state[fieldName].isValid !== 'undefined') + .filter( + (fieldName) => this.state[fieldName] && typeof this.state[fieldName].isValid !== 'undefined' + ) .map((fieldName) => ({ fieldName: fieldName, state: this.state[fieldName] as FieldState })); } diff --git a/packages/sitecore-jss-react-forms/src/field-factory.tsx b/packages/sitecore-jss-react-forms/src/field-factory.tsx index fdcd87f551..06abbcdf8d 100644 --- a/packages/sitecore-jss-react-forms/src/field-factory.tsx +++ b/packages/sitecore-jss-react-forms/src/field-factory.tsx @@ -19,7 +19,9 @@ class FieldFactory { constructor() { // eslint-disable-next-line react/display-name this._defaultComponent = (props: FormField) => ( - <div key={props.model.fieldTypeItemId}>{props.model.name}: No renderer for form element type {props.model.fieldTypeItemId}</div> + <div key={props.model.fieldTypeItemId}> + {props.model.name}: No renderer for form element type {props.model.fieldTypeItemId} + </div> ); } diff --git a/packages/sitecore-jss-react-forms/src/index.ts b/packages/sitecore-jss-react-forms/src/index.ts index 86ad19ac1b..4bcb7f7275 100644 --- a/packages/sitecore-jss-react-forms/src/index.ts +++ b/packages/sitecore-jss-react-forms/src/index.ts @@ -1,4 +1,11 @@ -import { FieldProps, FieldChangeCallback, ListFieldProps, ValueFieldProps, FieldWithValueProps, LabelProps } from './FieldProps'; +import { + FieldProps, + FieldChangeCallback, + ListFieldProps, + ValueFieldProps, + FieldWithValueProps, + LabelProps, +} from './FieldProps'; import FieldFactory from './field-factory'; import { Form, FormProps, ErrorComponentProps } from './components/form'; import Button from './components/field-templates/button'; @@ -41,7 +48,6 @@ export { Telephone, TextField, Form, - FormProps, ErrorComponentProps, FieldFactory, @@ -53,6 +59,5 @@ export { LabelProps, FieldTypes, ValidationDataModels, - createDefaultFieldFactory, }; diff --git a/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts b/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts index a160ddd7d1..56a76a18e9 100644 --- a/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts @@ -11,11 +11,14 @@ const jsDomWindow = jsdom.window; 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-react-native/src/components/Date.tsx b/packages/sitecore-jss-react-native/src/components/Date.tsx index 2c7355c93b..891e2f9b74 100644 --- a/packages/sitecore-jss-react-native/src/components/Date.tsx +++ b/packages/sitecore-jss-react-native/src/components/Date.tsx @@ -40,9 +40,7 @@ export const DateField: React.FunctionComponent<DateFieldProps> = ({ if (field.editable && editable) { return <HtmlView value={children as string} {...otherProps} />; } - return render - ? <>{children}</> - : <Text>{children}</Text>; + return render ? <>{children}</> : <Text>{children}</Text>; }; DateField.propTypes = { diff --git a/packages/sitecore-jss-react-native/src/components/Image.tsx b/packages/sitecore-jss-react-native/src/components/Image.tsx index 633648babb..6e9ead595a 100644 --- a/packages/sitecore-jss-react-native/src/components/Image.tsx +++ b/packages/sitecore-jss-react-native/src/components/Image.tsx @@ -29,11 +29,9 @@ export interface ImageProps { /** * Parameters that will be attached to Sitecore media URLs */ - imageUrlParams?: - | { + imageUrlParams?: { [paramName: string]: string; - } - | null; + } | null; } const getImageAttrs = ( @@ -108,7 +106,9 @@ export const Image: React.SFC<ImageProps> = ({ media, imageUrlParams, field, ... } // some wise-guy/gal might pass in a 'raw' image object value - const img = (dynamicMedia as ImageFieldValue).src ? dynamicMedia : (dynamicMedia as ImageField).value; + const img = (dynamicMedia as ImageFieldValue).src + ? dynamicMedia + : (dynamicMedia as ImageField).value; if (!img) { return null; } @@ -129,7 +129,7 @@ Image.propTypes = { }), PropTypes.shape({ value: PropTypes.object, - }) + }), ]), imageUrlParams: PropTypes.any, }; diff --git a/packages/sitecore-jss-react-native/src/components/Link.tsx b/packages/sitecore-jss-react-native/src/components/Link.tsx index ce791e832f..b273a6c9ab 100644 --- a/packages/sitecore-jss-react-native/src/components/Link.tsx +++ b/packages/sitecore-jss-react-native/src/components/Link.tsx @@ -46,7 +46,12 @@ export const Link: React.FunctionComponent<LinkProps> = ({ }) => { const dynamicField = field; - if (!field || (!dynamicField.editableFirstPart && !dynamicField.value && !(dynamicField as LinkFieldValue).href)) { + if ( + !field || + (!dynamicField.editableFirstPart && + !dynamicField.value && + !(dynamicField as LinkFieldValue).href) + ) { return null; } @@ -84,7 +89,11 @@ export const Link: React.FunctionComponent<LinkProps> = ({ const linkText = showLinkTextWithChildrenPresent || !children ? link.text || link.href : null; resultTags.push( - <TouchableWithoutFeedback onPress={() => link.href && Linking.openURL(link.href)} key="link" {...otherProps}> + <TouchableWithoutFeedback + onPress={() => link.href && Linking.openURL(link.href)} + key="link" + {...otherProps} + > <View style={style}> {linkText && <Text style={textStyle}>{linkText}</Text>} {children} @@ -104,7 +113,7 @@ Link.propTypes = { value: PropTypes.object, editableFirstPart: PropTypes.string, editableLastPart: PropTypes.string, - }) + }), ]).isRequired, editable: PropTypes.bool, }; diff --git a/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx b/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx index b3b5696897..2ae439213d 100644 --- a/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx +++ b/packages/sitecore-jss-react-native/src/components/PlaceholderCommon.tsx @@ -131,9 +131,7 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { // register a warning instead. if (!componentRendering.componentName && htmlElementRendering.name) { console.error( - `Placeholder ${name} contains a rendering that cannot be rendered in React Native '${ - htmlElementRendering.name - }'. This is likely the result of including Experience Editor output in rendering data + `Placeholder ${name} contains a rendering that cannot be rendered in React Native '${htmlElementRendering.name}'. This is likely the result of including Experience Editor output in rendering data or using non-JSON renderings in an item's presentation details / layout. React Native is not able to render DOM elements, your Sitecore renderings must map to React components defined in your componentFactory.js.` @@ -145,9 +143,7 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { component = this.getComponentForRendering(componentRendering); if (!component) { console.error( - `Placeholder ${name} contains unknown component ${ - componentRendering.componentName - }. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.` + `Placeholder ${name} contains unknown component ${componentRendering.componentName}. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.` ); component = missingComponentComponent || MissingComponent; @@ -166,7 +162,10 @@ export class PlaceholderCommon extends React.Component<PlaceholderProps> { rendering, }; - return React.createElement<{ [attr: string]: unknown }>(component as React.ComponentType, finalProps); + return React.createElement<{ [attr: string]: unknown }>( + component as React.ComponentType, + finalProps + ); }) .filter((element: React.ReactNode) => element) ); // remove nulls diff --git a/packages/sitecore-jss-react-native/src/dataConversion.ts b/packages/sitecore-jss-react-native/src/dataConversion.ts index 4ebdc0ef2d..5abde30245 100644 --- a/packages/sitecore-jss-react-native/src/dataConversion.ts +++ b/packages/sitecore-jss-react-native/src/dataConversion.ts @@ -14,11 +14,7 @@ const isComponentRendering = (element: unknown) => (element as ComponentRenderin * @returns {Object} prop data in layout service format */ export const convertPropDataToLayoutServiceFormat = ( - propData: - | { - [name: string]: Field | Item | Item[] | undefined; - } - | undefined + propData: { [name: string]: Field | Item | Item[] | undefined } | undefined ): { [name: string]: Field } => { if (!propData) { return {}; @@ -102,31 +98,28 @@ export const convertRouteToLayoutServiceFormat = (routeData: RouteData) => { return {}; } - return Object.keys(placeholders).reduce( - (result, placeholderName) => { - const placeholder = placeholders[placeholderName]; - const elements = placeholder.map((element) => { - if (isComponentRendering(element)) { - const componentRendering = element as ComponentRendering; - // https://stackoverflow.com/a/40560953/9324 - return { - ...componentRendering, - ...(componentRendering.placeholders && { - placeholders: transformPlaceholders(componentRendering.placeholders), - }), - ...(componentRendering.params && { params: componentRendering.params }), - ...(componentRendering.fields && { - fields: convertPropDataToLayoutServiceFormat(componentRendering.fields), - }), - }; - } - return element; - }); - result[placeholderName] = elements; - return result; - }, - {} as PlaceholdersData - ); + return Object.keys(placeholders).reduce((result, placeholderName) => { + const placeholder = placeholders[placeholderName]; + const elements = placeholder.map((element) => { + if (isComponentRendering(element)) { + const componentRendering = element as ComponentRendering; + // https://stackoverflow.com/a/40560953/9324 + return { + ...componentRendering, + ...(componentRendering.placeholders && { + placeholders: transformPlaceholders(componentRendering.placeholders), + }), + ...(componentRendering.params && { params: componentRendering.params }), + ...(componentRendering.fields && { + fields: convertPropDataToLayoutServiceFormat(componentRendering.fields), + }), + }; + } + return element; + }); + result[placeholderName] = elements; + return result; + }, {} as PlaceholdersData); }; const transformedPlaceholders = transformPlaceholders(routeData.placeholders); diff --git a/packages/sitecore-jss-react/src/components/Date.tsx b/packages/sitecore-jss-react/src/components/Date.tsx index f2b448bd08..9cb03c61b8 100644 --- a/packages/sitecore-jss-react/src/components/Date.tsx +++ b/packages/sitecore-jss-react/src/components/Date.tsx @@ -18,10 +18,18 @@ export interface DateFieldProps { * @default true */ editable?: boolean; - render?: (date: Date | null) => React.ComponentClass<unknown> | React.FunctionComponent<unknown> | React.ReactNode; + render?: ( + date: Date | null + ) => React.ComponentClass<unknown> | React.FunctionComponent<unknown> | React.ReactNode; } -export const DateField: React.SFC<DateFieldProps> = ({ field, tag, editable, render, ...otherProps }) => { +export const DateField: React.SFC<DateFieldProps> = ({ + field, + tag, + editable, + render, + ...otherProps +}) => { if (!field || (!field.editable && !field.value)) { return null; } @@ -29,8 +37,8 @@ export const DateField: React.SFC<DateFieldProps> = ({ field, tag, editable, ren let children: React.ComponentType | React.ReactNode; const htmlProps: { - [htmlAttr: string]: unknown, - children?: React.ReactNode + [htmlAttr: string]: unknown; + children?: React.ReactNode; } = { ...otherProps, }; diff --git a/packages/sitecore-jss-react/src/components/File.tsx b/packages/sitecore-jss-react/src/components/File.tsx index d3f20e2323..cafb2ed595 100644 --- a/packages/sitecore-jss-react/src/components/File.tsx +++ b/packages/sitecore-jss-react/src/components/File.tsx @@ -17,7 +17,7 @@ export interface FileProps { /** The file field data. */ field: FileFieldValue | FileField; /** HTML attributes that will be appended to the rendered <a /> tag. */ - children?: React.ReactNode[] + children?: React.ReactNode[]; } export const File: React.SFC<FileProps> = ({ field, children, ...otherProps }) => { @@ -32,7 +32,9 @@ export const File: React.SFC<FileProps> = ({ field, children, ...otherProps }) = } // handle link directly on field for forgetful devs - const file = ((dynamicField as FileFieldValue).src ? field : dynamicField.value) as FileFieldValue; + const file = ((dynamicField as FileFieldValue).src + ? field + : dynamicField.value) as FileFieldValue; if (!file) { return null; } @@ -51,7 +53,7 @@ File.propTypes = { }), PropTypes.shape({ value: PropTypes.object, - }) + }), ]).isRequired, children: PropTypes.array, }; diff --git a/packages/sitecore-jss-react/src/components/Image.test.tsx b/packages/sitecore-jss-react/src/components/Image.test.tsx index 67a37bb983..c72d517f5d 100644 --- a/packages/sitecore-jss-react/src/components/Image.test.tsx +++ b/packages/sitecore-jss-react/src/components/Image.test.tsx @@ -60,7 +60,9 @@ describe('<Image />', () => { it('should render <img /> with needed img tags', () => { expect(rendered).to.have.length(1); expect(rendered.prop('src')).to.equal(props.media.src); - expect(rendered.prop('srcSet')).to.equal('/assets/img/test0.png?mw=100 100w, /assets/img/test0.png?mw=300 300w'); + expect(rendered.prop('srcSet')).to.equal( + '/assets/img/test0.png?mw=100 100w, /assets/img/test0.png?mw=300 300w' + ); expect(rendered.prop('sizes')).to.equal('(min-width: 960px) 300px, 100px'); }); diff --git a/packages/sitecore-jss-react/src/components/Image.tsx b/packages/sitecore-jss-react/src/components/Image.tsx index fc365ef836..6a0f5e54d3 100644 --- a/packages/sitecore-jss-react/src/components/Image.tsx +++ b/packages/sitecore-jss-react/src/components/Image.tsx @@ -104,19 +104,10 @@ const getImageAttrs = ( }; // update image URL for jss handler and image rendering params - const resolvedSrc = mediaApi.updateImageUrl( - src, - imageParams, - mediaUrlPrefix - ); + const resolvedSrc = mediaApi.updateImageUrl(src, imageParams, mediaUrlPrefix); if (srcSet) { // replace with HTML-formatted srcset, including updated image URLs - newAttrs.srcSet = mediaApi.getSrcSet( - resolvedSrc, - srcSet, - imageParams, - mediaUrlPrefix - ); + newAttrs.srcSet = mediaApi.getSrcSet(resolvedSrc, srcSet, imageParams, mediaUrlPrefix); } // always output original src as fallback for older browsers newAttrs.src = resolvedSrc; @@ -138,7 +129,10 @@ export const Image: React.SFC<ImageProps> = ({ const dynamicMedia = media as ImageField | ImageFieldValue; - if (!media || (!dynamicMedia.editable && !dynamicMedia.value && !(dynamicMedia as ImageFieldValue).src)) { + if ( + !media || + (!dynamicMedia.editable && !dynamicMedia.value && !(dynamicMedia as ImageFieldValue).src) + ) { return null; } @@ -154,7 +148,11 @@ export const Image: React.SFC<ImageProps> = ({ const foundImgProps = convertAttributesToReactProps(foundImg.attrs); // Note: otherProps may override values from foundImgProps, e.g. `style`, `className` prop // We do not attempt to merge. - const imgAttrs = getImageAttrs({ ...foundImgProps, ...otherProps }, imageParams, mediaUrlPrefix); + const imgAttrs = getImageAttrs( + { ...foundImgProps, ...otherProps }, + imageParams, + mediaUrlPrefix + ); if (!imgAttrs) { return getEditableWrapper(imageField.editable); } @@ -165,7 +163,9 @@ export const Image: React.SFC<ImageProps> = ({ } // some wise-guy/gal is passing in a 'raw' image object value - const img = (dynamicMedia as ImageFieldValue).src ? media : dynamicMedia.value as ImageFieldValue; + const img = (dynamicMedia as ImageFieldValue).src + ? media + : (dynamicMedia.value as ImageFieldValue); if (!img) { return null; } @@ -186,7 +186,7 @@ Image.propTypes = { PropTypes.shape({ value: PropTypes.object, editable: PropTypes.string, - }) + }), ]), field: PropTypes.oneOfType([ PropTypes.shape({ @@ -195,14 +195,13 @@ Image.propTypes = { PropTypes.shape({ value: PropTypes.object, editable: PropTypes.string, - }) + }), ]), editable: PropTypes.bool, mediaUrlPrefix: PropTypes.instanceOf(RegExp), - imageParams: PropTypes.objectOf(PropTypes.oneOfType([ - PropTypes.number.isRequired, - PropTypes.string.isRequired - ]).isRequired), + imageParams: PropTypes.objectOf( + PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.string.isRequired]).isRequired + ), }; Image.defaultProps = { diff --git a/packages/sitecore-jss-react/src/components/Link.tsx b/packages/sitecore-jss-react/src/components/Link.tsx index 9230287b89..dfcdf91490 100644 --- a/packages/sitecore-jss-react/src/components/Link.tsx +++ b/packages/sitecore-jss-react/src/components/Link.tsx @@ -17,7 +17,10 @@ export interface LinkField { editableLastPart?: string; } -export type LinkProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & { +export type LinkProps = React.DetailedHTMLProps< + React.AnchorHTMLAttributes<HTMLAnchorElement>, + HTMLAnchorElement +> & { /** The link field data. */ field: LinkField | LinkFieldValue; /** @@ -34,10 +37,21 @@ export type LinkProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLA showLinkTextWithChildrenPresent?: boolean; }; -export const Link: React.SFC<LinkProps> = ({ field, editable, children, showLinkTextWithChildrenPresent, ...otherProps }) => { +export const Link: React.SFC<LinkProps> = ({ + field, + editable, + children, + showLinkTextWithChildrenPresent, + ...otherProps +}) => { const dynamicField: LinkField | LinkFieldValue = field; - if (!field || (!dynamicField.editableFirstPart && !dynamicField.value && !(dynamicField as LinkFieldValue).href)) { + if ( + !field || + (!dynamicField.editableFirstPart && + !dynamicField.value && + !(dynamicField as LinkFieldValue).href) + ) { return null; } @@ -91,9 +105,11 @@ export const Link: React.SFC<LinkProps> = ({ field, editable, children, showLink anchorAttrs.rel = 'noopener noreferrer'; } - const linkText = showLinkTextWithChildrenPresent || !children ? (link.text || link.href) : null; + const linkText = showLinkTextWithChildrenPresent || !children ? link.text || link.href : null; - resultTags.push(React.createElement('a', { ...anchorAttrs, ...otherProps, key: 'link' }, linkText, children)); + resultTags.push( + React.createElement('a', { ...anchorAttrs, ...otherProps, key: 'link' }, linkText, children) + ); return <React.Fragment>{resultTags}</React.Fragment>; }; @@ -107,7 +123,7 @@ export const LinkPropTypes = { value: PropTypes.object, editableFirstPart: PropTypes.string, editableLastPart: PropTypes.string, - }) + }), ]).isRequired, editable: PropTypes.bool, children: PropTypes.node, diff --git a/packages/sitecore-jss-react/src/components/Placeholder.test.tsx b/packages/sitecore-jss-react/src/components/Placeholder.test.tsx index 6866c561e7..afa12fb8a7 100644 --- a/packages/sitecore-jss-react/src/components/Placeholder.test.tsx +++ b/packages/sitecore-jss-react/src/components/Placeholder.test.tsx @@ -59,7 +59,7 @@ describe('<Placeholder />', () => { const testData = [ { label: 'Dev data', data: nonEeDevData }, { label: 'LayoutService data - EE off', data: nonEeLsData }, - { label: 'LayoutService data - EE on', data: eeData } + { label: 'LayoutService data - EE on', data: eeData }, ]; testData.forEach((dataSet) => { @@ -131,11 +131,7 @@ describe('<Placeholder />', () => { const renderedComponent = mount( <SitecoreContext componentFactory={componentFactory}> - <Placeholder - name={phKey} - rendering={component} - render={() => null} - /> + <Placeholder name={phKey} rendering={component} render={() => null} /> </SitecoreContext> ); @@ -147,7 +143,9 @@ describe('<Placeholder />', () => { it('should render output based on the renderEmpty function in case of no renderings', () => { const component: any = dataSet.data.sitecore.route; - const renderings = component.placeholders.main.filter(({ componentName }: any) => !componentName); + const renderings = component.placeholders.main.filter( + ({ componentName }: any) => !componentName + ); const myComponent = { ...component, placeholders: { @@ -177,8 +175,8 @@ describe('<Placeholder />', () => { it('should pass properties to nested components', () => { const component = dataSet.data.sitecore.route as any; const phKey = 'main'; - const expectedMessage = (component.placeholders.main as any[]).find((c) => c.componentName).fields - .message; + const expectedMessage = (component.placeholders.main as any[]).find((c) => c.componentName) + .fields.message; const renderedComponent = mount( <SitecoreContext componentFactory={componentFactory}> @@ -218,7 +216,7 @@ describe('<Placeholder />', () => { main: [ { componentName: 'Home', - } + }, ], }, }; @@ -237,7 +235,7 @@ it('should render MissingComponent for unknown rendering', () => { main: [ { componentName: 'Unknown', - } + }, ], }, }; diff --git a/packages/sitecore-jss-react/src/components/Placeholder.tsx b/packages/sitecore-jss-react/src/components/Placeholder.tsx index 9594abddb9..0156d36a51 100644 --- a/packages/sitecore-jss-react/src/components/Placeholder.tsx +++ b/packages/sitecore-jss-react/src/components/Placeholder.tsx @@ -31,8 +31,13 @@ export interface PlaceholderComponentProps extends PlaceholderProps { ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; } -function isRawRendering(rendering: HtmlElementRendering | ComponentRendering): rendering is HtmlElementRendering { - return !(rendering as ComponentRendering).componentName && (rendering as HtmlElementRendering).name !== undefined; +function isRawRendering( + rendering: HtmlElementRendering | ComponentRendering +): rendering is HtmlElementRendering { + return ( + !(rendering as ComponentRendering).componentName && + (rendering as HtmlElementRendering).name !== undefined + ); } class PlaceholderComponent extends PlaceholderCommon<PlaceholderComponentProps> { @@ -61,10 +66,18 @@ class PlaceholderComponent extends PlaceholderCommon<PlaceholderComponentProps> const renderingData = childProps.rendering; - const placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData(renderingData, this.props.name); + const placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData( + renderingData, + this.props.name + ); const components = this.getComponentsForRenderingData(placeholderData); - if (this.props.renderEmpty && placeholderData.every((rendering: ComponentRendering | HtmlElementRendering) => isRawRendering(rendering))) { + if ( + this.props.renderEmpty && + placeholderData.every((rendering: ComponentRendering | HtmlElementRendering) => + isRawRendering(rendering) + ) + ) { return this.props.renderEmpty(components); } else if (this.props.render) { return this.props.render(components, placeholderData, childProps); diff --git a/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx b/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx index 2e18069fe0..32df87a867 100644 --- a/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx +++ b/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx @@ -2,7 +2,13 @@ import React, { ComponentType } from 'react'; import PropTypes, { Requireable } from 'prop-types'; import { MissingComponent } from '../components/MissingComponent'; import { ComponentFactory } from '../components/sharedTypes'; -import { ComponentRendering, RouteData, Field, Item, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; +import { + ComponentRendering, + RouteData, + Field, + Item, + HtmlElementRendering, +} from '@sitecore-jss/sitecore-jss'; import { convertAttributesToReactProps } from '../utils'; type ErrorComponentProps = { @@ -14,9 +20,7 @@ export interface PlaceholderProps { /** Name of the placeholder to render. */ name: string; /** Rendering data to be used when rendering the placeholder. */ - rendering: - | ComponentRendering - | RouteData; + rendering: ComponentRendering | RouteData; /** * A factory function that will receive a componentName and return an instance of a React component. * When rendered within a <SitecoreContext> component, defaults to the context componentFactory. @@ -27,9 +31,7 @@ export interface PlaceholderProps { * Any component or placeholder rendered by a placeholder will have access to this data via `props.fields`. */ fields?: { - [name: string]: - | Field - | Item[]; + [name: string]: Field | Item[]; }; /** * An object of rendering parameter names/values that are aggregated and propagated through the component tree created by a placeholder. @@ -56,20 +58,22 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone static propTypes = { rendering: PropTypes.oneOfType([ PropTypes.object as Requireable<RouteData>, - PropTypes.object as Requireable<ComponentRendering> + PropTypes.object as Requireable<ComponentRendering>, ]).isRequired, - fields: PropTypes.objectOf(PropTypes.oneOfType([ - PropTypes.object as Requireable<Field>, - PropTypes.object as Requireable<Item[]> - ]).isRequired), + fields: PropTypes.objectOf( + PropTypes.oneOfType([ + PropTypes.object as Requireable<Field>, + PropTypes.object as Requireable<Item[]>, + ]).isRequired + ), params: PropTypes.objectOf(PropTypes.string.isRequired), missingComponentComponent: PropTypes.oneOfType([ PropTypes.object as Requireable<React.ComponentClass<unknown>>, - PropTypes.func as Requireable<React.FC<unknown>> + PropTypes.func as Requireable<React.FC<unknown>>, ]), errorComponent: PropTypes.oneOfType([ PropTypes.object as Requireable<React.ComponentClass<unknown>>, - PropTypes.object as Requireable<React.SFC<unknown>> + PropTypes.object as Requireable<React.SFC<unknown>>, ]), }; @@ -85,7 +89,10 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone this.createRawElement = this.createRawElement.bind(this); } - static getPlaceholderDataFromRenderingData(rendering: ComponentRendering | RouteData, name: string) { + static getPlaceholderDataFromRenderingData( + rendering: ComponentRendering | RouteData, + name: string + ) { let result; if (rendering && rendering.placeholders && Object.keys(rendering.placeholders).length > 0) { result = rendering.placeholders[name]; @@ -126,51 +133,59 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone ...placeholderProps } = this.props; - return placeholderData.map((rendering: ComponentRendering | HtmlElementRendering, index: number) => { - const key = (rendering as ComponentRendering).uid - ? (rendering as ComponentRendering).uid - : `component-${index}`; - const commonProps = { key }; - - // if the element is not a 'component rendering', render it 'raw' - if (!(rendering as ComponentRendering).componentName && (rendering as HtmlElementRendering).name) { - return this.createRawElement(rendering as HtmlElementRendering, commonProps); - } + return placeholderData + .map((rendering: ComponentRendering | HtmlElementRendering, index: number) => { + const key = (rendering as ComponentRendering).uid + ? (rendering as ComponentRendering).uid + : `component-${index}`; + const commonProps = { key }; + + // if the element is not a 'component rendering', render it 'raw' + if ( + !(rendering as ComponentRendering).componentName && + (rendering as HtmlElementRendering).name + ) { + return this.createRawElement(rendering as HtmlElementRendering, commonProps); + } - const componentRendering = rendering as ComponentRendering; + const componentRendering = rendering as ComponentRendering; - let component = this.getComponentForRendering(componentRendering); - if (!component) { - console.error( - `Placeholder ${name} contains unknown component ${componentRendering.componentName - }. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.` - ); + let component = this.getComponentForRendering(componentRendering); + if (!component) { + console.error( + `Placeholder ${name} contains unknown component ${componentRendering.componentName}. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.` + ); - component = missingComponentComponent ?? MissingComponent; - } - - const finalProps = { - ...commonProps, - ...placeholderProps, - ...((placeholderFields || componentRendering.fields) && { - fields: { ...placeholderFields, ...componentRendering.fields }, - }), - ...((placeholderParams || componentRendering.params) && { - params: { ...placeholderParams, ...componentRendering.params }, - }), - rendering: componentRendering, - }; + component = missingComponentComponent ?? MissingComponent; + } - return React.createElement<{ [attr: string]: unknown }>(component as React.ComponentType, finalProps); - }) - .filter(element => element); // remove nulls + const finalProps = { + ...commonProps, + ...placeholderProps, + ...((placeholderFields || componentRendering.fields) && { + fields: { ...placeholderFields, ...componentRendering.fields }, + }), + ...((placeholderParams || componentRendering.params) && { + params: { ...placeholderParams, ...componentRendering.params }, + }), + rendering: componentRendering, + }; + + return React.createElement<{ [attr: string]: unknown }>( + component as React.ComponentType, + finalProps + ); + }) + .filter((element) => element); // remove nulls } getComponentForRendering(renderingDefinition: { componentName: string }): ComponentType | null { const componentFactory = this.props.componentFactory; if (!componentFactory || typeof componentFactory !== 'function') { - console.warn(`No componentFactory was available to service request for component ${renderingDefinition}`); + console.warn( + `No componentFactory was available to service request for component ${renderingDefinition}` + ); return null; } @@ -188,14 +203,14 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone ); return null; } - const attributes = convertAttributesToReactProps(elem.attributes); + const attributes = convertAttributesToReactProps(elem.attributes); const props: { [attr: string]: unknown; key?: string; dangerouslySetInnerHTML: { - __html: string | null - } + __html: string | null; + }; } = { ...baseProps, ...attributes, diff --git a/packages/sitecore-jss-react/src/components/RichText.tsx b/packages/sitecore-jss-react/src/components/RichText.tsx index 3cb2ac407e..0f6e6e81ec 100644 --- a/packages/sitecore-jss-react/src/components/RichText.tsx +++ b/packages/sitecore-jss-react/src/components/RichText.tsx @@ -21,21 +21,23 @@ export interface RichTextProps { editable?: boolean; } -export const RichText: React.SFC<RichTextProps> = forwardRef(({ field, tag, editable, ...otherProps }, ref) => { - if (!field || (!field.editable && !field.value)) { - return null; +export const RichText: React.SFC<RichTextProps> = forwardRef( + ({ field, tag, editable, ...otherProps }, ref) => { + if (!field || (!field.editable && !field.value)) { + return null; + } + + const htmlProps = { + dangerouslySetInnerHTML: { + __html: field.editable && editable ? field.editable : field.value, + }, + ref, + ...otherProps, + }; + + return React.createElement(tag || 'div', htmlProps); } - - const htmlProps = { - dangerouslySetInnerHTML: { - __html: field.editable && editable ? field.editable : field.value, - }, - ref, - ...otherProps, - }; - - return React.createElement(tag || 'div', htmlProps); -}); +); export const RichTextPropTypes = { field: PropTypes.shape({ diff --git a/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx b/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx index 1524f273a1..dbbeec2808 100644 --- a/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx +++ b/packages/sitecore-jss-react/src/components/SitecoreContext.test.tsx @@ -7,13 +7,15 @@ import { ComponentFactory } from './sharedTypes'; import { withSitecoreContext, ComponentConsumerProps } from '../enhancers/withSitecoreContext'; interface NestedComponentProps extends ComponentConsumerProps { - anotherProperty?: string, + anotherProperty?: string; } -const NestedComponent: FC<NestedComponentProps> = (props: NestedComponentProps) => <div>{props.sitecoreContext && 'test'}</div>; +const NestedComponent: FC<NestedComponentProps> = (props: NestedComponentProps) => ( + <div>{props.sitecoreContext && 'test'}</div> +); const NestedComponentWithContext = withSitecoreContext()(NestedComponent); const components = new Map(); -const mockComponentFactory: ComponentFactory = name => components.get(name); +const mockComponentFactory: ComponentFactory = (name) => components.get(name); const mockSitecoreContext = { x: 'test1', diff --git a/packages/sitecore-jss-react/src/components/SitecoreContext.tsx b/packages/sitecore-jss-react/src/components/SitecoreContext.tsx index f3cc6b1c13..c7b03e7f76 100644 --- a/packages/sitecore-jss-react/src/components/SitecoreContext.tsx +++ b/packages/sitecore-jss-react/src/components/SitecoreContext.tsx @@ -12,8 +12,12 @@ export interface SitecoreContextState { context: unknown; } -export const SitecoreContextReactContext = React.createContext<SitecoreContextState>({} as SitecoreContextState); -export const ComponentFactoryReactContext = React.createContext<ComponentFactory>({} as ComponentFactory); +export const SitecoreContextReactContext = React.createContext<SitecoreContextState>( + {} as SitecoreContextState +); +export const ComponentFactoryReactContext = React.createContext<ComponentFactory>( + {} as ComponentFactory +); export class SitecoreContext extends React.Component<SitecoreContextProps, SitecoreContextState> { static propTypes = { diff --git a/packages/sitecore-jss-react/src/components/Text.tsx b/packages/sitecore-jss-react/src/components/Text.tsx index f46c31743b..1e3a847afc 100644 --- a/packages/sitecore-jss-react/src/components/Text.tsx +++ b/packages/sitecore-jss-react/src/components/Text.tsx @@ -24,7 +24,13 @@ export interface TextProps { encode?: boolean; } -export const Text: FunctionComponent<TextProps> = ({ field, tag, editable, encode, ...otherProps }) => { +export const Text: FunctionComponent<TextProps> = ({ + field, + tag, + editable, + encode, + ...otherProps +}) => { if (!field || (!field.editable && !field.value)) { return null; } @@ -53,7 +59,7 @@ export const Text: FunctionComponent<TextProps> = ({ field, tag, editable, encod output.push(str); if (!isLast) { - output.push(<br key={i}/>); + output.push(<br key={i} />); } }); } diff --git a/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx b/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx index 464ff4dad7..2f6670f267 100644 --- a/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx @@ -6,11 +6,13 @@ export interface ComponentFactoryProps { componentFactory?: ComponentFactory; } -export function withComponentFactory<T extends ComponentFactoryProps>(Component: React.ComponentClass<T> | React.SFC<T>) { +export function withComponentFactory<T extends ComponentFactoryProps>( + Component: React.ComponentClass<T> | React.SFC<T> +) { return function WithComponentFactory(props: T) { return ( <ComponentFactoryReactContext.Consumer> - {context => <Component {...props} componentFactory={props.componentFactory || context} />} + {(context) => <Component {...props} componentFactory={props.componentFactory || context} />} </ComponentFactoryReactContext.Consumer> ); }; diff --git a/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx b/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx index 9b55f08d51..f32810c916 100644 --- a/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withExperienceEditorChromes.tsx @@ -1,9 +1,12 @@ import React, { ComponentType } from 'react'; import { resetExperienceEditorChromes } from '../'; -export const withExperienceEditorChromes = (WrappedComponent: React.ComponentClass<unknown> | React.SFC<unknown>) => { +export const withExperienceEditorChromes = ( + WrappedComponent: React.ComponentClass<unknown> | React.SFC<unknown> +) => { class Enhancer extends React.Component<unknown> { - displayName: string = (WrappedComponent as ComponentType).displayName || WrappedComponent.name || 'Component'; + displayName: string = + (WrappedComponent as ComponentType).displayName || WrappedComponent.name || 'Component'; componentDidUpdate() { resetExperienceEditorChromes(); diff --git a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx index 184e12bcb5..335ebf8ef1 100644 --- a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx @@ -30,10 +30,17 @@ export interface PlaceholderToPropMapping { prop: string; } -export type WithPlaceholderSpec = (string | PlaceholderToPropMapping) | (string | PlaceholderToPropMapping)[]; - -export function withPlaceholder(placeholders: WithPlaceholderSpec, options?: WithPlaceholderOptions) { - return (WrappedComponent: React.ComponentClass<PlaceholderProps> | React.SFC<PlaceholderProps>) => { +export type WithPlaceholderSpec = + | (string | PlaceholderToPropMapping) + | (string | PlaceholderToPropMapping)[]; + +export function withPlaceholder( + placeholders: WithPlaceholderSpec, + options?: WithPlaceholderOptions +) { + return ( + WrappedComponent: React.ComponentClass<PlaceholderProps> | React.SFC<PlaceholderProps> + ) => { class WithPlaceholder extends PlaceholderCommon<PlaceholderProps> { static propTypes = PlaceholderCommon.propTypes; @@ -62,25 +69,35 @@ export function withPlaceholder(placeholders: WithPlaceholderSpec, options?: Wit ); } - const renderingData = options && options.resolvePlaceholderDataFromProps - ? options.resolvePlaceholderDataFromProps(childProps) - : childProps.rendering; + const renderingData = + options && options.resolvePlaceholderDataFromProps + ? options.resolvePlaceholderDataFromProps(childProps) + : childProps.rendering; const definitelyArrayPlacholders = !Array.isArray(placeholders) - ? [ placeholders ] : placeholders; + ? [placeholders] + : placeholders; definitelyArrayPlacholders.forEach((placeholder: string | PlaceholderToPropMapping) => { let placeholderData: (ComponentRendering | HtmlElementRendering)[]; if (typeof placeholder !== 'string' && placeholder.placeholder && placeholder.prop) { - placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData(renderingData, placeholder.placeholder); + placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData( + renderingData, + placeholder.placeholder + ); if (placeholderData) { childProps[placeholder.prop] = this.getComponentsForRenderingData(placeholderData); } } else { - placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData(renderingData, placeholder as string); + placeholderData = PlaceholderCommon.getPlaceholderDataFromRenderingData( + renderingData, + placeholder as string + ); if (placeholderData) { - childProps[placeholder as string] = this.getComponentsForRenderingData(placeholderData); + childProps[placeholder as string] = this.getComponentsForRenderingData( + placeholderData + ); } } }); diff --git a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx index 0be4fb1c36..b165c88bad 100644 --- a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.test.tsx @@ -22,7 +22,8 @@ describe('withSitecoreContext', () => { const TestComponent: React.FC<any> = (props: any) => ( <div onClick={props.updateSitecoreContext}> - {props.sitecoreContext.text}{props.customProp} + {props.sitecoreContext.text} + {props.customProp} </div> ); @@ -71,7 +72,8 @@ describe('withSitecoreContext', () => { return ( <div onClick={reactContext.updateSitecoreContext}> - {context.text}{props.customProp} + {context.text} + {props.customProp} </div> ); }; @@ -106,7 +108,8 @@ describe('withSitecoreContext', () => { return ( <div onClick={reactContext.updateSitecoreContext}> - {context.text}{props.customProp} + {context.text} + {props.customProp} </div> ); }; diff --git a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx index 11d816eedf..5b6ce5e3b4 100644 --- a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx @@ -14,19 +14,21 @@ export interface ComponentConsumerProps extends WithSitecoreContextProps { children?: ReactNode; } -export type WithSitecoreContextHocProps<ComponentProps> = Pick<ComponentProps, Exclude<keyof ComponentProps, keyof WithSitecoreContextProps>>; +export type WithSitecoreContextHocProps<ComponentProps> = Pick< + ComponentProps, + Exclude<keyof ComponentProps, keyof WithSitecoreContextProps> +>; export function withSitecoreContext(options?: WithSitecoreContextOptions) { - - return function withSitecoreContextHoc<ComponentProps extends ComponentConsumerProps>(Component: React.ComponentType<ComponentProps>) { - + return function withSitecoreContextHoc<ComponentProps extends ComponentConsumerProps>( + Component: React.ComponentType<ComponentProps> + ) { return function WithSitecoreContext(props: WithSitecoreContextHocProps<ComponentProps>) { - return ( <SitecoreContextReactContext.Consumer> - {context => ( + {(context) => ( <Component - {...props as ComponentProps} + {...(props as ComponentProps)} sitecoreContext={context.context} updateSitecoreContext={options && options.updatable && context.setContext} /> @@ -34,8 +36,6 @@ export function withSitecoreContext(options?: WithSitecoreContextOptions) { </SitecoreContextReactContext.Consumer> ); }; - - }; } diff --git a/packages/sitecore-jss-react/src/index.ts b/packages/sitecore-jss-react/src/index.ts index 4eef50b45e..623b64aae1 100644 --- a/packages/sitecore-jss-react/src/index.ts +++ b/packages/sitecore-jss-react/src/index.ts @@ -29,7 +29,11 @@ export { DateField } from './components/Date'; export { Link, LinkField, LinkFieldValue, LinkProps, LinkPropTypes } from './components/Link'; export { File, FileField } from './components/File'; export { VisitorIdentification } from './components/VisitorIdentification'; -export { SitecoreContext, SitecoreContextState, SitecoreContextReactContext } from './components/SitecoreContext'; +export { + SitecoreContext, + SitecoreContextState, + SitecoreContextReactContext, +} from './components/SitecoreContext'; export { withSitecoreContext, useSitecoreContext } from './enhancers/withSitecoreContext'; export { withExperienceEditorChromes } from './enhancers/withExperienceEditorChromes'; export { withPlaceholder } from './enhancers/withPlaceholder'; diff --git a/packages/sitecore-jss-react/src/testData/ee-data.ts b/packages/sitecore-jss-react/src/testData/ee-data.ts index 70c6c398ca..6435d1450c 100644 --- a/packages/sitecore-jss-react/src/testData/ee-data.ts +++ b/packages/sitecore-jss-react/src/testData/ee-data.ts @@ -126,7 +126,7 @@ export const convertedData = { hintname: 'page-header', class: 'scpm', }, - } + }, ], 'page-content': [ { @@ -209,7 +209,7 @@ export const convertedData = { hintname: 'page-content', class: 'scpm', }, - } + }, ], }, }, @@ -238,13 +238,14 @@ export const convertedData = { hintname: 'main', class: 'scpm', }, - } + }, ], }, fields: { key: { value: '', - editable: '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', + editable: + '<input id=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' class=\'scFieldValue\' name=\'fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15\' type=\'hidden\' value="This is a some sample <p>field data</p> o'boy! "wow"" /><span class="scChromeData">{"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}</span><span id="fld_9BCF4A172EC7416095045ABD096B46AE_30F5C2ACE7C842418AD031434E4E96CF_en_1_a95ded857429473e8ced62dee49d6747_15_edit" sc_parameters="prevent-line-break=true" contenteditable="true" class="scWebEditInput" scFieldType="single-line text" scDefaultText="[No text in field]">This is a some sample <p>field data</p> o'boy! "wow"</span>', }, }, }, diff --git a/packages/sitecore-jss-react/src/testData/non-ee-data.ts b/packages/sitecore-jss-react/src/testData/non-ee-data.ts index 3920163289..cd1a7d4a31 100644 --- a/packages/sitecore-jss-react/src/testData/non-ee-data.ts +++ b/packages/sitecore-jss-react/src/testData/non-ee-data.ts @@ -35,7 +35,7 @@ export const convertedDevData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -47,10 +47,10 @@ export const convertedDevData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { @@ -107,7 +107,7 @@ export const convertedLayoutServiceData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -120,10 +120,10 @@ export const convertedLayoutServiceData = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { diff --git a/packages/sitecore-jss-react/src/tests/jsdom-setup.ts b/packages/sitecore-jss-react/src/tests/jsdom-setup.ts index fea0c50e1d..a88ab385d0 100644 --- a/packages/sitecore-jss-react/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-react/src/tests/jsdom-setup.ts @@ -12,11 +12,14 @@ const jsDomWindow = jsdom.window; 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-react/src/utils.ts b/packages/sitecore-jss-react/src/utils.ts index 43ff8c4eae..564f1fc984 100644 --- a/packages/sitecore-jss-react/src/utils.ts +++ b/packages/sitecore-jss-react/src/utils.ts @@ -2,9 +2,8 @@ import { parse as styleParse } from 'style-attr'; // https://stackoverflow.com/a/10426674/9324 export const convertKebabCasetoCamelCase = (str: string) => - str.replace( - /^.|-./g, - (letter, index) => (index === 0 ? letter.toLowerCase() : letter.substr(1).toUpperCase()) + str.replace(/^.|-./g, (letter, index) => + index === 0 ? letter.toLowerCase() : letter.substr(1).toUpperCase() ); /** diff --git a/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts b/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts index 8033bb3429..216fd7d034 100644 --- a/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts +++ b/packages/sitecore-jss-rendering-host/src/defaultAppInvocationInfoResolver.ts @@ -43,7 +43,9 @@ export function getDefaultAppInvocationInfoResolver({ return { renderFunction: (...args) => { - console.log(`[SSR] rendering app at ${modulePath} via render function named ${resolvedRenderFunctionName}`); + console.log( + `[SSR] rendering app at ${modulePath} via render function named ${resolvedRenderFunctionName}` + ); return renderFunction(...args); }, renderFunctionArgs, diff --git a/packages/sitecore-jss-rendering-host/src/devServer.ts b/packages/sitecore-jss-rendering-host/src/devServer.ts index 57834594d5..baee0d418b 100644 --- a/packages/sitecore-jss-rendering-host/src/devServer.ts +++ b/packages/sitecore-jss-rendering-host/src/devServer.ts @@ -195,7 +195,8 @@ export function startDevServer({ const modulePath = path.join(buildArtifactsPath, serverBundleFileName); console.log('Resolved server bundle path', modulePath); const appInvocationInfoResolver = - customAppInvocationInfoResolver || getDefaultAppInvocationInfoResolver({ appPathResolver: () => modulePath }); + customAppInvocationInfoResolver || + getDefaultAppInvocationInfoResolver({ appPathResolver: () => modulePath }); // Devs may have assigned a value to `serverOptions.after` via `configs.devServerConfig`, so // preserve the existing value so we can invoke it later. @@ -203,11 +204,11 @@ export function startDevServer({ serverOptions.after = (app: Application, server: WebpackDevServer) => { const middleware = ssrMiddleware ? ssrMiddleware({ - appInvocationInfoResolver, - }) + appInvocationInfoResolver, + }) : defaultSSRMiddleware({ - appInvocationInfoResolver, - }); + appInvocationInfoResolver, + }); // Give devs a chance to add custom middleware before the SSR middleware is registered, // but after all WDS middleware. diff --git a/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts b/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts index aad8e7f15a..fca26a139c 100644 --- a/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts +++ b/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts @@ -66,11 +66,11 @@ export function startRenderingHostServer({ const middleware = ssrMiddleware ? ssrMiddleware({ - appInvocationInfoResolver, - }) + appInvocationInfoResolver, + }) : defaultSSRMiddleware({ - appInvocationInfoResolver, - }); + appInvocationInfoResolver, + }); // Give devs a chance to add custom middleware before the SSR middleware is registered. invokeHook(hooks.beforeSSRMiddlewareRegistered, server); diff --git a/packages/sitecore-jss-rendering-host/src/tunnel.ts b/packages/sitecore-jss-rendering-host/src/tunnel.ts index 85027b6736..ec2c9a07e0 100644 --- a/packages/sitecore-jss-rendering-host/src/tunnel.ts +++ b/packages/sitecore-jss-rendering-host/src/tunnel.ts @@ -22,12 +22,10 @@ export function startRenderHostTunnel( addr: rewriteHost, }; - return ngrok - .connect(finalOptions) - .then((url: string) => { - if (!options.quiet) { - console.log(`Tunnel started, forwarding '${url}' to '${rewriteHost}'`); - } - return url; - }); + return ngrok.connect(finalOptions).then((url: string) => { + if (!options.quiet) { + console.log(`Tunnel started, forwarding '${url}' to '${rewriteHost}'`); + } + return url; + }); } diff --git a/packages/sitecore-jss-tracking/src/trackingApi.test.ts b/packages/sitecore-jss-tracking/src/trackingApi.test.ts index cfe592e1e2..f4f984d5bd 100644 --- a/packages/sitecore-jss-tracking/src/trackingApi.test.ts +++ b/packages/sitecore-jss-tracking/src/trackingApi.test.ts @@ -9,12 +9,13 @@ import { trackEvent } from './trackingApi'; // note: axios needs to use `withCredentials: true` in order for Sitecore cookies to be included in CORS requests // which is necessary for analytics and such -const axiosFetcher: HttpJsonFetcher<void> = (url, data) => axios({ - url, - method: data ? 'POST' : 'GET', - data, - withCredentials: true, -}); +const axiosFetcher: HttpJsonFetcher<void> = (url, data) => + axios({ + url, + method: data ? 'POST' : 'GET', + data, + withCredentials: true, + }); describe('trackEvent', () => { let mock: MockAdapter; @@ -39,21 +40,17 @@ describe('trackEvent', () => { return [200, { ...config }]; }); - return trackEvent([ - { eventId: 'porgs' } - ], - { + return trackEvent([{ eventId: 'porgs' }], { host: 'https://www.myhost.net', test: true, fetcher: axiosFetcher, - }) - .then((data) => { - // testData should contain the 'config' object from the mock request - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const testData = data as any; - expect(testData.url).to.equal(expectedUrl); - expect(testData.withCredentials, 'with credentials is not true').to.be.true; - }); + }).then((data) => { + // testData should contain the 'config' object from the mock request + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const testData = data as any; + expect(testData.url).to.equal(expectedUrl); + expect(testData.withCredentials, 'with credentials is not true').to.be.true; + }); }); it('should fetch with querystring', () => { @@ -65,21 +62,17 @@ describe('trackEvent', () => { return [200, { ...config }]; }); - return trackEvent([ - { campaignId: '123456' } - ], - { + return trackEvent([{ campaignId: '123456' }], { host: 'https://www.myhost.net', querystringParams: { sc_camp: 123456 }, test: true, fetcher: axiosFetcher, - }) - .then((data) => { - // testData should contain the 'config' object from the mock request - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const testData = data as any; - expect(testData.url).to.equal(expectedUrl); - expect(testData.withCredentials, 'with credentials is not true').to.be.true; - }); + }).then((data) => { + // testData should contain the 'config' object from the mock request + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const testData = data as any; + expect(testData.url).to.equal(expectedUrl); + expect(testData.withCredentials, 'with credentials is not true').to.be.true; + }); }); }); diff --git a/packages/sitecore-jss-tracking/src/trackingApi.ts b/packages/sitecore-jss-tracking/src/trackingApi.ts index 997c6943d0..e20c7be4fb 100644 --- a/packages/sitecore-jss-tracking/src/trackingApi.ts +++ b/packages/sitecore-jss-tracking/src/trackingApi.ts @@ -1,5 +1,11 @@ import { HttpJsonFetcher, HttpResponse, isServer } from '@sitecore-jss/sitecore-jss'; -import { CampaignInstance, EventInstance, GoalInstance, OutcomeInstance, PageViewInstance } from './dataModels'; +import { + CampaignInstance, + EventInstance, + GoalInstance, + OutcomeInstance, + PageViewInstance, +} from './dataModels'; import { TrackingRequestOptions } from './trackingRequestOptions'; class ResponseError extends Error { @@ -39,14 +45,14 @@ function fetchData<T>( data: any, fetcher: HttpJsonFetcher<T>, // eslint-disable-next-line @typescript-eslint/no-explicit-any - params: { [key: string]: any } = {}) { - + params: { [key: string]: any } = {} +) { const qs = getQueryString(params); const fetchUrl = url.indexOf('?') !== -1 ? `${url}&${qs}` : `${url}?${qs}`; return fetcher(fetchUrl, data) .then(checkStatus) - .then(response => { + .then((response) => { // axios auto-parses JSON responses, don't need to JSON.parse return response.data as T; }); @@ -65,7 +71,9 @@ function resolveTrackingUrl(options: TrackingRequestOptions) { * @returns {Promise<void>} void */ export function trackEvent( - events: Array<EventInstance | GoalInstance | OutcomeInstance | CampaignInstance | PageViewInstance>, + events: Array< + EventInstance | GoalInstance | OutcomeInstance | CampaignInstance | PageViewInstance + >, options: TrackingRequestOptions ): Promise<void> { const { querystringParams } = options; @@ -76,7 +84,7 @@ export function trackEvent( } if (!Array.isArray(events)) { - events = [ events ]; + events = [events]; } const fetchUrl = resolveTrackingUrl(options); diff --git a/packages/sitecore-jss-update-package/src/index.ts b/packages/sitecore-jss-update-package/src/index.ts index ac905a3710..7e2c14f399 100644 --- a/packages/sitecore-jss-update-package/src/index.ts +++ b/packages/sitecore-jss-update-package/src/index.ts @@ -22,7 +22,7 @@ interface FileEntry { const getEntries = (folder: string): FileEntry[] => { const files = walkSync(folder); - const entries: { path: string, name: string }[] = []; + const entries: { path: string; name: string }[] = []; files.forEach((entry) => { const entryPath = path.join('.', entry); // remove initial folder and convert to fwd slash @@ -50,7 +50,7 @@ export const createPackage = (contentsPath: string, outputPath: string, callback zip .generateNodeStream({ type: 'nodebuffer' }) .pipe(fs.createWriteStream(outputPath)) - .on('error', error => { + .on('error', (error) => { console.error(error); }) .on('finish', () => { diff --git a/packages/sitecore-jss-vue/src/components/Image.test.ts b/packages/sitecore-jss-vue/src/components/Image.test.ts index 9de5356294..d25a9749b4 100644 --- a/packages/sitecore-jss-vue/src/components/Image.test.ts +++ b/packages/sitecore-jss-vue/src/components/Image.test.ts @@ -206,7 +206,9 @@ describe('<Image />', () => { const rendered = mount(Image, { context: { props, attrs } }).find('img'); const img = rendered.find('img'); - expect(img.attributes().srcset).toBe('/-/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /-/jssmedia/img/test0.png?h=100&w=150&mw=300 150w'); + expect(img.attributes().srcset).toBe( + '/-/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /-/jssmedia/img/test0.png?h=100&w=150&mw=300 150w' + ); }); it('should handle /~/media', () => { @@ -226,7 +228,9 @@ describe('<Image />', () => { const rendered = mount(Image, { context: { props, attrs } }).find('img'); const img = rendered.find('img'); - expect(img.attributes().srcset).toBe('/~/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /~/jssmedia/img/test0.png?h=100&w=150&mw=300 150w'); + expect(img.attributes().srcset).toBe( + '/~/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /~/jssmedia/img/test0.png?h=100&w=150&mw=300 150w' + ); }); it('should handle custom mediaUrlPrefix, /-assets', () => { @@ -247,7 +251,9 @@ describe('<Image />', () => { const rendered = mount(Image, { context: { props, attrs } }).find('img'); const img = rendered.find('img'); - expect(img.attributes().srcset).toBe('/-/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /-/jssmedia/img/test0.png?h=100&w=150&mw=300 150w'); + expect(img.attributes().srcset).toBe( + '/-/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /-/jssmedia/img/test0.png?h=100&w=150&mw=300 150w' + ); }); it('should handle custom mediaUrlPrefix, /~assets', () => { @@ -268,7 +274,9 @@ describe('<Image />', () => { const rendered = mount(Image, { context: { props, attrs } }).find('img'); const img = rendered.find('img'); - expect(img.attributes().srcset).toBe('/~/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /~/jssmedia/img/test0.png?h=100&w=150&mw=300 150w'); + expect(img.attributes().srcset).toBe( + '/~/jssmedia/img/test0.png?h=100&w=150&mw=100 150w, /~/jssmedia/img/test0.png?h=100&w=150&mw=300 150w' + ); }); it('should handle custom mediaUrlPrefix, invalid prefix', () => { @@ -289,7 +297,9 @@ describe('<Image />', () => { const rendered = mount(Image, { context: { props, attrs } }).find('img'); const img = rendered.find('img'); - expect(img.attributes().srcset).toBe('/~invalid/img/test0.png?h=100&w=150&mw=100 150w, /~invalid/img/test0.png?h=100&w=150&mw=300 150w'); + expect(img.attributes().srcset).toBe( + '/~invalid/img/test0.png?h=100&w=150&mw=100 150w, /~invalid/img/test0.png?h=100&w=150&mw=300 150w' + ); }); }); diff --git a/packages/sitecore-jss-vue/src/components/Image.ts b/packages/sitecore-jss-vue/src/components/Image.ts index 1eba43622e..ae4c2f2fb1 100644 --- a/packages/sitecore-jss-vue/src/components/Image.ts +++ b/packages/sitecore-jss-vue/src/components/Image.ts @@ -108,7 +108,11 @@ export const Image: FunctionalComponentOptions<ImageProps> = { return getEditableWrapper(media.editable, createElement); } - const imgAttrs = getImageAttrs({ ...foundImg.attrs, ...contextAttrs }, imageParams, mediaUrlPrefix); + const imgAttrs = getImageAttrs( + { ...foundImg.attrs, ...contextAttrs }, + imageParams, + mediaUrlPrefix + ); if (!imgAttrs) { return getEditableWrapper(media.editable, createElement); } diff --git a/packages/sitecore-jss-vue/src/components/Link.ts b/packages/sitecore-jss-vue/src/components/Link.ts index 40f76db81b..6cc57c815b 100644 --- a/packages/sitecore-jss-vue/src/components/Link.ts +++ b/packages/sitecore-jss-vue/src/components/Link.ts @@ -95,7 +95,7 @@ export const Link: FunctionalComponentOptions<LinkProps> = { return createElement('span', { class: 'sc-link-editable-wrapper' }, [ xEditorElement, - childElements + childElements, ]); } @@ -109,7 +109,9 @@ export const Link: FunctionalComponentOptions<LinkProps> = { } const linkText = - showLinkTextWithChildrenPresent || !children || children.length === 0 ? (link.text || link.href) : null; + showLinkTextWithChildrenPresent || !children || children.length === 0 + ? link.text || link.href + : null; const finalChildren = children ? [linkText, ...children] : linkText; diff --git a/packages/sitecore-jss-vue/src/components/MissingComponent.ts b/packages/sitecore-jss-vue/src/components/MissingComponent.ts index 486d28382f..7440face54 100644 --- a/packages/sitecore-jss-vue/src/components/MissingComponent.ts +++ b/packages/sitecore-jss-vue/src/components/MissingComponent.ts @@ -36,7 +36,7 @@ export const MissingComponent: FunctionalComponentOptions<MissingComponentProps> createElement( 'p', 'JSS component is missing Vue implementation. See the developer console for more information.' - ) + ), ] ); }, diff --git a/packages/sitecore-jss-vue/src/components/Placeholder.test.ts b/packages/sitecore-jss-vue/src/components/Placeholder.test.ts index 3f5282e332..5240fad72a 100644 --- a/packages/sitecore-jss-vue/src/components/Placeholder.test.ts +++ b/packages/sitecore-jss-vue/src/components/Placeholder.test.ts @@ -59,7 +59,7 @@ const testComponents: any = { arbitrary: arbitraryProp, ...otherProps, }, - }) + }), ]); }, }, @@ -80,7 +80,7 @@ const testComponents: any = { createElement('br'), `arbitrary function: ${ props.arbitrary.withFunction ? props.arbitrary.withFunction() : 'no function' - }` + }`, ]); }, }, @@ -114,10 +114,10 @@ describe('<Placeholder />', () => { const testData = [ { label: 'Dev data', data: devData }, { label: 'LayoutService data - EE off', data: lsDataEeOff }, - { label: 'LayoutService data - EE on', data: lsDataEeOn } + { label: 'LayoutService data - EE on', data: lsDataEeOn }, ]; - testData.forEach(dataSet => { + testData.forEach((dataSet) => { describe(`with ${dataSet.label}`, () => { it('should render a placeholder with given key', () => { const phData: any = dataSet.data.sitecore.route.placeholders.main; @@ -159,7 +159,7 @@ describe('<Placeholder />', () => { rendering: component, componentFactory, }, - }) + }), ] ); }, @@ -177,7 +177,7 @@ describe('<Placeholder />', () => { const testComponent = { render(createElement: CreateElement) { return createElement(SitecoreContext, { props: { componentFactory } }, [ - createElement(Placeholder, { props: { name: phKey, rendering: component } }) + createElement(Placeholder, { props: { name: phKey, rendering: component } }), ]); }, }; @@ -196,7 +196,7 @@ describe('<Placeholder />', () => { return createElement(SitecoreContext, { props: { componentFactory } }, [ createElement(SampleScopedSlotPlaceholder, { props: { name: phKey, rendering: component }, - }) + }), ]); }, }; @@ -218,7 +218,7 @@ describe('<Placeholder />', () => { main: [ { componentName: 'Home' }, { componentName: 'SfcHome' }, - { componentName: 'whatisthis' } + { componentName: 'whatisthis' }, ], }, }; @@ -313,7 +313,7 @@ describe('<Placeholder />', () => { type: 'text/sitecore', contents: 'this is the only element that should render within the "li" element', attributes: { type: 'text/sitecore' }, - } + }, ], }, }; diff --git a/packages/sitecore-jss-vue/src/components/Placeholder.ts b/packages/sitecore-jss-vue/src/components/Placeholder.ts index bad3671217..db50ab4195 100644 --- a/packages/sitecore-jss-vue/src/components/Placeholder.ts +++ b/packages/sitecore-jss-vue/src/components/Placeholder.ts @@ -42,11 +42,11 @@ export { PlaceholderProps }; // e.g. $router, $apollo export const Placeholder: ThisTypedComponentOptionsWithRecordProps< -Vue, -any, -any, -any, -PlaceholderProps + Vue, + any, + any, + any, + PlaceholderProps > = { name: 'Placeholder', @@ -153,8 +153,8 @@ PlaceholderProps // templated components to iterate and declaritively add <component /> elements to the template. // Developers are then able to use the ":is" attribute to render dynamic components in a template: https://vuejs.org/v2/api/#is const components = convertVNodesToDynamicComponents(vnodes); - const isEmpty = components.every( - (component) => (component.isxEditorComponent ? true : false) + const isEmpty = components.every((component) => + component.isxEditorComponent ? true : false ); return scopedSlots.default({ components, isEmpty }); } diff --git a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts index 61eba303be..8060e17047 100644 --- a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts +++ b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts @@ -111,9 +111,7 @@ export function getVNodesForRenderingData( let component = getComponentForRendering(rendering, componentFactory); if (!component) { console.error( - `Placeholder ${placeholderName} contains unknown component ${ - rendering.componentName - }. Ensure that a Vue component exists for it, and that it is mapped in your component factory.` + `Placeholder ${placeholderName} contains unknown component ${rendering.componentName}. Ensure that a Vue component exists for it, and that it is mapped in your component factory.` ); component = missingComponentComponent || MissingComponent; } @@ -206,9 +204,7 @@ function getComponentForRendering( ) { if (!componentFactory) { console.warn( - `No componentFactory was available to service request for component ${ - renderingDefinition.componentName - }` + `No componentFactory was available to service request for component ${renderingDefinition.componentName}` ); return null; } diff --git a/packages/sitecore-jss-vue/src/components/SitecoreContext.ts b/packages/sitecore-jss-vue/src/components/SitecoreContext.ts index b7031d032f..9da2114da8 100644 --- a/packages/sitecore-jss-vue/src/components/SitecoreContext.ts +++ b/packages/sitecore-jss-vue/src/components/SitecoreContext.ts @@ -9,11 +9,11 @@ export interface SitecoreContextProps { // For an explanation of why `ThisTypedComponentOptionsWithRecordProps` // is used here, see the `Placeholder.ts` component file. export const SitecoreContext: ThisTypedComponentOptionsWithRecordProps< -Vue, -any, -any, -any, -SitecoreContextProps + Vue, + any, + any, + any, + SitecoreContextProps > = { props: { componentFactory: { diff --git a/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts b/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts index 984ac1d628..26c3e1bfd2 100644 --- a/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts +++ b/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts @@ -29,14 +29,14 @@ declare module 'vue/types/options' { // eslint-disable-next-line @typescript-eslint/no-unused-vars interface ComponentOptions<V extends Vue> { withPlaceholder?: - | (() => { - placeholders: WithPlaceholderSpec; - options?: WithPlaceholderOptions; - }) - | { - placeholders: WithPlaceholderSpec; - options?: WithPlaceholderOptions; - }; + | (() => { + placeholders: WithPlaceholderSpec; + options?: WithPlaceholderOptions; + }) + | { + placeholders: WithPlaceholderSpec; + options?: WithPlaceholderOptions; + }; } } diff --git a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts index 5ece49d532..8feaa2388c 100644 --- a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts +++ b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-off.ts @@ -45,7 +45,7 @@ export const lsDataEeOff = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -58,10 +58,10 @@ export const lsDataEeOff = { }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: [], - } + }, ], }, - } + }, ], }, fields: { diff --git a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts index b73fdcbde0..8549fd4530 100644 --- a/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts +++ b/packages/sitecore-jss-vue/src/test/data/LS-data-EE-on.ts @@ -126,7 +126,7 @@ export const lsDataEeOn = { hintname: 'page-header', class: 'scpm', }, - } + }, ], 'page-content': [ { @@ -209,7 +209,7 @@ export const lsDataEeOn = { hintname: 'page-content', class: 'scpm', }, - } + }, ], }, }, @@ -238,7 +238,7 @@ export const lsDataEeOn = { hintname: 'main', class: 'scpm', }, - } + }, ], }, fields: { diff --git a/packages/sitecore-jss-vue/src/test/data/dev-data.ts b/packages/sitecore-jss-vue/src/test/data/dev-data.ts index 180ec2f097..94baceaee8 100644 --- a/packages/sitecore-jss-vue/src/test/data/dev-data.ts +++ b/packages/sitecore-jss-vue/src/test/data/dev-data.ts @@ -24,7 +24,7 @@ export const devData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -38,7 +38,7 @@ export const devData = { fields: { linkText: { value: 'Download' } }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: {}, - } + }, ], }, }, @@ -60,7 +60,7 @@ export const devData = { }, }, uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30', - } + }, ], 'page-content': [ { @@ -74,10 +74,10 @@ export const devData = { fields: { linkText: { value: 'Download' } }, uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908', params: {}, - } + }, ], }, - } + }, ], }, fields: { diff --git a/packages/sitecore-jss/src/data-fetcher.test.ts b/packages/sitecore-jss/src/data-fetcher.test.ts index e6f309e7cd..fdec25962e 100644 --- a/packages/sitecore-jss/src/data-fetcher.test.ts +++ b/packages/sitecore-jss/src/data-fetcher.test.ts @@ -109,7 +109,7 @@ describe('AxiosDataFetcher', () => { }, { 'set-cookie': 'test-set-cookie-value', - } + }, ]; }); diff --git a/packages/sitecore-jss/src/data-fetcher.ts b/packages/sitecore-jss/src/data-fetcher.ts index 4b5b2853f1..053361ad51 100644 --- a/packages/sitecore-jss/src/data-fetcher.ts +++ b/packages/sitecore-jss/src/data-fetcher.ts @@ -48,7 +48,7 @@ export class AxiosDataFetcher { * @param {any} [data] Optional data to POST with the request. * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance - * @returns {Promise<AxiosResponse>} response + * @returns {Promise<AxiosResponse>} response */ fetch( url: string, @@ -86,7 +86,7 @@ export class AxiosDataFetcher { * Setup request headers * @param {IncomingMessage} req * @param {AxiosRequestConfig} reqConfig - * @returns {AxiosRequestConfig} axios request config + * @returns {AxiosRequestConfig} axios request config */ private setupReqHeaders(req: IncomingMessage, reqConfig: AxiosRequestConfig) { reqConfig.headers.common = { @@ -104,7 +104,7 @@ export class AxiosDataFetcher { * Setup response headers based on response from layout service * @param {ServerResponse} res * @param {AxiosResponse} serverRes - * @returns {AxiosResponse} response + * @returns {AxiosResponse} response */ private setupResHeaders(res: ServerResponse, serverRes: AxiosResponse) { serverRes.headers['set-cookie'] && res.setHeader('set-cookie', serverRes.headers['set-cookie']); diff --git a/packages/sitecore-jss/src/dataApi.test.ts b/packages/sitecore-jss/src/dataApi.test.ts index 7f60ff5f09..db22fd47c9 100644 --- a/packages/sitecore-jss/src/dataApi.test.ts +++ b/packages/sitecore-jss/src/dataApi.test.ts @@ -9,12 +9,13 @@ import { HttpJsonFetcher } from './httpClientInterface'; // note: axios needs to use `withCredentials: true` in order for Sitecore cookies to be included in CORS requests // which is necessary for analytics and such -const axiosFetcher: HttpJsonFetcher<any> = (url, data) => axios({ - url, - method: data ? 'POST' : 'GET', - data, - withCredentials: true, -}); +const axiosFetcher: HttpJsonFetcher<any> = (url, data) => + axios({ + url, + method: data ? 'POST' : 'GET', + data, + withCredentials: true, + }); describe('fetchRouteData', () => { let mock: MockAdapter; @@ -39,17 +40,20 @@ describe('fetchRouteData', () => { return [200, { ...config }]; }); - return fetchRouteData('/about', { layoutServiceConfig: { host: 'https://www.myhost.net' }, fetcher: axiosFetcher }) - .then((data) => { - // testData should contain the 'config' object from the mock request - const testData = data as any; - expect(testData.url).to.equal(expectedUrl); - expect(testData.withCredentials, 'with credentials is not true').to.be.true; - }); + return fetchRouteData('/about', { + layoutServiceConfig: { host: 'https://www.myhost.net' }, + fetcher: axiosFetcher, + }).then((data) => { + // testData should contain the 'config' object from the mock request + const testData = data as any; + expect(testData.url).to.equal(expectedUrl); + expect(testData.withCredentials, 'with credentials is not true').to.be.true; + }); }); it('should fetch with querystring', () => { - const expectedUrl = 'https://www.myhost.net/sitecore/api/layout/render/jss?item=%2Fabout&sc_camp=123456'; + const expectedUrl = + 'https://www.myhost.net/sitecore/api/layout/render/jss?item=%2Fabout&sc_camp=123456'; // configure 'GET' requests to return config options mock.onGet().reply((config) => { @@ -57,18 +61,16 @@ describe('fetchRouteData', () => { return [200, { ...config }]; }); - return fetchRouteData('/about', - { - fetcher: axiosFetcher, - layoutServiceConfig: { host: 'https://www.myhost.net' }, - querystringParams: { sc_camp: 123456 }, - }) - .then((data) => { - // testData should contain the 'config' object from the mock request - const testData = data as any; - expect(testData.url).to.equal(expectedUrl); - expect(testData.withCredentials, 'with credentials is not true').to.be.true; - }); + return fetchRouteData('/about', { + fetcher: axiosFetcher, + layoutServiceConfig: { host: 'https://www.myhost.net' }, + querystringParams: { sc_camp: 123456 }, + }).then((data) => { + // testData should contain the 'config' object from the mock request + const testData = data as any; + expect(testData.url).to.equal(expectedUrl); + expect(testData.withCredentials, 'with credentials is not true').to.be.true; + }); }); }); @@ -87,7 +89,8 @@ describe('fetchPlaceholderData', () => { }); it('should fetch with host', () => { - const expectedUrl = 'https://www.myhost.net/sitecore/api/layout/placeholder/jss?placeholderName=%2F%24root%2Fmain&item=%2Fabout'; + const expectedUrl = + 'https://www.myhost.net/sitecore/api/layout/placeholder/jss?placeholderName=%2F%24root%2Fmain&item=%2Fabout'; // configure 'GET' requests to return config options mock.onGet().reply((config) => { @@ -95,17 +98,15 @@ describe('fetchPlaceholderData', () => { return [200, { elements: [{ ...config }] }]; }); - return fetchPlaceholderData('/$root/main', '/about', - { - layoutServiceConfig: { host: 'https://www.myhost.net' }, - fetcher: axiosFetcher, - }) - .then((data) => { - // testData should contain the 'config' object from the mock request - const testData = data as any; - expect(testData.elements[0].url).to.equal(expectedUrl); - expect(testData.elements[0].withCredentials, 'with credentials is not true').to.be.true; - }); + return fetchPlaceholderData('/$root/main', '/about', { + layoutServiceConfig: { host: 'https://www.myhost.net' }, + fetcher: axiosFetcher, + }).then((data) => { + // testData should contain the 'config' object from the mock request + const testData = data as any; + expect(testData.elements[0].url).to.equal(expectedUrl); + expect(testData.elements[0].withCredentials, 'with credentials is not true').to.be.true; + }); }); it('should fetch with querystring', () => { @@ -118,19 +119,15 @@ describe('fetchPlaceholderData', () => { return [200, { elements: [{ ...config }] }]; }); - return fetchPlaceholderData( - '/$root/main', - '/about', - { - layoutServiceConfig: { host: 'https://www.myhost.net' }, - querystringParams: { sc_camp: 123456 }, - fetcher: axiosFetcher, - }) - .then((data) => { - // testData should contain the 'config' object from the mock request - const testData = data as any; - expect(testData.elements[0].url).to.equal(expectedUrl); - expect(testData.elements[0].withCredentials, 'with credentials is not true').to.be.true; - }); + return fetchPlaceholderData('/$root/main', '/about', { + layoutServiceConfig: { host: 'https://www.myhost.net' }, + querystringParams: { sc_camp: 123456 }, + fetcher: axiosFetcher, + }).then((data) => { + // testData should contain the 'config' object from the mock request + const testData = data as any; + expect(testData.elements[0].url).to.equal(expectedUrl); + expect(testData.elements[0].withCredentials, 'with credentials is not true').to.be.true; + }); }); }); diff --git a/packages/sitecore-jss/src/dataApi.ts b/packages/sitecore-jss/src/dataApi.ts index e89ee24814..82f8ec85fe 100644 --- a/packages/sitecore-jss/src/dataApi.ts +++ b/packages/sitecore-jss/src/dataApi.ts @@ -107,10 +107,7 @@ export function fetchRouteData( const fetchUrl = resolveLayoutServiceUrl(layoutServiceConfig, 'render'); - return fetchData( - fetchUrl, - options.fetcher, - { item: itemPath, ...querystringParams }); + return fetchData(fetchUrl, options.fetcher, { item: itemPath, ...querystringParams }); } /** @@ -132,9 +129,9 @@ export function fetchPlaceholderData( const fetchUrl = resolveLayoutServiceUrl(layoutServiceConfig, 'placeholder'); - return fetchData( - fetchUrl, - options.fetcher, - { placeholderName, item: itemPath, ...querystringParams } - ); + return fetchData(fetchUrl, options.fetcher, { + placeholderName, + item: itemPath, + ...querystringParams, + }); } diff --git a/packages/sitecore-jss/src/dataModels.ts b/packages/sitecore-jss/src/dataModels.ts index 3999e11f72..54c1bc23d6 100644 --- a/packages/sitecore-jss/src/dataModels.ts +++ b/packages/sitecore-jss/src/dataModels.ts @@ -19,7 +19,7 @@ export interface DictionaryServiceData { */ export interface LayoutServiceData { sitecore: LayoutServiceContextData & { - route: RouteData + route: RouteData; }; } @@ -29,7 +29,7 @@ export interface LayoutServiceData { export enum LayoutServicePageState { Preview = 'preview', Edit = 'edit', - Normal = 'normal' + Normal = 'normal', } /** @@ -50,7 +50,7 @@ export interface LayoutServiceContext { * Context information from the Sitecore Layout Service */ export interface LayoutServiceContextData { - context: LayoutServiceContext + context: LayoutServiceContext; } /** @@ -60,7 +60,7 @@ export interface RouteData { name: string; displayName?: string; fields?: { - [name: string]: Field + [name: string]: Field; }; databaseName?: string; deviceId?: string; @@ -115,14 +115,19 @@ export interface HtmlElementRendering { type?: string; contents: string | null; attributes: { - [name: string]: string | undefined, + [name: string]: string | undefined; }; } /** * Field value data on a component */ -export type GenericFieldValue = string | boolean | number | { [key: string]: unknown } | Array<{ [key: string]: unknown }>; +export type GenericFieldValue = + | string + | boolean + | number + | { [key: string]: unknown } + | Array<{ [key: string]: unknown }>; export interface Field<T = GenericFieldValue> { value: T; diff --git a/packages/sitecore-jss/src/httpClientInterface.ts b/packages/sitecore-jss/src/httpClientInterface.ts index a728175f86..7d13d27abf 100644 --- a/packages/sitecore-jss/src/httpClientInterface.ts +++ b/packages/sitecore-jss/src/httpClientInterface.ts @@ -16,5 +16,8 @@ export interface HttpResponse<T> { * - Parse response values as JSON and return them into <T> * - Send HTTP POST requests if `data` param is specified; GET is suggested but not required for data-less requests */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type HttpJsonFetcher<T> = (url: string, data?: { [key: string]: any }) => Promise<HttpResponse<T>>; +export type HttpJsonFetcher<T> = ( + url: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data?: { [key: string]: any } +) => Promise<HttpResponse<T>>; diff --git a/packages/sitecore-jss/src/index.ts b/packages/sitecore-jss/src/index.ts index c45790b743..63ea2ea1d5 100644 --- a/packages/sitecore-jss/src/index.ts +++ b/packages/sitecore-jss/src/index.ts @@ -3,9 +3,7 @@ import * as mediaApi from './mediaApi'; export { dataApi, mediaApi }; -export { - LayoutServiceRequestOptions, -} from './dataApi'; +export { LayoutServiceRequestOptions } from './dataApi'; export { AxiosDataFetcher, AxiosDataFetcherConfig } from './data-fetcher'; @@ -31,9 +29,6 @@ export { ComponentParams, } from './dataModels'; -export { - getFieldValue, - getChildPlaceholder, -} from './layoutDataUtils'; +export { getFieldValue, getChildPlaceholder } from './layoutDataUtils'; export { HttpJsonFetcher, HttpResponse } from './httpClientInterface'; diff --git a/packages/sitecore-jss/src/layout-service.test.ts b/packages/sitecore-jss/src/layout-service.test.ts index 954b7d7fd5..f20f1c272c 100644 --- a/packages/sitecore-jss/src/layout-service.test.ts +++ b/packages/sitecore-jss/src/layout-service.test.ts @@ -61,7 +61,7 @@ describe('LayoutService', () => { }, { 'set-cookie': 'test-set-cookie-value', - } + }, ]; }); @@ -118,7 +118,7 @@ describe('LayoutService', () => { }, { 'set-cookie': 'test-set-cookie-value', - } + }, ]; }); @@ -181,19 +181,21 @@ describe('LayoutService', () => { dataFetcherResolver: () => fetcherSpy, }); - return service.fetchLayoutData('/home', 'da-DK').then((layoutServiceData: LayoutServiceData) => { - expect(layoutServiceData).to.deep.equal({ - sitecore: { - context: {}, - route: { name: 'xxx' }, - }, + return service + .fetchLayoutData('/home', 'da-DK') + .then((layoutServiceData: LayoutServiceData) => { + expect(layoutServiceData).to.deep.equal({ + sitecore: { + context: {}, + route: { name: 'xxx' }, + }, + }); + + expect(fetcherSpy).to.be.called.once; + expect(fetcherSpy).to.be.called.with( + 'http://sctest/sitecore/api/layout/render/jss?item=%2Fhome&sc_apikey=0FBFF61E-267A-43E3-9252-B77E71CEE4BA&sc_site=supersite&sc_lang=da-DK&tracking=true' + ); }); - - expect(fetcherSpy).to.be.called.once; - expect(fetcherSpy).to.be.called.with( - 'http://sctest/sitecore/api/layout/render/jss?item=%2Fhome&sc_apikey=0FBFF61E-267A-43E3-9252-B77E71CEE4BA&sc_site=supersite&sc_lang=da-DK&tracking=true' - ); - }); }); it('should fetch placeholder data', () => { @@ -207,7 +209,7 @@ describe('LayoutService', () => { }, { 'set-cookie': 'test-set-cookie-value', - } + }, ]; }); @@ -235,14 +237,16 @@ describe('LayoutService', () => { tracking: false, }); - return service.fetchPlaceholderData('superPh', '/xxx', 'da-DK', req, res).then((placeholderData: PlaceholderData) => { - expect(placeholderData).to.deep.equal({ - name: 'x1', - path: 'x1/x2', - elements: [], + return service + .fetchPlaceholderData('superPh', '/xxx', 'da-DK', req, res) + .then((placeholderData: PlaceholderData) => { + expect(placeholderData).to.deep.equal({ + name: 'x1', + path: 'x1/x2', + elements: [], + }); + expect(setHeaderSpy).to.be.called.with('set-cookie', 'test-set-cookie-value'); }); - expect(setHeaderSpy).to.be.called.with('set-cookie', 'test-set-cookie-value'); - }); }); it('should fetch placeholder data using custom fetcher resolver', () => { @@ -251,11 +255,14 @@ describe('LayoutService', () => { }); mock.onGet().reply(() => { - return [200, { - name: 'x1', - path: 'x1/x2', - elements: [], - }]; + return [ + 200, + { + name: 'x1', + path: 'x1/x2', + elements: [], + }, + ]; }); const service = new LayoutService({ @@ -265,17 +272,19 @@ describe('LayoutService', () => { dataFetcherResolver: () => fetcherSpy, }); - return service.fetchPlaceholderData('superPh', '/xxx', 'da-DK').then((placeholderData: PlaceholderData) => { - expect(placeholderData).to.deep.equal({ - name: 'x1', - path: 'x1/x2', - elements: [], - }); + return service + .fetchPlaceholderData('superPh', '/xxx', 'da-DK') + .then((placeholderData: PlaceholderData) => { + expect(placeholderData).to.deep.equal({ + name: 'x1', + path: 'x1/x2', + elements: [], + }); - expect(fetcherSpy).to.be.called.once; - expect(fetcherSpy).to.be.called.with( - 'http://sctest/sitecore/api/layout/placeholder/jss?placeholderName=superPh&item=%2Fxxx&sc_apikey=0FBFF61E-267A-43E3-9252-B77E71CEE4BA&sc_site=supersite&sc_lang=da-DK&tracking=true' - ); - }); + expect(fetcherSpy).to.be.called.once; + expect(fetcherSpy).to.be.called.with( + 'http://sctest/sitecore/api/layout/placeholder/jss?placeholderName=superPh&item=%2Fxxx&sc_apikey=0FBFF61E-267A-43E3-9252-B77E71CEE4BA&sc_site=supersite&sc_lang=da-DK&tracking=true' + ); + }); }); }); diff --git a/packages/sitecore-jss/src/layout-service.ts b/packages/sitecore-jss/src/layout-service.ts index 24607fdf5b..3c79a9fd0a 100644 --- a/packages/sitecore-jss/src/layout-service.ts +++ b/packages/sitecore-jss/src/layout-service.ts @@ -4,7 +4,10 @@ import { fetchPlaceholderData, fetchRouteData, LayoutServiceConfig } from './dat import { HttpJsonFetcher } from './httpClientInterface'; import { IncomingMessage, ServerResponse } from 'http'; -export type DataFetcherResolver = <T>(req?: IncomingMessage, res?: ServerResponse) => HttpJsonFetcher<T>; +export type DataFetcherResolver = <T>( + req?: IncomingMessage, + res?: ServerResponse +) => HttpJsonFetcher<T>; export type LayoutServiceInstanceConfig = { apiHost: string; @@ -50,7 +53,7 @@ export class LayoutService { * @param {string} [language] * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance - * @returns {Promise<LayoutServiceData>} layout service data + * @returns {Promise<LayoutServiceData>} layout service data */ fetchLayoutData( itemPath: string, @@ -76,7 +79,7 @@ export class LayoutService { * @param {string} [language] * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance - * @returns {Promise<PlaceholderData>} placeholder data + * @returns {Promise<PlaceholderData>} placeholder data */ fetchPlaceholderData( placeholderName: string, @@ -97,7 +100,7 @@ export class LayoutService { /** * Provides fetch options in order to fetch route data * @param {string} [language] language will be applied to `sc_lang` param - * @returns {FetchOptions} fetch options + * @returns {FetchOptions} fetch options */ private getFetchOptions = (language?: string): FetchOptions => { const params: FetchParams = { @@ -119,7 +122,7 @@ export class LayoutService { * Provides default @see AxiosDataFetcher data fetcher * @param {IncomingMessage} [req] Request instance * @param {ServerResponse} [res] Response instance - * @returns default fetcher + * @returns default fetcher */ private getDefaultFetcher = (req?: IncomingMessage, res?: ServerResponse) => { const axiosFetcher = new AxiosDataFetcher(); diff --git a/packages/sitecore-jss/src/layoutDataUtils.ts b/packages/sitecore-jss/src/layoutDataUtils.ts index ba71150eaa..2af033eae9 100644 --- a/packages/sitecore-jss/src/layoutDataUtils.ts +++ b/packages/sitecore-jss/src/layoutDataUtils.ts @@ -8,22 +8,24 @@ type Fields = { [name: string]: Field | Item[] }; */ export function getFieldValue<T>( renderingOrFields: ComponentRendering | Fields, - fieldName: string): T | undefined; + fieldName: string +): T | undefined; export function getFieldValue<T>( renderingOrFields: ComponentRendering | Fields, fieldName: string, - defaultValue: T): T; + defaultValue: T +): T; export function getFieldValue<T>( renderingOrFields: ComponentRendering | Fields, fieldName: string, - defaultValue?: T) { - + defaultValue?: T +) { if (!renderingOrFields || !fieldName) { return defaultValue; } const fields = renderingOrFields as Fields; - const field = fields[fieldName] as unknown as Field<T>; + const field = (fields[fieldName] as unknown) as Field<T>; if (field && typeof field.value !== 'undefined') { return field.value; } @@ -37,7 +39,7 @@ export function getFieldValue<T>( return defaultValue; } - return (rendering.fields[fieldName] as unknown as Field<T>).value; + return ((rendering.fields[fieldName] as unknown) as Field<T>).value; } /** @@ -46,7 +48,10 @@ export function getFieldValue<T>( * @param {string} placeholderName * @returns {Array<ComponentRendering | HtmlElementRendering>} child placeholder */ -export function getChildPlaceholder(rendering: ComponentRendering, placeholderName: string): Array<ComponentRendering | HtmlElementRendering> { +export function getChildPlaceholder( + rendering: ComponentRendering, + placeholderName: string +): Array<ComponentRendering | HtmlElementRendering> { if ( !rendering || !placeholderName || diff --git a/packages/sitecore-jss/src/mediaApi.test.ts b/packages/sitecore-jss/src/mediaApi.test.ts index 9dab28dd39..c7d25a2318 100644 --- a/packages/sitecore-jss/src/mediaApi.test.ts +++ b/packages/sitecore-jss/src/mediaApi.test.ts @@ -12,8 +12,10 @@ const expect = chai.use(chaiString).expect; describe('findEditorImageTag', () => { it('should find, parse, and return an img tag from EE rendered Image field', () => { /* eslint-disable no-useless-escape */ - const editableField = '<input id=\'fld_0FDED3F7211E48A18A466E7F2C95C40E_9DDD62F9D0B1456A8F0ED80B66C98A03_en_1_27eee2bb989840b78cc3e5f5dc81c558_49\' class=\'scFieldValue\' name=\'fld_0FDED3F7211E48A18A466E7F2C95C40E_9DDD62F9D0B1456A8F0ED80B66C98A03_en_1_27eee2bb989840b78cc3e5f5dc81c558_49\' type=\'hidden\' value=\"<image mediaid="{49C5EC6F-97CE-4D69-A303-BFBED4768ED2}" \/>\" \/><code id=\"fld_0FDED3F7211E48A18A466E7F2C95C40E_9DDD62F9D0B1456A8F0ED80B66C98A03_en_1_27eee2bb989840b78cc3e5f5dc81c558_49_edit\" type=\"text\/sitecore\" chromeType=\"field\" scFieldType=\"image\" class=\"scpm\" kind=\"open\">{\"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\"}],\"contextItemUri\":\"sitecore:\/\/master\/{0FDED3F7-211E-48A1-8A46-6E7F2C95C40E}?lang=en&ver=1\",\"custom\":{},\"displayName\":\"Image\",\"expandedDisplayName\":null}<\/code><img src=\"http:\/\/jssadvancedapp\/sitecore\/shell\/-\/media\/JssAdvancedApp\/assets\/img\/portfolio\/1.ashx?h=350&la=en&w=650&hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D\" alt=\"\" width=\"650\" height=\"350\" \/><code class=\"scpm\" type=\"text\/sitecore\" chromeType=\"field\" kind=\"close\"><\/code>'; - const imgTag = '<img src=\"http:\/\/jssadvancedapp\/sitecore\/shell\/-\/media\/JssAdvancedApp\/assets\/img\/portfolio\/1.ashx?h=350&la=en&w=650&hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D\" alt=\"\" width=\"650\" height=\"350\" \/>'; + const editableField = + '<input id=\'fld_0FDED3F7211E48A18A466E7F2C95C40E_9DDD62F9D0B1456A8F0ED80B66C98A03_en_1_27eee2bb989840b78cc3e5f5dc81c558_49\' class=\'scFieldValue\' name=\'fld_0FDED3F7211E48A18A466E7F2C95C40E_9DDD62F9D0B1456A8F0ED80B66C98A03_en_1_27eee2bb989840b78cc3e5f5dc81c558_49\' type=\'hidden\' value="<image mediaid="{49C5EC6F-97CE-4D69-A303-BFBED4768ED2}" />" /><code id="fld_0FDED3F7211E48A18A466E7F2C95C40E_9DDD62F9D0B1456A8F0ED80B66C98A03_en_1_27eee2bb989840b78cc3e5f5dc81c558_49_edit" type="text/sitecore" chromeType="field" scFieldType="image" class="scpm" kind="open">{"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"}],"contextItemUri":"sitecore://master/{0FDED3F7-211E-48A1-8A46-6E7F2C95C40E}?lang=en&ver=1","custom":{},"displayName":"Image","expandedDisplayName":null}</code><img src="http://jssadvancedapp/sitecore/shell/-/media/JssAdvancedApp/assets/img/portfolio/1.ashx?h=350&la=en&w=650&hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D" alt="" width="650" height="350" /><code class="scpm" type="text/sitecore" chromeType="field" kind="close"></code>'; + const imgTag = + '<img src="http://jssadvancedapp/sitecore/shell/-/media/JssAdvancedApp/assets/img/portfolio/1.ashx?h=350&la=en&w=650&hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D" alt="" width="650" height="350" />'; /* eslint-enable no-useless-escape */ const imgMatch = findEditorImageTag(editableField); @@ -63,7 +65,8 @@ describe('getRequiredParams', () => { describe('updateImageUrl', () => { it('should override parameters with those provided', () => { - const original = 'http://sitecore/-/media/lorem.png?h=1&w=2&mh=3&mw=4hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D'; + const original = + 'http://sitecore/-/media/lorem.png?h=1&w=2&mh=3&mw=4hash=CC5043DC03C6C27F40EDB08CF84AB8670C05D63D'; const updated = updateImageUrl(original, { mh: '5', mw: '6' }); const url = URL(updated, true); expect(url.query.mh).to.equal('5'); @@ -120,12 +123,15 @@ describe('updateImageUrl', () => { }); it('should merge querystring and params', () => { - const src = '/media/lorem/ipsum.jpg?x=valueX&y=value111&rev=109010&db=333&la=444&vs=555&ts=666&unknownParam=54321'; + const src = + '/media/lorem/ipsum.jpg?x=valueX&y=value111&rev=109010&db=333&la=444&vs=555&ts=666&unknownParam=54321'; const params = { y: 'valueY', z: 'valueZ' }; const parsed = updateImageUrl(src, params); const url = URL(parsed, {}, true); - expect(url.toString()).equal('/media/lorem/ipsum.jpg?y=valueY&z=valueZ&rev=109010&db=333&la=444&vs=555&ts=666'); + expect(url.toString()).equal( + '/media/lorem/ipsum.jpg?y=valueY&z=valueZ&rev=109010&db=333&la=444&vs=555&ts=666' + ); expect(url.query).deep.equal({ y: 'valueY', z: 'valueZ', @@ -141,12 +147,13 @@ describe('updateImageUrl', () => { describe('getSrcSet', () => { it('should create a srcset for all provided widths', () => { const original = '/ipsum.jpg'; - const expected = '/ipsum.jpg?h=1000&w=1000 1000w, /ipsum.jpg?h=500&w=500 500w, /ipsum.jpg?mh=250&mw=250 250w'; + const expected = + '/ipsum.jpg?h=1000&w=1000 1000w, /ipsum.jpg?h=500&w=500 500w, /ipsum.jpg?mh=250&mw=250 250w'; const params = [ { h: '1000', w: '1000' }, { h: '500', w: '500' }, { mh: '250', mw: '250' }, - { h: '100' } + { h: '100' }, ]; const srcSet = getSrcSet(original, params); expect(srcSet).to.equal(expected); @@ -155,23 +162,18 @@ describe('getSrcSet', () => { it('should combine default and srcset parameters', () => { const original = '/ipsum.jpg'; const expected = '/ipsum.jpg?as=1&w=1000 1000w, /ipsum.jpg?as=1&w=500 500w'; - const params = [ - { w: '1000' }, - { w: '500' } - ]; + const params = [{ w: '1000' }, { w: '500' }]; const srcSet = getSrcSet(original, params, { as: '1', w: '9999' }); expect(srcSet).to.equal(expected); }); describe('should replace url using custom mediaUrlPrefix', () => { - const params = [ - { w: '1000' }, - { w: '500' } - ]; + const params = [{ w: '1000' }, { w: '500' }]; it('should replace /-assets/ with /-/jssmedia', () => { const original = '/-assets/lorem/ipsum.jpg'; - const expected = '/-/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /-/jssmedia/lorem/ipsum.jpg?w=500 500w'; + const expected = + '/-/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /-/jssmedia/lorem/ipsum.jpg?w=500 500w'; const mediaUrlPrefix = /\/([-~]{1})assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); @@ -179,7 +181,8 @@ describe('getSrcSet', () => { it('should replace /~assets/ with /~/jssmedia', () => { const original = '/~assets/lorem/ipsum.jpg'; - const expected = '/~/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /~/jssmedia/lorem/ipsum.jpg?w=500 500w'; + const expected = + '/~/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /~/jssmedia/lorem/ipsum.jpg?w=500 500w'; const mediaUrlPrefix = /\/([-~]{1})assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); @@ -187,7 +190,8 @@ describe('getSrcSet', () => { it('should replace /-/assets/ with /-/jssmedia/', () => { const original = '/-/assets/lorem/ipsum.jpg'; - const expected = '/-/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /-/jssmedia/lorem/ipsum.jpg?w=500 500w'; + const expected = + '/-/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /-/jssmedia/lorem/ipsum.jpg?w=500 500w'; const mediaUrlPrefix = /\/([-~]{1})\/assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); @@ -195,7 +199,8 @@ describe('getSrcSet', () => { it('should replace /~/assets/ with /~/jssmedia/', () => { const original = '/~/assets/lorem/ipsum.jpg'; - const expected = '/~/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /~/jssmedia/lorem/ipsum.jpg?w=500 500w'; + const expected = + '/~/jssmedia/lorem/ipsum.jpg?w=1000 1000w, /~/jssmedia/lorem/ipsum.jpg?w=500 500w'; const mediaUrlPrefix = /\/([-~]{1})\/assets\//i; const srcSet = getSrcSet(original, params, undefined, mediaUrlPrefix); expect(srcSet).to.equal(expected); diff --git a/packages/sitecore-jss/src/mediaApi.ts b/packages/sitecore-jss/src/mediaApi.ts index f6f26ef3f7..2fd4d5e27b 100644 --- a/packages/sitecore-jss/src/mediaApi.ts +++ b/packages/sitecore-jss/src/mediaApi.ts @@ -42,9 +42,7 @@ export const findEditorImageTag = (editorMarkup: string) => { * @param {object} qs layout service parsed query string * @returns {object} requiredParams */ -export const getRequiredParams = (qs: { - [key: string]: string | undefined -}) => { +export const getRequiredParams = (qs: { [key: string]: string | undefined }) => { const { rev, db, la, vs, ts } = qs; return { rev, db, la, vs, ts }; diff --git a/packages/sitecore-pipelines/src/configLoader.test.ts b/packages/sitecore-pipelines/src/configLoader.test.ts index e1b28c8654..1bdc54c000 100644 --- a/packages/sitecore-pipelines/src/configLoader.test.ts +++ b/packages/sitecore-pipelines/src/configLoader.test.ts @@ -22,7 +22,7 @@ describe('configLoader', () => { const fakeImportModules = () => { const mockModules = [ { import: () => Promise.resolve({ config: spy1 }) }, - { import: () => Promise.resolve({ config: spy2 }) } + { import: () => Promise.resolve({ config: spy2 }) }, ]; return mockModules; }; @@ -54,7 +54,7 @@ describe('configLoader', () => { const fakeImportModules = () => { const mockModules = [ { import: () => Promise.resolve({ config: () => {} }) }, - { import: () => Promise.resolve({ config: () => {} }) } + { import: () => Promise.resolve({ config: () => {} }) }, ]; return mockModules; }; diff --git a/packages/sitecore-pipelines/src/configLoader.ts b/packages/sitecore-pipelines/src/configLoader.ts index 347364951f..e2bb988026 100644 --- a/packages/sitecore-pipelines/src/configLoader.ts +++ b/packages/sitecore-pipelines/src/configLoader.ts @@ -10,12 +10,16 @@ const config = async ({ createPipelinesRegistryImplementation, importModulesImplementation, }: { - fileGlobs: string[], - workingDirectory?: string, - existingConfig?: any, - allowEmptyGlobs?: boolean, + fileGlobs: string[]; + workingDirectory?: string; + existingConfig?: any; + allowEmptyGlobs?: boolean; createPipelinesRegistryImplementation?: (existingConfig: any) => any; - importModulesImplementation?: (options: { fileGlobs: string[], workingDirectory: string, allowEmptyGlobs: boolean }) => any; + importModulesImplementation?: (options: { + fileGlobs: string[]; + workingDirectory: string; + allowEmptyGlobs: boolean; + }) => any; }) => { if (!fileGlobs || fileGlobs.length === 0) { throw new Error('no pipeline config file search patterns specified'); diff --git a/packages/sitecore-pipelines/src/pipeline.test.ts b/packages/sitecore-pipelines/src/pipeline.test.ts index 2a5e5c136d..831be4540d 100644 --- a/packages/sitecore-pipelines/src/pipeline.test.ts +++ b/packages/sitecore-pipelines/src/pipeline.test.ts @@ -17,7 +17,7 @@ describe('runProcessors', () => { { name: 'proc1', process: (args: any) => ({ ...args, proc1result: true }), - } + }, ]; const fileProcessors = () => [ @@ -35,7 +35,7 @@ describe('runProcessors', () => { { name: 'proc2', modulePath: './src/test/pipelines/pipeline0/proc2.ts', - } + }, ]; it('should execute function-based processors', () => { diff --git a/packages/sitecore-pipelines/src/pipeline.ts b/packages/sitecore-pipelines/src/pipeline.ts index dee187c6b4..a9e6ae8a9d 100644 --- a/packages/sitecore-pipelines/src/pipeline.ts +++ b/packages/sitecore-pipelines/src/pipeline.ts @@ -20,13 +20,7 @@ const enhanceProcessors = (processors: Processor[]) => return processor; }); -const runProcessor = async ({ - processor, - args, -}: { - processor: Processor, - args: any -}) => { +const runProcessor = async ({ processor, args }: { processor: Processor; args: any }) => { if (args && args.debug) { console.log(`executing processor ${processor.name}`); } @@ -69,8 +63,8 @@ export const runProcessors = async ({ processors, pipelineArgs = {}, }: { - processors: Processor[], - pipelineArgs: any + processors: Processor[]; + pipelineArgs: any; }) => { if (!processors || processors.length === 0) { throw new Error('no processors specified to run'); diff --git a/packages/sitecore-pipelines/src/pipelineFactory.ts b/packages/sitecore-pipelines/src/pipelineFactory.ts index d19dde2c7b..d677393cac 100644 --- a/packages/sitecore-pipelines/src/pipelineFactory.ts +++ b/packages/sitecore-pipelines/src/pipelineFactory.ts @@ -8,7 +8,7 @@ export interface Processor { /** * optional but must be specified if process is not */ - modulePath?: { workingDirectory: string, filePath: string } | string; + modulePath?: { workingDirectory: string; filePath: string } | string; /** * optional but must be specified if modulePath is not */ @@ -21,11 +21,12 @@ export interface Processor { } export const processorFactory = { - create: (name = '') => ({ - name, - modulePath: '', - args: {}, - } as Processor), + create: (name = '') => + ({ + name, + modulePath: '', + args: {}, + } as Processor), }; export interface ExecutablePipeline { @@ -87,9 +88,7 @@ export const pipelineFactory = { processors.push({ ...processor }); // weak attempt at immutability } else { console.warn( - `processor "${ - processor.name - }" already exists. you may experience unexpected results when trying to reference the processor by name.` + `processor "${processor.name}" already exists. you may experience unexpected results when trying to reference the processor by name.` ); } }; @@ -99,7 +98,7 @@ export const pipelineFactory = { if (!procName) { throw new Error( 'no processor name specified for call to "updateProcessor", you must specify either' + - ' processor.name or pass in a name via the "processorName" argument.' + ' processor.name or pass in a name via the "processorName" argument.' ); } const found = processors.findIndex((proc) => proc.name === procName); diff --git a/packages/sitecore-pipelines/src/pipelinesRegistry.ts b/packages/sitecore-pipelines/src/pipelinesRegistry.ts index 7febe66a70..044fc8b617 100644 --- a/packages/sitecore-pipelines/src/pipelinesRegistry.ts +++ b/packages/sitecore-pipelines/src/pipelinesRegistry.ts @@ -8,8 +8,8 @@ export interface PipelineRegistry { getPipelines: () => { [key: string]: Pipeline }; } -export const createPipelinesRegistry = (existingPipelines: {[k: string]: Pipeline} = {}) => { - const pipelines: {[k: string]: Pipeline} = { ...existingPipelines }; +export const createPipelinesRegistry = (existingPipelines: { [k: string]: Pipeline } = {}) => { + const pipelines: { [k: string]: Pipeline } = { ...existingPipelines }; const addPipeline = (pipeline: Pipeline) => { const found = pipelines[pipeline.name]; @@ -17,9 +17,7 @@ export const createPipelinesRegistry = (existingPipelines: {[k: string]: Pipelin pipelines[pipeline.name] = { ...pipeline }; // weak attempt at immutability } else { console.warn( - `pipeline "${ - pipeline.name - }" already exists. you may experience unexpected results when trying to reference the pipeline by name.` + `pipeline "${pipeline.name}" already exists. you may experience unexpected results when trying to reference the pipeline by name.` ); } }; @@ -29,7 +27,7 @@ export const createPipelinesRegistry = (existingPipelines: {[k: string]: Pipelin if (!pipeName) { throw new Error( 'no pipeline name specified for call to "updatePipeline", ' + - 'you must specify either pipeline.name or pass in a name via the "pipelineName" argument.' + 'you must specify either pipeline.name or pass in a name via the "pipelineName" argument.' ); } const found = pipelines[pipeName]; diff --git a/packages/sitecore-pipelines/src/utils.ts b/packages/sitecore-pipelines/src/utils.ts index d15b33c891..29fa6113bd 100644 --- a/packages/sitecore-pipelines/src/utils.ts +++ b/packages/sitecore-pipelines/src/utils.ts @@ -10,11 +10,11 @@ export const resolveFiles = ({ workingDirectory, allowEmptyGlobs = false, }: { - fileGlob: string, - extensions: string[], - recursive: boolean, - workingDirectory: string, - allowEmptyGlobs?: boolean + fileGlob: string; + extensions: string[]; + recursive: boolean; + workingDirectory: string; + allowEmptyGlobs?: boolean; }) => { let files: string[] = []; let lookupPath = fileGlob; @@ -88,9 +88,9 @@ export const importModules = ({ workingDirectory = '', allowEmptyGlobs = false, }: { - fileGlobs: string[], - workingDirectory?: string, - allowEmptyGlobs?: boolean + fileGlobs: string[]; + workingDirectory?: string; + allowEmptyGlobs?: boolean; }) => { const resolved = fileGlobs.reduce((initialResult: string[], fileGlob) => { let result = initialResult; diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 3167c89928..0000000000 --- a/tslint.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": ["tslint:recommended"], - "rules": { - "import-blacklist": [true], - "indent": [true, "spaces", 2], - "interface-name": false, - "max-line-length": [true, 140], - "member-access": false, - "member-ordering": [ - true, - { - "order": ["static-field", "instance-field", "static-method", "instance-method"] - } - ], - "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], - "no-default-export": false, - "no-empty": false, - "no-inferrable-types": [true, "ignore-params"], - "no-redundant-jsdoc": true, - "no-non-null-assertion": true, - "no-string-literal": false, - "no-switch-case-fall-through": true, - "no-use-before-declare": true, - "object-literal-sort-keys": false, - "one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace"], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "quotemark": [true, "single"], - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "angular-whitespace": [true, "check-interpolation", "check-semicolon"], - "banana-in-box": true, - "templates-no-negated-async": true, - "directive-selector": [true, "attribute", "sc", "camelCase"], - "component-selector": [true, "element", ["sc", "test"], "kebab-case"], - "use-input-property-decorator": true, - "use-output-property-decorator": true, - "use-host-property-decorator": true, - "no-attribute-parameter-decorator": true, - "no-input-rename": true, - "no-output-rename": true, - "no-unused-variable": true, - "no-forward-ref": true, - "use-view-encapsulation": true, - "use-life-cycle-interface": true, - "use-pipe-transform-interface": true, - "pipe-naming": [true, "camelCase", "sc"], - "component-class-suffix": true, - "directive-class-suffix": true, - "pipe-impure": true, - "trailing-comma": [ - true, - { - "multiline": { - "objects": "always", - "arrays": "always", - "functions": "never", - "typeLiterals": "ignore" - }, - "esSpecCompliant": true - } - ] - } -} From c8c7480d16e8bef72a05113ebce32c34376157e0 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 11:05:56 +0200 Subject: [PATCH 29/37] push lock --- package-lock.json | 125 +++------------------------------------------- 1 file changed, 6 insertions(+), 119 deletions(-) diff --git a/package-lock.json b/package-lock.json index d92604048f..d7ffd849fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3001,20 +3001,6 @@ "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, - "babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - } - }, "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", @@ -3207,12 +3193,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -3637,12 +3617,6 @@ "proto-list": "~1.2.1" } }, - "confusing-browser-globals": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", - "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==", - "dev": true - }, "connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -4386,12 +4360,6 @@ "wrappy": "1" } }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, "dir-glob": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", @@ -4667,30 +4635,19 @@ } } }, - "eslint-config-airbnb-base": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz", - "integrity": "sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w==", - "dev": true, - "requires": { - "confusing-browser-globals": "^1.0.5", - "object.assign": "^4.1.0", - "object.entries": "^1.1.0" - } - }, "eslint-config-prettier": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", - "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", "dev": true, "requires": { "get-stdin": "^6.0.0" } }, "eslint-plugin-prettier": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", - "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.0.tgz", + "integrity": "sha512-tMTwO8iUWlSRZIwS9k7/E4vrTsfvsrcM5p1eftyuqWH25nKsz/o6/54I7jwQ/3zobISyC7wMy9ZsFwgTxOcOpQ==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" @@ -9105,38 +9062,6 @@ "object-keys": "^1.1.1" } }, - "object.entries": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", - "integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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-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" - } - } - } - }, "object.getownpropertydescriptors": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", @@ -11121,44 +11046,6 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, - "tslint": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", - "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", From 57c4ff96a74bb83d728b3156ff03b1b193a1f0e7 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 12:07:55 +0200 Subject: [PATCH 30/37] remove eslint plugins from jss-react --- packages/sitecore-jss-react/package-lock.json | 161 ++---------------- packages/sitecore-jss-react/package.json | 2 - 2 files changed, 16 insertions(+), 147 deletions(-) diff --git a/packages/sitecore-jss-react/package-lock.json b/packages/sitecore-jss-react/package-lock.json index deac8e1d8d..f372230c30 100644 --- a/packages/sitecore-jss-react/package-lock.json +++ b/packages/sitecore-jss-react/package-lock.json @@ -124,6 +124,15 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@sitecore-jss/sitecore-jss": { + "version": "16.0.0-canary.8", + "resolved": "https://registry.npmjs.org/@sitecore-jss/sitecore-jss/-/sitecore-jss-16.0.0-canary.8.tgz", + "integrity": "sha512-xOXrPSPkOwH6ejWoP3XvUWeBEMbKyIP1MeRjHbMXkx46/Wjnorws7T0a5vdgfMYQO8eg5TnMNcO0HDnkGgOVTA==", + "requires": { + "lodash.unescape": "^4.0.1", + "url-parse": "^1.4.7" + } + }, "@types/chai": { "version": "4.2.13", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.13.tgz", @@ -186,12 +195,6 @@ "@types/node": "*" } }, - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", - "dev": true - }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -253,125 +256,6 @@ "integrity": "sha512-4kHAkbV/OfW2kb5BLVUuUMoumB3CP8rHqlw48aHvFy5tf9ER0AfOonBlX29l/DD68G70DmyhRlSYfQPSYpC5Vw==", "dev": true }, - "@typescript-eslint/eslint-plugin": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.10.0.tgz", - "integrity": "sha512-h6/V46o6aXpKRlarP1AiJEXuCJ7cMQdlpfMDrcllIgX3dFkLwEBTXAoNP98ZoOmqd1xvymMVRAI4e7yVvlzWEg==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.10.0", - "@typescript-eslint/scope-manager": "4.10.0", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "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" - } - } - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.10.0.tgz", - "integrity": "sha512-opX+7ai1sdWBOIoBgpVJrH5e89ra1KoLrJTz0UtWAa4IekkKmqDosk5r6xqRaNJfCXEfteW4HXQAwMdx+jjEmw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.10.0", - "@typescript-eslint/types": "4.10.0", - "@typescript-eslint/typescript-estree": "4.10.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/parser": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.10.0.tgz", - "integrity": "sha512-amBvUUGBMadzCW6c/qaZmfr3t9PyevcSWw7hY2FuevdZVp5QPw/K76VSQ5Sw3BxlgYCHZcK6DjIhSZK0PQNsQg==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "4.10.0", - "@typescript-eslint/types": "4.10.0", - "@typescript-eslint/typescript-estree": "4.10.0", - "debug": "^4.1.1" - } - }, - "@typescript-eslint/scope-manager": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.10.0.tgz", - "integrity": "sha512-WAPVw35P+fcnOa8DEic0tQUhoJJsgt+g6DEcz257G7vHFMwmag58EfowdVbiNcdfcV27EFR0tUBVXkDoIvfisQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.10.0", - "@typescript-eslint/visitor-keys": "4.10.0" - } - }, - "@typescript-eslint/types": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.10.0.tgz", - "integrity": "sha512-+dt5w1+Lqyd7wIPMa4XhJxUuE8+YF+vxQ6zxHyhLGHJjHiunPf0wSV8LtQwkpmAsRi1lEOoOIR30FG5S2HS33g==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.10.0.tgz", - "integrity": "sha512-mGK0YRp9TOk6ZqZ98F++bW6X5kMTzCRROJkGXH62d2azhghmq+1LNLylkGe6uGUOQzD452NOAEth5VAF6PDo5g==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.10.0", - "@typescript-eslint/visitor-keys": "4.10.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "globby": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", - "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "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" - } - } - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.10.0.tgz", - "integrity": "sha512-hPyz5qmDMuZWFtHZkjcCpkAKHX8vdu1G3YsCLEd25ryZgnJfj6FQuJ5/O7R+dB1ueszilJmAFMtlU4CA6se3Jg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.10.0", - "eslint-visitor-keys": "^2.0.0" - } - }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -2497,6 +2381,11 @@ "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", @@ -3219,8 +3108,7 @@ "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" }, "quick-lru": { "version": "4.0.1", @@ -3480,8 +3368,7 @@ "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, "resolve": { "version": "1.17.0", @@ -4041,21 +3928,6 @@ "yn": "3.1.1" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "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" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -4111,7 +3983,6 @@ "version": "1.4.7", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "dev": true, "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" diff --git a/packages/sitecore-jss-react/package.json b/packages/sitecore-jss-react/package.json index 619831c1db..bc0ca869b1 100644 --- a/packages/sitecore-jss-react/package.json +++ b/packages/sitecore-jss-react/package.json @@ -34,8 +34,6 @@ "@types/react": "16.9.2", "@types/react-dom": "^16.9.0", "@types/url-parse": "^1.4.3", - "@typescript-eslint/eslint-plugin": "^4.9.1", - "@typescript-eslint/parser": "^4.9.1", "chai": "^4.2.0", "chai-spies": "^1.0.0", "chai-string": "^1.5.0", From 646652d1dde776581169e8d61d0c361d67c638bf Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Mon, 21 Dec 2020 15:34:45 +0200 Subject: [PATCH 31/37] Fix react props --- packages/sitecore-jss-react/src/components/File.tsx | 4 ++-- .../sitecore-jss-react/src/enhancers/withPlaceholder.tsx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/sitecore-jss-react/src/components/File.tsx b/packages/sitecore-jss-react/src/components/File.tsx index cafb2ed595..ff53220f38 100644 --- a/packages/sitecore-jss-react/src/components/File.tsx +++ b/packages/sitecore-jss-react/src/components/File.tsx @@ -17,7 +17,7 @@ export interface FileProps { /** The file field data. */ field: FileFieldValue | FileField; /** HTML attributes that will be appended to the rendered <a /> tag. */ - children?: React.ReactNode[]; + children?: React.ReactNode; } export const File: React.SFC<FileProps> = ({ field, children, ...otherProps }) => { @@ -55,7 +55,7 @@ File.propTypes = { value: PropTypes.object, }), ]).isRequired, - children: PropTypes.array, + children: PropTypes.node, }; File.displayName = 'File'; diff --git a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx index 335ebf8ef1..84071bda99 100644 --- a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx @@ -38,9 +38,8 @@ export function withPlaceholder( placeholders: WithPlaceholderSpec, options?: WithPlaceholderOptions ) { - return ( - WrappedComponent: React.ComponentClass<PlaceholderProps> | React.SFC<PlaceholderProps> - ) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (WrappedComponent: React.ComponentClass<any> | React.SFC<any>) => { class WithPlaceholder extends PlaceholderCommon<PlaceholderProps> { static propTypes = PlaceholderCommon.propTypes; From c8d52467e98c66648030b57b9f8535fa9615b002 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 22 Dec 2020 12:47:40 +0200 Subject: [PATCH 32/37] Add eslint-plugin-jsdoc --- .eslintrc | 13 +++- package.json | 1 + .../src/components/placeholder.component.ts | 4 ++ .../src/components/placeholder.token.ts | 6 ++ .../src/components/rendering.ts | 3 + packages/sitecore-jss-cli/src/cli-shared.ts | 3 + packages/sitecore-jss-cli/src/cli.global.ts | 5 +- packages/sitecore-jss-cli/src/cli.ts | 7 ++- packages/sitecore-jss-cli/src/create/index.ts | 5 ++ .../sitecore-jss-cli/src/micro-manifest.ts | 4 ++ .../src/run-package-script.ts | 8 +++ .../sitecore-jss-cli/src/scripts/clean.ts | 3 + .../sitecore-jss-cli/src/scripts/create.ts | 17 +++++ .../src/scripts/deploy.app.ts | 3 + .../src/scripts/deploy.component.ts | 9 +++ .../src/scripts/deploy.config.ts | 3 + .../src/scripts/deploy.files.ts | 3 + .../src/scripts/deploy.items.ts | 3 + .../src/scripts/deploy.package.ts | 3 + .../src/scripts/deploy.template.ts | 9 +++ .../sitecore-jss-cli/src/scripts/deploy.ts | 3 + .../src/scripts/easter-egg.ts | 3 + .../sitecore-jss-cli/src/scripts/elephant.ts | 3 + .../sitecore-jss-cli/src/scripts/manifest.ts | 3 + .../sitecore-jss-cli/src/scripts/package.ts | 3 + .../sitecore-jss-cli/src/scripts/setup.ts | 3 + packages/sitecore-jss-cli/src/spawn.ts | 5 ++ packages/sitecore-jss-dev-tools/src/clean.ts | 3 + packages/sitecore-jss-dev-tools/src/deploy.ts | 3 + packages/sitecore-jss-dev-tools/src/digest.ts | 7 +++ .../create-default-disconnected-server.ts | 3 + .../disconnected-server/default-document.ts | 4 ++ .../src/disconnected-server/media-service.ts | 5 ++ .../src/package-deploy.ts | 21 +++++++ .../src/package-generate.ts | 3 + .../src/resolve-scjssconfig.ts | 3 + .../src/setup/find-app-name.ts | 6 ++ .../src/setup/secret-patch.ts | 9 +++ .../sitecore-jss-dev-tools/src/setup/setup.ts | 16 +++++ packages/sitecore-jss-forms/src/FormField.ts | 12 ++++ .../sitecore-jss-forms/src/FormTracker.ts | 3 + packages/sitecore-jss-forms/src/ViewModel.ts | 6 ++ .../sitecore-jss-forms/src/serializeForm.ts | 15 +++++ packages/sitecore-jss-forms/src/submitForm.ts | 8 +++ .../src/generator/createIdMapping.ts | 3 + .../src/generator/generate.ts | 29 +++++++-- .../src/generator/manifest.babel-shim.ts | 28 +++++++++ .../src/generator/manifest.types.ts | 3 + .../expandReferencedContent.ts | 3 + .../pipelines/generateMedia/utils.ts | 30 +++++++-- .../src/generator/traversal.ts | 33 +++++++--- .../src/generator/utils.ts | 10 ++- .../src/absolutify.ts | 2 +- .../src/editing-middleware.ts | 5 +- .../src/html-processors.ts | 2 +- .../src/components/Link.tsx | 2 +- .../src/components/RichText.tsx | 2 +- .../src/services/component-props-service.ts | 5 ++ .../src/tests/jsdom-setup.ts | 4 ++ packages/sitecore-jss-proxy/src/index.ts | 62 ++++++++++++++++++- .../field-templates/checkbox-list.tsx | 7 +++ .../components/field-templates/checkbox.tsx | 5 ++ .../src/components/field-templates/date.tsx | 8 +++ .../field-templates/dropdown-list.tsx | 5 ++ .../src/components/field-templates/email.tsx | 5 ++ .../components/field-templates/list-box.tsx | 5 ++ .../field-templates/multiple-line-text.tsx | 5 ++ .../src/components/field-templates/number.tsx | 5 ++ .../components/field-templates/password.tsx | 5 ++ .../field-templates/radio-button-list.tsx | 5 ++ .../field-templates/single-line-text.tsx | 5 ++ .../components/field-templates/telephone.tsx | 5 ++ .../src/default-field-factory.tsx | 3 + .../src/tests/jsdom-setup.ts | 4 ++ .../src/components/Placeholder.tsx | 3 + .../src/enhancers/withComponentFactory.tsx | 3 + .../src/components/Placeholder.tsx | 3 + .../src/enhancers/withComponentFactory.tsx | 3 + .../src/enhancers/withPlaceholder.tsx | 4 ++ .../src/enhancers/withSitecoreContext.tsx | 3 + .../src/tests/jsdom-setup.ts | 4 ++ packages/sitecore-jss-react/src/utils.ts | 2 +- .../src/devServer.ts | 7 +++ .../src/renderingHostServer.ts | 7 +++ .../src/ssrMiddleware.ts | 21 +++++++ .../sitecore-jss-rendering-host/src/tunnel.ts | 4 ++ .../sitecore-jss-tracking/src/trackingApi.ts | 25 ++++++-- .../src/components/PlaceholderCommon.ts | 9 +++ .../src/enhancers/providePlaceholders.ts | 4 ++ .../plugins/SitecoreJssPlaceholderPlugin.ts | 7 ++- packages/sitecore-jss/src/dataApi.ts | 11 ++++ packages/sitecore-jss/src/layoutDataUtils.ts | 5 ++ samples/angular/.eslintignore | 3 + 93 files changed, 648 insertions(+), 37 deletions(-) create mode 100644 samples/angular/.eslintignore diff --git a/.eslintrc b/.eslintrc index e4093077ed..0e4b0a5c64 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,7 +3,9 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "prettier" + "plugin:jsdoc/recommended", + "prettier", + "prettier/@typescript-eslint" ], "parser": "@typescript-eslint/parser", "parserOptions": { @@ -13,13 +15,19 @@ "ecmaVersion": 2020, "sourceType": "module" }, - "plugins": ["@typescript-eslint", "prettier"], + "plugins": ["@typescript-eslint", "prettier", "jsdoc"], "env": { "browser": true, "node": true, "es6": true }, "rules": { + "jsdoc/newline-after-description": "off", + "jsdoc/require-property-description": "off", + "jsdoc/require-param-description": "off", + "jsdoc/require-returns": "off", + "jsdoc/no-undefined-types": "off", + "jsdoc/require-returns-type": "off", "prettier/prettier": "error", "@typescript-eslint/naming-convention": [ "error", @@ -47,7 +55,6 @@ "curly": ["error", "multi-line"], "eol-last": ["error", "always"], "guard-for-in": "error", - "valid-jsdoc": ["error", { "requireParamDescription": false, "requireReturn": false, "requireReturnType": false }], "no-unused-labels": "error", "max-len": "off", "no-caller": "error", diff --git a/package.json b/package.json index 7dda99e4d3..874def28a7 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@typescript-eslint/parser": "^4.10.0", "eslint": "^6.6.0", "eslint-config-prettier": "^6.15.0", + "eslint-plugin-jsdoc": "^30.7.9", "eslint-plugin-prettier": "^3.3.0", "lerna": "^3.4.0", "metro": "^0.60.0", diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.ts index 951e89d7f7..76b330890b 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.ts @@ -34,6 +34,10 @@ import { RenderEachDirective } from './render-each.directive'; import { RenderEmptyDirective } from './render-empty.directive'; import { isRawRendering } from './rendering'; +/** + * @param {ComponentRendering} rendering + * @param {string} name + */ function getPlaceholder(rendering: ComponentRendering, name: string) { if (rendering && rendering.placeholders && Object.keys(rendering.placeholders).length > 0) { return rendering.placeholders[name]; diff --git a/packages/sitecore-jss-angular/src/components/placeholder.token.ts b/packages/sitecore-jss-angular/src/components/placeholder.token.ts index cf5f795808..530a91f98f 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.token.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.token.ts @@ -17,10 +17,16 @@ export interface ComponentNameAndModule { loadChildren: () => Promise<any>; } +/** + * @param {any} object + */ export function instanceOfComponentNameAndType(object: any): object is ComponentNameAndType { return 'type' in object; } +/** + * @param {any} object + */ export function instanceOfComponentNameAndModule(object: any): object is ComponentNameAndModule { return 'module' in object; } diff --git a/packages/sitecore-jss-angular/src/components/rendering.ts b/packages/sitecore-jss-angular/src/components/rendering.ts index 5d28ebcb94..c253fc3957 100644 --- a/packages/sitecore-jss-angular/src/components/rendering.ts +++ b/packages/sitecore-jss-angular/src/components/rendering.ts @@ -1,5 +1,8 @@ import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss'; +/** + * @param {HtmlElementRendering | ComponentRendering} rendering + */ export function isRawRendering( rendering: HtmlElementRendering | ComponentRendering ): rendering is HtmlElementRendering { diff --git a/packages/sitecore-jss-cli/src/cli-shared.ts b/packages/sitecore-jss-cli/src/cli-shared.ts index ea657cf0d3..871c417176 100644 --- a/packages/sitecore-jss-cli/src/cli-shared.ts +++ b/packages/sitecore-jss-cli/src/cli-shared.ts @@ -7,6 +7,9 @@ process.on('unhandledRejection', (err) => { throw err; }); +/** + * @param {any} commands + */ export default function cli(commands: { [key: string]: CommandModule & { disableStrictArgs?: boolean }; }) { diff --git a/packages/sitecore-jss-cli/src/cli.global.ts b/packages/sitecore-jss-cli/src/cli.global.ts index e1de4ac418..8e273ed881 100644 --- a/packages/sitecore-jss-cli/src/cli.global.ts +++ b/packages/sitecore-jss-cli/src/cli.global.ts @@ -1,8 +1,9 @@ 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 0da3a4b582..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 } = {}; @@ -36,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/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 45c0bb3135..1ba07ad579 100644 --- a/packages/sitecore-jss-cli/src/micro-manifest.ts +++ b/packages/sitecore-jss-cli/src/micro-manifest.ts @@ -10,6 +10,10 @@ import resolvePackage from './resolve-package'; import { handler as manifestHandler } from './scripts/manifest'; import { handler as packageHandler } from './scripts/package'; +/** + * @param {any} argv + * @param {string} manifestContents + */ export default async function microManifest( // eslint-disable-next-line @typescript-eslint/no-explicit-any argv: { [key: string]: any }, diff --git a/packages/sitecore-jss-cli/src/run-package-script.ts b/packages/sitecore-jss-cli/src/run-package-script.ts index b09fa2967f..4659178192 100644 --- a/packages/sitecore-jss-cli/src/run-package-script.ts +++ b/packages/sitecore-jss-cli/src/run-package-script.ts @@ -3,6 +3,10 @@ import spawn from './spawn'; // runs a package.json script using npm // uses yarn semantics for args (i.e. pass ['scriptname', '--myarg=value'], no -- needed) +/** + * @param {string[]} args + * @param {SpawnSyncOptionsWithStringEncoding} [options] + */ export default function runPackageScript( args: string[], options?: SpawnSyncOptionsWithStringEncoding @@ -15,6 +19,10 @@ export default function runPackageScript( // runs a package.json script using yarn or npm // uses yarn semantics for args (i.e. pass ['scriptname', '--myarg=value'], no -- needed) +/** + * @param {string[]} npmArgs + * @param {SpawnSyncOptionsWithStringEncoding} options + */ export function runPackageManagerCommand( npmArgs: string[], options?: SpawnSyncOptionsWithStringEncoding diff --git a/packages/sitecore-jss-cli/src/scripts/clean.ts b/packages/sitecore-jss-cli/src/scripts/clean.ts index d150685fd8..144ca6e6e2 100644 --- a/packages/sitecore-jss-cli/src/scripts/clean.ts +++ b/packages/sitecore-jss-cli/src/scripts/clean.ts @@ -14,6 +14,9 @@ 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 d930356824..d07bb39f86 100644 --- a/packages/sitecore-jss-cli/src/scripts/create.ts +++ b/packages/sitecore-jss-cli/src/scripts/create.ts @@ -8,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 <name> <template>', @@ -61,6 +64,9 @@ export function builder(yargs: Argv) { ); } +/** + * @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); @@ -108,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( @@ -126,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' }); @@ -158,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 5bb223059d..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,9 @@ 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) diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts index 66cc7cf103..35db44431c 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts @@ -3,6 +3,9 @@ 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 <name>', @@ -13,6 +16,9 @@ export default function builder(yargs: Argv) { ); } +/** + * @param {Argv} yargs + */ export function args(yargs: Argv) { return templateArgs(yargs) .option('allowedPlaceholders', { @@ -31,6 +37,9 @@ export function args(yargs: Argv) { }); } +/** + * @param {any} argv + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any async function handler(argv: any) { // create micro-manifest to deploy from diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts index 6b06302d4c..411f30b298 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts @@ -30,6 +30,9 @@ 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.files.ts b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts index 8aa5a3aa25..43cd0584cc 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts @@ -61,6 +61,9 @@ 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 48eed10337..3216185c08 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts @@ -61,6 +61,9 @@ export const builder = { ...packageBuilder, }; +/** + * @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.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 d326cba7bc..d5e3448005 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts @@ -3,6 +3,9 @@ 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 <name>', @@ -13,6 +16,9 @@ export default function builder(yargs: Argv) { ); } +/** + * @param {Argv} yargs + */ export function args(yargs: Argv) { return yargs .positional('name', { @@ -68,6 +74,9 @@ export function args(yargs: Argv) { }); } +/** + * @param {Argv} argv + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any async function handler(argv: any) { // create micro-manifest to deploy from diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.ts b/packages/sitecore-jss-cli/src/scripts/deploy.ts index 9b85d8d333..ea2c990fa7 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.ts @@ -9,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({ diff --git a/packages/sitecore-jss-cli/src/scripts/easter-egg.ts b/packages/sitecore-jss-cli/src/scripts/easter-egg.ts index 72706c17b8..27e30a5127 100644 --- a/packages/sitecore-jss-cli/src/scripts/easter-egg.ts +++ b/packages/sitecore-jss-cli/src/scripts/easter-egg.ts @@ -5,6 +5,9 @@ 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/manifest.ts b/packages/sitecore-jss-cli/src/scripts/manifest.ts index ecf935fe5a..971ce0440b 100644 --- a/packages/sitecore-jss-cli/src/scripts/manifest.ts +++ b/packages/sitecore-jss-cli/src/scripts/manifest.ts @@ -102,6 +102,9 @@ 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/package.ts b/packages/sitecore-jss-cli/src/scripts/package.ts index b601a30c4e..b30778348e 100644 --- a/packages/sitecore-jss-cli/src/scripts/package.ts +++ b/packages/sitecore-jss-cli/src/scripts/package.ts @@ -27,6 +27,9 @@ 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(); diff --git a/packages/sitecore-jss-cli/src/scripts/setup.ts b/packages/sitecore-jss-cli/src/scripts/setup.ts index e9484ebb99..33ead5b8d5 100644 --- a/packages/sitecore-jss-cli/src/scripts/setup.ts +++ b/packages/sitecore-jss-cli/src/scripts/setup.ts @@ -51,6 +51,9 @@ 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 58d844414c..edf718a8ea 100644 --- a/packages/sitecore-jss-cli/src/spawn.ts +++ b/packages/sitecore-jss-cli/src/spawn.ts @@ -1,6 +1,11 @@ import { SpawnSyncOptionsWithStringEncoding } from 'child_process'; import spawn from 'cross-spawn'; +/** + * @param {string} command + * @param {string[]} args + * @param {SpawnSyncOptionsWithStringEncoding} options + */ export default function( command: string, args: string[], 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 d195913e20..93ae8fffcf 100644 --- a/packages/sitecore-jss-dev-tools/src/deploy.ts +++ b/packages/sitecore-jss-dev-tools/src/deploy.ts @@ -10,6 +10,9 @@ export interface DeployOptions { clean?: boolean; } +/** + * @param {DeployOptions} options + */ export function deploy(options: DeployOptions) { let createdDestination = false; diff --git a/packages/sitecore-jss-dev-tools/src/digest.ts b/packages/sitecore-jss-dev-tools/src/digest.ts index 59a7d16bab..abdfed6a81 100644 --- a/packages/sitecore-jss-dev-tools/src/digest.ts +++ b/packages/sitecore-jss-dev-tools/src/digest.ts @@ -1,6 +1,9 @@ import { createHash, createHmac } from 'crypto'; import { createReadStream } from 'fs'; +/** + * @param {string} path + */ export function digest(path: string): Promise<string> { return new Promise((resolve, reject) => { const hash = createHash('sha256'); @@ -12,6 +15,10 @@ export function digest(path: string): Promise<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/create-default-disconnected-server.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/create-default-disconnected-server.ts index d831a31987..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 @@ -94,6 +94,9 @@ export interface DisconnectedServerOptions { customizeRendering?: CustomizeRenderFunction; } +/** + * @param {DisconnectedServerOptions} options + */ export function createDefaultDisconnectedServer(options: DisconnectedServerOptions) { let app = options.server; 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 6db0fb6033..613cff101d 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 @@ -8,6 +8,10 @@ export interface DefaultDocumentMiddlewareOptions { indexFilePath: string; } +/** + * @param {object} config + * @param {string} config.indexFilePath + */ export function createDefaultDocumentMiddleware({ indexFilePath, }: DefaultDocumentMiddlewareOptions) { 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 44deef5f6e..7494db12da 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 @@ -11,6 +11,11 @@ export interface DisconnectedAssetMiddlewareOptions { staticRootPath: string; } +/** + * @param {Object} config + * @param {string} config.manifestPath + * @param {string} config.staticRootPath + */ export function createDisconnectedAssetMiddleware({ manifestPath, staticRootPath, diff --git a/packages/sitecore-jss-dev-tools/src/package-deploy.ts b/packages/sitecore-jss-dev-tools/src/package-deploy.ts index 305e6e7d8b..9a4cc56293 100644 --- a/packages/sitecore-jss-dev-tools/src/package-deploy.ts +++ b/packages/sitecore-jss-dev-tools/src/package-deploy.ts @@ -20,6 +20,10 @@ 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', () => { @@ -44,6 +48,9 @@ function applyCertPinning(req: request.Request, options: PackageDeployOptions) { }); }); } +/** + * @param {string} fp + */ function normalizeFingerprint(fp: string): string { // // The fingerprint for a certificate is a 20-byte value. @@ -62,9 +69,17 @@ function normalizeFingerprint(fp: string): string { // function implements the logic for that conversion. return fp.toLowerCase().replace(new RegExp(':', 'g'), ''); } +/** + * @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[] = []; @@ -96,6 +111,9 @@ 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( @@ -208,6 +226,9 @@ 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 diff --git a/packages/sitecore-jss-dev-tools/src/package-generate.ts b/packages/sitecore-jss-dev-tools/src/package-generate.ts index 590458fcd5..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); diff --git a/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts b/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts index 0c130ad3b8..acb689084e 100644 --- a/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts +++ b/packages/sitecore-jss-dev-tools/src/resolve-scjssconfig.ts @@ -14,6 +14,9 @@ export interface ScJssConfig { sitecore: JssConfiguration; } +/** + * @param {any} config + */ export function resolveScJssConfig({ configPath = './scjssconfig.json', configName = 'sitecore', 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 = /<app (.*)name="([^"]+)/gm.exec(contents); 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 `<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> diff --git a/packages/sitecore-jss-dev-tools/src/setup/setup.ts b/packages/sitecore-jss-dev-tools/src/setup/setup.ts index ee0d3b38a7..bbeaab115f 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/setup.ts @@ -14,6 +14,16 @@ 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, @@ -52,6 +62,12 @@ function getInteractiveData( return result; } +/** + * @param {boolean} interactive + * @param {string} outputFile + * @param {JssConfiguration} [initialData] + * @param {string} [configName] + */ export function setup( interactive: boolean, outputFile?: string, diff --git a/packages/sitecore-jss-forms/src/FormField.ts b/packages/sitecore-jss-forms/src/FormField.ts index 290411d3af..a3daf77830 100644 --- a/packages/sitecore-jss-forms/src/FormField.ts +++ b/packages/sitecore-jss-forms/src/FormField.ts @@ -7,6 +7,9 @@ export interface FormField<TViewModel extends ViewModel = ViewModel> { model: TViewModel; } +/** + * @param {any} object + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function instanceOfFormField<T extends ViewModel>(object: any): object is FormField<T> { return 'model' in object; @@ -19,6 +22,9 @@ export interface ValueFormField<TViewModel extends InputViewModel = InputViewMod valueField: HtmlFormField; } +/** + * @param {FormField} object + */ export function instanceOfValueFormField(object: FormField<any>): object is ValueFormField<any> { return 'indexField' in object; } @@ -29,6 +35,9 @@ export interface ButtonFormField extends FormField<TitleFieldViewModel> { buttonField: HtmlFormField; } +/** + * @param {FormField} object + */ export function instanceOfButtonFormField(object: FormField): object is ButtonFormField { return 'buttonField' in object; } @@ -37,6 +46,9 @@ export interface FormFieldSection extends FormField<FieldViewModel> { 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 4fd5282d9c..56d763c056 100644 --- a/packages/sitecore-jss-forms/src/FormTracker.ts +++ b/packages/sitecore-jss-forms/src/FormTracker.ts @@ -27,6 +27,9 @@ export interface FormTrackerOptions { fetcher?: TrackerFetcher; } +/** + * @param {RequestInit} [options] + */ export function createFetchBasedTrackerFetcher(options?: RequestInit): TrackerFetcher { return (formData, endpoint) => fetch(endpoint, { 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/serializeForm.ts b/packages/sitecore-jss-forms/src/serializeForm.ts index e0ac61b9b7..b55cda94ed 100644 --- a/packages/sitecore-jss-forms/src/serializeForm.ts +++ b/packages/sitecore-jss-forms/src/serializeForm.ts @@ -45,6 +45,11 @@ export function serializeForm(form: SitecoreForm, options?: SerializeFormOptions return result; } +/** + * @param {JssFormData} result + * @param {Array<FormField<any>>} fields + * @param {SerializeFormOptions} options + */ function pushFields( result: JssFormData, // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -85,11 +90,21 @@ function pushFields( }); } +/** + * @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 9d44911099..9549e6c229 100644 --- a/packages/sitecore-jss-forms/src/submitForm.ts +++ b/packages/sitecore-jss-forms/src/submitForm.ts @@ -7,6 +7,9 @@ export interface FormSubmitOptions { fetcher?: FormFetcher; } +/** + * @param {RequestInit} [options] + */ export function createFetchBasedFormFetcher(options?: RequestInit): FormFetcher { return (formData: JssFormData, endpoint: string) => fetch(endpoint, { @@ -21,6 +24,11 @@ export function createFetchBasedFormFetcher(options?: RequestInit): FormFetcher .then((res) => res as FormResult); } +/** + * @param formData + * @param endpoint + * @param {FormSubmitOptions} [options] + */ export function submitForm( formData: JssFormData, endpoint: string, diff --git a/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts b/packages/sitecore-jss-manifest/src/generator/createIdMapping.ts index f822f4cda3..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 diff --git a/packages/sitecore-jss-manifest/src/generator/generate.ts b/packages/sitecore-jss-manifest/src/generator/generate.ts index 50a3544126..ee9f5ece06 100644 --- a/packages/sitecore-jss-manifest/src/generator/generate.ts +++ b/packages/sitecore-jss-manifest/src/generator/generate.ts @@ -164,10 +164,26 @@ 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 {Object} config + * @param {string} config.requireArg + * @param {string[]} config.fileGlobs + * @param {any} config.pipelines + * @param {string} config.appName + * @param {boolean} [config.excludeItems] + * @param {boolean} [config.excludeDictionary] + * @param {string} config.language + * @param {string[]} config.pipelinePatchFileGlobs + * @param {boolean} config.debug + * @param {boolean} config.wipe + * @param {string[]} config.rootPlaceholders + * @param {boolean} config.skipPlaceholderBlacklist + */ export async function generateToVariable({ requireArg, fileGlobs, @@ -207,6 +223,11 @@ export async function generateToVariable({ // generates a JSON manifest and writes its contents to a directory. Media referenced in the manifest // is also copied to the directory. +/** + * @param {Object} config + * @param {string} [config.outputPath] + * @param {boolean} [config.excludeMedia] + */ 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 8f42997879..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,6 +9,10 @@ import { Manifest } from './manifest.types'; // DEPRECATED: favor using typing JSDoc instead, e.g. @param {Manifest} manifest Manifest instance to add components to +/** + * @param {Manifest} manifest + * @param {...any} components + */ export function addComponent( manifest: Manifest, ...components: ManifestTypes.ComponentDefinition[] @@ -16,16 +20,28 @@ export function addComponent( manifest.addComponent(...components); } +/** + * @param {Manifest} manifest + * @param {...any} templates + */ export function addTemplate(manifest: Manifest, ...templates: ManifestTypes.TemplateDefinition[]) { manifest.addTemplate(...templates); } +/** + * @param {Manifest} manifest + * @param {...any} placeholders + */ export function addPlaceholder( manifest: Manifest, ...placeholders: ManifestTypes.PlaceholderDefinition[] ) { manifest.addPlaceholder(...placeholders); } +/** + * @param {Manifest} manifest + * @param {...any} routeTypes + */ export function addRouteType( manifest: Manifest, ...routeTypes: ManifestTypes.TemplateDefinition[] @@ -33,14 +49,26 @@ export function addRouteType( 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); } +/** + * @param {Manifest} manifest + * @param {...any} entries + */ export function addDictionary( manifest: Manifest, ...entries: Array<{ key: string; value: string }> diff --git a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts index c2817e1428..8f40554606 100644 --- a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts +++ b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts @@ -356,6 +356,9 @@ export interface ItemReference { id: string; } +/** + * @param {ItemDefinition | ItemReference} obj + */ export function isItemDefinition(obj: ItemDefinition | ItemReference): obj is ItemDefinition { return (obj as ItemDefinition).name !== undefined; } 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 ddae5403ba..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; 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 ab815af209..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; @@ -55,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)) { @@ -72,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': @@ -87,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/traversal.ts b/packages/sitecore-jss-manifest/src/generator/traversal.ts index 976587d925..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); @@ -85,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)) { @@ -96,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 b725243b1d..ce8f105204 100644 --- a/packages/sitecore-jss-manifest/src/generator/utils.ts +++ b/packages/sitecore-jss-manifest/src/generator/utils.ts @@ -134,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[] = []; @@ -160,6 +164,7 @@ export function checkUnique(input: any[], selector: (element: any) => string) { /** * Finds a template definition by name in one or more arrays of template/component definitions * @param {string} templateName + * @param {...Array<Array<TemplateDefinition | ComponentDefinition>>} templates * @returns {TemplateDefinition | ComponentDefinition | null} template */ export function findTemplate( @@ -197,6 +202,7 @@ export function findTemplate( * @param {Object} fields * @param {TemplateDefinition | ComponentDefinition} template * @param {Function} handleError + * @param {...Array<Array<TemplateDefinition | ComponentDefinition>>} inheritedTemplates * @returns {Object} validated fields */ export function validateFieldDefinitions( diff --git a/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts b/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts index 00f4816a8e..d4aaa60611 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/absolutify.ts @@ -43,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/editing-middleware.ts b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts index 2d3aa35b65..422af34ff5 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts @@ -8,7 +8,7 @@ import { HtmlProcessor } from './html-processors'; export class EditingMiddleware { /** * Express middleware for handling requests from the Sitecore Experience Editor. - * @constructor + * @class * @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. @@ -76,6 +76,9 @@ export class EditingMiddleware { }; } +/** + * @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". 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 e0bf886309..5129b0cc53 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts @@ -11,7 +11,7 @@ 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. */ diff --git a/packages/sitecore-jss-nextjs/src/components/Link.tsx b/packages/sitecore-jss-nextjs/src/components/Link.tsx index e6f210e3e1..a6151e9733 100644 --- a/packages/sitecore-jss-nextjs/src/components/Link.tsx +++ b/packages/sitecore-jss-nextjs/src/components/Link.tsx @@ -12,7 +12,7 @@ import { export type LinkProps = ReactLinkProps & { /** * If `href` match with `internalLinkMatcher` regexp, then it's internal link and NextLink will be rendered - * @defaultvalue /^\//g + * @default /^\//g */ internalLinkMatcher?: RegExp; }; diff --git a/packages/sitecore-jss-nextjs/src/components/RichText.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.tsx index 5b96135498..eccbea78df 100644 --- a/packages/sitecore-jss-nextjs/src/components/RichText.tsx +++ b/packages/sitecore-jss-nextjs/src/components/RichText.tsx @@ -10,7 +10,7 @@ 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; }; 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 198a21b4a7..21ced4b377 100644 --- a/packages/sitecore-jss-nextjs/src/services/component-props-service.ts +++ b/packages/sitecore-jss-nextjs/src/services/component-props-service.ts @@ -123,6 +123,11 @@ 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<NextContext>} params.fetchFunctionFactory + * @param {LayoutServiceData} params.layoutData + * @param {NextContext} params.context + * @param {ComponentPropsRequest<NextContext>[]} params.requests * @returns {ComponentPropsRequest<NextContext>[]} array of requests */ collectRequests<NextContext>(params: { diff --git a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts index 8ddb12124c..52b98bc2a5 100644 --- a/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-nextjs/src/tests/jsdom-setup.ts @@ -11,6 +11,10 @@ const { JSDOM } = require('jsdom'); const jsdom = new JSDOM('<!doctype html><html><body></body></html>'); 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') diff --git a/packages/sitecore-jss-proxy/src/index.ts b/packages/sitecore-jss-proxy/src/index.ts index 6b2747c034..c8fb26d1c7 100644 --- a/packages/sitecore-jss-proxy/src/index.ts +++ b/packages/sitecore-jss-proxy/src/index.ts @@ -35,6 +35,13 @@ export const removeEmptyAnalyticsCookie = (proxyResponse: any) => { }; // inspired by: http://stackoverflow.com/a/22487927/9324 +/** + * @param {IncomingMessage} proxyResponse + * @param {IncomingMessage} request + * @param {ServerResponse} serverResponse + * @param {AppRenderer} renderer + * @param {ProxyConfig} config + */ async function renderAppToResponse( proxyResponse: IncomingMessage, request: IncomingMessage, @@ -88,6 +95,9 @@ async function renderAppToResponse( return true; }; + /** + * Extract layout service data from proxy response + */ async function extractLayoutServiceDataFromProxyResponse(): Promise<any> { if ( proxyResponse.statusCode === HttpStatus.OK || @@ -124,7 +134,10 @@ async function renderAppToResponse( return Promise.resolve(null); } - // function replies with HTTP 500 when an error occurs + /** + * function replies with HTTP 500 when an error occurs + * @param {Error} error + */ async function replyWithError(error: Error) { console.error(error); @@ -142,6 +155,10 @@ async function renderAppToResponse( } // callback handles the result of server-side rendering + /** + * @param {Error | null} error + * @param {RenderResponse} result + */ async function handleRenderingResult(error: Error | null, result: RenderResponse | null) { if (!error && !result) { return replyWithError(new Error('Render function did not return a result or an error!')); @@ -202,6 +219,11 @@ async function renderAppToResponse( completeProxyResponse(content, finalStatusCode); } + /** + * @param {Buffer | null} content + * @param {number} statusCode + * @param {any} [headers] + */ function completeProxyResponse(content: Buffer | null, statusCode: number, headers?: any) { if (!headers) { headers = proxyResponse.headers; @@ -214,6 +236,9 @@ async function renderAppToResponse( originalEnd.call(serverResponse); } + /** + * @param {any} layoutServiceData + */ async function createViewBag(layoutServiceData: any): Promise<any> { let viewBag = { statusCode: proxyResponse.statusCode, @@ -259,6 +284,13 @@ async function renderAppToResponse( }; } +/** + * @param {IncomingMessage} proxyResponse + * @param {any} request + * @param {ServerResponse} serverResponse + * @param {AppRenderer} renderer + * @param {ProxyConfig} config + */ function handleProxyResponse( proxyResponse: IncomingMessage, request: any, @@ -291,6 +323,12 @@ function handleProxyResponse( return renderAppToResponse(proxyResponse, request, serverResponse, renderer, config); } +/** + * @param {string} reqPath + * @param {any} req + * @param {ProxyConfig} config + * @param {RouteUrlParser} parseRouteUrl + */ export function rewriteRequestPath( reqPath: string, req: any, @@ -373,6 +411,11 @@ export function rewriteRequestPath( return path; } +/** + * @param {string} originalUrl + * @param {ProxyConfig} config + * @param {boolean} noDebug + */ function isUrlIgnored(originalUrl: string, config: ProxyConfig, noDebug = false): boolean { if (config.pathRewriteExcludePredicate && config.pathRewriteExcludeRoutes) { console.error( @@ -427,6 +470,13 @@ function isUrlIgnored(originalUrl: string, config: ProxyConfig, noDebug = false) return false; } +/** + * @param {any} proxyReq + * @param {any} req + * @param {ServerResponse} res + * @param {ProxyConfig} config + * @param {Function} customOnProxyReq + */ function handleProxyRequest( proxyReq: any, req: any, @@ -450,6 +500,11 @@ function handleProxyRequest( } } +/** + * @param {AppRenderer} renderer + * @param {ProxyConfig} config + * @param {RouteUrlParser} parseRouteUrl + */ function createOptions( renderer: AppRenderer, config: ProxyConfig, @@ -484,6 +539,11 @@ function createOptions( }; } +/** + * @param {AppRenderer} renderer + * @param {ProxyConfig} config + * @param {RouteUrlParser} parseRouteUrl + */ export default function scProxy( renderer: AppRenderer, config: ProxyConfig, diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox-list.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox-list.tsx index e4966133b5..95e56d41fe 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox-list.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox-list.tsx @@ -42,6 +42,13 @@ const CheckboxList: React.FunctionComponent<ListFieldProps> = (props) => { ); }; +/** + * @param {ValueFormField} field + * @param {string[]} originalFieldValue + * @param {string} changedElement + * @param {boolean} checked + * @param {FieldChangeCallback} callback + */ function handleOnChange( field: ValueFormField, originalFieldValue: string[], diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx index b4a72b0887..89566e7f40 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/checkbox.tsx @@ -26,6 +26,11 @@ const Checkbox: React.FunctionComponent<ValueFieldProps> = (props) => { ); }; +/** + * @param {ValueFormField} field + * @param {boolean} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: boolean, callback: FieldChangeCallback) { // (fieldName, fieldValue, isValid, validationErrors) // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/date.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/date.tsx index 3c8d4bb573..b57a2342fc 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/date.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/date.tsx @@ -27,6 +27,9 @@ const DateField: React.FunctionComponent<ValueFieldProps<DateInputViewModel>> = ); }; +/** + * @param {string} [value] + */ function formatValue(value?: string) { // dates are serialized from the API as full date/times (i.e. 2019-01-11T00:00:00) // but the date input expects only the date. Since the format is predictably long, @@ -38,6 +41,11 @@ function formatValue(value?: string) { return value.substring(0, 10); } +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx index e02e30f747..668e694a24 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/dropdown-list.tsx @@ -41,6 +41,11 @@ const DropdownList: React.FunctionComponent<ListFieldProps<DropdownListViewModel ); }; +/** + * @param {ValueFormField} field + * @param {string} newValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, newValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/email.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/email.tsx index ae262373b9..de5d212110 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/email.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/email.tsx @@ -27,6 +27,11 @@ const Email: React.FunctionComponent<ValueFieldProps<StringInputViewModel>> = (p ); }; +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx index eef54bd9b8..0cff8e5edd 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/list-box.tsx @@ -53,6 +53,11 @@ const ListBox: React.FunctionComponent<ListFieldProps<ListBoxViewModel>> = (prop ); }; +/** + * @param {ValueFormField} field + * @param {HTMLOptionsCollection} options + * @param {FieldChangeCallback} callback + */ function handleOnChange( field: ValueFormField, options: HTMLOptionsCollection, diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/multiple-line-text.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/multiple-line-text.tsx index 848483dd51..dd54b87540 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/multiple-line-text.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/multiple-line-text.tsx @@ -29,6 +29,11 @@ const MultipleLineText: React.FunctionComponent<ValueFieldProps<MultiLineStringI ); }; +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/number.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/number.tsx index 7b0e16222e..f414cb0b2f 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/number.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/number.tsx @@ -28,6 +28,11 @@ const NumberField: React.FunctionComponent<ValueFieldProps<NumberInputViewModel> ); }; +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/password.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/password.tsx index c3c7c4faad..ff79be307c 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/password.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/password.tsx @@ -26,6 +26,11 @@ const Password: React.FunctionComponent<ValueFieldProps<StringInputViewModel>> = ); }; +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx index 630405fcf6..79f800df95 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/radio-button-list.tsx @@ -41,6 +41,11 @@ const RadioButtonList: React.FunctionComponent<ListFieldProps> = (props) => { ); }; +/** + * @param {ValueFormField} field + * @param {string} newValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, newValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/single-line-text.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/single-line-text.tsx index be91b72140..0e8938fbe9 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/single-line-text.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/single-line-text.tsx @@ -27,6 +27,11 @@ const SingleLineText: React.FunctionComponent<ValueFieldProps<StringInputViewMod ); }; +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/components/field-templates/telephone.tsx b/packages/sitecore-jss-react-forms/src/components/field-templates/telephone.tsx index f1a2e1773d..de83394eab 100644 --- a/packages/sitecore-jss-react-forms/src/components/field-templates/telephone.tsx +++ b/packages/sitecore-jss-react-forms/src/components/field-templates/telephone.tsx @@ -27,6 +27,11 @@ const Telephone: React.FunctionComponent<ValueFieldProps<StringInputViewModel>> ); }; +/** + * @param {ValueFormField} field + * @param {string} fieldValue + * @param {FieldChangeCallback} callback + */ function handleOnChange(field: ValueFormField, fieldValue: string, callback: FieldChangeCallback) { let valid = true; const errorMessages = []; diff --git a/packages/sitecore-jss-react-forms/src/default-field-factory.tsx b/packages/sitecore-jss-react-forms/src/default-field-factory.tsx index b033a84f39..4469171984 100644 --- a/packages/sitecore-jss-react-forms/src/default-field-factory.tsx +++ b/packages/sitecore-jss-react-forms/src/default-field-factory.tsx @@ -17,6 +17,9 @@ import Telephone from './components/field-templates/telephone'; import { FieldTypes } from './FieldTypes'; import FieldFactory from './field-factory'; +/** + * Create default field factory + */ export function createDefaultFieldFactory() { const defaultFieldFactory = new FieldFactory(); diff --git a/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts b/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts index 56a76a18e9..0a09cc6029 100644 --- a/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-react-forms/src/tests/jsdom-setup.ts @@ -9,6 +9,10 @@ const { JSDOM } = require('jsdom'); const jsdom = new JSDOM('<!doctype html><html><body></body></html>'); 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') diff --git a/packages/sitecore-jss-react-native/src/components/Placeholder.tsx b/packages/sitecore-jss-react-native/src/components/Placeholder.tsx index 22be4f7455..07ab5734f0 100644 --- a/packages/sitecore-jss-react-native/src/components/Placeholder.tsx +++ b/packages/sitecore-jss-react-native/src/components/Placeholder.tsx @@ -35,6 +35,9 @@ export interface PlaceholderComponentProps extends PlaceholderProps { ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; } +/** + * @param {HtmlElementRendering | ComponentRendering} rendering + */ function isRawRendering( rendering: HtmlElementRendering | ComponentRendering ): rendering is HtmlElementRendering { diff --git a/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.tsx b/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.tsx index a484e4e933..c567b255ab 100644 --- a/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.tsx +++ b/packages/sitecore-jss-react-native/src/enhancers/withComponentFactory.tsx @@ -6,6 +6,9 @@ export interface ComponentFactoryProps { componentFactory?: ComponentFactory | null; } +/** + * @param {React.ComponentClass<T> | React.SFC<T>} Component + */ export function withComponentFactory<T extends ComponentFactoryProps>( Component: React.ComponentClass<T> | React.SFC<T> ) { diff --git a/packages/sitecore-jss-react/src/components/Placeholder.tsx b/packages/sitecore-jss-react/src/components/Placeholder.tsx index 0156d36a51..8c5acc6b3c 100644 --- a/packages/sitecore-jss-react/src/components/Placeholder.tsx +++ b/packages/sitecore-jss-react/src/components/Placeholder.tsx @@ -31,6 +31,9 @@ export interface PlaceholderComponentProps extends PlaceholderProps { ) => React.ComponentClass<unknown> | React.SFC<unknown> | React.ReactNode; } +/** + * @param {HtmlElementRendering | ComponentRendering} rendering + */ function isRawRendering( rendering: HtmlElementRendering | ComponentRendering ): rendering is HtmlElementRendering { diff --git a/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx b/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx index 2f6670f267..0c7b0cb493 100644 --- a/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withComponentFactory.tsx @@ -6,6 +6,9 @@ export interface ComponentFactoryProps { componentFactory?: ComponentFactory; } +/** + * @param {React.ComponentClass<T> | React.SFC<T>} Component + */ export function withComponentFactory<T extends ComponentFactoryProps>( Component: React.ComponentClass<T> | React.SFC<T> ) { diff --git a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx index 84071bda99..765771f4e0 100644 --- a/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withPlaceholder.tsx @@ -34,6 +34,10 @@ export type WithPlaceholderSpec = | (string | PlaceholderToPropMapping) | (string | PlaceholderToPropMapping)[]; +/** + * @param {WithPlaceholderSpec} placeholders + * @param {WithPlaceholderOptions} [options] + */ export function withPlaceholder( placeholders: WithPlaceholderSpec, options?: WithPlaceholderOptions diff --git a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx index 5b6ce5e3b4..e8ed641993 100644 --- a/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withSitecoreContext.tsx @@ -19,6 +19,9 @@ export type WithSitecoreContextHocProps<ComponentProps> = Pick< Exclude<keyof ComponentProps, keyof WithSitecoreContextProps> >; +/** + * @param {WithSitecoreContextOptions} [options] + */ export function withSitecoreContext(options?: WithSitecoreContextOptions) { return function withSitecoreContextHoc<ComponentProps extends ComponentConsumerProps>( Component: React.ComponentType<ComponentProps> diff --git a/packages/sitecore-jss-react/src/tests/jsdom-setup.ts b/packages/sitecore-jss-react/src/tests/jsdom-setup.ts index a88ab385d0..3a6c560773 100644 --- a/packages/sitecore-jss-react/src/tests/jsdom-setup.ts +++ b/packages/sitecore-jss-react/src/tests/jsdom-setup.ts @@ -10,6 +10,10 @@ const { JSDOM } = require('jsdom'); const jsdom = new JSDOM('<!doctype html><html><body></body></html>'); 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') diff --git a/packages/sitecore-jss-react/src/utils.ts b/packages/sitecore-jss-react/src/utils.ts index 564f1fc984..204c2fa404 100644 --- a/packages/sitecore-jss-react/src/utils.ts +++ b/packages/sitecore-jss-react/src/utils.ts @@ -12,7 +12,7 @@ export const convertKebabCasetoCamelCase = (str: string) => * We don't need to convert any other attributes (that we know of), because the placeholder renders them "as-is" by using the special "is" React prop. * For whatever reason though, the "style" prop is still validated as needing to be an object when using the "is" prop, which is why we need to convert from string to object. * @param {string} [style] style - * @returns {array} converted attributes + * @returns {Array} converted attributes */ export const convertStyleAttribute = (style = '') => { // styleParse converts a style attribute string into an object format diff --git a/packages/sitecore-jss-rendering-host/src/devServer.ts b/packages/sitecore-jss-rendering-host/src/devServer.ts index baee0d418b..83707abdd9 100644 --- a/packages/sitecore-jss-rendering-host/src/devServer.ts +++ b/packages/sitecore-jss-rendering-host/src/devServer.ts @@ -70,6 +70,9 @@ export interface DevServerOptions { clean?: boolean; } +/** + * @param {any} config + */ export function startDevServer({ port = 0, tunnelUrl, @@ -253,6 +256,10 @@ export function startDevServer({ }); } +/** + * @param {Function | undefined} hook + * @param {...any} args + */ // eslint-disable-next-line @typescript-eslint/ban-types function invokeHook(hook: Function | undefined, ...args: any[]) { if (hook && typeof hook === 'function') { diff --git a/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts b/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts index fca26a139c..798299f051 100644 --- a/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts +++ b/packages/sitecore-jss-rendering-host/src/renderingHostServer.ts @@ -41,6 +41,9 @@ export interface RenderingHostServerOptions { enableCompression?: boolean; } +/** + * @param {any} config + */ export function startRenderingHostServer({ port = 0, hostname = 'localhost', @@ -95,6 +98,10 @@ export function startRenderingHostServer({ }); } +/** + * @param {Function | undefined} hook + * @param {...any} args + */ // eslint-disable-next-line @typescript-eslint/ban-types function invokeHook(hook: Function | undefined, ...args: any[]) { if (hook && typeof hook === 'function') { diff --git a/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts b/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts index 4d612b6709..f964aa4809 100644 --- a/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts +++ b/packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts @@ -56,6 +56,9 @@ export const ssrMiddleware: SSRMiddleware = ({ }; // todo: add hook for modifying html / response before end +/** + * @param {ServerResponse} res + */ export function getDefaultAppRendererCallback(res: ServerResponse) { const callback: RenderCallback = (errorValue: Error, successValue?: any) => { if (errorValue) { @@ -81,6 +84,9 @@ export function getDefaultAppRendererCallback(res: ServerResponse) { return callback; } +/** + * @param {IncomingMessage} request + */ export function readRequestBodyAsJson(request: IncomingMessage) { const dataWriter = { output: Buffer.from('') }; request.on('data', onReadableStreamDataHandler(dataWriter)); @@ -95,6 +101,10 @@ export function readRequestBodyAsJson(request: IncomingMessage) { }); } +/** + * @param {ServerResponse} res + * @param {Error} errorValue + */ export function respondWithError(res: ServerResponse, errorValue: Error) { console.error(errorValue); res.statusCode = 500; @@ -106,6 +116,10 @@ export function respondWithError(res: ServerResponse, errorValue: Error) { ); } +/** + * @param {Object} dataWriter + * @param {Buffer} dataWriter.output + */ export function onReadableStreamDataHandler(dataWriter: { output: Buffer }) { return (data: any) => { if (Buffer.isBuffer(data)) { @@ -116,6 +130,10 @@ export function onReadableStreamDataHandler(dataWriter: { output: Buffer }) { }; } +/** + * @param {Buffer} data + * @param {string} [contentEncoding] + */ export function extractJsonFromStreamData(data: Buffer, contentEncoding?: string): Promise<any> { let responseString: Promise<string>; @@ -141,6 +159,9 @@ export function extractJsonFromStreamData(data: Buffer, contentEncoding?: string return responseString.then(tryParseJson); } +/** + * @param {string} jsonString + */ export function tryParseJson(jsonString: string) { try { const json = JSON.parse(jsonString); diff --git a/packages/sitecore-jss-rendering-host/src/tunnel.ts b/packages/sitecore-jss-rendering-host/src/tunnel.ts index ec2c9a07e0..5e3214e65b 100644 --- a/packages/sitecore-jss-rendering-host/src/tunnel.ts +++ b/packages/sitecore-jss-rendering-host/src/tunnel.ts @@ -5,6 +5,10 @@ export interface TunnelOptions extends INgrokOptions { quiet?: boolean; } +/** + * @param {string} renderHostname + * @param {INgrokOptions} options + */ export function startRenderHostTunnel( renderHostname: string, options: INgrokOptions = { port: 80, proto: 'http', quiet: false } diff --git a/packages/sitecore-jss-tracking/src/trackingApi.ts b/packages/sitecore-jss-tracking/src/trackingApi.ts index e20c7be4fb..89f41e3485 100644 --- a/packages/sitecore-jss-tracking/src/trackingApi.ts +++ b/packages/sitecore-jss-tracking/src/trackingApi.ts @@ -19,6 +19,9 @@ class ResponseError extends Error { } } +/** + * @param {HttpResponse<unknown>} response + */ function checkStatus(response: HttpResponse<unknown>) { if (response.status >= 200 && response.status < 300) { return response; @@ -28,17 +31,26 @@ function checkStatus(response: HttpResponse<unknown>) { throw error; } -// note: encodeURIComponent is available via browser (window) or natively in node.js -// if you use another js engine for server-side rendering you may not have native encodeURIComponent -// and would then need to install a package for that functionality +/** + * note: encodeURIComponent is available via browser (window) or natively in node.js + * if you use another js engine for server-side rendering you may not have native encodeURIComponent + * and would then need to install a package for that functionality + * @param {Object} params + */ function getQueryString(params: { [key: string]: unknown }) { return Object.keys(params) .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k] as string)}`) .join('&'); } -// note: axios needs to use `withCredentials: true` in order for Sitecore cookies to be included in CORS requests -// which is necessary for analytics and such +/** + * Note: axios needs to use `withCredentials: true` in order for Sitecore cookies to be included in CORS requests + * which is necessary for analytics and such + * @param {string} url + * @param {any} data + * @param {HttpJsonFetcher<T>} fetcher + * @param {Object} params + */ function fetchData<T>( url: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -58,6 +70,9 @@ function fetchData<T>( }); } +/** + * @param {TrackingRequestOptions} options + */ function resolveTrackingUrl(options: TrackingRequestOptions) { const { host = '', serviceUrl = '/sitecore/api/jss/track', action = 'event' } = options; diff --git a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts index 8060e17047..81d9cb52ce 100644 --- a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts +++ b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts @@ -178,6 +178,10 @@ export function convertVNodesToDynamicComponents(vnodes: VNode[]) { }); } +/** + * @param {any} elem + * @param {CreateElement} createVueElement + */ function createRawElement(elem: any, createVueElement: CreateElement) { if (!elem.name) { console.error( @@ -198,6 +202,11 @@ function createRawElement(elem: any, createVueElement: CreateElement) { return component; } +/** + * @param {Object} renderingDefinition + * @param {string} renderingDefinition.componentName + * @param {ComponentFactory} [componentFactory] + */ function getComponentForRendering( renderingDefinition: { componentName: string }, componentFactory?: ComponentFactory diff --git a/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts b/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts index 26c3e1bfd2..ab075f9b19 100644 --- a/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts +++ b/packages/sitecore-jss-vue/src/enhancers/providePlaceholders.ts @@ -40,6 +40,10 @@ declare module 'vue/types/options' { } } +/** + * @param {Vue} vm + * @param {ComponentFactory} [componentFactory] + */ export function providePlaceholders(vm: Vue, componentFactory?: ComponentFactory) { const instanceOptions = vm.$options; const propsData: any = instanceOptions.propsData; diff --git a/packages/sitecore-jss-vue/src/plugins/SitecoreJssPlaceholderPlugin.ts b/packages/sitecore-jss-vue/src/plugins/SitecoreJssPlaceholderPlugin.ts index e187eb5d05..0627df8cf6 100644 --- a/packages/sitecore-jss-vue/src/plugins/SitecoreJssPlaceholderPlugin.ts +++ b/packages/sitecore-jss-vue/src/plugins/SitecoreJssPlaceholderPlugin.ts @@ -6,7 +6,12 @@ export interface SitecoreJssPlaceholderPluginOptions { componentFactory?: ComponentFactory; } -// Vue plugins must export a function named 'install' +/** + * Vue plugins must export a function named 'install' + * + * @param {typeof _Vue} Vue + * @param {SitecoreJssPlaceholderPluginOptions} options + */ function install(Vue: typeof _Vue, options?: SitecoreJssPlaceholderPluginOptions) { // eslint-disable-next-line no-param-reassign Vue.prototype.$jss = { diff --git a/packages/sitecore-jss/src/dataApi.ts b/packages/sitecore-jss/src/dataApi.ts index 82f8ec85fe..91131491fc 100644 --- a/packages/sitecore-jss/src/dataApi.ts +++ b/packages/sitecore-jss/src/dataApi.ts @@ -12,6 +12,9 @@ class ResponseError extends Error { } } +/** + * @param {HttpResponse<T>} response + */ function checkStatus<T>(response: HttpResponse<T>) { if (response.status >= 200 && response.status < 300) { return response; @@ -24,12 +27,20 @@ function checkStatus<T>(response: HttpResponse<T>) { // note: encodeURIComponent is available via browser (window) or natively in node.js // if you use another js engine for server-side rendering you may not have native encodeURIComponent // and would then need to install a package for that functionality +/** + * @param {Object} params + */ function getQueryString(params: { [key: string]: string | number | boolean }): string { return Object.keys(params) .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`) .join('&'); } +/** + * @param {string} url + * @param {HttpJsonFetcher} fetcher + * @param {Object} params + */ function fetchData<T>( url: string, fetcher: HttpJsonFetcher<T>, diff --git a/packages/sitecore-jss/src/layoutDataUtils.ts b/packages/sitecore-jss/src/layoutDataUtils.ts index 2af033eae9..4111422568 100644 --- a/packages/sitecore-jss/src/layoutDataUtils.ts +++ b/packages/sitecore-jss/src/layoutDataUtils.ts @@ -15,6 +15,11 @@ export function getFieldValue<T>( fieldName: string, defaultValue: T ): T; +/** + * @param {ComponentRendering | Fields} renderingOrFields + * @param {string} fieldName + * @param {T} [defaultValue] + */ export function getFieldValue<T>( renderingOrFields: ComponentRendering | Fields, fieldName: string, diff --git a/samples/angular/.eslintignore b/samples/angular/.eslintignore new file mode 100644 index 0000000000..3a67ee772b --- /dev/null +++ b/samples/angular/.eslintignore @@ -0,0 +1,3 @@ +src/environments/environment.ts +src/environments/environment.prod.ts +src/app/components/app-components.module.ts \ No newline at end of file From 2220eb79d12b51cb773bba6b3b252f00e55e7d5f Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 22 Dec 2020 13:59:29 +0200 Subject: [PATCH 33/37] enable `@typescript-eslint/explicit-module-boundary-types` - rule --- .eslintrc | 2 -- packages/sitecore-jss-angular/.eslintrc | 4 ++-- packages/sitecore-jss-cli/.eslintrc | 6 ++++++ packages/sitecore-jss-dev-tools/.eslintrc | 6 ++++++ packages/sitecore-jss-forms/.eslintrc | 6 ++++++ packages/sitecore-jss-forms/src/submitForm.ts | 4 ++-- packages/sitecore-jss-manifest/.eslintrc | 4 ++-- packages/sitecore-jss-nextjs-editing-host/.eslintrc | 6 ++++++ packages/sitecore-jss-nextjs-editing-host/src/config.ts | 2 +- .../src/editing-middleware.ts | 2 -- .../sitecore-jss-nextjs-editing-host/src/html-processors.ts | 2 +- .../src/components/ComponentPropsContext.tsx | 5 ++++- packages/sitecore-jss-nextjs/src/components/Link.tsx | 2 +- packages/sitecore-jss-nextjs/src/components/RichText.tsx | 2 +- packages/sitecore-jss-proxy/.eslintrc | 4 ++-- packages/sitecore-jss-react-forms/.eslintrc | 3 ++- packages/sitecore-jss-react/.eslintrc | 3 +++ packages/sitecore-jss-rendering-host/.eslintrc | 3 ++- packages/sitecore-jss-update-package/src/index.ts | 6 +++++- packages/sitecore-jss-vue/.eslintrc | 4 ++-- packages/sitecore-jss/.eslintrc | 6 ++++++ packages/sitecore-pipelines/.eslintrc | 4 ++-- packages/sitecore-pipelines/src/pipeline.ts | 1 + 23 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 packages/sitecore-jss-cli/.eslintrc create mode 100644 packages/sitecore-jss-dev-tools/.eslintrc create mode 100644 packages/sitecore-jss-forms/.eslintrc create mode 100644 packages/sitecore-jss-nextjs-editing-host/.eslintrc create mode 100644 packages/sitecore-jss/.eslintrc diff --git a/.eslintrc b/.eslintrc index 0e4b0a5c64..784d18374d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -40,7 +40,6 @@ } } ], - "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/member-ordering": "error", "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "variables": false }], @@ -59,7 +58,6 @@ "max-len": "off", "no-caller": "error", "no-bitwise": "error", - "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], "no-multiple-empty-lines": "error", "no-new-wrappers": "error", "no-debugger": "error", diff --git a/packages/sitecore-jss-angular/.eslintrc b/packages/sitecore-jss-angular/.eslintrc index 35ffa3bab9..a31607087e 100644 --- a/packages/sitecore-jss-angular/.eslintrc +++ b/packages/sitecore-jss-angular/.eslintrc @@ -4,7 +4,7 @@ "../../.eslintrc" ], "rules": { - // TODO: fix errors - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } 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-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-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/src/submitForm.ts b/packages/sitecore-jss-forms/src/submitForm.ts index 9549e6c229..edef56871e 100644 --- a/packages/sitecore-jss-forms/src/submitForm.ts +++ b/packages/sitecore-jss-forms/src/submitForm.ts @@ -25,8 +25,8 @@ export function createFetchBasedFormFetcher(options?: RequestInit): FormFetcher } /** - * @param formData - * @param endpoint + * @param {JssFormData} formData + * @param {string} endpoint * @param {FormSubmitOptions} [options] */ export function submitForm( diff --git a/packages/sitecore-jss-manifest/.eslintrc b/packages/sitecore-jss-manifest/.eslintrc index 9126f7b2a2..116e46f25f 100644 --- a/packages/sitecore-jss-manifest/.eslintrc +++ b/packages/sitecore-jss-manifest/.eslintrc @@ -1,7 +1,7 @@ { "extends": "../../.eslintrc", "rules": { - // TODO: around 190 errors - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } 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/src/config.ts b/packages/sitecore-jss-nextjs-editing-host/src/config.ts index 0e5ec0c4a0..8e0f779f63 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/config.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/config.ts @@ -25,7 +25,7 @@ export interface ConfigOptions { */ export function config({ enabled = false, distDir = '.next-editing' }: ConfigOptions = {}) { // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function plugin(nextConfig: any = {}) { + return function plugin(nextConfig: any = {}): any { if (!enabled) { return nextConfig; } 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 422af34ff5..d3ca3fc5ee 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts @@ -21,8 +21,6 @@ export class EditingMiddleware { /** * Returns the Express request handler for Experience Editor POST requests. - * @param {Request} req - * @param {Response} res * @returns {Promise<void>} request handler */ public getRequestHandler(): (req: Request, res: Response) => Promise<void> { 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 5129b0cc53..89f65134a8 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/html-processors.ts @@ -18,7 +18,7 @@ export interface HtmlProcessor { 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 && diff --git a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx index ed664cc194..c58210ee16 100644 --- a/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx +++ b/packages/sitecore-jss-nextjs/src/components/ComponentPropsContext.tsx @@ -23,7 +23,10 @@ export type ComponentPropsContextProps = { value: ComponentPropsCollection; }; -export const ComponentPropsContext = ({ children, value }: ComponentPropsContextProps) => ( +export const ComponentPropsContext = ({ + children, + value, +}: ComponentPropsContextProps): JSX.Element => ( <ComponentPropsReactContext.Provider value={value}> {children} </ComponentPropsReactContext.Provider> diff --git a/packages/sitecore-jss-nextjs/src/components/Link.tsx b/packages/sitecore-jss-nextjs/src/components/Link.tsx index a6151e9733..19501d6ba2 100644 --- a/packages/sitecore-jss-nextjs/src/components/Link.tsx +++ b/packages/sitecore-jss-nextjs/src/components/Link.tsx @@ -17,7 +17,7 @@ export type LinkProps = ReactLinkProps & { internalLinkMatcher?: RegExp; }; -export const Link = (props: LinkProps) => { +export const Link = (props: LinkProps): JSX.Element => { const { editable, internalLinkMatcher = /^\//g, diff --git a/packages/sitecore-jss-nextjs/src/components/RichText.tsx b/packages/sitecore-jss-nextjs/src/components/RichText.tsx index eccbea78df..79010e87f1 100644 --- a/packages/sitecore-jss-nextjs/src/components/RichText.tsx +++ b/packages/sitecore-jss-nextjs/src/components/RichText.tsx @@ -17,7 +17,7 @@ export type RichTextProps = ReactRichTextProps & { 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; diff --git a/packages/sitecore-jss-proxy/.eslintrc b/packages/sitecore-jss-proxy/.eslintrc index 9126f7b2a2..116e46f25f 100644 --- a/packages/sitecore-jss-proxy/.eslintrc +++ b/packages/sitecore-jss-proxy/.eslintrc @@ -1,7 +1,7 @@ { "extends": "../../.eslintrc", "rules": { - // TODO: around 190 errors - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } diff --git a/packages/sitecore-jss-react-forms/.eslintrc b/packages/sitecore-jss-react-forms/.eslintrc index 80c5b66b75..a63ba52d77 100644 --- a/packages/sitecore-jss-react-forms/.eslintrc +++ b/packages/sitecore-jss-react-forms/.eslintrc @@ -13,6 +13,7 @@ "React": "writable" }, "rules": { - "react/prop-types": "off" // TODO: fix errors + "react/prop-types": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } diff --git a/packages/sitecore-jss-react/.eslintrc b/packages/sitecore-jss-react/.eslintrc index 3d8eb496f9..72886daf5c 100644 --- a/packages/sitecore-jss-react/.eslintrc +++ b/packages/sitecore-jss-react/.eslintrc @@ -11,5 +11,8 @@ }, "globals": { "React": "writable" + }, + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off" } } diff --git a/packages/sitecore-jss-rendering-host/.eslintrc b/packages/sitecore-jss-rendering-host/.eslintrc index 02a6039f22..116e46f25f 100644 --- a/packages/sitecore-jss-rendering-host/.eslintrc +++ b/packages/sitecore-jss-rendering-host/.eslintrc @@ -1,6 +1,7 @@ { "extends": "../../.eslintrc", "rules": { - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } diff --git a/packages/sitecore-jss-update-package/src/index.ts b/packages/sitecore-jss-update-package/src/index.ts index 7e2c14f399..d30cc5ab0d 100644 --- a/packages/sitecore-jss-update-package/src/index.ts +++ b/packages/sitecore-jss-update-package/src/index.ts @@ -36,7 +36,11 @@ const getEntries = (folder: string): FileEntry[] => { return entries; }; -export const createPackage = (contentsPath: string, outputPath: string, callback: () => void) => { +export const createPackage = ( + contentsPath: string, + outputPath: string, + callback: () => void +): void => { const zip = new JSZip(); const contents = getEntries(contentsPath); contents.forEach((entry) => { diff --git a/packages/sitecore-jss-vue/.eslintrc b/packages/sitecore-jss-vue/.eslintrc index 824106128e..6828bab3fb 100644 --- a/packages/sitecore-jss-vue/.eslintrc +++ b/packages/sitecore-jss-vue/.eslintrc @@ -1,7 +1,7 @@ { "extends": ["plugin:vue/recommended", "../../.eslintrc"], "rules": { - // TODO: fix errors - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } diff --git a/packages/sitecore-jss/.eslintrc b/packages/sitecore-jss/.eslintrc new file mode 100644 index 0000000000..cf556dbaae --- /dev/null +++ b/packages/sitecore-jss/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "../../.eslintrc", + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off" + } +} diff --git a/packages/sitecore-pipelines/.eslintrc b/packages/sitecore-pipelines/.eslintrc index 54be84938a..116e46f25f 100644 --- a/packages/sitecore-pipelines/.eslintrc +++ b/packages/sitecore-pipelines/.eslintrc @@ -1,7 +1,7 @@ { "extends": "../../.eslintrc", "rules": { - // TODO: fix errors - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" } } diff --git a/packages/sitecore-pipelines/src/pipeline.ts b/packages/sitecore-pipelines/src/pipeline.ts index a9e6ae8a9d..60998616f8 100644 --- a/packages/sitecore-pipelines/src/pipeline.ts +++ b/packages/sitecore-pipelines/src/pipeline.ts @@ -56,6 +56,7 @@ const runProcessor = async ({ processor, args }: { processor: Processor; args: a }; /** + * @param {Object} args * @param {Processor[]} args.processors the processors to run (optional but must be specified if pipeline is not specified) * @param {any} args.pipelineArgs arguments to pass to the pipeline processors */ From fb113cdb62493e6bf3ddc2f4e42c17a72b78919d Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 22 Dec 2020 17:30:42 +0200 Subject: [PATCH 34/37] Push changes --- .eslintrc | 18 +-- package.json | 2 +- packages/sitecore-jss-angular/.npmignore | 2 +- .../src/components/date.directive.ts | 5 - .../src/components/file.directive.ts | 1 - .../components/generic-link.directive.spec.ts | 1 - .../src/components/generic-link.directive.ts | 4 - .../src/components/image.directive.spec.ts | 1 - .../src/components/image.directive.ts | 5 - .../src/components/link.directive.spec.ts | 1 - .../src/components/link.directive.ts | 3 - .../components/placeholder.component.spec.ts | 1 - .../src/components/placeholder.component.ts | 1 - .../src/components/render-each.directive.ts | 1 - .../src/components/render-empty.directive.ts | 1 - .../src/components/rendering-field.ts | 7 +- .../src/components/rich-text.directive.ts | 2 - .../components/router-link.directive.spec.ts | 1 - .../src/components/router-link.directive.ts | 3 - .../src/components/text.directive.ts | 3 - .../src/jss-component-factory.service.ts | 2 - .../src/testData/ee-data.ts | 2 - .../src/testData/non-ee-data.ts | 2 - packages/sitecore-jss-cli/.npmignore | 3 +- .../src/create/create.source.github.ts | 1 - .../sitecore-jss-cli/src/micro-manifest.ts | 1 - .../src/scripts/deploy.component.ts | 3 - .../src/scripts/deploy.config.ts | 1 - .../src/scripts/deploy.files.ts | 3 - .../src/scripts/deploy.items.ts | 2 - .../src/scripts/deploy.template.ts | 2 - .../sitecore-jss-cli/src/scripts/manifest.ts | 7 - .../sitecore-jss-cli/src/scripts/package.ts | 2 - packages/sitecore-jss-dev-tools/.npmignore | 3 +- .../disconnected-server/dictionary-service.ts | 1 - .../src/disconnected-server/layout-service.ts | 152 +++++++++++++----- .../src/package-deploy.ts | 5 - .../src/setup/jss-config.ts | 1 - .../sitecore-jss-dev-tools/src/setup/setup.ts | 3 - .../src/setup/verify-setup.ts | 3 - packages/sitecore-jss-forms/.npmignore | 3 +- packages/sitecore-jss-forms/src/FormField.ts | 1 - .../sitecore-jss-forms/src/serializeForm.ts | 2 - packages/sitecore-jss-manifest/.npmignore | 3 +- .../src/generator/generate.ts | 1 - .../src/generator/manifest.types.ts | 1 - .../generateContentItem/generateItem.ts | 2 - .../generateManifest/generateRenderings.ts | 3 - .../generateManifest/generateTemplates.ts | 3 - .../checkBlacklistedKeys.ts | 1 - .../generateRouteItem/processPlaceholders.ts | 1 - .../generateRouteItem/processRenderings.ts | 6 - .../src/generator/utils.ts | 2 - .../src/testData/routes/route.ts | 1 - .../.npmignore | 3 +- .../src/editing-middleware.test.ts | 3 +- .../src/editing-middleware.ts | 2 +- packages/sitecore-jss-nextjs/.npmignore | 3 +- packages/sitecore-jss-nextjs/package.json | 1 - packages/sitecore-jss-proxy/.npmignore | 3 +- packages/sitecore-jss-proxy/src/index.ts | 2 - packages/sitecore-jss-react-forms/.npmignore | 3 +- .../{.eslintrc.json => .eslintrc} | 0 packages/sitecore-jss-react-native/.npmignore | 3 +- .../src/dataConversion.test.ts | 1 - .../dataConversionTestData/dev-data.ts | 2 - packages/sitecore-jss-react/.npmignore | 3 +- .../sitecore-jss-rendering-host/.npmignore | 3 +- packages/sitecore-jss-tracking/.npmignore | 3 +- .../src/trackingApi.test.ts | 2 - .../sitecore-jss-update-package/.npmignore | 3 +- packages/sitecore-jss-vue/.npmignore | 3 +- packages/sitecore-jss-vue/package.json | 1 - .../src/components/Placeholder.test.ts | 10 -- packages/sitecore-jss/.npmignore | 3 +- packages/sitecore-jss/package.json | 2 +- packages/sitecore-pipelines/.npmignore | 3 +- samples/angular/{.eslintrc.json => .eslintrc} | 0 .../scripts/disconnected-mode-proxy.ts | 1 - .../scripts/generate-component-factory.ts | 3 - samples/angular/scripts/generate-config.ts | 2 +- .../scripts/update-graphql-fragment-data.ts | 4 +- samples/nextjs/.eslintrc | 3 +- .../{.eslintrc.json => .eslintrc} | 14 +- samples/react/.eslintrc | 8 +- samples/sitecore-embedded-jss-app/.eslintrc | 1 + 86 files changed, 156 insertions(+), 234 deletions(-) rename packages/sitecore-jss-react-native/{.eslintrc.json => .eslintrc} (100%) rename samples/angular/{.eslintrc.json => .eslintrc} (100%) rename samples/react-native/{.eslintrc.json => .eslintrc} (86%) diff --git a/.eslintrc b/.eslintrc index 784d18374d..596bbc45c0 100644 --- a/.eslintrc +++ b/.eslintrc @@ -35,42 +35,40 @@ "format": ["PascalCase"], "selector": "typeLike", "custom": { - "regex": "^I[A-Z]", + "regex": "^I[A-Z]", "match": false } } ], "@typescript-eslint/member-ordering": "error", - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "variables": false }], + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": [ + "error", + { "functions": false, "variables": false } + ], "@typescript-eslint/typedef": "error", "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/semi": "error", "@typescript-eslint/no-var-requires": "off", "no-useless-escape": "off", - "no-restricted-globals": "off", - "no-restricted-properties": "off", "spaced-comment": "error", "curly": ["error", "multi-line"], "eol-last": ["error", "always"], "guard-for-in": "error", "no-unused-labels": "error", - "max-len": "off", "no-caller": "error", "no-bitwise": "error", "no-multiple-empty-lines": "error", "no-new-wrappers": "error", - "no-debugger": "error", - "no-empty": "error", "no-eval": "error", "dot-notation": "error", - "no-fallthrough": "error", "no-trailing-spaces": "error", "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], "brace-style": "error", "quotes": ["error", "single"], "radix": "error", "default-case": "error", - "eqeqeq": "error" + "eqeqeq": "error", + "jsx-quotes": ["error", "prefer-double"] } } diff --git a/package.json b/package.json index 874def28a7..1a39894a08 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.10.0", "@typescript-eslint/parser": "^4.10.0", - "eslint": "^6.6.0", + "eslint": "^7.16.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-jsdoc": "^30.7.9", "eslint-plugin-prettier": "^3.3.0", diff --git a/packages/sitecore-jss-angular/.npmignore b/packages/sitecore-jss-angular/.npmignore index 327fdf4bd7..2dc1bc5393 100644 --- a/packages/sitecore-jss-angular/.npmignore +++ b/packages/sitecore-jss-angular/.npmignore @@ -3,6 +3,7 @@ testData coverage sitecore index.test.js +.eslintrc .vscode .npmignore .gitignore @@ -10,7 +11,6 @@ jsconfig.json tsconfig.json ng-package.json karma.conf.js -tslint.json npm-debug* /dist/package.json /dist/README.md diff --git a/packages/sitecore-jss-angular/src/components/date.directive.ts b/packages/sitecore-jss-angular/src/components/date.directive.ts index 3950691777..b6dce7b57a 100644 --- a/packages/sitecore-jss-angular/src/components/date.directive.ts +++ b/packages/sitecore-jss-angular/src/components/date.directive.ts @@ -16,19 +16,14 @@ import { TextField } from './rendering-field'; export class DateDirective implements OnChanges { private viewRef: EmbeddedViewRef<any>; - // tslint:disable-next-line:no-input-rename @Input('scDateFormat') format?: string; - // tslint:disable-next-line:no-input-rename @Input('scDateTimezone') timezone?: string; - // tslint:disable-next-line:no-input-rename @Input('scDateLocale') locale?: string; - // tslint:disable-next-line:no-input-rename @Input('scDateEditable') editable = true; - // tslint:disable-next-line:no-input-rename @Input('scDate') field: TextField; constructor( diff --git a/packages/sitecore-jss-angular/src/components/file.directive.ts b/packages/sitecore-jss-angular/src/components/file.directive.ts index 8a72cc1a69..9ac53b59ab 100644 --- a/packages/sitecore-jss-angular/src/components/file.directive.ts +++ b/packages/sitecore-jss-angular/src/components/file.directive.ts @@ -16,7 +16,6 @@ import { FileField } from './rendering-field'; export class FileDirective implements OnChanges { private viewRef: EmbeddedViewRef<any>; - // tslint:disable-next-line:no-input-rename @Input('scFile') field: FileField; constructor(private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>) {} diff --git a/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts index 17304e1e64..e08c45a8d6 100644 --- a/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/generic-link.directive.spec.ts @@ -167,7 +167,6 @@ describe('<a *scGenericLink />', () => { }); }); -// tslint:disable-next-line:max-classes-per-file @Component({ selector: 'test-router-link-children', template: ` diff --git a/packages/sitecore-jss-angular/src/components/generic-link.directive.ts b/packages/sitecore-jss-angular/src/components/generic-link.directive.ts index 5d718253d7..8b3a971a50 100644 --- a/packages/sitecore-jss-angular/src/components/generic-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/generic-link.directive.ts @@ -12,16 +12,12 @@ import { LinkField } from './rendering-field'; @Directive({ selector: '[scGenericLink]' }) export class GenericLinkDirective extends LinkDirective { - // tslint:disable-next-line:no-input-rename @Input('scGenericLinkEditable') editable = true; - // tslint:disable-next-line:no-input-rename @Input('scGenericLinkAttrs') attrs: any = {}; - // tslint:disable-next-line:no-input-rename @Input('scGenericLink') field: LinkField; - // tslint:disable-next-line:no-input-rename @Input('scGenericLinkExtras') extras?: NavigationExtras; constructor( diff --git a/packages/sitecore-jss-angular/src/components/image.directive.spec.ts b/packages/sitecore-jss-angular/src/components/image.directive.spec.ts index cf842f1e8b..fd38ad573b 100644 --- a/packages/sitecore-jss-angular/src/components/image.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/image.directive.spec.ts @@ -1,4 +1,3 @@ -// tslint:disable:max-classes-per-file import { Component, DebugElement, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; diff --git a/packages/sitecore-jss-angular/src/components/image.directive.ts b/packages/sitecore-jss-angular/src/components/image.directive.ts index a99e36e069..6658820892 100644 --- a/packages/sitecore-jss-angular/src/components/image.directive.ts +++ b/packages/sitecore-jss-angular/src/components/image.directive.ts @@ -15,10 +15,8 @@ import { ImageField } from './rendering-field'; export class ImageDirective implements OnChanges { private inlineRef: HTMLSpanElement | null = null; - // tslint:disable-next-line:no-input-rename @Input('scImage') field: ImageField | ''; - // tslint:disable-next-line:no-input-rename @Input('scImageEditable') editable = true; /** @@ -28,13 +26,10 @@ export class ImageDirective implements OnChanges { * /-assets/website -> /-/jssmedia/website * /~assets/website -> /~/jssmedia/website */ - // tslint:disable-next-line:no-input-rename @Input('scImageMediaUrlPrefix') mediaUrlPrefix?: RegExp; - // tslint:disable-next-line:no-input-rename @Input('scImageUrlParams') urlParams = {}; - // tslint:disable-next-line:no-input-rename @Input('scImageAttrs') attrs = {}; constructor( diff --git a/packages/sitecore-jss-angular/src/components/link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/link.directive.spec.ts index 936d10804d..e1c862bb97 100644 --- a/packages/sitecore-jss-angular/src/components/link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/link.directive.spec.ts @@ -219,7 +219,6 @@ describe('<a *scLink />', () => { }); }); -// tslint:disable-next-line:max-classes-per-file @Component({ selector: 'test-link-children', template: ` diff --git a/packages/sitecore-jss-angular/src/components/link.directive.ts b/packages/sitecore-jss-angular/src/components/link.directive.ts index 8094b0e9be..7ac641d8a4 100644 --- a/packages/sitecore-jss-angular/src/components/link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/link.directive.ts @@ -14,13 +14,10 @@ import { LinkField } from './rendering-field'; export class LinkDirective implements OnChanges { private inlineRef: HTMLSpanElement | null = null; - // tslint:disable-next-line:no-input-rename @Input('scLinkEditable') editable = true; - // tslint:disable-next-line:no-input-rename @Input('scLinkAttrs') attrs: any = {}; - // tslint:disable-next-line:no-input-rename @Input('scLink') field: LinkField; constructor( diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts index cf45df1d38..d1f6ece209 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.spec.ts @@ -1,4 +1,3 @@ -// tslint:disable:max-classes-per-file import { Component, DebugElement, diff --git a/packages/sitecore-jss-angular/src/components/placeholder.component.ts b/packages/sitecore-jss-angular/src/components/placeholder.component.ts index 76b330890b..0c8b40e7d6 100644 --- a/packages/sitecore-jss-angular/src/components/placeholder.component.ts +++ b/packages/sitecore-jss-angular/src/components/placeholder.component.ts @@ -169,7 +169,6 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr } if (!this.name && !this.renderings) { - // tslint:disable-next-line:max-line-length console.warn( 'Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.' ); diff --git a/packages/sitecore-jss-angular/src/components/render-each.directive.ts b/packages/sitecore-jss-angular/src/components/render-each.directive.ts index dd4771cb18..39b08c5511 100644 --- a/packages/sitecore-jss-angular/src/components/render-each.directive.ts +++ b/packages/sitecore-jss-angular/src/components/render-each.directive.ts @@ -1,7 +1,6 @@ import { Directive, TemplateRef } from '@angular/core'; @Directive({ - // tslint:disable-next-line:directive-selector selector: '[renderEach]', }) export class RenderEachDirective { diff --git a/packages/sitecore-jss-angular/src/components/render-empty.directive.ts b/packages/sitecore-jss-angular/src/components/render-empty.directive.ts index 8b7a380965..858c9bc8ba 100644 --- a/packages/sitecore-jss-angular/src/components/render-empty.directive.ts +++ b/packages/sitecore-jss-angular/src/components/render-empty.directive.ts @@ -1,7 +1,6 @@ import { Directive, TemplateRef } from '@angular/core'; @Directive({ - // tslint:disable-next-line:directive-selector selector: '[renderEmpty]', }) export class RenderEmptyDirective { diff --git a/packages/sitecore-jss-angular/src/components/rendering-field.ts b/packages/sitecore-jss-angular/src/components/rendering-field.ts index e8d0bfd99a..a4a9ea9ce6 100644 --- a/packages/sitecore-jss-angular/src/components/rendering-field.ts +++ b/packages/sitecore-jss-angular/src/components/rendering-field.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-interface */ export interface RenderingField { value?: any; editable?: string; @@ -18,8 +19,6 @@ export interface LinkField extends RenderingField { editableLastPart?: string; } -// tslint:disable-next-line:no-empty-interface -export type RichTextField = RenderingField; +export interface RichTextField extends RenderingField {} -// tslint:disable-next-line:no-empty-interface -export type TextField = RenderingField; +export interface TextField extends RenderingField {} diff --git a/packages/sitecore-jss-angular/src/components/rich-text.directive.ts b/packages/sitecore-jss-angular/src/components/rich-text.directive.ts index 1800b4e9e2..a342ee4d7b 100644 --- a/packages/sitecore-jss-angular/src/components/rich-text.directive.ts +++ b/packages/sitecore-jss-angular/src/components/rich-text.directive.ts @@ -15,10 +15,8 @@ import { RichTextField } from './rendering-field'; export class RichTextDirective implements OnChanges { private viewRef: EmbeddedViewRef<any>; - // tslint:disable-next-line:no-input-rename @Input('scRichTextEditable') editable = true; - // tslint:disable-next-line:no-input-rename @Input('scRichText') field: RichTextField; constructor(private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>) {} diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts index 358735209c..c596ab12aa 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts @@ -165,7 +165,6 @@ describe('<a *scRouterLink />', () => { }); }); -// tslint:disable-next-line:max-classes-per-file @Component({ selector: 'test-router-link-children', template: ` diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.ts index 1c02fbf49e..d10e59bf9e 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.ts @@ -12,13 +12,10 @@ import { LinkField } from './rendering-field'; @Directive({ selector: '[scRouterLink]' }) export class RouterLinkDirective extends LinkDirective { - // tslint:disable-next-line:no-input-rename @Input('scRouterLinkEditable') editable = true; - // tslint:disable-next-line:no-input-rename @Input('scRouterLinkAttrs') attrs: any = {}; - // tslint:disable-next-line:no-input-rename @Input('scRouterLink') field: LinkField; constructor( diff --git a/packages/sitecore-jss-angular/src/components/text.directive.ts b/packages/sitecore-jss-angular/src/components/text.directive.ts index aea4b1d67c..4ba635b180 100644 --- a/packages/sitecore-jss-angular/src/components/text.directive.ts +++ b/packages/sitecore-jss-angular/src/components/text.directive.ts @@ -15,13 +15,10 @@ import { TextField } from './rendering-field'; export class TextDirective implements OnChanges { private viewRef: EmbeddedViewRef<any>; - // tslint:disable-next-line:no-input-rename @Input('scTextEditable') editable = true; - // tslint:disable-next-line:no-input-rename @Input('scTextEncode') encode = true; - // tslint:disable-next-line:no-input-rename @Input('scText') field: TextField; constructor(private viewContainer: ViewContainerRef, private templateRef: TemplateRef<any>) {} diff --git a/packages/sitecore-jss-angular/src/jss-component-factory.service.ts b/packages/sitecore-jss-angular/src/jss-component-factory.service.ts index 804f17270f..fea77257de 100644 --- a/packages/sitecore-jss-angular/src/jss-component-factory.service.ts +++ b/packages/sitecore-jss-angular/src/jss-component-factory.service.ts @@ -74,7 +74,6 @@ export class JssComponentFactoryService { const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT); if (!dynamicComponentType) { throw new Error( - // tslint:disable-next-line:max-line-length `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` ); } @@ -86,7 +85,6 @@ export class JssComponentFactoryService { componentType = dynamicComponentType; } else { throw new Error( - // tslint:disable-next-line:max-line-length `JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?` ); } diff --git a/packages/sitecore-jss-angular/src/testData/ee-data.ts b/packages/sitecore-jss-angular/src/testData/ee-data.ts index 2051d6f127..00672f6057 100644 --- a/packages/sitecore-jss-angular/src/testData/ee-data.ts +++ b/packages/sitecore-jss-angular/src/testData/ee-data.ts @@ -1,7 +1,5 @@ // 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 convertedData = { sitecore: { context: { 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 343d958fd5..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,7 +1,5 @@ // 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: { 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/src/create/create.source.github.ts b/packages/sitecore-jss-cli/src/create/create.source.github.ts index d041a67552..bf60d17d63 100644 --- a/packages/sitecore-jss-cli/src/create/create.source.github.ts +++ b/packages/sitecore-jss-cli/src/create/create.source.github.ts @@ -52,7 +52,6 @@ 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' } }, diff --git a/packages/sitecore-jss-cli/src/micro-manifest.ts b/packages/sitecore-jss-cli/src/micro-manifest.ts index 1ba07ad579..fb63046f99 100644 --- a/packages/sitecore-jss-cli/src/micro-manifest.ts +++ b/packages/sitecore-jss-cli/src/micro-manifest.ts @@ -43,7 +43,6 @@ export default async function microManifest( 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.' ); } diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts index 35db44431c..807f20d97e 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.component.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.component.ts @@ -9,7 +9,6 @@ import { args as templateArgs } from './deploy.template'; export default function builder(yargs: Argv) { return yargs.command( 'component <name>', - // 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 @@ -25,14 +24,12 @@ export function args(yargs: Argv) { 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.', }); } diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts index 411f30b298..bd805593bc 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.config.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.config.ts @@ -19,7 +19,6 @@ 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: { diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts index 43cd0584cc..9e96963e3e 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.files.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.files.ts @@ -8,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 = { @@ -22,7 +21,6 @@ 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: { @@ -48,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', }, diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts index 3216185c08..4b979b4f7e 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.items.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.items.ts @@ -37,7 +37,6 @@ 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, }, @@ -90,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.' ); } diff --git a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts index d5e3448005..1e47caef9e 100644 --- a/packages/sitecore-jss-cli/src/scripts/deploy.template.ts +++ b/packages/sitecore-jss-cli/src/scripts/deploy.template.ts @@ -9,7 +9,6 @@ import microManifest from '../micro-manifest'; export default function builder(yargs: Argv) { return yargs.command( 'template <name>', - // 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 @@ -34,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', { diff --git a/packages/sitecore-jss-cli/src/scripts/manifest.ts b/packages/sitecore-jss-cli/src/scripts/manifest.ts index 971ce0440b..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, @@ -114,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" } }'; } @@ -123,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" } }'; } @@ -137,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 b30778348e..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, }, 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/src/disconnected-server/dictionary-service.ts b/packages/sitecore-jss-dev-tools/src/disconnected-server/dictionary-service.ts index 925be23c30..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 @@ -69,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 3af24925cf..e0402bf1fe 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,14 +1,16 @@ -/* eslint-disable */ - +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ManifestInstance, RouteDefinition } from '@sitecore-jss/sitecore-jss-manifest'; import chalk from 'chalk'; -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 -*/ - +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, @@ -20,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); @@ -61,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 @@ -87,6 +95,9 @@ function extractDynamicPlaceholderKeyDetails(dynamicKey: string) { }; } +/** + * @param {string} placeholderKey + */ function extractTopLevelPlaceholderDetails(placeholderKey: string) { let keySegment = placeholderKey; @@ -109,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); @@ -166,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) => { @@ -222,41 +240,60 @@ export function remapFieldsArrayToFieldsObject(input: any) { }, {}); } -// eslint-disable-next-line @typescript-eslint/no-explicit-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) => { @@ -268,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', @@ -304,6 +356,14 @@ function defaultCustomizeRoute(route: any, language: string, currentManifest: Ma return transformedRoute; } +/** + * @param {Object} config + * @param {ManifestInstance} config.manifest + * @param {CustomizeContextFunction | undefined} config.customizeContext + * @param {CustomizeRouteFunction | undefined} config.customizeRoute + * @param {Function} config.manifestLanguageChangeCallback + * @param {CustomizeRenderFunction | undefined} config.customizeRendering + */ export function createDisconnectedLayoutService({ manifest, customizeContext, @@ -316,7 +376,10 @@ export function createDisconnectedLayoutService({ console.log(`🔌 Disconnected ${chalk.red('Layout Service')} initializing...⏳`); const service = { - middleware: async function disconnectedLayoutServiceMiddleware(request: Request, response: Response) { + 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; @@ -336,9 +399,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; @@ -357,7 +418,14 @@ export function createDisconnectedLayoutService({ 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/package-deploy.ts b/packages/sitecore-jss-dev-tools/src/package-deploy.ts index 9a4cc56293..1df7fe8aa6 100644 --- a/packages/sitecore-jss-dev-tools/src/package-deploy.ts +++ b/packages/sitecore-jss-dev-tools/src/package-deploy.ts @@ -35,7 +35,6 @@ function applyCertPinning(req: request.Request, options: PackageDeployOptions) { !doFingerprintsMatch(options.acceptCertificate, fingerprint) ) { // Abort request, optionally emit an error event - // tslint:disable-next-line:max-line-length req.emit( 'error', new Error( @@ -115,13 +114,11 @@ async function watchJobStatus(options: PackageDeployOptions, taskName: string) { * 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.' @@ -231,14 +228,12 @@ async function watchJobStatus(options: PackageDeployOptions, taskName: string) { */ 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' ); } 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.' ); diff --git a/packages/sitecore-jss-dev-tools/src/setup/jss-config.ts b/packages/sitecore-jss-dev-tools/src/setup/jss-config.ts index 24b864c53d..1fb0b88a6f 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/jss-config.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/jss-config.ts @@ -17,7 +17,6 @@ export const replaceConfigTokens = (val: string) => { // 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/setup.ts b/packages/sitecore-jss-dev-tools/src/setup/setup.ts index bbeaab115f..a88c38f221 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/setup.ts @@ -8,8 +8,6 @@ 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); @@ -171,7 +169,6 @@ export function setup( 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.'; } 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 8fcdef10e1..caf0c25cb3 100644 --- a/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts +++ b/packages/sitecore-jss-dev-tools/src/setup/verify-setup.ts @@ -8,12 +8,10 @@ export const verifySetup = () => { 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?' ); if (!runSetup) { - // tslint:disable-next-line:no-string-throw throw 'This command cannot execute without a Sitecore connection'; } @@ -29,7 +27,6 @@ export const verifySetup = () => { ); 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/.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/src/FormField.ts b/packages/sitecore-jss-forms/src/FormField.ts index a3daf77830..18f18fe915 100644 --- a/packages/sitecore-jss-forms/src/FormField.ts +++ b/packages/sitecore-jss-forms/src/FormField.ts @@ -10,7 +10,6 @@ export interface FormField<TViewModel extends ViewModel = ViewModel> { /** * @param {any} object */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export function instanceOfFormField<T extends ViewModel>(object: any): object is FormField<T> { return 'model' in object; } diff --git a/packages/sitecore-jss-forms/src/serializeForm.ts b/packages/sitecore-jss-forms/src/serializeForm.ts index b55cda94ed..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, 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/src/generator/generate.ts b/packages/sitecore-jss-manifest/src/generator/generate.ts index ee9f5ece06..9bba8d2a16 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}`; }); }; diff --git a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts index 8f40554606..b4c31bdc12 100644 --- a/packages/sitecore-jss-manifest/src/generator/manifest.types.ts +++ b/packages/sitecore-jss-manifest/src/generator/manifest.types.ts @@ -152,7 +152,6 @@ 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. 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 8135562783..c199cf7a5e 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateContentItem/generateItem.ts @@ -16,7 +16,6 @@ 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.` @@ -27,7 +26,6 @@ export default (args: GenerateContentItemArgs) => { 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.` 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 85042368c9..0ca9614629 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRenderings.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateManifest/generateRenderings.ts @@ -50,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)`; } @@ -76,7 +75,6 @@ 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.`; @@ -85,7 +83,6 @@ export default (args: GeneratePipelineArgs) => { 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.`; 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 a1f25caacf..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,7 +43,6 @@ 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.`; @@ -53,7 +51,6 @@ export default (args: any) => { 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.`; 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 af94bc1192..38979297b0 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generatePlaceholders/checkBlacklistedKeys.ts @@ -41,6 +41,5 @@ export default (args: GeneratePlaceholdersPipelineArgs) => { '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/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.ts b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts index d16015ec43..92983d43f3 100644 --- a/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts +++ b/packages/sitecore-jss-manifest/src/generator/pipelines/generateRouteItem/processRenderings.ts @@ -28,7 +28,6 @@ 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) @@ -43,7 +42,6 @@ const generateRenderingParams = (component: any, rendering: any) => { } // find params that are not defined in manifest - // tslint:disable-next-line:max-line-length const invalidParams = reducedParams.filter( (param) => !component.params.some( @@ -55,7 +53,6 @@ const generateRenderingParams = (component: any, rendering: any) => { 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 @@ -82,7 +79,6 @@ 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.` @@ -213,7 +209,6 @@ const processRendering = ( // 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.` ); @@ -315,7 +310,6 @@ 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.` ); diff --git a/packages/sitecore-jss-manifest/src/generator/utils.ts b/packages/sitecore-jss-manifest/src/generator/utils.ts index ce8f105204..d0db65a490 100644 --- a/packages/sitecore-jss-manifest/src/generator/utils.ts +++ b/packages/sitecore-jss-manifest/src/generator/utils.ts @@ -185,7 +185,6 @@ export function findTemplate( const template = templateList.find((templateDef: any) => templateDef.name === templateName); if (template && templateResult !== null) { - // tslint:disable-next-line:no-string-throw throw `Template ${templateName} was defined more than once with the same name.`; } @@ -225,7 +224,6 @@ export function validateFieldDefinitions( 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; diff --git a/packages/sitecore-jss-manifest/src/testData/routes/route.ts b/packages/sitecore-jss-manifest/src/testData/routes/route.ts index af1d18208f..599430ad5d 100644 --- a/packages/sitecore-jss-manifest/src/testData/routes/route.ts +++ b/packages/sitecore-jss-manifest/src/testData/routes/route.ts @@ -10,7 +10,6 @@ export default { value: 'Sitecore Experience Platform + JSS', }, text: { - // tslint:disable-next-line:max-line-length value: '<p>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.</p><p>For further information, please go to the <a href="https://doc.sitecore.net/" target="_blank" title="Sitecore Documentation site">Sitecore Documentation site</a></p>', }, 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/src/editing-middleware.test.ts b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.test.ts index b31b67684c..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,6 +1,7 @@ /* eslint-disable no-unused-expressions */ /* eslint-disable @typescript-eslint/no-explicit-any */ -// / <reference types="../global" /> +// eslint-disable-next-line spaced-comment +/// <reference types="../global" /> import chai from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; 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 d3ca3fc5ee..34b0304084 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts @@ -21,7 +21,7 @@ export class EditingMiddleware { /** * Returns the Express request handler for Experience Editor POST requests. - * @returns {Promise<void>} request handler + * @returns request handler */ public getRequestHandler(): (req: Request, res: Response) => Promise<void> { return this.handleRequest; 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/package.json b/packages/sitecore-jss-nextjs/package.json index a562287f37..215be3b63f 100644 --- a/packages/sitecore-jss-nextjs/package.json +++ b/packages/sitecore-jss-nextjs/package.json @@ -37,7 +37,6 @@ "@types/node": "12.7.5", "@types/react": "16.9.2", "@types/react-dom": "^16.9.0", - "@types/url-parse": "^1.4.3", "chai": "^4.2.0", "chai-spies": "^1.0.0", "chai-string": "^1.5.0", 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/src/index.ts b/packages/sitecore-jss-proxy/src/index.ts index c8fb26d1c7..d4963eb727 100644 --- a/packages/sitecore-jss-proxy/src/index.ts +++ b/packages/sitecore-jss-proxy/src/index.ts @@ -9,8 +9,6 @@ import { RenderResponse } from './RenderResponse'; import { RouteUrlParser } from './RouteUrlParser'; import { buildQueryString, tryParseJson } from './util'; -// tslint:disable:max-line-length - // For some reason, every other response returned by Sitecore contains the 'set-cookie' header with the SC_ANALYTICS_GLOBAL_COOKIE value as an empty string. // This effectively sets the cookie to empty on the client as well, so if a user were to close their browser // after one of these 'empty value' responses, they would not be tracked as a returning visitor after re-opening their browser. diff --git a/packages/sitecore-jss-react-forms/.npmignore b/packages/sitecore-jss-react-forms/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-jss-react-forms/.npmignore +++ b/packages/sitecore-jss-react-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-react-native/.eslintrc.json b/packages/sitecore-jss-react-native/.eslintrc similarity index 100% rename from packages/sitecore-jss-react-native/.eslintrc.json rename to packages/sitecore-jss-react-native/.eslintrc diff --git a/packages/sitecore-jss-react-native/.npmignore b/packages/sitecore-jss-react-native/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-jss-react-native/.npmignore +++ b/packages/sitecore-jss-react-native/.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-react-native/src/dataConversion.test.ts b/packages/sitecore-jss-react-native/src/dataConversion.test.ts index 7fa9980fe5..13103bb75a 100644 --- a/packages/sitecore-jss-react-native/src/dataConversion.test.ts +++ b/packages/sitecore-jss-react-native/src/dataConversion.test.ts @@ -1,4 +1,3 @@ -/* tslint:disable:no-unused-expression max-line-length */ import { convertPropDataToLayoutServiceFormat, convertRouteToLayoutServiceFormat, diff --git a/packages/sitecore-jss-react-native/testData/dataConversionTestData/dev-data.ts b/packages/sitecore-jss-react-native/testData/dataConversionTestData/dev-data.ts index 78e03da4e9..d38758a733 100644 --- a/packages/sitecore-jss-react-native/testData/dataConversionTestData/dev-data.ts +++ b/packages/sitecore-jss-react-native/testData/dataConversionTestData/dev-data.ts @@ -1,5 +1,3 @@ -/* tslint:disable:quotemark*/ - export const devRouteData = { name: 'portfolio', displayName: 'Portfolio', diff --git a/packages/sitecore-jss-react/.npmignore b/packages/sitecore-jss-react/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-jss-react/.npmignore +++ b/packages/sitecore-jss-react/.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-rendering-host/.npmignore b/packages/sitecore-jss-rendering-host/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-jss-rendering-host/.npmignore +++ b/packages/sitecore-jss-rendering-host/.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-tracking/.npmignore b/packages/sitecore-jss-tracking/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-jss-tracking/.npmignore +++ b/packages/sitecore-jss-tracking/.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-tracking/src/trackingApi.test.ts b/packages/sitecore-jss-tracking/src/trackingApi.test.ts index f4f984d5bd..4095830f53 100644 --- a/packages/sitecore-jss-tracking/src/trackingApi.test.ts +++ b/packages/sitecore-jss-tracking/src/trackingApi.test.ts @@ -1,6 +1,4 @@ /* eslint-disable no-unused-expressions */ -/* tslint:disable:no-unused-expression */ - import { HttpJsonFetcher } from '@sitecore-jss/sitecore-jss'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; diff --git a/packages/sitecore-jss-update-package/.npmignore b/packages/sitecore-jss-update-package/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-jss-update-package/.npmignore +++ b/packages/sitecore-jss-update-package/.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-vue/.npmignore b/packages/sitecore-jss-vue/.npmignore index 16232f8d50..29473576e7 100644 --- a/packages/sitecore-jss-vue/.npmignore +++ b/packages/sitecore-jss-vue/.npmignore @@ -4,12 +4,11 @@ sitecore *.test.js .vscode .babelrc -.eslintrc.js +.eslintrc .npmignore .gitignore jsconfig.json tsconfig.json -tslint.json npm-debug* *.log jest.config.js diff --git a/packages/sitecore-jss-vue/package.json b/packages/sitecore-jss-vue/package.json index ce65477b9b..41d892a8fe 100644 --- a/packages/sitecore-jss-vue/package.json +++ b/packages/sitecore-jss-vue/package.json @@ -34,7 +34,6 @@ "jest": "^26.4.2", "jest-serializer-html": "^7.0.0", "ts-jest": "24.1.0", - "tslint": "^5.20.0", "typescript": "~3.6.3", "url-parse": "^1.4.7", "vue": "^2.6.10", diff --git a/packages/sitecore-jss-vue/src/components/Placeholder.test.ts b/packages/sitecore-jss-vue/src/components/Placeholder.test.ts index 5240fad72a..50f98deeab 100644 --- a/packages/sitecore-jss-vue/src/components/Placeholder.test.ts +++ b/packages/sitecore-jss-vue/src/components/Placeholder.test.ts @@ -124,7 +124,6 @@ describe('<Placeholder />', () => { const component = phData.find((c: any) => c.componentName); const phKey = 'page-content'; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(Placeholder, { propsData: { name: phKey, @@ -165,7 +164,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); @@ -182,7 +180,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); @@ -201,7 +198,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); @@ -249,7 +245,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); @@ -276,7 +271,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); @@ -288,7 +282,6 @@ describe('<Placeholder />', () => { const route = { placeholders: { main: [{ componentName: 'Home' }] } }; const phKey = 'unknown-test'; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(Placeholder, { propsData: { name: phKey, @@ -330,7 +323,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); @@ -363,7 +355,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); @@ -377,7 +368,6 @@ describe('<Placeholder />', () => { }, }; - // tslint:disable-next-line:no-shadowed-variable const renderedComponent = mount(testComponent); expect(renderedComponent.html()).toMatchSnapshot(); }); diff --git a/packages/sitecore-jss/.npmignore b/packages/sitecore-jss/.npmignore index 1d8f6f0306..af4363fcb3 100644 --- a/packages/sitecore-jss/.npmignore +++ b/packages/sitecore-jss/.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/package.json b/packages/sitecore-jss/package.json index 722601f6fc..672d7b454e 100644 --- a/packages/sitecore-jss/package.json +++ b/packages/sitecore-jss/package.json @@ -8,7 +8,7 @@ "lint": "eslint --fix ./src/**/*.ts", "test": "mocha --require ts-node/register \"./src/**/*.test.ts\"", "prepublishOnly": "npm run build", - "coverage": "nyc npm test" + "coverage": "nyc --require ts-node/register npm test" }, "engines": { "node": ">=8.1" diff --git a/packages/sitecore-pipelines/.npmignore b/packages/sitecore-pipelines/.npmignore index 7d2dda9ed6..56a24e1aa2 100644 --- a/packages/sitecore-pipelines/.npmignore +++ b/packages/sitecore-pipelines/.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/samples/angular/.eslintrc.json b/samples/angular/.eslintrc similarity index 100% rename from samples/angular/.eslintrc.json rename to samples/angular/.eslintrc diff --git a/samples/angular/scripts/disconnected-mode-proxy.ts b/samples/angular/scripts/disconnected-mode-proxy.ts index 5101dd5226..1fe7bdc3fa 100644 --- a/samples/angular/scripts/disconnected-mode-proxy.ts +++ b/samples/angular/scripts/disconnected-mode-proxy.ts @@ -42,6 +42,5 @@ const proxyOptions = { // Need to customize something that the proxy options don't support? // createDefaultDisconnectedServer() is a boilerplate that you can copy from // and customize the middleware registrations within as you see fit. -// tslint:disable-next-line:max-line-length // See https://github.com/Sitecore/jss/blob/master/packages/sitecore-jss-dev-tools/src/disconnected-server/create-default-disconnected-server.ts createDefaultDisconnectedServer(proxyOptions); diff --git a/samples/angular/scripts/generate-component-factory.ts b/samples/angular/scripts/generate-component-factory.ts index a7733eccfb..25aba470f4 100644 --- a/samples/angular/scripts/generate-component-factory.ts +++ b/samples/angular/scripts/generate-component-factory.ts @@ -17,7 +17,6 @@ const chokidar = require('chokidar'); This is used during `jss start` to pick up new or removed components at runtime. */ -// tslint:disable:no-console const componentFactoryPath = path.resolve('src/app/components/app-components.module.ts'); const componentRootPath = 'src/app/components'; @@ -94,7 +93,6 @@ function generateComponentFactory() { if (isLazyLoaded) { console.debug(`Registering JSS component (lazy) ${componentName}`); - // tslint:disable-next-line:max-line-length lazyRegistrations.push(`{ path: '${componentName}', loadChildren: () => import('./${componentFolder}/${componentFolder}.module').then(m => m.${componentName}Module) },`); } else { console.debug(`Registering JSS component ${componentName}`); @@ -109,7 +107,6 @@ function generateComponentFactory() { // Use app-components.shared.module.ts to modify the imports, etc of this module. // Note: code-generation is optional! See ./.gitignore for directions to remove it, // if you do not want it. -// tslint:disable import { NgModule } from '@angular/core'; import { JssModule } from '@sitecore-jss/sitecore-jss-angular'; diff --git a/samples/angular/scripts/generate-config.ts b/samples/angular/scripts/generate-config.ts index 23a26644a1..30015c6376 100644 --- a/samples/angular/scripts/generate-config.ts +++ b/samples/angular/scripts/generate-config.ts @@ -40,7 +40,7 @@ export function generateConfig(configOverrides?: any, outputPath?: string) { // based on other config settings. addGraphQLConfig(config); - const configText = `/* tslint:disable */ + const configText = ` // Do not edit this file, it is auto-generated at build time! // See scripts/bootstrap.ts to modify the generation of this file. export const environment = ${JSON.stringify(config, null, 2)}; diff --git a/samples/angular/scripts/update-graphql-fragment-data.ts b/samples/angular/scripts/update-graphql-fragment-data.ts index 452f808f37..e647bbeed3 100644 --- a/samples/angular/scripts/update-graphql-fragment-data.ts +++ b/samples/angular/scripts/update-graphql-fragment-data.ts @@ -54,9 +54,7 @@ fetch(jssConfig.graphQLEndpoint, { fs.writeFile( './src/graphql-fragment-types.ts', - `/* tslint:disable */ -export default ${JSON.stringify(filteredResult.data, null, 2)} -`, + `export default ${JSON.stringify(filteredResult.data, null, 2)}`, (err) => { if (err) { console.error('Error writing GraphQLFragmentTypes file', err); diff --git a/samples/nextjs/.eslintrc b/samples/nextjs/.eslintrc index 2fbc8efc1b..9ba8b00549 100644 --- a/samples/nextjs/.eslintrc +++ b/samples/nextjs/.eslintrc @@ -42,6 +42,7 @@ "prettier/prettier": "error", // needed for NextJS's in order to use jsx without react import "react/react-in-jsx-scope": "off", - "no-unused-vars": "error" + "no-unused-vars": "error", + "jsx-quotes": ["error", "prefer-double"] } } diff --git a/samples/react-native/.eslintrc.json b/samples/react-native/.eslintrc similarity index 86% rename from samples/react-native/.eslintrc.json rename to samples/react-native/.eslintrc index 7b5c16f50e..eb178399a6 100644 --- a/samples/react-native/.eslintrc.json +++ b/samples/react-native/.eslintrc @@ -1,6 +1,11 @@ { "root": true, "parser": "babel-eslint", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + } + }, "extends": [ "airbnb-base", "plugin:react/recommended", @@ -23,6 +28,7 @@ "jest": true }, "rules": { + "jsx-quotes": ["error", "prefer-double"], "react/prop-types": "off", "prettier/prettier": "error", "import/prefer-default-export": "off", @@ -43,27 +49,21 @@ } ], "func-names": "off", + "no-console": "off", "radix": ["error", "as-needed"], "prefer-destructuring": "off", "no-useless-escape": "off", - "no-restricted-globals": "off", - "no-restricted-properties": "off", "spaced-comment": "error", "curly": ["error", "multi-line"], "eol-last": ["error", "always"], "guard-for-in": "error", "no-unused-labels": "error", - "max-len": "off", "no-caller": "error", "no-bitwise": "error", - "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], "no-multiple-empty-lines": "error", "no-new-wrappers": "error", - "no-debugger": "error", - "no-empty": "error", "no-eval": "error", "dot-notation": "error", - "no-fallthrough": "error", "no-trailing-spaces": "error", "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], "brace-style": "error", diff --git a/samples/react/.eslintrc b/samples/react/.eslintrc index 43eeb6a03b..cc62d96f7d 100644 --- a/samples/react/.eslintrc +++ b/samples/react/.eslintrc @@ -37,7 +37,6 @@ "import/no-unresolved": "off", "import/no-duplicates": "off", "import/no-named-as-default": "off", - "max-len": "off", "import/no-extraneous-dependencies": [ "error", { @@ -47,6 +46,7 @@ ], "linebreak-style": "off", "react/jsx-filename-extension": 0, + "jsx-quotes": ["error", "prefer-double"], "import/prefer-default-export": "off", "react/forbid-prop-types": "off", "react/prop-types": 0, @@ -57,8 +57,6 @@ "global-require": 0, "no-param-reassign": 0, "no-useless-escape": "off", - "no-restricted-globals": "off", - "no-restricted-properties": "off", "spaced-comment": "error", "curly": ["error", "multi-line"], "eol-last": ["error", "always"], @@ -66,14 +64,10 @@ "no-unused-labels": "error", "no-caller": "error", "no-bitwise": "error", - "no-console": ["error", { "allow": ["log", "warn", "error", "info"] }], "no-multiple-empty-lines": "error", "no-new-wrappers": "error", - "no-debugger": "error", - "no-empty": "error", "no-eval": "error", "dot-notation": "error", - "no-fallthrough": "error", "no-trailing-spaces": "error", "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], "brace-style": "error", diff --git a/samples/sitecore-embedded-jss-app/.eslintrc b/samples/sitecore-embedded-jss-app/.eslintrc index 77b9178e03..cd9a6f90fc 100644 --- a/samples/sitecore-embedded-jss-app/.eslintrc +++ b/samples/sitecore-embedded-jss-app/.eslintrc @@ -37,6 +37,7 @@ "document": true }, "rules": { + "jsx-quotes": ["error", "prefer-double"], "import/no-duplicates": "off", "import/no-named-as-default": "off", "max-len": "off", From 21141858fa4f097fed97bd971f95e16df0e1e6b2 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 22 Dec 2020 17:46:12 +0200 Subject: [PATCH 35/37] push locks --- package-lock.json | 634 ++++++++++-------- .../sitecore-jss-nextjs/package-lock.json | 6 - packages/sitecore-jss-react/package-lock.json | 21 +- packages/sitecore-jss-vue/package-lock.json | 59 -- samples/vue/package-lock.json | 140 ++-- 5 files changed, 418 insertions(+), 442 deletions(-) diff --git a/package-lock.json b/package-lock.json index d7ffd849fc..bc95871d11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -853,6 +853,35 @@ "minimist": "^1.2.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" + } + } + } + }, "@evocateur/libnpmaccess": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", @@ -2778,22 +2807,11 @@ "uri-js": "^4.2.2" } }, - "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", - "dev": true, - "requires": { - "type-fest": "^0.11.0" - }, - "dependencies": { - "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", - "dev": true - } - } + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true }, "ansi-regex": { "version": "5.0.0", @@ -2957,9 +2975,9 @@ "dev": true }, "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "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": { @@ -3409,21 +3427,6 @@ } } }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true - }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -3550,6 +3553,12 @@ "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", "dev": true }, + "comment-parser": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.6.tgz", + "integrity": "sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg==", + "dev": true + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -4479,6 +4488,15 @@ "once": "^1.4.0" } }, + "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" + } + }, "env-paths": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", @@ -4580,50 +4598,101 @@ "dev": true }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "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": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "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": "^5.0.1", + "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", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash": "^4.17.19", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "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-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" + } + }, + "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 + }, "globals": { "version": "12.4.0", "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", @@ -4632,6 +4701,84 @@ "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" + } + }, + "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" + } + }, + "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 } } }, @@ -4644,6 +4791,56 @@ "get-stdin": "^6.0.0" } }, + "eslint-plugin-jsdoc": { + "version": "30.7.9", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.9.tgz", + "integrity": "sha512-qMM0fNx7/6OCnIh3jRpIrEBAhTG1THNXXbr3yfJ8yqLrDbzJR98xsstX25xt9GCPlrjNc/bBpTHfJQOvn7nVMA==", + "dev": true, + "requires": { + "comment-parser": "^0.7.6", + "debug": "^4.3.1", + "jsdoctypeparser": "^9.0.0", + "lodash": "^4.17.20", + "regextras": "^0.7.1", + "semver": "^7.3.4", + "spdx-expression-parse": "^3.0.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" + } + }, + "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" + } + }, + "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" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "eslint-plugin-prettier": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.0.tgz", @@ -4664,9 +4861,9 @@ } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "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" @@ -4679,14 +4876,14 @@ "dev": true }, "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "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.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" } }, "esprima": { @@ -5034,22 +5231,13 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "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": "^2.0.1" + "flat-cache": "^3.0.4" } }, "fill-range": { @@ -5204,20 +5392,30 @@ } }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "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": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "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": { @@ -6290,9 +6488,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "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", @@ -6427,87 +6625,6 @@ } } }, - "inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "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" - } - }, - "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 - }, - "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" - } - }, - "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" - } - } - } - }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -7251,6 +7368,12 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsdoctypeparser": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", + "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "dev": true + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -7368,13 +7491,13 @@ "dev": true }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "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.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "lines-and-columns": { @@ -8399,12 +8522,6 @@ "mime-db": "1.44.0" } }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -9126,27 +9243,18 @@ "wrappy": "1" } }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "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.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "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" } }, "options": { @@ -9422,9 +9530,9 @@ "dev": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prettier": { @@ -9755,9 +9863,9 @@ } }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "regexpu-core": { @@ -9774,6 +9882,12 @@ "unicode-match-property-value-ecmascript": "^1.2.0" } }, + "regextras": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", + "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", + "dev": true + }, "regjsgen": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", @@ -9911,16 +10025,6 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -10127,20 +10231,38 @@ "dev": true }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "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": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "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 } } @@ -10682,40 +10804,15 @@ } }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "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.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "dependencies": { - "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 - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - } + "ajv": "^6.12.4", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" } }, "tar": { @@ -11062,12 +11159,12 @@ "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "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.1.2" + "prelude-ls": "^1.2.1" } }, "type-fest": { @@ -11293,9 +11390,9 @@ "dev": true }, "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "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": { @@ -11495,15 +11592,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, "write-file-atomic": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", diff --git a/packages/sitecore-jss-nextjs/package-lock.json b/packages/sitecore-jss-nextjs/package-lock.json index 4c92eab994..8daebe0012 100644 --- a/packages/sitecore-jss-nextjs/package-lock.json +++ b/packages/sitecore-jss-nextjs/package-lock.json @@ -985,12 +985,6 @@ "@types/react": "*" } }, - "@types/url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@types/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-4kHAkbV/OfW2kb5BLVUuUMoumB3CP8rHqlw48aHvFy5tf9ER0AfOonBlX29l/DD68G70DmyhRlSYfQPSYpC5Vw==", - "dev": true - }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", diff --git a/packages/sitecore-jss-react/package-lock.json b/packages/sitecore-jss-react/package-lock.json index f372230c30..d2c6ba61df 100644 --- a/packages/sitecore-jss-react/package-lock.json +++ b/packages/sitecore-jss-react/package-lock.json @@ -124,15 +124,6 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "@sitecore-jss/sitecore-jss": { - "version": "16.0.0-canary.8", - "resolved": "https://registry.npmjs.org/@sitecore-jss/sitecore-jss/-/sitecore-jss-16.0.0-canary.8.tgz", - "integrity": "sha512-xOXrPSPkOwH6ejWoP3XvUWeBEMbKyIP1MeRjHbMXkx46/Wjnorws7T0a5vdgfMYQO8eg5TnMNcO0HDnkGgOVTA==", - "requires": { - "lodash.unescape": "^4.0.1", - "url-parse": "^1.4.7" - } - }, "@types/chai": { "version": "4.2.13", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.13.tgz", @@ -2381,11 +2372,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", @@ -3108,7 +3094,8 @@ "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true }, "quick-lru": { "version": "4.0.1", @@ -3368,7 +3355,8 @@ "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true }, "resolve": { "version": "1.17.0", @@ -3983,6 +3971,7 @@ "version": "1.4.7", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "dev": true, "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" diff --git a/packages/sitecore-jss-vue/package-lock.json b/packages/sitecore-jss-vue/package-lock.json index a07502b30c..ea9e587622 100644 --- a/packages/sitecore-jss-vue/package-lock.json +++ b/packages/sitecore-jss-vue/package-lock.json @@ -2316,12 +2316,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -2826,12 +2820,6 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, "diff-sequences": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", @@ -9113,53 +9101,6 @@ } } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tslint": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", - "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", diff --git a/samples/vue/package-lock.json b/samples/vue/package-lock.json index 7d50f3bfdf..c575921ae2 100644 --- a/samples/vue/package-lock.json +++ b/samples/vue/package-lock.json @@ -2103,6 +2103,17 @@ "unique-filename": "^1.1.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, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2259,6 +2270,13 @@ "slash": "^2.0.0" } }, + "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, + "optional": true + }, "hash-sum": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", @@ -2297,6 +2315,18 @@ } } }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -2449,6 +2479,16 @@ "ansi-regex": "^5.0.0" } }, + "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, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + }, "terser-webpack-plugin": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz", @@ -2476,6 +2516,18 @@ "repeat-string": "^1.6.1" } }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.1.2", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz", + "integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -12519,94 +12571,6 @@ "vue-style-loader": "^4.1.0" } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.1.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz", - "integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.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, - "optional": 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, - "optional": 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, - "optional": 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, - "optional": 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, - "optional": true - }, - "hash-sum": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", - "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", - "dev": true, - "optional": true - }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "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, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "vue-meta": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.2.2.tgz", From f1c019c120abf329ef5af97bc92086a650b52214 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 22 Dec 2020 18:05:08 +0200 Subject: [PATCH 36/37] Add upgrade guide step --- docs/data/routes/upgrade-guides/16.0/en.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/data/routes/upgrade-guides/16.0/en.md diff --git a/docs/data/routes/upgrade-guides/16.0/en.md b/docs/data/routes/upgrade-guides/16.0/en.md new file mode 100644 index 0000000000..3268e835e1 --- /dev/null +++ b/docs/data/routes/upgrade-guides/16.0/en.md @@ -0,0 +1,9 @@ +--- +name: "16.0" +routeTemplate: ./data/component-templates/full-page.yml +title: Upgrading to JSS 16.0 +--- + +### Upgrading from JSS 15.0 to JSS 16.0 + +1. Check usages of `any` type (and fix any build/lint errors) as we start to migrate from `any` to `unknown` or more specific types \ No newline at end of file From b384ee02ff90c7bd6db7288ed78dbf2bcbcda406 Mon Sep 17 00:00:00 2001 From: sc-illiakovalenko <illia.kovalenko@sitecore.com> Date: Tue, 22 Dec 2020 19:55:54 +0200 Subject: [PATCH 37/37] Changes after review --- .../disconnected-server/default-document.ts | 3 +-- .../src/disconnected-server/layout-service.ts | 7 +----- .../src/disconnected-server/media-service.ts | 4 +--- .../src/generator/generate.ts | 23 ++++--------------- .../src/editing-middleware.ts | 4 ++-- 5 files changed, 10 insertions(+), 31 deletions(-) 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 613cff101d..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 @@ -9,8 +9,7 @@ export interface DefaultDocumentMiddlewareOptions { } /** - * @param {object} config - * @param {string} config.indexFilePath + * @param {DefaultDocumentMiddlewareOptions} config */ export function createDefaultDocumentMiddleware({ indexFilePath, 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 e0402bf1fe..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 @@ -357,12 +357,7 @@ function defaultCustomizeRoute( } /** - * @param {Object} config - * @param {ManifestInstance} config.manifest - * @param {CustomizeContextFunction | undefined} config.customizeContext - * @param {CustomizeRouteFunction | undefined} config.customizeRoute - * @param {Function} config.manifestLanguageChangeCallback - * @param {CustomizeRenderFunction | undefined} config.customizeRendering + * @param {DisconnectedLayoutServiceOptions} config */ export function createDisconnectedLayoutService({ manifest, 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 7494db12da..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 @@ -12,9 +12,7 @@ export interface DisconnectedAssetMiddlewareOptions { } /** - * @param {Object} config - * @param {string} config.manifestPath - * @param {string} config.staticRootPath + * @param {DisconnectedAssetMiddlewareOptions} config */ export function createDisconnectedAssetMiddleware({ manifestPath, diff --git a/packages/sitecore-jss-manifest/src/generator/generate.ts b/packages/sitecore-jss-manifest/src/generator/generate.ts index 9bba8d2a16..396936068e 100644 --- a/packages/sitecore-jss-manifest/src/generator/generate.ts +++ b/packages/sitecore-jss-manifest/src/generator/generate.ts @@ -169,19 +169,7 @@ export interface GenerateToFileOptions extends GenerateOptions { * and no files are written to disk. Use generateToFile() to make a manifest * that is designed to get packaged/imported. * - * @param {Object} config - * @param {string} config.requireArg - * @param {string[]} config.fileGlobs - * @param {any} config.pipelines - * @param {string} config.appName - * @param {boolean} [config.excludeItems] - * @param {boolean} [config.excludeDictionary] - * @param {string} config.language - * @param {string[]} config.pipelinePatchFileGlobs - * @param {boolean} config.debug - * @param {boolean} config.wipe - * @param {string[]} config.rootPlaceholders - * @param {boolean} config.skipPlaceholderBlacklist + * @param {GenerateOptions} config */ export async function generateToVariable({ requireArg, @@ -220,12 +208,11 @@ 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. /** - * @param {Object} config - * @param {string} [config.outputPath] - * @param {boolean} [config.excludeMedia] + * 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', 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 34b0304084..a389301b82 100644 --- a/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts +++ b/packages/sitecore-jss-nextjs-editing-host/src/editing-middleware.ts @@ -5,10 +5,10 @@ import { Request, Response } from 'express'; 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. */ export class EditingMiddleware { /** - * Express middleware for handling requests from the Sitecore Experience Editor. - * @class * @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.