Skip to content
Open
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: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require("path");

module.exports = {
plugins: [
"react-hooks",
Expand Down Expand Up @@ -71,7 +73,7 @@ module.exports = {
"import/resolver": {
"alias": {
map: [
[ "src", "./src" ]
[ "packages", path.join(__dirname, "packages") ]
],
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json']
}
Expand Down
4 changes: 2 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require("path");

module.exports = {
stories: ["../src/**/*.stories.(ts|tsx|js|jsx|mdx)"],
stories: ["../packages/**/*.stories.(ts|tsx|js|jsx|mdx)"],
addons: [
{
name: "@storybook/addon-docs",
Expand All @@ -27,7 +27,7 @@ module.exports = {
});
config.resolve.extensions.push('.ts', '.tsx', '.js', '.jsx');
config.resolve.alias = {
"src": path.join(__dirname, "..", "src"),
"packages": path.join(__dirname, "..", "packages"),
};

return config;
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { addDecorator } from '@storybook/react';
import styled from "@emotion/styled";
import { withA11y } from '@storybook/addon-a11y';

import { ErrorBoundary } from "src/ErrorBoundary/ErrorBoundary";
import { ErrorBoundary } from "packages/ErrorBoundary/src";

import "bootstrap/dist/css/bootstrap.min.css";

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
> 9 April 2020

- Optimise annotation highlight [`#24`](https://github.com/matt-dunn/react-wireframes/pull/24)
- Initial re-org and setup [`f77eff2`](https://github.com/matt-dunn/react-wireframes/commit/f77eff20458722aa4ef8fb34f6dae3b110b8e5ca)

#### [v2.0.6](https://github.com/matt-dunn/react-wireframes/compare/v2.0.5...v2.0.6)

Expand Down
87 changes: 2 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# react-wireframes [![Build Status](https://travis-ci.org/matt-dunn/react-wireframes.svg?branch=master)](https://travis-ci.org/matt-dunn/react-wireframes) [![npm version](https://badge.fury.io/js/%40matt-dunn%2Freact-wireframes.svg)](https://www.npmjs.com/package/@matt-dunn/react-wireframes)
# @matt-dunn Packages [![Build Status](https://travis-ci.org/matt-dunn/react-wireframes.svg?branch=master)](https://travis-ci.org/matt-dunn/react-wireframes)

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=matt-dunn_react-wireframes&metric=coverage)](https://sonarcloud.io/dashboard?id=matt-dunn_react-wireframes)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=matt-dunn_react-wireframes&metric=alert_status)](https://sonarcloud.io/dashboard?id=matt-dunn_react-wireframes)
Expand All @@ -7,88 +7,5 @@
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=matt-dunn_react-wireframes&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=matt-dunn_react-wireframes)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=matt-dunn_react-wireframes&metric=security_rating)](https://sonarcloud.io/dashboard?id=matt-dunn_react-wireframes)

React component to annotate your components — useful for prototypes and proof of concepts.

---

[Storybook](https://matt-dunn.github.io/react-wireframes/storybook/?path=/story/)

[Demo](https://matt-dunn.github.io/react-wireframes/)

[CodePen](https://codepen.io/matt-j-dunn/pen/NWqZmQY?editors=0010)

---

## Getting Started

```sh
npm install --save @matt-dunn/react-wireframes
```

or

```sh
yarn add @matt-dunn/react-wireframes
```

### Annotate a component

```jsx
const AnnotatedMyComponent = withWireframeAnnotation({
title: "MyComponent title",
description: "MyComponent description.",
})(MyComponent);
```

### Wrap your application with the container

```jsx
<WireframeContainer>
<AnnotatedMyComponent />
{/*...application*/}
</WireframeContainer>
```

## API

See [Storybook](https://matt-dunn.github.io/react-wireframes/storybook/?path=/story/).

## Example Implementation

This example shows a set of components annotated using ```react-wireframes```.

![](./docs/assets/react-wireframes.gif)


## Simple bare-bones example

```jsx
import ReactDOM from "react-dom";
import React from "react";

import {
WireframeContainer, withWireframeAnnotation,
} from "@matt-dunn/react-wireframes";

const MyComponent = () => <article>Hello world</article>;

const AnnotatedMyComponent = withWireframeAnnotation({
title: "MyComponent title",
description: "MyComponent description.",
})(MyComponent);

const app = (
<WireframeContainer>
<AnnotatedMyComponent />
</WireframeContainer>
);

ReactDOM.render(
app,
document.getElementById("app"),
);
```

## License

The MIT License (MIT) Copyright (c) 2020 Matt Dunn
TODO:
32 changes: 16 additions & 16 deletions .babelrc → babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"env": {
"test": {
"presets": [
Expand All @@ -10,35 +10,35 @@
"useBuiltIns": "usage",
"corejs": {
"version": 3,
"proposals": true
"proposals": true,
},
"debug": false,
"targets": {
"browsers": [
"last 3 versions"
]
}
}
]
"last 3 versions",
],
},
},
],
],
"plugins": [
["emotion", {
"inline": true,
"sourceMap": true
"sourceMap": true,
}],
["module-resolver", {
"root": ["./"],
"alias": {
}
},
}],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
"legacy": true,
},
],
"@babel/plugin-proposal-class-properties"
]
}
}
}
"@babel/plugin-proposal-class-properties",
],
},
},
};
39 changes: 0 additions & 39 deletions demo/bootstrap.scss

This file was deleted.

8 changes: 6 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ module.exports = {
testEnvironment: "node",
verbose: true,
collectCoverageFrom: [
"src/**/*.{js,jsx,ts,tsx}",
"packages/**/src/**/*.{js,jsx,ts,tsx}",
"!**/node_modules/**",
"!**/demo/**",
"!**/*.stories.*",
"!**/dist/**",
"!**/test/**",
"!**/*.d.ts",
],
coverageDirectory: "./reports/coverage",
setupFiles: ["./test/setupTests.js"],
setupFiles: ["<rootDir>/test/setupTests.js"],
// setupFilesAfterEnv: ["./test/setupTests.js"],
snapshotSerializers: ["enzyme-to-json/serializer", "jest-emotion"],
reporters: [
Expand All @@ -23,4 +24,7 @@ module.exports = {
"/dist/",
"/node_modules",
],
"moduleNameMapper": {
"^packages/(.*)$": "<rootDir>/packages/$1",
},
};
24 changes: 24 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"ignoreChanges": [
"ignored-file",
"*.md"
],
"message": "chore(release): publish",
"registry": "https://npm.pkg.github.com"
},
"bootstrap": {
"ignore": "component-*",
"npmClientArgs": [
"--no-package-lock"
]
}
},
"packages": [
"packages/*"
]
}
Loading