Skip to content

Commit 8175574

Browse files
committed
Merge pull request #17 from shakacode/alex/contributing
Add contributing guide
2 parents 766bfa7 + 0772c05 commit 8175574

File tree

3 files changed

+93
-13
lines changed

3 files changed

+93
-13
lines changed

CODE_OF_CONDUCT.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6+
7+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8+
9+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10+
11+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12+
13+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)

CONTRIBUTING.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing
2+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](CODE_OF_CONDUCT.md).
3+
4+
## Reporting Issues and Asking Questions
5+
Before opening an issue, please search the [issue tracker](https://github.com/shakacode/bootstrap-loader/issues) to make sure your issue hasn't already been reported.
6+
7+
## Development
8+
Fork, then clone the repo:
9+
10+
```
11+
git clone https://github.com/your-username/bootstrap-loader.git
12+
```
13+
14+
To start development simply run:
15+
16+
```
17+
npm start
18+
```
19+
20+
It will run linters, clear directory with previous build, create new build and run watchers to re-build on every change. Sadly, but we can't use `npm link` feature in development process here because this command symlinks package folder, what makes impossible to resolve `bootstrap` packages in project's `npm_modules` folder. Instead of this just install `bootstrap-loader` locally:
21+
22+
```
23+
cd my-test-project
24+
npm install --save-dev ../path/to/local/bootstrap-lodaer
25+
```
26+
27+
It is a pity, but you have to re-install `bootstrap-lodaer` on every change.
28+
29+
### Build
30+
To create a build run:
31+
32+
```
33+
npm run prerelease
34+
```
35+
36+
It will do the same things as `npm start`, but without activating watchers.
37+
38+
### Linting and Testing
39+
To lint your code run:
40+
41+
```
42+
npm run lint
43+
```
44+
45+
Shame on us, but we don't have any tests here yet. We will be happy, if you can give us a hand with it.
46+
47+
## How loader works
48+
There are 2 entry points: `./loader.js` & `./extractStyles.js`. These are the dummy loaders, which apply real loader to dummy `no-op.js` file. The source of the real loader is located in `./src/bootstrap.loader.js`. Before exploring things in it, check out `./src/bootstrap.config.js` to figure out how we handle default / user config files & gather options for loader.
49+
50+
The main purpose of `./src/bootstrap.loader.js` is to resolve location of `bootstrap` package and create `require`s for webpack to invoke `./src/bootstrap.styles.loader.js` and `./src/bootstrap.scripts.loader.js`. Those are responsible for loading bootstrap's SCSS styles and jQuery scripts.
51+
52+
If you have any questions about further details – don't hesitate to create an issue.
53+
54+
## Examples
55+
Bootstrap loader comes with [examples](examples) to demonstrate how to implement it in various cases. Currently there are 2 example apps: [basic implementation](examples/basic) and [implementation with CSS Modules](examples/css-modules). Check out theirs READMEs to find out how to use them.
56+
57+
## New Features
58+
Please open an issue with a proposal for a new feature or refactoring before starting on the work. We don't want you to waste your efforts on a pull request that we won't want to accept.
59+
60+
## Style
61+
[Shakacode](https://github.com/shakacode) is trying to keep a standard style across its various projects, which can be found over in [eslint-config-shakacode](https://github.com/shakacode/style-guide-javascript). If you have a style change proposal, it should first be proposed there. If accepted, we will be happy to accept a PR to implement it here.
62+
63+
## Submitting Changes
64+
* Open a new issue in the [issue tracker](https://github.com/shakacode/bootstrap-loader/issues).
65+
* Fork the repo.
66+
* Create a new feature branch based off the master branch.
67+
* Make sure there are no linting errors and all tests pass (if any).
68+
* Submit a pull request, referencing any issues it addresses.
69+
70+
Please try to keep your pull request focused in scope and avoid including unrelated commits.
71+
72+
After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or improvements.
73+
74+
Thank you for contributing!

README.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Successor to [bootstrap-sass-loader](https://github.com/shakacode/bootstrap-sass-loader). Load Bootstrap styles and scripts in your Webpack bundle. This loader uses SASS to process CSS styles. Bootstrap 3 & 4 are supported.
66

77
## Installation
8-
98
Get it via npm:
109

1110
```bash
@@ -26,7 +25,6 @@ npm install css-loader node-sass resolve-url-loader sass-loader style-loader url
2625
```
2726

2827
## Usage
29-
3028
Simply require it:
3129

3230
```js
@@ -82,14 +80,12 @@ scripts:
8280
If no config provided, default one for Bootstrap 3 will be used.
8381

8482
## Examples
85-
8683
Check out example apps in [`examples/`](examples) folder:
8784

8885
* Basic usage: [examples/basic](examples/basic)
8986
* With CSS Modules: [examples/css-modules](examples/css-modules) (This example shows off hot reloading with Babel 6 as well!)
9087

9188
## Common Options for Bootstrap 3 and 4
92-
9389
Here are common options for Bootstrap 3 & 4.
9490

9591
### Bootstrap 3
@@ -221,7 +217,6 @@ scripts: true / false
221217
```
222218

223219
### Bootstrap 4
224-
225220
There is only one additional option for Bootstrap 4:
226221

227222
#### `useFlexbox`
@@ -237,7 +232,6 @@ useFlexbox: true
237232
## Additional configurations
238233

239234
#### Paths to custom assets
240-
241235
If you use `bootstrap-loader` to load your styles (via `preBootstrapCustomizations`, `bootstrapCustomizations` & `appStyles`) and you load custom assets (fonts, images etc.), then you can use relative paths inside `url` method (relative to SASS file, from which you load asset).
242236

243237
This was made possible thanks to [resolve-url-loader](https://github.com/bholloway/resolve-url-loader). In common case you don't have to do anything special to apply it — we are doing it internally (just don't forget to install it). But if you want to use its custom settings, please provide it explicitly via `styleLoaders` option in `.bootstraprc`:
@@ -251,7 +245,6 @@ styleLoaders:
251245
```
252246

253247
#### jQuery
254-
255248
If you want to use Bootstrap's JS scripts — you have to provide `jQuery` to Bootstrap JS modules using `imports-loader`:
256249

257250
```js
@@ -269,7 +262,6 @@ module: {
269262
```
270263

271264
#### Icon fonts
272-
273265
Bootstrap uses **icon fonts**. If you want to load them, don't forget to setup `url-loader` or `file-loader` in webpack config:
274266

275267
```js
@@ -281,21 +273,22 @@ module: {
281273
},
282274
```
283275

284-
## License
276+
## Contributing
277+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](CODE_OF_CONDUCT.md).
285278

286-
MIT.
279+
See [Contributing](CONTRIBUTING.md) to get started.
287280

288-
## Example and Related Libraries:
281+
## License
282+
MIT.
289283

284+
## Example and Related Libraries
290285
* [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/), live example at [www.reactrails.com](http://www.reactrails.com/).
291286
* [sass-resources-loader](https://github.com/shakacode/sass-resources-loader/)
292287
* [Simple integration example](./examples/basic)
293288
* [React + hot reloading example: bootstrap-loader-css-modules-example](./examples/css-modules)
294289

295290
## Useful Q&A
296-
297291
* [Using CSS modules with Bootstrap](https://github.com/shakacode/bootstrap-loader/issues/9)
298292
* [How would you use bootstrap styles to build css module styles](https://github.com/shakacode/bootstrap-loader/issues/12)
299293

300294
We'll identify issues that are [questions](https://github.com/shakacode/bootstrap-loader/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Aquestion).
301-

0 commit comments

Comments
 (0)