GitXplorerGitXplorer
s

ui-dev-env

public
1 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
eb54137b4c010eab97e4ceb0c94d8ac09c0df01e

Add notes to README

sslightlytyler committed 6 years ago
Unverified
72a3570bb383e68d82ddebed0c791bdedd84a1a9

Add images link to README

sslightlytyler committed 6 years ago
Unverified
018fc37cbd1ca4808bcd87dcf61e82a567d0dc71

Remove type from README

sslightlytyler committed 6 years ago
Unverified
08ee7b33e222018b21f56ae86a20413405a8ebd2

Better README formatting

sslightlytyler committed 6 years ago
Unverified
18f639c55d91b56f97cc9f19e3ed3505070ec429

It works! Initial release

sslightlytyler committed 6 years ago
Unverified
a58d3265b46b6d45f62e108705296a7a5510b863

Init

sslightlytyler committed 6 years ago

README

The README file for this repository.

UI Dev Env

Images

Use guide

Development

From your development directory, <dev>, create a file <dev>/src/App.js. Here's an example component (React and Emotion are already installed).

import styled from "@emotion/styled";
import React from "react";

const Header = styled("h1")`
  font-family: sans-serif;
`;

const App = () => (
  <div>
    <Header data-testid="header">🔥 UI Dev Env</Header>
  </div>
);

export default App;

Then from <dev> run:

docker run -it --rm -p 3000:3000 -v $(PWD)/src:/usr/app/src slightlytyler/ui-dev-env dev

Testing

To use tests, create a test file <dev>/src/App.test.js. Here's an example test (Jest and react-testing-library are already installed).

import React from "react";
import { cleanup, render, waitForElement } from "react-testing-library";
import "jest-dom/extend-expect";
import App from "./App";

test("it should render a spicy header", async () => {
  const { getByTestId } = render(<App />);
  const headerNode = await waitForElement(() => getByTestId("header"));
  expect(headerNode).toHaveTextContent("UI");
  expect(headerNode).toHaveTextContent("🔥");
});

Then from <dev> run:

docker run -it --rm -p 3000:3000 -v $(PWD)/src:/usr/app/src slightlytyler/ui-dev-env test

Formatting

To format the source files run:

docker run -it --rm -p 3000:3000 -v $(PWD)/src:/usr/app/src slightlytyler/ui-dev-env fmt

Dev

Building

make build

Running

make run ARGS="fmt"

Test dev command

make run-dev

Shortcuts

make run-fmt
make run-test

Project administration

make run-yarn ARGS="add some-package"

Publish

Increment VERSION in the Makefile then:

make publish

Push

To push up the current tag (as tagged by the Git SHA):

make push