Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port more content to website-next #1435

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/validate-website-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ on:
- name: Setup
uses: ./.github/actions/setup-js

- name: Build Yoga
run: yarn build
working-directory: javascript

- name: Build Website
run: yarn build
working-directory: website-next
Expand Down
37 changes: 34 additions & 3 deletions javascript/just.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const {

const {readFile, writeFile} = require('fs/promises');

const chalk = require('chalk');
const glob = require('glob');
const path = require('path');
const which = require('which');
Expand Down Expand Up @@ -132,10 +133,37 @@ function runBenchTask() {
};
}

function findExecutable(name, failureMessage) {
const exec = which.sync(name, {nothrow: true});
if (exec) {
return exec;
}

logger.error(chalk.bold.red(failureMessage));
process.exit(1);
}

function tryFindExecutable(name, failureMessage) {
const exec = which.sync(name, {nothrow: true});
if (exec) {
return exec;
}

logger.warn(chalk.bold.yellow(failureMessage));
return exec;
}

function emcmakeGenerateTask() {
return () => {
const emcmake = which.sync('emcmake');
const ninja = which.sync('ninja', {nothrow: true});
const ninja = tryFindExecutable(
'ninja',
'Warning: Install Ninja (e.g. "brew install ninja") for faster builds',
);
const emcmake = findExecutable(
'emcmake',
'Error: Please install the emscripten SDK: https://emscripten.org/docs/getting_started/',
);

const args = [
'cmake',
'-S',
Expand All @@ -152,7 +180,10 @@ function emcmakeGenerateTask() {

function cmakeBuildTask(opts) {
return () => {
const cmake = which.sync('cmake');
const cmake = findExecutable(
'cmake',
'Error: Please install CMake (e.g. "brew install cmake")',
);
const args = [
'--build',
'build',
Expand Down
2 changes: 1 addition & 1 deletion javascript/tests/generated/YGStaticPositionTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// @generated by gentest/gentest.rb from gentest/fixtures/YGStaticPositionTest.html

import {Yoga} from "../tools/globals";
import Yoga from 'yoga-layout';
import {
Align,
Direction,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
"lint:fix": "eslint . --fix",
"tsc": "yarn workspaces run tsc"
},
"workspaces": [
"javascript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

// @ts-check

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
export default {
title: 'Yoga',
tagline:
'Build flexible layouts on any platform with a highly optimized open source layout engine designed with speed, size, and ease of use in mind.',
Expand Down Expand Up @@ -63,20 +62,27 @@ const config = {
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: 'Tutorial',
label: 'Documentation',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/facebook/yoga',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'Meta Open Source',
src: 'img/meta_oss.svg',
href: 'https://opensource.fb.com',
width: 300,
height: 64,
},
links: [
{
title: 'Docs',
Expand Down Expand Up @@ -117,10 +123,8 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};

module.exports = config;
36 changes: 12 additions & 24 deletions website-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"start": "yarn workspace yoga-layout build && docusaurus start",
"build": "yarn workspace yoga-layout build && docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand All @@ -17,34 +17,22 @@
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
"antd": "^3.6.5",
"@docusaurus/core": "3.0.0-rc.1",
"@docusaurus/preset-classic": "3.0.0-rc.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"immutable": "^4.0.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-syntax-highlighter": "^8.0.0",
"prism-react-renderer": "^2.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"yoga-layout": "^2.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"@tsconfig/docusaurus": "^1.0.5"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"@docusaurus/module-type-aliases": "3.0.0-rc.1",
"@docusaurus/tsconfig": "3.0.0-rc.1",
"@docusaurus/types": "3.0.0-rc.1"
},
"browserslist": "> 0.5%, last 2 versions, Firefox ESR, not dead",
"engines": {
"node": ">=16.14"
}
Expand Down
2 changes: 1 addition & 1 deletion website-next/sidebars.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
docsSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
Expand Down
77 changes: 0 additions & 77 deletions website-next/src/components/HomepageFeatures/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

.features {
display: flex;
align-items: center;
padding: 2rem 0;
.input {
width: 100%;
}

.featureSvg {
height: 200px;
width: 200px;
}
7 changes: 5 additions & 2 deletions website-next/src/components/Playground/EditValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import React from 'react';
import YogaEnumSelect from './YogaEnumSelect';
import YogaPositionEditor from './YogaPositionEditor';
import {Input} from 'antd';

import styles from './EditValue.module.css';

type Props<T> = {
property: string;
Expand All @@ -20,6 +21,7 @@ type Props<T> = {
placeholder?: string;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default (props: Props<any>) => {
if (YogaEnumSelect.availableProperties.indexOf(props.property) > -1) {
// @ts-ignore
Expand All @@ -31,7 +33,8 @@ export default (props: Props<any>) => {
return <YogaPositionEditor {...props} />;
} else {
return (
<Input
<input
className={styles.input}
type="text"
{...props}
onChange={e => props.onChange(props.property, e.target.value)}
Expand Down
63 changes: 0 additions & 63 deletions website-next/src/components/Playground/Editor.css

This file was deleted.

Loading
Loading