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

Rename package to @primer/primitives #14

Merged
merged 14 commits into from
Oct 23, 2019
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# 2.0.0 (2019-10-21)

#### :rotating_light: Breaking Changes
* [#14](https://github.com/primer/primitives/pull/14) Rename npm package to `@primer/primitives` and deprecate old `primer-*` packages ([@BinaryMuse](https://github.com/BinaryMuse))

# 1.0.2 (2018-07-20)

#### :bug: Bug Fix
* [#3](https://github.com/primer/primer-primitives/pull/6) Fix spacing to be an array instead of an object. ([@broccolini](https://github.com/broccolini))
* [#6](https://github.com/primer/primer-primitives/pull/6) Fix spacing to be an array instead of an object. ([@broccolini](https://github.com/broccolini))

#### :memo: Documentation
* [#3](https://github.com/primer/primer-primitives/pull/6) Add usage example to README. ([@broccolini](https://github.com/broccolini))
* [#6](https://github.com/primer/primer-primitives/pull/6) Add usage example to README. ([@broccolini](https://github.com/broccolini))

# 1.0.1 (2018-05-10)

Expand All @@ -18,5 +23,5 @@
# 1.0.0 (2018-04-29)

#### :rocket: Enhancement
* [#2](https://github.com/primer/primer-primitives/pull/1) Add color, typography, and spacing packages. ([@broccolini](https://github.com/broccolini))
* [#2](https://github.com/primer/primer-primitives/pull/1) Add primer-primitives package that imports all primitives. ([@broccolini](https://github.com/broccolini))
* [#1](https://github.com/primer/primer-primitives/pull/1) Add color, typography, and spacing packages. ([@broccolini](https://github.com/broccolini))
* [#1](https://github.com/primer/primer-primitives/pull/1) Add primer-primitives package that imports all primitives. ([@broccolini](https://github.com/broccolini))
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
# Primer Primitives

This is a monorepo for color, spacing, and typography primitives for use with [Primer][primer], GitHub's design system.

## Packages

The Primer Primitives repo is a monorepo composed of multiple npm packages:

- [primer-primitives][primer-primitives]
- [primer-colors][primer-colors]
- [primer-spacing][primer-spacing]
- [primer-typography][primer-typography]
This repo contains values for color, spacing, and typography primitives for use with [Primer][primer], GitHub's design system.

## Install

This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-primitives` with this command.
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `@primer/primitives` with this command.

```sh
$ npm install --save primer-primitives
$ npm install --save @primer/primitives
```

## Usage
Expand All @@ -32,7 +23,7 @@ Here's an example using `styled-components`.
```js
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
import theme from 'primer-primitives'
import theme from '@primer/primitives'

const Alert = styled.div`
color: ${props => props.theme.colors.green[9]};
Expand All @@ -52,7 +43,7 @@ When used with libraries like [styled-system](https://jxnblk.com/styled-system/)
```js
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
import theme from 'primer-primitives'
import theme from '@primer/primitives'
import { color } from 'styled-system'

const Alert = styled.div`
Expand All @@ -67,14 +58,18 @@ const App = props => (

```

You can also import the `colors`, `typography`, and `spacing` primitives individually if you so desire:
shawnbot marked this conversation as resolved.
Show resolved Hide resolved

```js
import colors from '@primer/primitives/colors'
import spacing from '@primer/primitives/spacing'
import typography from '@primer/primitives/typography'
```

## License

[MIT](./LICENSE) © [GitHub](https://github.com/)

[primer]: https://github.com/primer/primer
[primer-primitives]: https://github.com/primer/primer-primitives/tree/master/modules/primer-primitives
[primer-colors]: https://github.com/primer/primer-primitives/tree/master/modules/primer-colors
[primer-spacing]: https://github.com/primer/primer-primitives/tree/master/modules/primer-spacing
[primer-typography]: https://github.com/primer/primer-primitives/tree/master/modules/primer-typography
[npm]: https://www.npmjs.com/
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
File renamed without changes.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const colors = require('./colors')
const space = require('./spacing')
const { fontSizes, lineHeights } = require('./typography')

BinaryMuse marked this conversation as resolved.
Show resolved Hide resolved
const theme = {
colors,
space,
fontSizes,
lineHeights
}

module.exports = theme
7 changes: 0 additions & 7 deletions lerna.json

This file was deleted.

22 changes: 0 additions & 22 deletions modules/primer-colors/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions modules/primer-colors/package.json

This file was deleted.

22 changes: 0 additions & 22 deletions modules/primer-primitives/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions modules/primer-primitives/index.js

This file was deleted.

26 changes: 0 additions & 26 deletions modules/primer-primitives/package.json

This file was deleted.

22 changes: 0 additions & 22 deletions modules/primer-spacing/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions modules/primer-spacing/package.json

This file was deleted.

22 changes: 0 additions & 22 deletions modules/primer-typography/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions modules/primer-typography/package.json

This file was deleted.

23 changes: 19 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"private": true,
"devDependencies": {
"lerna": "^2.10.2"
}
"name": "@primer/primitives",
"version": "2.0.0",
"description": "Typography, spacing, and color primitives for Primer design system",
"main": "index.js",
"repository": "https://github.com/primer/primitives",
"keywords": [
"primitives",
"colors",
"spacing",
"typography",
"variables",
"design-system"
],
"author": "GitHub, Inc.",
"license": "MIT",
"bugs": {
"url": "https://github.com/primer/primer-primitives/issues"
},
"homepage": "https://github.com/primer/primer-primitives#readme"
}
File renamed without changes.
File renamed without changes.