Skip to content

Commit

Permalink
Chore: Update dependencies (#195)
Browse files Browse the repository at this point in the history
* Chore: Update dependencies
* Fix: formatting issues
  • Loading branch information
nmn authored Dec 16, 2023
1 parent ee3ac48 commit 8018f8c
Show file tree
Hide file tree
Showing 29 changed files with 2,800 additions and 2,379 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
0.223.0
0.224.0

[ignore]
.*/build/.*
Expand Down
9 changes: 0 additions & 9 deletions apps/docs/.prettierrc

This file was deleted.

5 changes: 3 additions & 2 deletions apps/docs/components/CtaButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ import * as React from 'react';
import * as stylex from '@stylexjs/stylex';
import Link from '@docusaurus/Link';

export default function CtaButton({children, color, to}) {
export default function CtaButton({ children, color, to }) {
return (
<Link
{...stylex.props(
styles.base,
color === 'pink' && styles.pink,
color === 'blue' && styles.blue,
)}
to={to}>
to={to}
>
{children}
</Link>
);
Expand Down
20 changes: 13 additions & 7 deletions apps/docs/components/Logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function LogoText() {
);
}

export default function Logo({xstyle}) {
export default function Logo({ xstyle }) {
const idA = 'a';
const idB = 'b';
const idC = 'c';
Expand All @@ -39,7 +39,8 @@ export default function Logo({xstyle}) {
fx="62.144%"
fy="40.669%"
id={idC}
r="55.819%">
r="55.819%"
>
<stop offset="0%" stopColor="#E5F9FF" />
<stop offset="21.605%" stopColor="#B2EEFE" />
<stop offset="57.356%" stopColor="#5ED9FB" />
Expand All @@ -52,7 +53,8 @@ export default function Logo({xstyle}) {
fx="69.561%"
fy="37.427%"
id={idF}
r="62.945%">
r="62.945%"
>
<stop offset="0%" stopColor="#FCD5FD" />
<stop offset="19.619%" stopColor="#FD9EFF" />
<stop offset="51.352%" stopColor="#F53BFA" />
Expand All @@ -64,7 +66,8 @@ export default function Logo({xstyle}) {
x1="40.797%"
x2="74.283%"
y1="31.719%"
y2="59.893%">
y2="59.893%"
>
<stop offset="0%" stopColor="var(--fg1)" stopOpacity="0" />
<stop offset="100%" stopColor="var(--fg1)" />
</linearGradient>
Expand All @@ -73,7 +76,8 @@ export default function Logo({xstyle}) {
x1="42.442%"
x2="64.703%"
y1="56.078%"
y2="39.384%">
y2="39.384%"
>
<stop offset="0%" stopColor="var(--fg1)" stopOpacity="0" />
<stop offset="100%" stopColor="var(--fg1)" />
</linearGradient>
Expand All @@ -83,7 +87,8 @@ export default function Logo({xstyle}) {
id={idE}
width="133.3%"
x="-16.7%"
y="-16.7%">
y="-16.7%"
>
<feGaussianBlur
in="SourceAlpha"
result="shadowBlurInner1"
Expand Down Expand Up @@ -114,7 +119,8 @@ export default function Logo({xstyle}) {
id={idH}
width="124.1%"
x="-12.1%"
y="-12.1%">
y="-12.1%"
>
<feGaussianBlur
in="SourceAlpha"
result="shadowBlurInner1"
Expand Down
8 changes: 5 additions & 3 deletions apps/docs/components/LogoBold.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import * as React from 'react';
import * as stylex from '@stylexjs/stylex';

export default function LogoBold({xstyle}) {
export default function LogoBold({ xstyle }) {
const id = 'logo-bold';

return (
Expand All @@ -21,7 +21,8 @@ export default function LogoBold({xstyle}) {
x1="40.855%"
x2="74.131%"
y1="31.719%"
y2="59.893%">
y2="59.893%"
>
<stop offset="0%" stopColor="var(--fg1)" stopOpacity="0" />
<stop offset="100%" stopColor="var(--fg1)" />
</linearGradient>
Expand All @@ -30,7 +31,8 @@ export default function LogoBold({xstyle}) {
x1="42.121%"
x2="65.327%"
y1="56.078%"
y2="39.384%">
y2="39.384%"
>
<stop offset="0%" stopColor="var(--fg1)" stopOpacity="0" />
<stop offset="100%" stopColor="var(--fg1)" />
</linearGradient>
Expand Down
22 changes: 11 additions & 11 deletions apps/docs/components/StylexAnimatedLogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import * as React from 'react';
import * as stylex from '@stylexjs/stylex';
import {LogoText, viewBox} from './Logo';
import { LogoText, viewBox } from './Logo';

const ANIM_DURATION = '6s';
const STAGGER = '-2.5s';
Expand All @@ -23,17 +23,17 @@ const rotate = stylex.keyframes({
},
});
const fade = stylex.keyframes({
'0%': {opacity: 1, transform: 'scale(1)'},
'45%': {opacity: 1, transform: 'scale(1)'},
'55%': {opacity: 0, transform: 'scale(0.5)'},
'90%': {opacity: 0, transform: 'scale(0.5)'},
'0%': { opacity: 1, transform: 'scale(1)' },
'45%': { opacity: 1, transform: 'scale(1)' },
'55%': { opacity: 0, transform: 'scale(0.5)' },
'90%': { opacity: 0, transform: 'scale(0.5)' },
});
const fade2 = stylex.keyframes({
'0%': {opacity: 0, transform: 'scale(0)'},
'10%': {opacity: 1, transform: 'scale(1)'},
'58%': {opacity: 1, transform: 'scale(1)'},
'68%': {opacity: 0, transform: 'scale(0.5)'},
'100%': {opacity: 0, transform: 'scale(0.5)'},
'0%': { opacity: 0, transform: 'scale(0)' },
'10%': { opacity: 1, transform: 'scale(1)' },
'58%': { opacity: 1, transform: 'scale(1)' },
'68%': { opacity: 0, transform: 'scale(0.5)' },
'100%': { opacity: 0, transform: 'scale(0.5)' },
});

const styles = stylex.create({
Expand Down Expand Up @@ -118,7 +118,7 @@ const styles = stylex.create({
},
});

export default function StylexAnimatedLogo({style}) {
export default function StylexAnimatedLogo({ style }) {
return (
<div {...stylex.props(styles.root)}>
<svg {...stylex.props(style)} viewBox={viewBox}>
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/components/VersionTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@

import React from 'react';
import json from '@stylexjs/stylex/package.json';
const {version} = json;
const { version } = json;

export const versionTag = version.includes('beta') ? '@beta' : '';

export function VersionTag() {
return <span>{versionTag}</span>;
}

export function IfBeta({children}) {
export function IfBeta({ children }) {
if (version.includes('beta')) {
return children;
}
return null;
}

export function IfNotBeta({children}) {
export function IfNotBeta({ children }) {
if (version.includes('beta')) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const styles = stylex.create({
},
});

export default function YouTube({width: _w, height: _h, src, title}) {
export default function YouTube({ width: _w, height: _h, src, title }) {
return (
<div {...stylex.props(styles.container)}>
<iframe
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/components/ZStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import React from 'react';
import * as stylex from '@stylexjs/stylex';

const {useEffect, useState} = React;
const { useEffect, useState } = React;

const styles = stylex.create({
container: {
Expand All @@ -30,7 +30,7 @@ const styles = stylex.create({

const ActiveItemContext = React.createContext(false);

export function ZStack({children, xstyle}) {
export function ZStack({ children, xstyle }) {
const [active, setActive] = useState(0);

useEffect(() => {
Expand All @@ -53,7 +53,7 @@ export function ZStack({children, xstyle}) {
);
}

export function ZStackItem({children, style}) {
export function ZStackItem({ children, style }) {
const active = React.useContext(ActiveItemContext);
return (
<span {...stylex.props(styles.item, active && styles.visible, style)}>
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/components/examples/dev-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

import React from 'react';
import CodeBlock from '@theme/CodeBlock';
import {versionTag} from '../VersionTag';
import { versionTag } from '../VersionTag';

const codeForCLI = ({prod, dev}) => ({
const codeForCLI = ({ prod, dev }) => ({
npm: [
prod?.length > 0 ? `npm install --save ${prod.join(' ')}` : null,
dev?.length > 0 ? `npm install --save-dev ${dev.join(' ')}` : null,
Expand All @@ -20,11 +20,11 @@ const codeForCLI = ({prod, dev}) => ({
.join('\n'),
});

export function DevInstallExample({prod = [], dev = []}) {
export function DevInstallExample({ prod = [], dev = [] }) {
const p = prod.map((p) => p + versionTag);
const d = dev.map((d) => d + versionTag);

const codeExamples = codeForCLI({prod: p, dev: d});
const codeExamples = codeForCLI({ prod: p, dev: d });

return <CodeBlock className="language-bash">{codeExamples.npm}</CodeBlock>;
}
4 changes: 2 additions & 2 deletions apps/docs/components/hooks/useViewTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @format
*/

import {useLayoutEffect, useRef} from 'react';
import { useLayoutEffect, useRef } from 'react';

export default function useViewTransition() {
const promise = useRef(null);
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function useViewTransition() {
transition.current = document.startViewTransition(
() =>
new Promise((resolve, reject) => {
promise.current = {resolve, reject};
promise.current = { resolve, reject };
callback();
}),
);
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const config = {
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/facebook/stylex/tree/main/apps/docs/',
Expand All @@ -41,7 +41,7 @@ const config = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
},
],
],

Expand Down Expand Up @@ -159,7 +159,7 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc. Built with Docusaurus.`,
},
metadata: [
{name: 'og:title', content: 'StyleX'},
{ name: 'og:title', content: 'StyleX' },
{
name: 'og:description',
content: 'The styling system that powers Meta.',
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/eslintrc-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
// Ignore certain webpack alias because it can't be resolved
'import/no-unresolved': [
ERROR,
{ignore: ['^@theme', '^@docusaurus', '^@generated']},
{ ignore: ['^@theme', '^@docusaurus', '^@generated'] },
],
'import/extensions': OFF,
'header/header': [
Expand Down
7 changes: 3 additions & 4 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
"@babel/eslint-parser": "^7.22.15",
"@stylexjs/babel-plugin": "0.3.0",
"clean-css": "^5.3.2",
"eslint": "^8.19.0",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"mkdirp": "^1.0.4",
"prettier": "^2.7.1",
"stylelint": "^14.9.1"
},
"browserslist": {
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/scripts/make-stylex-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'use strict';

const fs = require('fs/promises');
const {transformAsync} = require('@babel/core');
const { transformAsync } = require('@babel/core');
const stylexBabelPlugin = require('@stylexjs/babel-plugin');
const flowSyntaxPlugin = require('@babel/plugin-syntax-flow');
const jsxSyntaxPlugin = require('@babel/plugin-syntax-jsx');
Expand Down Expand Up @@ -46,7 +46,7 @@ async function transformFile(filePath) {
}

async function getAllFilesOfType(folder, type) {
const contents = await fs.readdir(folder, {withFileTypes: true});
const contents = await fs.readdir(folder, { withFileTypes: true });

const files = await Promise.all(
contents.map(async (dirent) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

module.exports = {
// By default, Docusaurus generates a sidebar from the docs folder structure
docs: [{type: 'autogenerated', dirName: 'learn'}],
docs: [{ type: 'autogenerated', dirName: 'learn' }],
api: [
{
type: 'autogenerated',
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as React from 'react';
import * as stylex from '@stylexjs/stylex';
import Layout from '@theme/Layout';
import StylexAnimatedLogo from '@site/components/StylexAnimatedLogo';
import {ZStack, ZStackItem} from '../../components/ZStack';
import { ZStack, ZStackItem } from '../../components/ZStack';
import CtaButton from '../../components/CtaButton';

export default function Home() {
Expand Down
Loading

0 comments on commit 8018f8c

Please sign in to comment.