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

Feat/add spindle hooks pkg #359

Merged
merged 9 commits into from
Apr 26, 2022
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/deploy-hooks-catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: deploy Hooks catalog

on:
push:
branches:
- main
paths:
- 'packages/spindle-hooks/**'

jobs:
deploy_ui_catalog:
name: deploy_ui_catalog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: 14
- name: restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: npx lerna bootstrap -- --frozen-lockfile
- name: Update UI catalog
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
run: |
npx lerna run --scope @openameba/spindle-hooks storybook:build
npx lerna run --scope @openameba/spindle-hooks storybook:deploy -- --token $FIREBASE_TOKEN
27 changes: 27 additions & 0 deletions .github/workflows/deploy-hoooks-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: deploy Hooks preview

on:
pull_request:
paths:
- 'packages/spindle-hooks/**'

jobs:
build_and_preview:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/spindle-hooks/
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: 14
- run: yarn install --frozen-lockfile
- run: yarn storybook:build
- name: deploy to preview channel
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
entryPoint: ./packages/spindle-hooks/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Ameba Design System
- [Spindle Tokens](packages/spindle-tokens) (Design tokens)
- [Spindle Icons](packages/spindle-icons) (SVG and PDF icons)
- [Spindle UI](packages/spindle-ui) (UI components)
- [Spindle Hooks](packages/spindle-hooks) (React Hooks)
- [Spindle Syntax Themes](packages/spindle-syntax-themes) (Syntax themes with Spindle color palette)
5 changes: 5 additions & 0 deletions packages/spindle-hooks/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "ameba-spindle"
}
}
85 changes: 85 additions & 0 deletions packages/spindle-hooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*

# Firebase cache
.firebase/

# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Output for Firebase hosting
public

# reg-suit working directory
.reg

# storing directory for reg-suit and storycap
.reg-suit

