Skip to content

Commit 26cc7d7

Browse files
Merge pull request #70 from francoischalifour/next
Prepare for 1.0.0
2 parents 5924d0a + f518591 commit 26cc7d7

File tree

101 files changed

+30967
-2431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+30967
-2431
lines changed

.babelrc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
2+
"presets": [
3+
["env", {
4+
"modules": false,
5+
"loose": true,
6+
"targets": {
7+
"browsers": "ie >= 10"
8+
}
9+
}]
10+
],
211
"env": {
3-
"build": {
4-
"presets": [
5-
[
6-
"env",
7-
{
8-
"modules": false
9-
}
10-
]
11-
],
12-
"plugins": ["external-helpers"]
13-
},
1412
"test": {
15-
"presets": ["env"]
13+
"presets": [["env"]]
1614
}
1715
}
1816
}

.eslintignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
**/node_modules/**
2-
dist
3-
examples
2+
/coverage
3+
/dist
4+
/examples
5+
/stories
6+
/website

.eslintrc.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
module.exports = {
2-
extends: ['eslint:recommended', 'prettier'],
3-
rules: {
4-
'no-console': 'off'
5-
},
2+
extends: ['eslint:recommended', 'airbnb-base', 'prettier'],
63
parser: 'babel-eslint',
74
env: {
85
es6: true,
96
browser: true,
10-
node: true
11-
}
7+
node: true,
8+
jest: true,
9+
},
10+
globals: {
11+
__TEST__: false,
12+
},
13+
rules: {
14+
'no-underscore-dangle': 0,
15+
'no-use-before-define': 0,
16+
'no-shadow': 0,
17+
'no-console': ['error', { allow: ['warn', 'error'] }],
18+
},
1219
}

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
node_modules
2-
dist
1+
/node_modules
2+
/coverage
3+
/cypress/screenshots
4+
/cypress/videos
5+
/dist
6+
/storybook
7+
38
.DS_Store
49
package-lock.json
5-
/examples/**/yarn.lock
610
*.log
7-
/storybook
11+
.vscode

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10.6.0

.release-it.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"requireUpstream": false,
3+
"requireCleanWorkingDir": false,
4+
"increment": "conventional:angular",
5+
"src": {
6+
"commitMessage": "chore(release): %s",
7+
"beforeStartCommand": "yarn run lint && yarn run build && yarn run test --colors && yarn run test:cypress && yarn run test:size"
8+
}
9+
}

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
cache:
3+
directories:
4+
- ~/.cache
5+
before_install:
6+
- curl -o- -L yarnpkg.com/install.sh | bash -s -- --version 1.9.4
7+
- export PATH=$HOME/.yarn/bin:$PATH
8+
install: yarn install --frozen-lockfile
9+
before_script: yarn run build
10+
script:
11+
- '${SCRIPT}'
12+
env:
13+
matrix:
14+
- SCRIPT="yarn run lint"
15+
- SCRIPT="yarn run test --coverage --colors"
16+
- SCRIPT="yarn run test:cypress:record $CYPRESS_RECORD_KEY"
17+
- SCRIPT="yarn run test:size"

CONTRIBUTING.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Contributing to Medium Zoom
2+
3+
Thank you for getting involved in Medium Zoom!
4+
5+
## Concept
6+
7+
This module is meant to reproduce the zoom from [Medium](http://medium.com). We want to provide a great UX (User Experience) with a lightweight vanilla JavaScript solution. Thus, this package must remain focused on this core principle, yet be extended with a composable API.
8+
9+
## Folder structure
10+
11+
```
12+
▸ cypress The end-to-end tests written for Cypress
13+
▸ examples The Medium Zoom featured examples available on CodeSandbox
14+
▸ src The source code of the module
15+
▸ __tests__ The tests for the module API
16+
▸ stories The stories for the Medium Zoom Storybook
17+
▸ website The Medium Zoom website source code
18+
```
19+
20+
## Requirements
21+
22+
- [Node](https://nodejs.org)
23+
- [Yarn](https://yarnpkg.com)
24+
25+
## Conventions
26+
27+
### Commits
28+
29+
This project follows the [conventional changelog](https://conventionalcommits.org/) guidelines. All commit messages should be formatted using the following scheme:
30+
31+
```
32+
type(scope): description
33+
```
34+
35+
## Workflow
36+
37+
### Filing issues
38+
39+
Reporting a bug or requesting a feature is always welcome. Feel free to [open an issue](https://github.com/francoischalifour/medium-zoom/issues/new/choose) with the according template which helps you create an effective report.
40+
41+
### Submit code
42+
43+
After discussing in an issue about the need to change the code, you will need to follow these steps:
44+
45+
- [Fork the repository](https://help.github.com/articles/fork-a-repo/)
46+
- Clone your fork
47+
- Install the dependencies: `yarn`
48+
- For a **documentation** change:
49+
- Create a branch `docs/what-you-change`
50+
- Make the changes
51+
- Run `yarn run format`
52+
- For a **bug fix**:
53+
- Create a branch `fix/issue-number`
54+
- [Write a test](src/__tests__/medium-zoom.test.js) to reproduce the bug (run `yarn run test`)
55+
- Fix the bug in the [source code](src/medium-zoom.js)
56+
- Make your test pass the previous bug
57+
- Run `yarn run format` and fix problems if any
58+
- For a **feature**:
59+
- Create a branch `feat/name-of-the-feature`
60+
- Add the feature to the [source code](src/medium-zoom.js)
61+
- Create a story in the [storybook](stories) showcasing the feature
62+
- [Write a test](src/__tests__/medium-zoom.test.js) to ensure it's working as expected (run `yarn run test`)
63+
- Run `yarn run format` and fix problems if any
64+
- [Create a pull request](https://help.github.com/articles/creating-a-pull-request/)
65+
66+
We will then review your pull request!
67+
68+
### Testing
69+
70+
#### Unit and integration tests
71+
72+
[Unit and integration tests](src/__tests__) with [Jest](https://jestjs.io) ensure that the API works as documented.
73+
74+
###### Commands
75+
76+
- Run the tests: `yarn run test`
77+
- Watch the tests: `yarn run test --watch`
78+
- Run the tests with coverage: `yarn run test --coverage`
79+
80+
#### End-to-end tests
81+
82+
[End-to-end tests](cypress/integration) with [Cypress](https://cypress.io) take screenshots of the stories to ensure that the zoom looks as expected.
83+
84+
###### Commands
85+
86+
- Open the Cypress UI: `yarn run test:cypress:open`
87+
- Run the Cypress tests: `yarn run test:cypress:run`
88+
89+
### Releasing
90+
91+
We rely on [release-it](https://github.com/webpro/release-it) to release new versions of this package.
92+
93+
#### Release flow
94+
95+
The release flow goes through these steps:
96+
97+
1. Run acceptance tests
98+
1. Bump the project version in [`package.json`](package.json) based on [the commits](#conventions)
99+
1. Commit the release version
100+
1. Create the new Git tag for this release
101+
1. Push to GitHub
102+
1. Publish to npm
103+
104+
#### Release steps
105+
106+
##### Unstable version
107+
108+
1. Make sure you're on the `next` branch
109+
1. Run `npm run release:next` (_do not_ use `yarn` for releasing)
110+
1. Follow the command-line instructions
111+
112+
##### Stable version
113+
114+
1. Make sure you're on the `master` branch
115+
1. Run `npm run release` (_do not_ use `yarn` for releasing)
116+
1. Follow the command-line instructions
117+
118+
---
119+
120+
Thank you for contributing!

0 commit comments

Comments
 (0)