Skip to content

Commit

Permalink
Merge pull request #50 from Vizzuality/fix/compilation
Browse files Browse the repository at this point in the history
Fixed compilation with react 17
  • Loading branch information
davidsingal authored Apr 27, 2022
2 parents 1f3b132 + 4b92797 commit cbf840d
Show file tree
Hide file tree
Showing 19 changed files with 3,907 additions and 2,462 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.next
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
es2021: true,
node: true,
},
extends: ['airbnb-typescript', 'prettier'],
extends: ['next/core-web-vitals', 'airbnb-typescript', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ yarn-error.log*

# Yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

# typescript
tsconfig.tsbuildinfo
768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.1.1.cjs
4 changes: 0 additions & 4 deletions now.json

This file was deleted.

170 changes: 88 additions & 82 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,100 +20,106 @@
"postinstall": "husky install"
},
"engines": {
"node": "~16.14"
"node": "~16.14 || ~14"
},
"dependencies": {
"@artsy/fresnel": "^3.4.0",
"@artsy/fresnel": "3.4.0",
"@deck.gl/core": "8.4.16",
"@deck.gl/geo-layers": "8.4.16",
"@deck.gl/layers": "8.4.16",
"@deck.gl/mesh-layers": "8.4.16",
"@dnd-kit/core": "^3.0.3",
"@dnd-kit/modifiers": "^2.0.0",
"@dnd-kit/sortable": "^3.0.1",
"@dnd-kit/utilities": "^2.0.0",
"@luma.gl/constants": "^8.4.5",
"@math.gl/web-mercator": "^3.4.2",
"@popperjs/core": "^2.9.2",
"@react-aria/button": "^3.3.2",
"@react-aria/dialog": "^3.1.3",
"@react-aria/focus": "^3.3.0",
"@react-aria/i18n": "^3.3.1",
"@react-aria/interactions": "^3.4.0",
"@react-aria/overlays": "^3.6.3",
"@react-aria/searchfield": "^3.1.3",
"@react-aria/slider": "^3.0.2",
"@react-aria/utils": "^3.8.0",
"@react-aria/visually-hidden": "^3.2.2",
"@react-stately/overlays": "^3.1.2",
"@react-stately/searchfield": "^3.1.2",
"@react-stately/slider": "^3.0.2",
"@react-types/searchfield": "^3.1.1",
"@reduxjs/toolkit": "^1.5.1",
"@storybook/react": "^6.4.19",
"@tailwindcss/forms": "^0.3.2",
"@tippyjs/react": "^4.2.5",
"@vizzuality/layer-manager-layers-deckgl": "^1.0.0-alpha.3",
"@vizzuality/layer-manager-plugin-mapboxgl": "^1.0.0-alpha.3",
"@vizzuality/layer-manager-provider-carto": "^1.0.0-alpha.3",
"@vizzuality/layer-manager-react": "^1.0.0-alpha.3",
"autoprefixer": "^10.2.5",
"axios": "^0.21.1",
"classnames": "^2.3.1",
"d3-ease": "^2.0.0",
"downshift": "^6.1.3",
"final-form": "^4.20.2",
"framer-motion": "^4.1.17",
"jsona": "^1.9.2",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.21",
"next": "^12.0.9",
"next-auth": "^3.21.1",
"next-compose-plugins": "^2.2.1",
"next-optimized-images": "^2.6.2",
"popmotion": "^9.3.6",
"postcss": "^8.2.15",
"react": "^17.0.2",
"react-aria": "^3.6.0",
"react-dom": "^17.0.2",
"react-final-form": "^6.5.3",
"react-map-gl": "^6.1.15",
"react-popper": "^2.2.5",
"react-query": "^3.16.0",
"react-redux": "^7.2.4",
"tailwindcss": "^2.1.2",
"use-debounce": "^6.0.1",
"validate.js": "^0.13.1"
"@dnd-kit/core": "3.0.3",
"@dnd-kit/modifiers": "2.0.0",
"@dnd-kit/sortable": "6.0.1",
"@dnd-kit/utilities": "2.0.0",
"@luma.gl/constants": "8.4.5",
"@math.gl/web-mercator": "3.4.2",
"@popperjs/core": "2.9.2",
"@react-aria/button": "3.3.2",
"@react-aria/dialog": "3.1.3",
"@react-aria/focus": "3.3.0",
"@react-aria/i18n": "3.3.1",
"@react-aria/interactions": "3.4.0",
"@react-aria/overlays": "3.6.3",
"@react-aria/searchfield": "3.1.3",
"@react-aria/slider": "3.0.7",
"@react-aria/utils": "3.8.0",
"@react-aria/visually-hidden": "3.2.2",
"@react-stately/overlays": "3.1.2",
"@react-stately/searchfield": "3.1.2",
"@react-stately/slider": "3.0.7",
"@react-types/searchfield": "3.1.1",
"@reduxjs/toolkit": "1.5.1",
"@storybook/react": "6.4.19",
"@tailwindcss/forms": "0.3.2",
"@tippyjs/react": "4.2.5",
"@vizzuality/layer-manager-layers-deckgl": "1.0.0-alpha.3",
"@vizzuality/layer-manager-plugin-mapboxgl": "1.0.0-alpha.3",
"@vizzuality/layer-manager-provider-carto": "1.0.0-alpha.3",
"@vizzuality/layer-manager-react": "1.0.0-alpha.3",
"autoprefixer": "10.2.5",
"axios": "0.21.1",
"classnames": "2.3.1",
"d3-ease": "2.0.0",
"downshift": "6.1.3",
"final-form": "4.20.2",
"framer-motion": "4.1.17",
"jsona": "1.9.2",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.21",
"next": "12.0.9",
"next-auth": "3.21.1",
"next-compose-plugins": "2.2.1",
"next-optimized-images": "2.6.2",
"popmotion": "9.3.6",
"postcss": "8.2.15",
"react": "17.0.2",
"react-aria": "3.6.0",
"react-dom": "17.0.2",
"react-final-form": "6.5.3",
"react-map-gl": "6.1.15",
"react-popper": "2.2.5",
"react-query": "3.16.0",
"react-redux": "7.2.4",
"tailwindcss": "2.1.2",
"use-debounce": "6.0.1",
"validate.js": "0.13.1"
},
"devDependencies": {
"@babel/core": "^7.14.2",
"@storybook/addon-actions": "^6.4.19",
"@storybook/addon-essentials": "^6.4.19",
"@storybook/addon-links": "^6.4.19",
"@types/axios": "^0.14.0",
"@types/gtag.js": "^0.0.5",
"@types/react": "^17.0.5",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"@typescript-eslint/parser": "^4.0.0",
"babel-loader": "^8.2.2",
"cypress": "^7.3.0",
"eslint": "^7.2.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4",
"husky": "^6.0.0",
"prettier": "^2.3.0",
"start-server-and-test": "^1.12.1",
"svg-sprite-loader": "^6.0.6",
"@babel/core": "7.14.2",
"@storybook/addon-actions": "6.4.19",
"@storybook/addon-essentials": "6.4.19",
"@storybook/addon-links": "6.4.19",
"@types/gtag.js": "0.0.5",
"@types/react": "17.0.39",
"@types/react-dom": "17.0.11",
"@typescript-eslint/eslint-plugin": "5.13.0",
"@typescript-eslint/parser": "5.0.0",
"babel-loader": "8.2.2",
"cypress": "7.3.0",
"eslint": "7.32.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-next": "12.1.5",
"eslint-config-prettier": "8.3.0",
"eslint-import-resolver-typescript": "2.4.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"husky": "6.0.0",
"prettier": "2.3.0",
"start-server-and-test": "1.12.1",
"svg-sprite-loader": "6.0.6",
"svgo": "1.3.2",
"svgo-loader": "2.2.2",
"typescript": "4.4.4"
},
"resolutions": {
"@types/react": "17.0.39",
"@types/react-dom": "17.0.11"
},
"husky": {
"pre-commit": "yarn lint"
},
Expand Down
44 changes: 23 additions & 21 deletions src/components/avatar/component.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,26 @@ Default.args = {
bgImage: '/images/avatar.png',
};

