Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
wipfli committed Jan 21, 2025
2 parents f9c8b40 + cd7d607 commit 63ae6ac
Show file tree
Hide file tree
Showing 41 changed files with 9,286 additions and 8,111 deletions.
46 changes: 0 additions & 46 deletions .eslintrc

This file was deleted.

13 changes: 8 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
open-pull-requests-limit: 2
open-pull-requests-limit: 20
versioning-strategy: increase
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 2
versioning-strategy: increase
26 changes: 26 additions & 0 deletions .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Automerge Dependabot

on: pull_request

permissions: write-all

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve Dependabot PRs
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
start: npm run start
browser: ${{ matrix.browser }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
files: ${{ github.workspace }}/.nyc_output/out.json
verbose: true
2 changes: 1 addition & 1 deletion .github/workflows/create-bump-version-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
./build/bump-version-changelog.js ${{ inputs.version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
commit-message: Bump version to ${{ inputs.version }}
branch: bump-version-to-${{ inputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: npm run build

- name: Upload to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19
22.13
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- Add scheme type options for vector/raster tile
- Add `tileSize` field for raster and raster-dem tile sources
- Update Protomaps Light gallery style to v4
- Add support to edit local files on the file system if supported by the browser
- Upgrade to MapLibre LG JS v5
- Upgrade Vite 6 and Cypress 14 ([#970](https://github.com/maplibre/maputnik/pull/970))
- Upgrade OpenLayers from v6 to v10
- _...Add new stuff here..._

### 🐞 Bug fixes

- Fix incorrect handing of network error response (#944)
- _...Add new stuff here..._

## 2.1.1
Expand Down
11 changes: 5 additions & 6 deletions build/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ const changelog = fs.readFileSync(changelogPath, 'utf8');
*/
const regex = /^## (\d+\.\d+\.\d+.*?)\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;

let releaseNotes = [];
const releaseNotes = [];
let match;
// eslint-disable-next-line no-cond-assign
while (match = regex.exec(changelog)) {
releaseNotes.push({
'version': match[1],
'changelog': match[2].trim(),
});
releaseNotes.push({
'version': match[1],
'changelog': match[2].trim(),
});
}

const latest = releaseNotes[0];
Expand All @@ -44,5 +44,4 @@ const templatedReleaseNotes = `${header}
${latest.changelog}`;

// eslint-disable-next-line eol-last
process.stdout.write(templatedReleaseNotes.trimEnd());
2 changes: 1 addition & 1 deletion cypress/e2e/accessibility.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MaputnikDriver } from "./maputnik-driver";

describe("accessibility", () => {
let { beforeAndAfter, get, when, then } = new MaputnikDriver();
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
beforeAndAfter();

describe("skip links", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/history.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MaputnikDriver } from "./maputnik-driver";

describe("history", () => {
let { beforeAndAfter, when, get, then } = new MaputnikDriver();
const { beforeAndAfter, when, get, then } = new MaputnikDriver();
beforeAndAfter();

let undoKeyCombo: string;
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/i18n.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MaputnikDriver } from "./maputnik-driver";

describe("i18n", () => {
let { beforeAndAfter, get, when, then } = new MaputnikDriver();
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
beforeAndAfter();

describe("language detector", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/keyboard.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MaputnikDriver } from "./maputnik-driver";

describe("keyboard", () => {
let { beforeAndAfter, given, when, get, then } = new MaputnikDriver();
const { beforeAndAfter, given, when, get, then } = new MaputnikDriver();
beforeAndAfter();
describe("shortcuts", () => {
beforeEach(() => {
Expand Down
28 changes: 14 additions & 14 deletions cypress/e2e/layers.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { v1 as uuid } from "uuid";
import { MaputnikDriver } from "./maputnik-driver";

describe("layers", () => {
let { beforeAndAfter, get, when, then } = new MaputnikDriver();
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
beforeAndAfter();
beforeEach(() => {
when.setStyle("both");
Expand Down Expand Up @@ -101,7 +101,7 @@ describe("layers", () => {
});
describe("background", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "background",
});
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
Expand All @@ -117,7 +117,7 @@ describe("layers", () => {
describe("modify", () => {
function createBackground() {
// Setup
let id = uuid();
const id = uuid();

when.selectWithin("add-layer.layer-type", "background");
when.setValue("add-layer.layer-id.input", "background:" + id);
Expand All @@ -139,11 +139,11 @@ describe("layers", () => {
describe("layer", () => {
it("expand/collapse");
it("id", () => {
let bgId = createBackground();
const bgId = createBackground();

when.click("layer-list-item:background:" + bgId);

let id = uuid();
const id = uuid();
when.setValue("layer-editor.layer-id.input", "foobar:" + id);
when.click("min-zoom");

Expand Down Expand Up @@ -219,7 +219,7 @@ describe("layers", () => {

describe("comments", () => {
let bgId: string;
let comment = "42";
const comment = "42";

beforeEach(() => {
bgId = createBackground();
Expand Down Expand Up @@ -320,11 +320,11 @@ describe("layers", () => {

// TODO
it.skip("parse error", () => {
let bgId = createBackground();
const bgId = createBackground();

when.click("layer-list-item:background:" + bgId);

let errorSelector = ".CodeMirror-lint-marker-error";
const errorSelector = ".CodeMirror-lint-marker-error";
then(get.elementByTestId(errorSelector)).shouldNotExist();

when.click(".CodeMirror");
Expand All @@ -339,7 +339,7 @@ describe("layers", () => {

describe("fill", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "fill",
layer: "example",
});
Expand All @@ -361,7 +361,7 @@ describe("layers", () => {

describe("line", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "line",
layer: "example",
});
Expand All @@ -385,7 +385,7 @@ describe("layers", () => {

describe("symbol", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "symbol",
layer: "example",
});
Expand All @@ -404,7 +404,7 @@ describe("layers", () => {

describe("raster", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "raster",
layer: "raster",
});
Expand All @@ -423,7 +423,7 @@ describe("layers", () => {

describe("circle", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "circle",
layer: "example",
});
Expand All @@ -442,7 +442,7 @@ describe("layers", () => {

describe("fill extrusion", () => {
it("add", () => {
let id = when.modal.fillLayers({
const id = when.modal.fillLayers({
type: "fill-extrusion",
layer: "example",
});
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/map.cy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { MaputnikDriver } from "./maputnik-driver";

describe("map", () => {
let { beforeAndAfter, get, when, then } = new MaputnikDriver();
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
beforeAndAfter();
describe("zoom level", () => {
it("via url", () => {
let zoomLevel = 12.37;
const zoomLevel = 12.37;
when.setStyle("geojson", zoomLevel);
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldContainText(
Expand All @@ -14,7 +14,7 @@ describe("map", () => {
});

it("via map controls", () => {
let zoomLevel = 12.37;
const zoomLevel = 12.37;
when.setStyle("geojson", zoomLevel);
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
when.clickZoomIn();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/modal-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default class ModalDriver {
fillLayers: (opts: { type: string; layer?: string; id?: string }) => {
// Having logic in test code is an anti pattern.
// This should be splitted to multiple single responsibility functions
let type = opts.type;
let layer = opts.layer;
const type = opts.type;
const layer = opts.layer;
let id;
if (opts.id) {
id = opts.id;
Expand Down
Loading

0 comments on commit 63ae6ac

Please sign in to comment.