From c314281da07870a7650a95fc593b2137a8d16c2f Mon Sep 17 00:00:00 2001 From: Samy Pesse Date: Wed, 28 Sep 2016 10:03:38 +0200 Subject: [PATCH] Add CONTRIBUTING.md --- CONTRIBUTING.md | 51 +++++++++++++++++++ packages/gitbook-core/.npmignore | 2 +- packages/gitbook-core/package.json | 2 +- packages/gitbook-plugin-sharing/index.js | 7 +-- .../gitbook-plugin-theme-default/.gitignore | 2 +- .../gitbook-plugin-theme-default/.npmignore | 2 +- .../assets/.gitkeep | 0 .../gitbook-plugin-theme-default/package.json | 7 ++- .../src/output/website/copyPluginAssets.js | 2 +- 9 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 packages/gitbook-plugin-theme-default/assets/.gitkeep diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..d8c3fb07d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,51 @@ + +# Contributing + +Want to contribute to GitBook? That would be awesome! + +- [Send feedback](#send-feedback) +- [Reporting Bugs](#reporting-bugs) +- [Asking Questions](#asking-questions) +- [Submitting Pull Requests](#submitting-pull-requests) +- [Running Tests](#running-tests) + +## Send feedback + +We’ve done our best to test but your feedback is really important. If you encounter problems or have feedback about GitBook products (GitBook.com, GitBook Editor, or the Toolchain), please log an issue in the [GitbookIO/feedback](https://github.com/GitbookIO/feedback/issues) repository. + + +## Reporting Bugs + +If you run into any weird behavior while using GitBook, feel free to open a new issue in this repository! To be most helpful, please include the steps to reproduce the bug as best you can, including the output of command `gitbook -V`. + +## Asking Questions + +Questions are very welcome :smile:! Previous questions that folks have asked are tagged with a [`question`](https://github.com/GitBookIO/gitbook/issues?q=is%3Aissue+is%3Aclosed+label%3Aquestion) label, so before opening a new issue double-check that someone hasn't asked it before. But if you don't see anything, or if you're not sure if it's the same, err on the side of asking! + +We've also got a [GitBook Community Slack](https://slack.gitbook.com/) where you can ask questions and get answers from other people using GitBook. + +## Submitting Pull Requests + +All pull requests are super welcomed and greatly appreciated! Easy issues are marked with an [`easy-one`](https://github.com/GitBookIO/gitbook/issues?q=is%3Aopen+is%3Aissue+label%3Aeasy-one) label if you're looking for a simple place to get familiar with the code base. + +Please include tests and docs with every pull request! + +## Running Tests + +To run the examples, you need to have the GitBook repository cloned to your computer. After that, you need to `cd` into the directory where you cloned it, and install the dependencies from `npm`. + +``` +npm install +``` + +Then you'll need to bootstrap it: + +``` +npm run bootstrap +``` + +Which will also compile the source files. Then run the tests with: + +``` +npm test +``` diff --git a/packages/gitbook-core/.npmignore b/packages/gitbook-core/.npmignore index 5862c1393..b9cde8e05 100644 --- a/packages/gitbook-core/.npmignore +++ b/packages/gitbook-core/.npmignore @@ -1,3 +1,3 @@ src !lib -!gitbook.core.min.js +!dist diff --git a/packages/gitbook-core/package.json b/packages/gitbook-core/package.json index c00c6ccdd..4d5a40aea 100644 --- a/packages/gitbook-core/package.json +++ b/packages/gitbook-core/package.json @@ -27,7 +27,7 @@ }, "scripts": { "dist-lib": "rm -rf lib/ && babel -d lib/ src/", - "dist-standalone": "browserify -r ./lib/index.js:gitbook-core -r react -r react-dom ./lib/index.js | uglifyjs -c > gitbook.core.min.js", + "dist-standalone": "browserify -r ./lib/index.js:gitbook-core -r react -r react-dom ./lib/index.js | uglifyjs -c > ./dist/gitbook.core.min.js", "dist": "npm run dist-lib && npm run dist-standalone", "prepublish": "npm run dist" }, diff --git a/packages/gitbook-plugin-sharing/index.js b/packages/gitbook-plugin-sharing/index.js index 5217cada2..58038891d 100644 --- a/packages/gitbook-plugin-sharing/index.js +++ b/packages/gitbook-plugin-sharing/index.js @@ -1,9 +1,4 @@ module.exports = { - website: { - assets: './assets', - plugins: [ - './src/index.js' - ] - } + }; diff --git a/packages/gitbook-plugin-theme-default/.gitignore b/packages/gitbook-plugin-theme-default/.gitignore index d352d3c5e..dfd90dc1b 100644 --- a/packages/gitbook-plugin-theme-default/.gitignore +++ b/packages/gitbook-plugin-theme-default/.gitignore @@ -1 +1 @@ -assets/theme.js +_assets diff --git a/packages/gitbook-plugin-theme-default/.npmignore b/packages/gitbook-plugin-theme-default/.npmignore index 6838c3ea9..75e092352 100644 --- a/packages/gitbook-plugin-theme-default/.npmignore +++ b/packages/gitbook-plugin-theme-default/.npmignore @@ -1 +1 @@ -!assets/theme.js +!_assets diff --git a/packages/gitbook-plugin-theme-default/assets/.gitkeep b/packages/gitbook-plugin-theme-default/assets/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/gitbook-plugin-theme-default/package.json b/packages/gitbook-plugin-theme-default/package.json index 349bace9d..6beaaedbc 100644 --- a/packages/gitbook-plugin-theme-default/package.json +++ b/packages/gitbook-plugin-theme-default/package.json @@ -2,14 +2,13 @@ "name": "gitbook-plugin-theme-default", "description": "Default theme for GitBook", "main": "./index.js", - "browser": "./assets/theme.js", + "browser": "./_assets/theme.js", "version": "1.0.5", "engines": { "gitbook": ">=3.0.0" }, "dependencies": { - "gitbook-core": "^0.0.0", - "react": "^15.3.1" + "gitbook-core": "^0.0.0" }, "devDependencies": { "classnames": "^2.2.5", @@ -22,7 +21,7 @@ }, "scripts": { "build-css": "lessc -clean-css ./less/main.less ./_assets/website/theme.css", - "build-js": "gitbook-plugin build ./src/index.js ./assets/theme.js", + "build-js": "gitbook-plugin build ./src/index.js ./_assets/theme.js", "prepublish": "npm run build-css && npm run build-js" }, "repository": { diff --git a/packages/gitbook/src/output/website/copyPluginAssets.js b/packages/gitbook/src/output/website/copyPluginAssets.js index 1291a061c..bf5f488e6 100644 --- a/packages/gitbook/src/output/website/copyPluginAssets.js +++ b/packages/gitbook/src/output/website/copyPluginAssets.js @@ -105,7 +105,7 @@ function copyCoreJS(output) { const options = output.getOptions(); const outputRoot = options.get('root'); - const inputFile = require.resolve('gitbook-core/gitbook.core.min.js'); + const inputFile = require.resolve('gitbook-core/dist/gitbook.core.min.js'); const outputFile = path.join(outputRoot, 'gitbook/core.js'); logger.debug.ln('copy JS for gitbook-core');