Skip to content

Commit

Permalink
Merge pull request #92 from b2wads/develop
Browse files Browse the repository at this point in the history
Ajuste para subir no NPM
  • Loading branch information
Ana Azevedo authored Nov 7, 2019
2 parents b4a4627 + b91c78f commit 0600b85
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 642 deletions.
25 changes: 18 additions & 7 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { configure } from '@storybook/react';
import { setAddon, addDecorator } from '@storybook/react';
import { withOptions } from '@storybook/addon-options';
import { addParameters } from '@storybook/react';
import { themes } from '@storybook/theming';
import { create } from '@storybook/theming';
import brandImage from '../internals/logo/logo-grimorio-white.png';


import infoAddon from '@storybook/addon-info';
Expand All @@ -23,14 +23,25 @@ addDecorator((fn, { kind, story }) => <div className={styles.container}>
</div>
</div>);

setOptions({
name: 'Grimório ✨',
});

setAddon(infoAddon);
addParameters({
options: {
theme: themes.dark,
theme: create({
base: 'dark',
brandTitle: 'Grimório✨',
brandUrl: 'https://github.com/b2wads/grimorio-ui#readme',
brandImage,

// colorPrimary: '#5e4596',
colorSecondary: '#7934d0',

// UI
appBg: '#282a36',
appBorderRadius: 0,

// Toolbar default and active colors
barBg: '#282a36',
}),
},
});

Expand Down
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,29 @@

# 📦 Instalação

Primeiro, copie o pacote para uma pasta do seu projeto, por exemplo `/packages`. Depois adicione a dependencia no seu package.json e instale!
Primeiro, instale o pacote vindo do npm:

```bash
# your package.json

"dependencies": {
"grimorio-ui": "./packages/grimorio-ui-x.x.x.tgz"
}
yarn add @b2wads/grimorio-ui
```

```bash
yarn

# or

npm i
npm i @b2wads/grimorio-ui
```

Importe o CSS do Grimório✨ no seu arquivo de entrada ou na lista de entrypoints do seu Webpack:

```js
// import the CSS on js

import '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui.min.css';
import '[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/grimorio-ui.min.css';

// or

{
//...webpack configs
entry: {
'your-app': [
'[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui.min.css',
'[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/grimorio-ui.min.css',
'index.js',
],
},
Expand All @@ -56,7 +47,7 @@ E então, é só usar!
```js
// component.js

import { Alert } from 'grimorio-ui';
import { Alert } from '@b2wads/grimorio-ui';
```

Caso seu webpack ignore o `node_modules` na hora de gerar o build de CSS, é necessário criar uma regra para incluir o CSS do Grimório✨.
Expand All @@ -65,7 +56,7 @@ Caso seu webpack ignore o `node_modules` na hora de gerar o build de CSS, é nec
// exemplo de exceção no webpack 3.X.X
{
test: /\.css$/,
include: path.resolve(__dirname, '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui.min.css'),
include: path.resolve(__dirname, '[path/to/node_modules]/@b2wads/grimorio-ui/css/grimorio-ui.min.css'),
use: ['style-loader', 'css-loader', { ... }],
},
```
Expand All @@ -80,10 +71,10 @@ Para migrar vindo do Grimório✨ 6.X ou anterior para a versão mais atual, é

```js
// ❌ Antigo CSS
import '[path/to/node_modules]/grimorio-ui/dist/grimorio-ui.min.css';
import '[path/to/node_modules]/@b2wads/grimorio-ui/grimorio-ui.min.css';

// ✔️ Novo CSS
import '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui.min.css';
import '[path/to/node_modules]/@b2wads/grimorio-ui/css/grimorio-ui.min.css';

```
Já no caso da migração vir de outras variações do Grimório✨ (`grimorio-ui-[version].b2wads.tgz` ou `grimorio-ui-[version].sieve.tgz`), será necessário seguir o [guia de personalização](./docs/advanced-css.md), usando as [variáveis legado](./docs/legacy-variables.md) relativas a cada variante.
Expand Down
14 changes: 7 additions & 7 deletions docs/advanced-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Depois, importe suas variáveis e o arquivo custom do Grimório✨:
// import the CSS on js

import '[path/to/your/styles]/custom-variables.css';
import '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui-custom.min.css';
import '[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/grimorio-ui-custom.min.css';

// or on Webpack

