====================
- Introduction
- Project Structure
- Setup
- Testing locally
- Reporting Bugs
- Requesting Features
- Submitting PR
First of all, thank you for taking the time to contribute!
Before starting, make yourself familiar with the nativescript-dev-webpack
's documentation and the official NativeScript Code Of Conduct.
The repository contains several ingredients:
installer.js
- combination of postinstall scripts for adding or removing webpack configurations and necessary dependecies when installing the plugin.templates/
- webpack config templates for different types of projects - NativeScript with JavaScript, NativeScript with TypeScript and NativeScript Angular projects.plugins/
- several Webpack plugins necessary for bundling NativeScript applications.snapshot/android/
- tools used with theNativeScriptSnapshot
plugin for generating V8 Heap Snapshots.nativescript-target/
- configuration of a Webpack deployment target for building NativeScript applications.bin/
- helper node/npm scripts for projects using the plugin.demo/
- resides several NativeScript applications, testing different scenarios. You can execute each app's tests by navigating to its directory and runningnpm run e2e -- --runType nameOfRuntype
. For more information on runTypes, check out the nativescript-dev-appium plugin.
Note that you need npm 5+ for local development of the plugin.
-
Fork and clone the GitHub repository:
git clone https://github.com/your-username/nativescript-dev-webpack.git
-
Add an 'upstream' remote pointing to the original repository:
cd nativescript-dev-webpack git remote add upstream https://github.com/NativeScript/nativescript-dev-webpack.git
-
Create a branch for your changes:
git checkout -b <my-fix-branch> master
-
Install dependencies:
npm install
The last command also runs npm prepare
which compiles the TypeScript files in the plugin.
You are good to go! You're strongly encouraged to follow the official NativeScript Coding Conventions and to use ES features available in NodeJS v6. If unsure, check on node.green.
There are three apps in the repository, located in the /demo
directory.
-
Create a new NativeScript project with NativeScript CLI:
tns create testapp # pass --ng/--tsc for Angular/TypeScript app
-
Install your local copy of the plugin.
npm install /path/to/repo/nativescript-dev-webpack
-
Make sure to force-update the project's configuration files if it's already using Webpack.
./node_modules/.bin/update-ns-webpack --deps --configs
- Always update to the most recent master release; the bug may already be resolved.
- Search for similar issues in the issues list for this repo; it may already be an identified problem.
- If this is a bug or problem that is clear, simple, and is unlikely to require any discussion -- it is OK to open an issue on GitHub with a reproduction of the bug including workflows and screenshots. If possible, submit a Pull Request with a failing test, entire application or module. If you'd rather take matters into your own hands, fix the bug yourself (jump down to the Submitting a PR section).
- Use Github Issues to submit feature requests.
- First, search for a similar request and extend it if applicable. This way it would be easier for the community to track the features.
- When requesting a new feature, please provide as much detail as possible about why you need the feature in your apps. We prefer that you explain a need rather than explain a technical solution for it. That might trigger a nice conversation on finding the best and broadest technical solution to a specific need.
-
Create one or several commits describing your changes. Follow the Angular commit message guidelines.
-
Push your branch to GitHub:
git push origin my-fix-branch
-
In GitHub, send a pull request to
nativescript-dev-webpack:master
. If we suggest changes, then:- Make the required updates.
- Commit the changes to your branch (e.g.
my-fix-branch
). - Push the changes to your GitHub repository (this will update your PR).
-
If your branch gets too outdated you may need to rebase it on top of the upstream master and force push to update your PR:
-
Fetch the latest changes
git fetch upstream
-
Check out to your fork's local
master
branchgit checkout master
-
Merge the original repo changes into your local
master
branchgit merge upstream/master
-
Rebase it on top of
master
git rebase -i master
-
Update your PR with force push
git push -f origin my-fix-branch
-
Thank you for your contribution!