Skip to content

Commit 08eeeea

Browse files
committed
docs: ✏️ update CONTRIBUTING.md to reflect Vite build syst
docs: modernize documentation for Vite migration BREAKING CHANGE: 🧨 - Update CONTRIBUTING.md to replace Grunt with Vite build system ✅ Closes: - Add comprehensive development workflow sections
1 parent f484715 commit 08eeeea

File tree

2 files changed

+59
-37
lines changed

2 files changed

+59
-37
lines changed

CONTRIBUTING.md

Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,76 @@
11
## Development and Production Versions
22

3-
Changes should to go the source files in `src/`. Then you run the build process
4-
outlines below to generate the production-ready files which go into `dist/`. E.g.
5-
those files are concatenated and minified.
3+
Changes should go into the source files in `src/`. Then you run the build process outlined below to generate the production-ready files which go into `dist/`. These files are bundled and minified for optimal performance.
64

75
## Rebuilding from Source
86

9-
The plugin's build process is managed by [Grunt](http://gruntjs.com/installing-grunt),
10-
which in turn is built on top of [Node.js](http://nodejs.org/). You'll need to have
11-
both of these applications installed on your machine to rebuild the plugin from source.
7+
The plugin's build process is managed by [Vite](https://vitejs.dev/), a modern build tool built on top of [Node.js](http://nodejs.org/). You'll need to have Node.js installed on your machine to rebuild the plugin from source.
128

13-
Assuming you have both Grunt and Node.js (version 10 or higher) installed, you can
14-
install all the build dependencies with a single command, from the plugin's root
15-
directory:
9+
Assuming you have Node.js (version 18 or higher) installed, you can install all the build dependencies with a single command, from the plugin's root directory:
1610

17-
```shell
18-
$ yarn install
11+
```bash
12+
npm install
1913
```
2014

21-
This will install all of the plugin's dependencies into the `node_modules` directory
22-
(and which is also why you'll find this directory in the plugin's `.gitignore` file).
15+
This will install all of the plugin's dependencies into the `node_modules` directory (which is also why you'll find this directory in the plugin's `.gitignore` file).
2316

24-
Once you have all the dependencies in place, you can rebuild the plugin from source
25-
by simply running `yarn build`:
17+
Once you have all the dependencies in place, you can rebuild the plugin from source by running `npm run build`:
2618

27-
```shell
28-
$ yarn build
29-
yarn run v1.22.17
30-
# $ grunt
31-
Running "clean:dist" (clean) task
32-
>> 3 paths cleaned.
19+
```bash
20+
npm run build
21+
```
22+
23+
This command will:
24+
25+
- Clean the `dist/` directory
26+
- Build both production (minified) and development versions
3327

34-
Running "jshint:files" (jshint) task
35-
>> 1 file lint free.
28+
### Development Workflow
3629

37-
Running "concat:dist" (concat) task
30+
For active development, you can use the watch mode to automatically rebuild when
31+
source files change:
32+
33+
```bash
34+
npm run dev
35+
```
36+
37+
### Testing
38+
39+
Run the test suite with:
40+
41+
```bash
42+
npm run test
43+
```
3844

39-
Running "uglify:dist" (uglify) task
40-
>> 1 file created 10.07 kB → 6.82 kB
45+
For watch mode during development:
4146

42-
Running "cssmin:minify" (cssmin) task
43-
>> 1 file created. 2.83 kB → 2.18 kB
47+
```bash
48+
npm run test:watch
49+
```
50+
51+
For test coverage:
52+
53+
```bash
54+
npm run test:coverage
55+
```
56+
57+
### Formatting and Linting
58+
59+
Format code with Prettier:
60+
61+
```bash
62+
npm run format
63+
```
4464

45-
Running "copy:images" (copy) task
46-
Copied 2 files
65+
Check code style with ESLint:
4766

48-
Done.
49-
✨ Done in 0.59s.
67+
```bash
68+
npm run lint
5069
```
5170

5271
## Releasing
5372

54-
1. update version in `bower.json` and `package.json`
73+
1. Update version in `package.json`
5574

5675
2. git commit, git push
5776

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenCage Geocoding Control for Leaflet
22

3-
A [Leaflet](http://leafletjs.com/) geocodig control that uses OpenCage's [geocoding API](https://opencagedata.com).
3+
A [Leaflet](http://leafletjs.com/) geocoding control that uses OpenCage's [geocoding API](https://opencagedata.com).
44

55
Check out a demo page in `/demo`. Or take a look at the live [demo](https://opencagedata.com/tutorials/geocode-in-leaflet).
66

@@ -31,7 +31,10 @@ require('leaflet-opencage-geocoding');
3131
For classic HTML projects, you can use the CDN:
3232

3333
```html
34-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/opencagedata/[email protected]/dist/css/L.Control.OpenCageGeocoding.min.css" />
34+
<link
35+
rel="stylesheet"
36+
href="https://cdn.jsdelivr.net/gh/opencagedata/[email protected]/dist/css/L.Control.OpenCageGeocoding.min.css"
37+
/>
3538
<script src="https://cdn.jsdelivr.net/gh/opencagedata/[email protected]/dist/js/L.Control.OpenCageGeocoding.min.js"></script>
3639
```
3740

@@ -40,7 +43,7 @@ For classic HTML projects, you can use the CDN:
4043
- Clone from GitHub: `[email protected]:opencagedata/leaflet-opencage-geocoding.git`
4144
- Download a [zip or tarball archive](https://github.com/opencagedata/leaflet-opencage-geocoding/tags)
4245

43-
## Usage
46+
## Usage
4447

4548
Load the plugin's CSS and JavaScript files:
4649

@@ -86,7 +89,7 @@ control.markGeocode = function (result) {
8689
};
8790
```
8891

89-
This will add a polygon representing the result's boundingbox when a result is selected.
92+
This will add a polygon representing the result's bounding box when a result is selected.
9093

9194
## Options
9295

0 commit comments

Comments
 (0)