export const Groups = (): ReactNode => (
<ul className="flex">
<li>
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="-ml-3">
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="-ml-3">
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="-ml-3">
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="ml-3">
<Avatar className="bg-white">
<Icon icon={HELP_SVG} className="w-5 h-5" />
</Avatar>
</li>
</ul>
);
export function Groups(): ReactNode {
return (
<ul className="flex">
<li>
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="-ml-3">
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="-ml-3">
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="-ml-3">
<Avatar bgImage="/images/avatar.png" />
</li>
<li className="ml-3">
<Avatar className="bg-white">
<Icon icon={HELP_SVG} className="w-5 h-5" />
</Avatar>
</li>
</ul>
);
}
4 changes: 2 additions & 2 deletions src/components/forms/component.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
parameters: { actions: { argTypesRegex: '^on.*' } },
};

export const Form = (): ReactNode => {
export function Form(): ReactNode {
const sliderLabelRef = useRef(null);

return (
Expand Down Expand Up @@ -253,4 +253,4 @@ export const Form = (): ReactNode => {
)}
</FormRFF>
);
};
}
26 changes: 14 additions & 12 deletions src/components/forms/label/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ import cx from 'classnames';
import { THEME } from './constants';
import type { LabelProps } from './types';

const LabelComponent = ({ htmlFor, theme = 'dark', children, className }: LabelProps, ref) => (
<label
className={cx({
[THEME[theme]]: true,
[className]: !!className,
})}
htmlFor={htmlFor}
ref={ref}
>
{children}
</label>
);
function LabelComponent({ htmlFor, theme = 'dark', children, className }: LabelProps, ref) {
return (
<label
className={cx({
[THEME[theme]]: true,
[className]: !!className,
})}
htmlFor={htmlFor}
ref={ref}
>
{children}
</label>
);
}

export const Label = forwardRef<HTMLLabelElement, LabelProps>(LabelComponent);

Expand Down
4 changes: 2 additions & 2 deletions src/components/map/legend/sortable/list/item/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { FC } from 'react';

import cx from 'classnames';

import { useSortable } from '@dnd-kit/sortable';
import { useSortable, UseSortableArguments } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';

import type { SortableItemProps } from './types';

export const SortableItem: FC<SortableItemProps> = ({ id, children }: SortableItemProps) => {
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
id,
});
} as UseSortableArguments);

const style = {
transform: CSS.Transform.toString(transform),
Expand Down
6 changes: 3 additions & 3 deletions src/components/map/legend/sortable/list/item/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

export interface SortableItemProps {
export type SortableItemProps = {
id: string;
children: ReactNode;
}
};
2 changes: 1 addition & 1 deletion src/components/media-query/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createMedia } from '@artsy/fresnel';

import { screens } from 'styles.config';
import { screens } from 'styles/styles.config';

const ExampleAppMedia = createMedia<
{ breakpoints: Record<string, number> },
Expand Down
35 changes: 0 additions & 35 deletions src/components/modal/types.ts

This file was deleted.

Loading

1 comment on commit cbf840d

@vercel
Copy link

@vercel vercel bot commented on cbf840d Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.