Giter VIP home page Giter VIP logo

iaux's Introduction

Build Status codecov

Overview

Monorepo for Archive.org UX development and prototyping.

Note: This is work-in-progress code, and until development has stabilized, things may change a lot. This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public.

There are multiple npm packages in this repo, and Lerna is used to manage them.

Setup

Install dependencies on all packages.

yarn install
yarn run lerna bootstrap
yarn run lerna link

Running ia-components

Run our local UI component development environment.

cd packages/ia-components && yarn run storybook

Code Structure

There are several node packages in this one repo. They are located under the packages directory.

At the time of writing, there are 4 packages:

ia-components

The ia-components package contains reusable "components" (loosely). It is actually just a package that is included into Archive.org's codebase. Having an external package makes it easier for new developers to contribute development.

It's easy to test these components using the "prototypes" package. The final integration into the Archive.org website still needs to be done by internal staff.

As a convention, the preferred framework is React, but vanilla JS components are also possible.

Within ia-components there are two subdirectories: sandbox and live. The idea is that code in the live directory is used in production. But in sandbox, components might still be works-in-progress, new designs, etc, and only used in prototypes.

ia-design-system

This is still a TODO, but the idea is that common CSS and a design style guide could live here.

ia-js-client

The ia-js-client package is a hybrid JavaScript and NodeJS client to the Internet Archive's APIs. It is written in TypeScript. It is used in both the ia-components and ia-prototype-apps packages for fetching data. See packages/ia-js-client/README.md for more info.

ia-prototype-apps

Prototypes are basically little websites built using code from ia-components. They can serve many purposes. For example, a prototype can be used to test the integration of several components in ia-components. A prototype can also be made by the UX team to test a new design using live data.

Of course, a prototype could also be made outside of this repo, and that will make sense in some cases.

Since the prototypes package is a "packages/ia-prototype-apps" and there are a lot of other files at that level, there is a second directory "packages/ia-prototype-apps/apps" and this is where the actual content lives.

See packages/ia-prototype-apps/README.md for more info.

Prototypes can be run like this:

cd packages/ia-prototype-apps
yarn run parcel apps/examples/example-hello/index.html

After, you can try running a more complex example:

yarn run parcel apps/details-react/index.html

Publishing

As stated earlier, there are multiple npm packages in this repo, and Lerna is used to manage them. The command used to publish changes is the following:

yarn run lerna publish --skip-git --canary

This will provide a step-by-step prompt, where you can decide whether this is a major, minor, or patch release. It's okay to try it, and then use control+c, to exit without having changes. However, once you publish a release, it's irrevocable.

Coding rules

This is structured so that there is compatibility with the upstream Archive.org codebase.

Base rules:

  • Use less instead of scss
  • Do not import other asset types into js code. E.g. do NOT do import 'styles.less'. Instead, create a separate less file, e.g. styles.less alongside the JavaScript code, and this will be imported into the petabox's archive.less at integration time.

JS Styleguide

Currently, we are using Airbnb's styleguide and will extend accordingly. We have added ESLint to help with staying in convention.

Using StorybookJS

We use StorybookJS to show usage examples of our components. For details on how to run StorybookJS, visit the ia-components readme: IA Components Readme

Run Storybook:

cd packages/ia-components && yarn run storybook

Unit Testing with JestJS

JestJS is pliable enough for us to test in JavaScript and TypeScript. Try running our tests:

cd packages/ia-components && yarn run test

Debugging

We are using the common debug module.

To add to a module, add a line like

const debug = require('debug')('ia-components:COMPONENTNAME')

To enable, for example, debugging in all ia-components, and debugging in the dweb-archive:Nav module.

In Node add a line to your top level application BEFORE requiring or importing the other modules.

process.env.DEBUG="ia-components:* dweb-archive:Nav"

In Browser, add a line to your index.html or equivalent BEFORE including the bundle.

<script type="text/javascript">localStorage.debug = "dweb-archive dweb-archive:* dweb-transports dweb-transports:* dweb-objects dweb-objects:*";</script>

Other

in v2mocks there is code that is pulled from IA "View Source" and converted to JSX using this tool: https://magic.reactjs.net/htmltojsx.htm

Archive.org v2 uses Bootstrap 3.0. Docs can be found here: http://bootstrapdocs.com/v3.0.0/docs/css/#overview

License

See our license file.

iaux's People

Contributors

iisa avatar mitra42 avatar shaneriley avatar jbuckner avatar dependabot[bot] avatar bfalling avatar rchrd2 avatar shreyansh23 avatar koderjoker avatar mc2 avatar kimuradev avatar batey96 avatar traceypooh avatar sarru1291 avatar ankitskvmdam avatar szt-r avatar dewstend avatar nsharma123 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.