CONTRIBUTING.md (Leaflet-1.8.0) | : | CONTRIBUTING.md (Leaflet-1.9.0) | ||
---|---|---|---|---|
skipping to change at line 87 | skipping to change at line 87 | |||
yarn install | yarn install | |||
``` | ``` | |||
### Making Changes to Leaflet Source | ### Making Changes to Leaflet Source | |||
If you're not yet familiar with the way GitHub works (forking, pull requests, et c.), | If you're not yet familiar with the way GitHub works (forking, pull requests, et c.), | |||
be sure to check out the awesome [article about forking](https://help.github.com /articles/fork-a-repo) | be sure to check out the awesome [article about forking](https://help.github.com /articles/fork-a-repo) | |||
on the GitHub Help website — it will get you started quickly. | on the GitHub Help website — it will get you started quickly. | |||
You should always write each batch of changes (feature, bugfix, etc.) in **its o wn topic branch**. | You should always write each batch of changes (feature, bugfix, etc.) in **its o wn topic branch**. | |||
Please do not commit to the `main` branch, or your unrelated changes will go int o the same pull request. | Please do not commit to the `main` branch of your fork — otherwise your unrelate d changes will go into the same pull request. | |||
You should also follow the code style and whitespace conventions of the original codebase. | You should also follow the code style and whitespace conventions of the original codebase. | |||
In particular, use tabs for indentation and spaces for alignment. | In particular, use tabs for indentation and spaces for alignment. | |||
Before committing your changes, run `npm run lint` to catch any JS errors in the code and fix them. | Before committing your changes, run `npm run lint` to catch any JS errors in the code and fix them. | |||
If you add any new files to the Leaflet source, make sure to also add them to `b | The same command is automatically executed while committing. | |||
uild/deps.js` | You can prevent it from execution with the git flag `--no-verify`: `git commit - | |||
so that the build system knows about them. | m "WIP" --no-verify`. | |||
Also, please make sure that you have [line endings configured properly](https:// help.github.com/articles/dealing-with-line-endings) in Git! Otherwise the diff w ill show that all lines of a file were changed even if you touched only one. | Also, please make sure that you have [line endings configured properly](https:// help.github.com/articles/dealing-with-line-endings) in Git! Otherwise the diff w ill show that all lines of a file were changed even if you touched only one. | |||
Happy coding! | Happy coding! | |||
### Using RollupJS | ### Using RollupJS | |||
The source JavaScript code for Leaflet is a few dozen files, in the `src/` direc tory. | The source JavaScript code for Leaflet is a few dozen files, in the `src/` direc tory. | |||
But normally, Leaflet is loaded in a web browser as just one JavaScript file. | But normally, Leaflet is loaded in a web browser as just one JavaScript file. | |||
In order to create this file, run `npm run rollup` or `yarn run rollup`. | In order to create this file, run `npm run build` or `yarn run build`. | |||
You'll find `dist/leaflet-src.js` and `dist/leaflet.js`. The difference is that | You'll find `dist/leaflet-src.js` and `dist/leaflet.js`. The difference is that | |||
`dist/leaflet-src.js` has sourcemaps and it's not uglified, so it's better for | `dist/leaflet-src.js` has sourcemaps and it's not uglified, so it's better for | |||
development. `dist/leaflet.js` is uglified and thus is smaller, so it's better | development. `dist/leaflet.js` is uglified and thus is smaller, so it's better | |||
for deployment. | for deployment. | |||
When developing (or bugfixing) core Leaflet functionalities, it's common to use | When developing (or bugfixing) core Leaflet functionalities, it's common to use | |||
the webpages in the `debug/` directory, and run the unit tests (`spec/index.html `) | the webpages in the `debug/` directory, and run the unit tests (`spec/index.html `) | |||
in a graphical browser. This requires regenerating the bundled files quickly. | in a graphical browser. This requires regenerating the bundled files quickly. | |||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added |