Skip to content

Commit

Permalink
pull master
Browse files Browse the repository at this point in the history
  • Loading branch information
damian committed Aug 29, 2023
2 parents 2b2c9da + 3a4e0ab commit 26468be
Show file tree
Hide file tree
Showing 95 changed files with 9,646 additions and 57,542 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
- name: npm install, run test
run: |
npm install
npm t
npm run lint
npm run test:coverage
48 changes: 46 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
with:
node-version: 16.x
- run: npm install
- run: npm test
- run: npm run lint
- run: npm run test:coverage

publish-npm:
needs: build
Expand All @@ -38,7 +39,50 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16.x
- run: bash ./scripts/release-notes.sh
env:
RELEASE_SLACK_WEBHOOK_URL: ${{secrets.RELEASE_SLACK_WEBHOOK_URL}}

build-and-deploy-storybooks:
needs: publish-npm
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

concurrency:
group: "pages"

permissions:
contents: read
pages: write
id-token: write

steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Build docs Storybooks
run: |
npm install
npm run storybook-web-docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './docs/'
name: docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
artifact_name: 'docs'
github-token: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: publish-docs

on: workflow_dispatch

jobs:
build-and-deploy-storybooks:
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

concurrency:
group: "pages"

permissions:
contents: read
pages: write
id-token: write

steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Build docs Storybooks
run: |
npm install
npm run storybook-web-docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './docs/'
name: docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
artifact_name: 'docs'
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ coverage
dist/

# Static storybook page
.storybook_static
.storybook_static
.docs
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npx lint-staged && npm run lint
80 changes: 41 additions & 39 deletions .ondevice/storybook.requires.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
/* do not change this file, it is auto generated by storybook. */

import {
configure,
addDecorator,
addParameters,
addArgsEnhancer,
clearDecorators,
} from "@storybook/react-native";
configure,
addDecorator,
addParameters,
addArgsEnhancer,
clearDecorators,
} from '@storybook/react-native';

global.STORIES = [
{
titlePrefix: "",
directory: "./storybook/stories",
files: "**/*.stories.?(ts|tsx|js|jsx)",
importPathMatcher:
"^\\.[\\\\/](?:storybook\\/stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$",
},
{
titlePrefix: '',
directory: './storybook/stories',
files: '**/*.stories.?(ts|tsx|js|jsx)',
importPathMatcher:
'^\\.[\\\\/](?:storybook\\/stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$',
},
];

import "@storybook/addon-ondevice-actions/register";
import "@storybook/addon-ondevice-controls/register";
import '@storybook/addon-ondevice-actions/register';
import '@storybook/addon-ondevice-controls/register';

import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs";
import {argsEnhancers} from '@storybook/addon-actions/dist/modern/preset/addArgs';

import { decorators, parameters } from "./preview";
import {decorators, parameters} from './preview';

if (decorators) {
if (__DEV__) {
// stops the warning from showing on every HMR
require("react-native").LogBox.ignoreLogs([
"`clearDecorators` is deprecated and will be removed in Storybook 7.0",
]);
}
// workaround for global decorators getting infinitely applied on HMR, see https://github.com/storybookjs/react-native/issues/185
clearDecorators();
decorators.forEach((decorator) => addDecorator(decorator));
if (__DEV__) {
// stops the warning from showing on every HMR
require('react-native').LogBox.ignoreLogs([
'`clearDecorators` is deprecated and will be removed in Storybook 7.0',
]);
}
// workaround for global decorators getting infinitely applied on HMR, see https://github.com/storybookjs/react-native/issues/185
clearDecorators();
decorators.forEach((decorator) => addDecorator(decorator));
}

if (parameters) {
addParameters(parameters);
addParameters(parameters);
}

try {
argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
} catch {}

