Skip to content

Commit 6b625de

Browse files
committed
Merge branch 'master' of github.com:Hyper-Enterprise/Hyper-Aurora-Vue
2 parents 7ae53da + 01bc940 commit 6b625de

File tree

13 files changed

+2159
-171
lines changed

13 files changed

+2159
-171
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"env": {
33
"browser": true,
44
"es6": true,
5-
"node": true
5+
"node": true,
6+
"jest/globals": true
67
},
8+
"plugins": ["jest"],
79
"parserOptions": {
810
"parser": "babel-eslint"
911
},

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
node_modules
33
/dist
4+
/coverage
45
storybook-static
56

67

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export default {
3434
</template>
3535
```
3636

37-
### Documentation
37+
### Live documentation
3838
[Aurora-Vue Doc](https://aurora-vue.netlify.app/)
3939
### Contributing
4040

4141
Guides:
42-
[Click here, and discovery how to develop](CONTRIBUTING.md)
42+
[Click here, and discovery how to develop](docs/CONTRIBUTING.md)
File renamed without changes.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
## Contributing (for DEVs)
22

3-
Para contribuir com o projeto, crie uma branch a parte desenvolva a ideia/feature e crie um PR apontando para a master.
4-
Features e mudanças grandes, espere por um review.
3+
To contribute to the project, create a separate branch from 'next', develop the idea/feature and create a PR pointing to the 'next' branch.
54

65
### Publish
76

87
1 - Será necessário, comitar e depois versionar conforme o tipo de mudança:
98

10-
```
9+
```bash
1110
npm version patch
11+
# or
1212
npm version minor
13+
# or
1314
npm version major
1415
```
1516

1617
2 - Os comandos para compilar o build final são:
1718

18-
```
19+
```bash
1920
npm run build-bundle
2021
```
2122

2223
3 - Os comandos para publicar no NPM é:
2324

24-
```
25+
```bash
2526
npm run publish:new
2627
```

docs/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Improvement request
2+
3+
### **Please check if the PR fulfills these requirements**
4+
- [ ] Tests passed
5+
- [ ] Tests for the changes have been added (for bug fixes / features)
6+
- [ ] Docs have been added / updated (for bug fixes / features)
7+
- [ ] Does this PR introduce a breaking change?
8+
9+
10+
### **Objective of request** (Bug fix, feature, docs update, ...)
11+
-
12+
13+
14+
### **Changes** (You can also link to an open issue here)
15+
-
16+
17+
18+
### **Screenshots**
19+
-
20+
21+
22+
### **Other information**:
23+
-

jest.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
verbose: true,
3+
globals: {
4+
'vue-jest': {
5+
babelConfig: '<rootDir>/babel.config.js',
6+
},
7+
},
8+
transform: {
9+
'^.+\\.js$': 'babel-jest',
10+
'^.+\\.vue$': 'vue-jest',
11+
},
12+
moduleNameMapper: {
13+
'^vue$': 'vue/dist/vue.esm.js',
14+
'^@/(.*)$': '<rootDir>/src/$1',
15+
},
16+
setupFilesAfterEnv: [
17+
'<rootDir>/src/tests/setup.js',
18+
],
19+
transformIgnorePatterns: [
20+
'node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)',
21+
],
22+
moduleFileExtensions: [
23+
'js',
24+
'json',
25+
'vue',
26+
],
27+
testEnvironment: 'jsdom',
28+
};

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyone-labs/aurora-vue",
3-
"version": "1.0.0",
3+
"version": "0.0.0-development",
44
"private": false,
55
"description": "Aurora-Vue is UI - Library write in Vue.js",
66
"author": "Jessé Correia Lins",
@@ -12,7 +12,9 @@
1212
"build-bundle": "vue-cli-service build --target lib --name aurora-vue ./src/export.js",
1313
"publish:new": "npm publish --access=public",
1414
"storybook:build": "vue-cli-service storybook:build -c .storybook",
15-
"storybook:serve": "vue-cli-service storybook:serve -p 6006 -c .storybook"
15+
"storybook:serve": "vue-cli-service storybook:serve -p 6006 -c .storybook",
16+
"test": "jest",
17+
"semantic-release": "semantic-release"
1618
},
1719
"main": "./dist/aurora-vue.common.js",
1820
"files": [
@@ -34,23 +36,30 @@
3436
"@storybook/addon-knobs": "^6.3.0",
3537
"@storybook/addon-links": "^6.3.6",
3638
"@storybook/vue": "^6.3.6",
39+
"@testing-library/jest-dom": "^5.14.1",
40+
"@testing-library/vue": "^5.8.2",
3741
"@vue/cli-plugin-babel": "~4.5.0",
3842
"@vue/cli-plugin-eslint": "~4.5.0",
3943
"@vue/cli-service": "~4.5.0",
4044
"@vue/eslint-config-airbnb": "^5.0.2",
45+
"babel-core": "^7.0.0-bridge.0",
4146
"babel-eslint": "^10.1.0",
4247
"css-loader": "^5.0.1",
43-
"eslint": "^6.7.2",
48+
"eslint": "^7.32.0",
4449
"eslint-plugin-import": "^2.20.2",
50+
"eslint-plugin-jest": "^24.4.0",
4551
"eslint-plugin-vue": "^6.2.2",
52+
"jest": "^27.0.6",
4653
"node-sass": "^5.0.0",
4754
"sass-loader": "^10.1.0",
4855
"sass-resources-loader": "^2.1.1",
4956
"storybook-design-token": "^1.2.0",
5057
"style-loader": "^2.0.0",
5158
"vue-cli-plugin-storybook": "~2.1.0",
59+
"vue-jest": "^3.0.7",
5260
"vue-template-compiler": "^2.6.11",
53-
"webpack-bundle-analyzer": "^4.4.0"
61+
"webpack-bundle-analyzer": "^4.4.0",
62+
"semantic-release": "^17.4.4"
5463
},
5564
"eslintConfig": {
5665
"root": true,
@@ -75,7 +84,7 @@
7584
"license": "ISC",
7685
"repository": {
7786
"type": "git",
78-
"url": "git+https://github.com/hyone-labs/aurora-vue.git"
87+
"url": "https://github.com/hyone-labs/aurora-vue.git"
7988
},
8089
"keywords": [
8190
"vue",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`AButton render correctly with default props 1`] = `
4+
"<button class=\\"a-button a-button--behavior-is-rounded a-button--variant-primary a-button--size-small\\">
5+
<!---->
6+
<!----> <span class=\\"a-button__text\\">My first test</span></button>"
7+
`;
8+
9+
exports[`AButton render correctly with different props 1`] = `
10+
"<button class=\\"a-button a-button--behavior-block a-button--behavior-is-rounded a-button--variant-secondary a-button--size-small\\">
11+
<div class=\\"a-icon a-icon--size-inherit a-icon--color-primary a-button__icon\\"><i class=\\"fas fa-circle\\"></i></div>
12+
<!----> <span class=\\"a-button__text\\">With many Itens</span>
13+
</button>"
14+
`;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { render } from '@testing-library/vue';
2+
import AButton from '../a-button.vue';
3+
4+
describe('AButton', () => {
5+
it('render correctly with default props', () => {
6+
const { html } = render(AButton, {
7+
slots: {
8+
default: 'My first test',
9+
},
10+
});
11+
expect(html()).toMatchSnapshot();
12+
});
13+
14+
it('render correctly with different props', () => {
15+
const { html } = render(AButton, {
16+
slots: {
17+
default: 'With many Itens',
18+
},
19+
props: {
20+
behavior: 'block',
21+
variant: 'secondary',
22+
size: 'small',
23+
icon: 'fas fa-circle',
24+
iconColor: 'primary',
25+
isRounded: true,
26+
},
27+
});
28+
expect(html()).toMatchSnapshot();
29+
// expect(getByText('My first button').closest('button')).toHaveAttribute('disabled');
30+
});
31+
});

src/docs/0-welcome-aurora-vue.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, ArgsTable, Story, Canvas, ColorPalette, ColorItem } from '@storybook/addon-docs/blocks';
1+
import { Meta } from '@storybook/addon-docs/blocks';
22

33
<Meta title="Aurora-Vue/Welcome" />
44

src/tests/setup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// eslint-disable-next-line import/no-extraneous-dependencies
2+
import '@testing-library/jest-dom';
3+
import Vue from 'vue';
4+
5+
Vue.config.productionTip = false;

0 commit comments

Comments
 (0)