GithubHelp home page GithubHelp logo

mcheshkov / times-components Goto Github PK

View Code? Open in Web Editor NEW

This project forked from newsuk/times-components

0.0 1.0 0.0 52.01 MB

A collection of reusable components used by The Times

Home Page: http://components.thetimes.co.uk

License: BSD 3-Clause "New" or "Revised" License

JavaScript 95.31% HTML 0.42% Ruby 0.14% Shell 0.80% Python 0.13% Java 1.50% Objective-C 1.69% Rust 0.01%

times-components's Introduction

The Times Component Library

Coverage Status Build Status

Purpose

Home of The Times' react/react native components, using react-native-web to share across platforms

Dev Environment

We require MacOS with Node.js (version >=8 with npm v5), yarn (latest) and watchman installed. Native development requires Xcode, Android Studio and JDK 8.

You can try without these requirements, but you'd be on your own.

Viewing Our Components

If you use Expo you are able to scan the QR code below

This has been made possible using Fructose

Getting Started

  1. Run yarn to install dependencies
  2. Install fontforge: brew install fontforge (See Fonts section)
  3. Components can be seen running in a storybook:
  • web storybook
    1. yarn storybook
    2. go to http://localhost:9001
  • native storybook
    1. yarn storybook-native and leave it running
    2. yarn ios to start the iOS app
    3. To start the Android app:
      • Start a virtual device
      • Check Android SDK path is exported to $ANDROID_HOME. In Mac, android sdk is installed to ~/Library/Android/sdk by default. export ANDROID_HOME="/Users/<USERNAME>/Library/Android/sdk"
      • yarn android
      • If you get build errors, check your JDK version with javac -version, which should print javac 1.8.XXXX. Earlier or later versions may not work.
    4. go to http://localhost:7007

Native App Dev Server

In order to run development servers for native applications, start haul dev server via:

yarn android:app or yarn ios:app

Haul

We use Haul in lieu of the standard react-native CLI so that we can generate native Storybook bundles using Webpack, which we configure to honour our monorepo packages' respective dev entry points; this allows one to update a package's source code and preview the changes without having to manually re-transpile. Haul also automatically generates debuggable source maps.

Fonts ⚠️

In order to view the storybook on native, you'll need to fix broken fonts. This fix is done automatically when running storybook (both web and native), but requires that fontforge is installed, otherwise the fix won't be applied and you'll get the classic red error screen when trying to use a broken font.

Schema

See utils package on how to update the schema

Debugging

The components in this project can be debugged through your browser's developer tools. These steps assume the use of Chrome DevTools.

To debug our web Storybook:

  1. yarn storybook
  2. navigate to `http://localhost:9001
  3. open DevTools
  4. Click Sources
  5. In the Network tab under the leftmost pane, expand top => storybook-preview-iframe => webpack:// => . => packages

Any of these source files can be debugged directly.

To debug our native Storybook:

  1. yarn storybook-native and leave it running
  2. yarn android or yarn ios
  3. open the developer menu on your device (Cmd + M on Android, Cmd + D on iOS) and tap Debug JS Remotely
  4. navigate to http://localhost:8081/debugger-ui if it hasn't opened automatically
  5. open DevTools
  6. click Sources
  7. expand debuggerWorker.js => webpack:// => . => packages

Testing and code coverage

Tests Covered CI
Unit tests, UI tests and Integration tests Travis Build
Visual Regression tool (Dextrose) Not automated
Functional Regression tool (Fructose) Not automated

Contributing

See the CONTRIBUTING.md for an extensive breakdown of the project

yarn commit will commit files (same as git commit), and will aid the contributor with adding a suitable commit message inline with conventional changelog

times-components's People

Contributors

a-ursino avatar adrienthiery avatar aronshamash avatar asifhafeez avatar berniesumption avatar colincclark avatar craigbilner avatar dickie81 avatar fabiosantoscode avatar fampinheiro avatar foliveira avatar fourlastor avatar hem-brahmbhatt avatar jackharvey1 avatar jamesseanwright avatar jgantunes avatar jimhunty avatar jonnywyatt avatar kaliabadi avatar l0wry avatar milesillsley avatar nehasri89 avatar nikhedonia avatar rjanjua avatar rogeriopvl avatar sericaia avatar thatportugueseguy avatar toboid avatar trevorah avatar tuncaulubilge avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.