const getStories = () => {
return {
"./storybook/stories/Avatar/Avatar.stories.js": require("../storybook/stories/Avatar/Avatar.stories.js"),
"./storybook/stories/CheckBox/CheckBox.stories.js": require("../storybook/stories/CheckBox/CheckBox.stories.js"),
"./storybook/stories/Image/Image.stories.js": require("../storybook/stories/Image/Image.stories.js"),
"./storybook/stories/Input/Input.stories.js": require("../storybook/stories/Input/Input.stories.js"),
"./storybook/stories/Loading/Loading.stories.js": require("../storybook/stories/Loading/Loading.stories.js"),
"./storybook/stories/Select/Select.stories.js": require("../storybook/stories/Select/Select.stories.js"),
"./storybook/stories/StatusChip/StatusChip.stories.js": require("../storybook/stories/StatusChip/StatusChip.stories.js"),
"./storybook/stories/Svg/Svg.stories.js": require("../storybook/stories/Svg/Svg.stories.js"),
"./storybook/stories/Text/Text.stories.js": require("../storybook/stories/Text/Text.stories.js"),
};
return {
'./storybook/stories/Avatar/Avatar.stories.js': require('../storybook/stories/Avatar/Avatar.stories.js'),
'./storybook/stories/CheckBox/CheckBox.stories.js': require('../storybook/stories/CheckBox/CheckBox.stories.js'),
'./storybook/stories/DesignStystem/Colors.stories.js': require('../storybook/stories/DesignStystem/Colors.stories.js'),
'./storybook/stories/Image/Image.stories.js': require('../storybook/stories/Image/Image.stories.js'),
'./storybook/stories/Input/Input.stories.js': require('../storybook/stories/Input/Input.stories.js'),
'./storybook/stories/Loading/Loading.stories.js': require('../storybook/stories/Loading/Loading.stories.js'),
'./storybook/stories/Select/Select.stories.js': require('../storybook/stories/Select/Select.stories.js'),
'./storybook/stories/LoadingFullScreen/LoadingFullScreen.stories.js': require('../storybook/stories/LoadingFullScreen/LoadingFullScreen.stories.js'),
'./storybook/stories/StatusChip/StatusChip.stories.js': require('../storybook/stories/StatusChip/StatusChip.stories.js'),
'./storybook/stories/Svg/Svg.stories.js': require('../storybook/stories/Svg/Svg.stories.js'),
'./storybook/stories/Text/Text.stories.js': require('../storybook/stories/Text/Text.stories.js'),
};
};

configure(getStories, module, false);
6 changes: 6 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {addons} from '@storybook/addons';
import yourTheme from './theme';

addons.setConfig({
theme: yourTheme,
});
9 changes: 9 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- .storybook/preview-head.html -->

<!-- Pull in static files served from your Static directory or the internet -->
<!-- Example: `main.js|ts` is configured with staticDirs: ['../public'] and your font is located in the `fonts` directory inside your `public` directory -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap" rel="stylesheet">

<!-- Or you can load custom head-tag JavaScript: -->
4 changes: 4 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from 'react';
import CenterView from '../storybook/decorators/CenterView';

export const parameters = {
viewMode: 'docs',
};

export const decorators = [
(Story) => (
<CenterView>
Expand Down
11 changes: 11 additions & 0 deletions .storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {create} from '@storybook/theming';

export default create({
base: 'light',
brandTitle: 'Janis UI apps',
brandUrl: 'https://janis.im',
brandImage: 'https://app.janis.in/static/media/janis-logo-base.0cc15e53.svg',
brandTarget: 'https://janis.im',
fontBase: '"Roboto", sans-serif',
fontCode: 'Roboto',
});
37 changes: 23 additions & 14 deletions CHANGELOG.MD → CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.3] - 2023-08-24

### Fixed

- Fixed script to publish slack message

## [1.0.2] - 2023-08-23

### Fixed

- Fixed action publish for npm
- Fixed import example of component in the readme file

## [1.0.1] - 2023-08-23

### Fixed

- Fixed command lint in github action

## [1.0.0] - 2023-08-23

### Added

- Added config for typescript
Expand All @@ -21,17 +42,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added component Status Chip
- Added component Input
- Added readme

### Changed

- Changed version from react to 17.0.2 and react native to 0.67 and made compatibility for react 18 and react native 0.71
- Changed version of storybook

### Fixed

- Fixed export components
- Fixed an error when localy linking the package with a react native app

### Removed

- Removed standard version package and setup
- Added github action to deploy storybooks docs
- Added component LoadingFullScreen
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ A quick example of how to import a component and start using **@janiscommerce/ui
```sh
import React from 'react';
import ReactDOM from 'react-dom';
import Avatar from '@janiscommerce/ui-native/Avatar';
import {Avatar} from '@janiscommerce/ui-native';

function App() {
return <Avatar size="sm" placeholder="Janis" bgColor="#2979FF" />;
}

ReactDOM.render(<App />, document.querySelector('#app'));
```

[Documentation](https://janis-commerce.github.io/ui-native)
1 change: 0 additions & 1 deletion docs/116.6bf98dd7.iframe.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/116.9bbb7cb1.iframe.bundle.js

This file was deleted.

2 changes: 0 additions & 2 deletions docs/117.9a5c27ea8674bb35d0cb.manager.bundle.js

This file was deleted.

8 changes: 0 additions & 8 deletions docs/117.9a5c27ea8674bb35d0cb.manager.bundle.js.LICENSE.txt

This file was deleted.

0 comments on commit 26468be

Please sign in to comment.