# components for npm
*/*.css
*/*.js
*/*.d.ts
*/*.map
index.css
index.js
index.d.ts
index*.map
12 changes: 12 additions & 0 deletions packages/spindle-hooks/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
src
dist
public
.storybook
.firebaserc
.gitignore
jest.config.js
bundlesize.config.json
firebase.json
tsconfig.json
design-doc.md
setup-tests.ts
2 changes: 2 additions & 0 deletions packages/spindle-hooks/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
*.mdx
10 changes: 10 additions & 0 deletions packages/spindle-hooks/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
stories: ['../src/**/*.stories.@(ts|tsx|mdx)'],
addons: [
'@storybook/addon-actions',
'@storybook/addon-a11y',
'@storybook/addon-backgrounds',
'@storybook/addon-docs',
'@storybook/addon-viewport',
]
};
6 changes: 6 additions & 0 deletions packages/spindle-hooks/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<style>
body {
font-family: Meiryo, Yu Gothic Medium, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
</style>
<script>window.MSInputMethodContext && document.documentMode && document.write('<script src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"><\x2fscript>');</script>
23 changes: 23 additions & 0 deletions packages/spindle-hooks/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const parameters = {
backgrounds: {
default: 'Surface Primary',
values: [
{
name: 'Background Color',
value: '#F5F6F6',
},
{
name: 'Surface Primary',
value: '#FFFFFF',
},
{
name: 'Surface Secondary',
value: 'rgba(8,18,26,0.04)',
},
{
name: 'Background Color Dark',
value: '#08121A'
}
],
},
};
48 changes: 48 additions & 0 deletions packages/spindle-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.0.1-alpha.3 (2022-04-15)


### Features

* **spindle-hooks:** add spindle-hooks pkg ([1d203af](https://github.com/openameba/spindle/commit/1d203afca4d89392183e96d95bc3fdecdf1cc291))
* **spindle-hooks:** add useCarousel hooks ([80adf49](https://github.com/openameba/spindle/commit/80adf49da1a7ef2920a9230b155e0834a472f419))





## 0.0.1-alpha.2 (2022-04-01)


### Features

* **spindle-hooks:** add spindle-hooks pkg ([dee8e61](https://github.com/openameba/spindle/commit/dee8e6173aa7a6f05d6edb855503445fcee54154))
* **spindle-hooks:** add useCarousel hooks ([d620ecb](https://github.com/openameba/spindle/commit/d620ecbc075f466273f545d666152f8aba879bfb))





## [0.0.1-alpha.1](https://github.com/openameba/spindle/compare/@openameba/spindle-hooks@0.0.1-alpha.0...@openameba/spindle-hooks@0.0.1-alpha.1) (2022-03-31)


### Features

* **spindle-hooks:** add spindle-hooks pkg ([10f6dd9](https://github.com/openameba/spindle/commit/10f6dd91e5e761d4d48b49539651ac3b6c4c029a))
* **spindle-hooks:** add useCarousel hooks ([d62bd35](https://github.com/openameba/spindle/commit/d62bd353bcf02a38a77a91e7374ce12ba672773c))





## 0.0.1-alpha.0 (2022-03-31)


### Features

* **spindle-hooks:** add spindle-hooks pkg ([34851cc](https://github.com/openameba/spindle/commit/34851ccda29e972932180b90a5e3b6559aed94a2))
* **spindle-hooks:** add useCarousel hooks ([17c7221](https://github.com/openameba/spindle/commit/17c7221291d5dc0942e40dce4d0235df556ed6e2))
57 changes: 57 additions & 0 deletions packages/spindle-hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Spindle Hooks (In development)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

別途改善します


Spindle (Ameba Design System) Hooks

<p align="center">
<img alt="Spindle" src="./docs/images/components.png" width="400">
</p>

> Spindle Hooks は試験開発中のため、大幅に変更される可能性があります。安定版リリースまでの間はバージョン番号は 0 となり、バージョンに関わらず breaking change が行われることがありますので、利用時には注意してください。変更内容は、[CHANGELOG](CHANGELOG.md)に記載されています。

![MIT licence](https://img.shields.io/npm/l/@openameba/spindle-ui) ![npm](https://img.shields.io/npm/v/@openameba/spindle-ui)

Spindle Hooks は、Ameba のデザインシステム「Spindle」で定義されたコンポーネントを配布するライブラリです。様々なタイプのプロジェクトに導入できるように設計されています。

## インストール

```
npm install @openameba/spindle-hooks
```

```
yarn add @openameba/spindle-hooks
```

## 利用方法

TODO

## Hooks 一覧

TODO

- ![stability-stable](https://img.shields.io/badge/stability-stable-green.svg) 想定された機能が実装、テストされており本番環境で利用できます
- ![stability-unstable](https://img.shields.io/badge/stability-unstable-yellow.svg) 足りていない機能や不安定な動作があり、まだ完全ではないですが、本番環境で利用できます
- ![stability-wip](https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg) 開発中のため、本番環境での利用はしない方がよいでしょう
- ![stability-experimental](https://img.shields.io/badge/stability-experimental-orange.svg) 実験的な機能で大きな変更や削除される可能性があります
- ![stability-deprecated](https://img.shields.io/badge/stability-deprecated-red.svg) 廃止される予定のため、できるだけはやく利用を停止してください

## サンプルアプリケーション

TODO

## ブラウザサポート

Spindle Hooks は Firefox、Google Chrome、Microsoft Edge、Safari の最新版と Internet Explorer 11 で動作確認しています。

## 開発方法

TODO

## ライセンス

Spindle Hooks は MIT ライセンスで公開されています。ただし、アイコンは[Spindle Icons](../spindle-icons/)に準じて、Creative Commons BY-NC-ND 4.0 ライセンスで公開されています。

## 関連ドキュメント

- [Design Doc](docs/design-doc.md)
8 changes: 8 additions & 0 deletions packages/spindle-hooks/bundlesize.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files": [
{
"path": "./dist/**/*.mjs",
"maxSize": "1.5 kB"
}
]
}
1 change: 1 addition & 0 deletions packages/spindle-hooks/docs/design-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
追記します。
Binary file added packages/spindle-hooks/docs/images/components.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/spindle-hooks/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hosting": {
"site": "ameba-spindle-hooks",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
9 changes: 9 additions & 0 deletions packages/spindle-hooks/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
verbose: true,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
setupFilesAfterEnv: ['<rootDir>/setup-tests.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testEnvironment: 'jsdom',
};
Loading