Expand All @@ -41,7 +41,7 @@ import '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui-custom.min.css';
entry: {
'your-app': [
'[path/to/your/styles]/custom-variables.css',
'[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui-custom.min.css',
'[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/grimorio-ui-custom.min.css',
'index.js',
],
},
Expand All @@ -53,9 +53,9 @@ No caso de querer apenas substituir algumas variáveis, é preciso importar as v
```js
// import the CSS on js

import '[path/to/node_modules]/grimorio-ui/lib/css/variables.css';
import '[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/variables.css';
import '[path/to/your/styles]/custom-variables.css';
import '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui-custom.min.css';
import '[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/grimorio-ui-custom.min.css';

// or on Webpack

Expand All @@ -64,8 +64,8 @@ import '[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui-custom.min.css';
entry: {
'your-app': [
'[path/to/your/styles]/custom-variables.css',
'[path/to/node_modules]/grimorio-ui/lib/css/variables.css',
'[path/to/node_modules]/grimorio-ui/lib/css/grimorio-ui-custom.min.css',
'[path/to/node_modules]/@b2wads/grimorio-ui/lib/css/variables.css',
'[path/to/node_modules]@b2wads/grimorio-ui/lib/css/grimorio-ui-custom.min.css',
'index.js',
],
},
Expand Down Expand Up @@ -103,7 +103,7 @@ const postcssCustomProperties = require('postcss-custom-properties');
postcssCustomProperties({
preserve: false, // Opção para sobrescrever as variaveis
importFrom: [
'./node_modules/grimorio-ui/lib/css/variables.css',
'./node_modules/@b2wads/grimorio-ui/lib/css/variables.css',
'./path/to/your/style/custom-variables.css',
],
}),
Expand Down
Binary file added internals/logo/logo-grimorio-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions internals/logo/logo-grimorio-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 16 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{
"name": "grimorio-ui",
"name": "@b2wads/grimorio-ui",
"sideEffects": false,
"version": "7.0.0",
"description": "React UI Kit that works like magic",
"main": "lib/index.js",
"repository": "https://github.com/b2wads/grimorio-ui",
"keywords": [
"react",
"ui",
"ui kit",
"material design"
],
"homepage": "https://github.com/b2wads/grimorio-ui#readme",
"scripts": {
"cp:pack": "rm ../$APP/packages/grimorio-ui-*.tgz && ./node_modules/.bin/cpy grimorio-ui-*.tgz ../$APP/packages/",
"cp": "./node_modules/.bin/cpy grimorio-ui-*.tgz ../$APP/packages/",
"cp:pack": "rm -f ../$APP/packages/grimorio-ui-*.tgz && cp ./grimorio-ui-*.tgz ../$APP/packages/",
"cp": "cp ./grimorio-ui-*.tgz ../$APP/packages/",
"pack:dist": "rm -f ./grimorio-ui-**.tgz && yarn build && yarn pack --filename grimorio-ui-${npm_package_version}.tgz",
"build": "yarn build:images && yarn build:modules && yarn build:css && yarn build:css:variables",
"build:css:variables": "./node_modules/.bin/postcss ./lib/css/grimorio-ui.min.css --config ./internals/postcss.config.js -r",
Expand Down Expand Up @@ -56,55 +64,42 @@
"@storybook/addon-viewport": "5.2.1",
"@storybook/addons": "5.2.1",
"@storybook/react": "5.2.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "7.2.3",
"babel-jest": "24.8.0",
"babel-loader": "8.0.6",
"babel-plugin-css-modules-transform": "1.5.0",
"brunch": "2.10.17",
"chai": "4.1.1",
"child-process-es6-promise": "1.2.0",
"cpy-cli": "2.0.0",
"cross-env": "^5.2.0",
"cross-env": "5.2.0",
"css-loader": "3.2.0",
"cssnano": "4.1.10",
"enzyme": "3.3.0",
"enzyme-adapter-react-16": "1.2.0",
"enzyme-to-json": "3.3.5",
"eslint": "4.19.0",
"eslint-config-google": "0.9.1",
"eslint-loader": "2.0.0",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-prettier": "2.3.1",
"eslint-plugin-react": "7.5.1",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "4.2.0",
"husky": "0.14.3",
"identity-obj-proxy": "3.0.0",
"imports-loader": "0.8.0",
"jest": "24.1.0",
"jest-css-modules": "1.1.0",
"jest-css-modules-transform": "1.0.5",
"jest-dot-reporter": "1.0.3",
"jsdom": "9.12.0",
"mini-css-extract-plugin": "0.8.0",
"npm-run-all": "4.1.2",
"npm-run-all": "4.1.5",
"postcss-brunch": "2.10.1",
"postcss-cli": "6.1.3",
"postcss-css-variables": "0.13.0",
"postcss-custom-properties": "9.0.2",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.7.0",
"prettier": "1.3.1",
"react-test-renderer": "16.3.1",
"rimraf": "2.6.2",
"style-loader": "1.0.0",
"stylint": "1.5.9",
"stylus": "0.54.7",
"stylus-brunch": "2.10.1",
"stylus-loader": "3.0.2",
"webpack": "4.41.2",
"webpack-bundle-analyzer": "3.3.2",
"webpack-cli": "3.3.9"
},
"dependencies": {
Expand Down Expand Up @@ -141,5 +136,8 @@
"snapshotSerializers": [
"enzyme-to-json/serializer"
]
},
"bugs": {
"url": "https://github.com/b2wads/grimorio-ui/issues"
}
}
Loading

0 comments on commit 0600b85

Please sign in to comment.