This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nuxt module for @chakra-ui/vue
- Loading branch information
1 parent
07bbf69
commit 9c311c2
Showing
22 changed files
with
12,229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
quote_type = single | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Common | ||
node_modules | ||
dist | ||
.nuxt | ||
coverage | ||
|
||
# Plugin | ||
lib/plugin.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
parser: 'babel-eslint', | ||
sourceType: 'module' | ||
}, | ||
extends: [ | ||
'@nuxtjs' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
node: [10, 12] | ||
|
||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: checkout | ||
uses: actions/checkout@master | ||
|
||
- name: cache node_modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Test | ||
run: yarn test | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
*.iml | ||
.idea | ||
*.log* | ||
.nuxt | ||
.vscode | ||
.DS_Store | ||
coverage | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
|
||
### 0.0.2 (2020-05-14) | ||
|
||
|
||
### Features | ||
|
||
* setting up the module ([d227b4d](https://github.com/DominusKelvin/chakraui-module/commit/d227b4de2f189fa2466222c62fbbcaa279e5e53f)) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* added scripts to package.json ([0fc4111](https://github.com/DominusKelvin/chakraui-module/commit/0fc41118dd189e295363e6265902b88db78dffb1)) | ||
* update test ([eed8b90](https://github.com/DominusKelvin/chakraui-module/commit/eed8b90fa80119703818beafabc123b3b5140e89)) | ||
* versioning ([928a85d](https://github.com/DominusKelvin/chakraui-module/commit/928a85dddb987f8d8582ea01b21671a17e198e81)) | ||
|
||
### 0.0.1 (2020-05-14) | ||
|
||
|
||
### Features | ||
|
||
* setting up the module ([d227b4d](https://github.com/DominusKelvin/chakraui-module/commit/d227b4de2f189fa2466222c62fbbcaa279e5e53f)) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* added scripts to package.json ([0fc4111](https://github.com/DominusKelvin/chakraui-module/commit/0fc41118dd189e295363e6265902b88db78dffb1)) | ||
* update test ([eed8b90](https://github.com/DominusKelvin/chakraui-module/commit/eed8b90fa80119703818beafabc123b3b5140e89)) | ||
* versioning ([928a85d](https://github.com/DominusKelvin/chakraui-module/commit/928a85dddb987f8d8582ea01b21671a17e198e81)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Kelvin Omereshone <kelvinomereshone@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# @nuxtjs/chakraui | ||
|
||
[![npm version][npm-version-src]][npm-version-href] | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
[![License][license-src]][license-href] | ||
|
||
> Chakra UI Module for Nuxt.js | ||
[📖 **Release Notes**](./CHANGELOG.md) | ||
|
||
## Setup | ||
|
||
1. Add `@nuxtjs/chakraui` dependency to your project | ||
|
||
```bash | ||
yarn add @nuxtjs/chakraui # or npm install @nuxtjs/chakraui | ||
``` | ||
|
||
2. Add `@nuxtjs/chakraui` to the `modules` section of `nuxt.config.js` | ||
|
||
```js | ||
{ | ||
modules: [ | ||
// Simple usage | ||
'@nuxtjs/chakraui', | ||
|
||
] | ||
} | ||
``` | ||
|
||
3. Wrap your default layout in `layouts/` directory inside CThemeProvider as seen in the Chakra UI [docs](https://vue.chakra-ui.com/with-nuxt) to start consuming Chakra Components. Like so: | ||
|
||
```js | ||
<template> | ||
<c-theme-provider> | ||
<c-reset/> | ||
<Nuxt/> | ||
</c-theme-provider> | ||
</template> | ||
|
||
<script> | ||
import { | ||
CThemeProvider, | ||
CReset, | ||
CButton | ||
} from "@chakra-ui/vue"; | ||
|
||
export default { | ||
name: 'DefaultLayout', | ||
components: { | ||
CThemeProvider, | ||
CReset, | ||
} | ||
}; | ||
</script> | ||
``` | ||
|
||
|
||
## Development | ||
|
||
1. Clone this repository | ||
2. Install dependencies using `yarn install` or `npm install` | ||
3. Start development server using `npm run dev` | ||
|
||
## License | ||
|
||
[MIT License](./LICENSE) | ||
|
||
Copyright (c) Kelvin Omereshone <kelvinomereshone@gmail.com> | ||
|
||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/chakraui/latest.svg | ||
[npm-version-href]: https://npmjs.com/package/@nuxtjs/chakraui | ||
|
||
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/chakraui.svg | ||
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/chakraui | ||
|
||
[github-actions-ci-src]: https://github.com/https://github.com/DominusKelvin/chakraui-module/workflows/ci/badge.svg | ||
[github-actions-ci-href]: https://github.com/https://github.com/DominusKelvin/chakraui-module/actions?query=workflow%3Aci | ||
|
||
[codecov-src]: https://img.shields.io/codecov/c/github/https://github.com/DominusKelvin/chakraui-module.svg | ||
[codecov-href]: https://codecov.io/gh/https://github.com/DominusKelvin/chakraui-module | ||
|
||
[license-src]: https://img.shields.io/npm/l/@nuxtjs/chakraui.svg | ||
[license-href]: https://npmjs.com/package/@nuxtjs/chakraui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
esmodules: true | ||
} | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
extends: [ | ||
'@commitlint/config-conventional' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<div class="container"> | ||
<c-theme-provider> | ||
<c-color-mode-provider> | ||
<c-box font-family="body" as="main"> | ||
<c-reset /> | ||
<Nuxt /> | ||
</c-box> | ||
</c-color-mode-provider> | ||
</c-theme-provider> | ||
</div> | ||
</template> | ||
<script> | ||
import { | ||
CThemeProvider, | ||
CColorModeProvider, | ||
CReset, | ||
CBox | ||
} from '@chakra-ui/vue' | ||
export default { | ||
name: 'App', | ||
components: { | ||
CThemeProvider, | ||
CColorModeProvider, | ||
CReset, | ||
CBox | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { resolve } = require('path') | ||
|
||
module.exports = { | ||
rootDir: resolve(__dirname, '..'), | ||
buildDir: resolve(__dirname, '.nuxt'), | ||
srcDir: __dirname, | ||
modules: [ | ||
{ handler: require('../') } | ||
] | ||
} |
Oops, something went wrong.