Skip to content

Commit a7d93cf

Browse files
authored
Merge pull request #33 from OpenCageData/release/v2.1.0
Release v2.1.0
2 parents f82bf15 + 3c860ad commit a7d93cf

31 files changed

+6346
-2197
lines changed

.eslintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["eslint:recommended"],
8+
"parserOptions": {
9+
"ecmaVersion": 2021,
10+
"sourceType": "module"
11+
},
12+
"globals": {
13+
"L": "readonly",
14+
"describe": "readonly",
15+
"it": "readonly",
16+
"expect": "readonly",
17+
"beforeEach": "readonly",
18+
"afterEach": "readonly",
19+
"vi": "readonly"
20+
},
21+
"rules": {
22+
"no-unused-vars": "warn",
23+
"no-console": "warn",
24+
"prefer-const": "error",
25+
"no-var": "error"
26+
}
27+
}

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x, 22.x, 24.x]
16+
17+
steps:
18+
- uses: actions/checkout@v5
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v5
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linter
30+
run: npm run lint
31+
32+
- name: Run tests
33+
run: npm test
34+
35+
# - name: Run tests with coverage
36+
# run: npm run test:coverage
37+
38+
- name: Build
39+
run: npm run build
40+
41+
build:
42+
runs-on: ubuntu-latest
43+
needs: test
44+
45+
steps:
46+
- uses: actions/checkout@v5
47+
48+
- name: Use Node.js 22.x
49+
uses: actions/setup-node@v5
50+
with:
51+
node-version: 22.x
52+
cache: "npm"
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: Build
58+
run: npm run build
59+
60+
- name: Upload build artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: dist
64+
path: dist/

.gitignore

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
/.DS_Store
1+
# Dependencies
2+
node_modules
23

3-
/node_modules/
4+
# IDE - VSCode
5+
.vscode/*
6+
!.vscode/settings.json
7+
!.vscode/extensions.json
8+
9+
# Local env files
10+
.env
11+
.env.local
12+
13+
# Testing
14+
coverage
15+
coverage.json
16+
17+
# Debug
18+
npm-debug.log*
19+
20+
# Misc
21+
.DS_Store
22+
*.pem

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

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

Gruntfile.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

LICENSE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Copyright (c) 2020 OpenCage GmbH (https://opencagedata.com)
1+
Copyright (c) 2020-2025 OpenCage GmbH (https://opencagedata.com)
22

33
All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without modification,
66
are permitted provided that the following conditions are met:
77

88
1. Redistributions of source code must retain the above copyright notice, this
9-
list of conditions and the following disclaimer.
9+
list of conditions and the following disclaimer.
1010

1111
2. Redistributions in binary form must reproduce the above copyright notice, this
12-
list of conditions and the following disclaimer in the documentation and/or other
13-
materials provided with the distribution.
12+
list of conditions and the following disclaimer in the documentation and/or other
13+
materials provided with the distribution.
1414

1515
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1616
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

0 commit comments

Comments
 (0)