Skip to content

Commit 2fe81d8

Browse files
authored
Merge pull request #1599 from geoman-io/feat/upgrade-deps
2 parents d720305 + 64e8a19 commit 2fe81d8

File tree

20 files changed

+6214
-122
lines changed

20 files changed

+6214
-122
lines changed

.eslintrc

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

.github/workflows/nodejs.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,25 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- uses: pnpm/action-setup@v3
18-
with:
19-
version: 8
20-
2117
- name: Use Node.js 20.x
2218
uses: actions/setup-node@v4
2319
with:
2420
node-version: ${{ matrix.node-version }}
25-
cache: pnpm
26-
27-
- name: Get pnpm store directory
28-
shell: bash
29-
run: |
30-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
21+
cache: npm
3122

3223
- uses: actions/cache@v4
33-
name: Setup pnpm cache
24+
name: Setup npm cache
3425
with:
3526
path: |
36-
${{ env.STORE_PATH }}
27+
~/.npm
3728
/home/runner/.cache/Cypress
38-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
3930
restore-keys: |
40-
${{ runner.os }}-pnpm-store-
31+
${{ runner.os }}-npm-
4132
4233
- name: Install dependencies
43-
run: pnpm install --frozen-lockfile --store-dir ${{ env.STORE_PATH }}
44-
- run: pnpm run build
45-
- run: pnpm test
34+
run: npm ci
35+
- run: npm run build
36+
- run: npm test
4637
env:
4738
CI: true

.github/workflows/release.yml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ on:
77
- 'v*.*.*'
88

99
permissions:
10+
id-token: write
1011
contents: write
1112

1213
env:
1314
FILE_NAME_PREFIX: geoman-io-leaflet-geoman
14-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1515

1616
jobs:
1717
build:
@@ -37,34 +37,29 @@ jobs:
3737
exit 1
3838
fi
3939
40-
- uses: pnpm/action-setup@v3
41-
with:
42-
version: 8
43-
4440
- name: Use Node.js 20.x
4541
uses: actions/setup-node@v4
4642
with:
4743
node-version: 20.x
48-
cache: pnpm
49-
50-
- name: Get pnpm store directory
51-
shell: bash
52-
run: |
53-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
44+
cache: npm
45+
registry-url: 'https://registry.npmjs.org'
5446

5547
- uses: actions/cache@v4
56-
name: Setup pnpm cache
48+
name: Setup npm cache
5749
with:
58-
path: ${{ env.STORE_PATH }}
59-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
50+
path: ~/.npm
51+
key: ${{ runner.os }}-npm-store-${{ hashFiles('**/package-lock.json') }}
6052
restore-keys: |
61-
${{ runner.os }}-pnpm-store-
53+
${{ runner.os }}-npm-store-
54+
55+
- name: Update npm
56+
run: npm install -g npm@latest
6257

6358
- name: Install dependencies
64-
run: pnpm install --frozen-lockfile --store-dir ${{ env.STORE_PATH }}
59+
run: npm ci
6560

6661
- name: Prepare package
67-
run: pnpm pack
62+
run: npm pack
6863

6964
- name: Release
7065
uses: softprops/action-gh-release@v1
@@ -77,17 +72,7 @@ jobs:
7772
LICENSE
7873
7974
- name: Publish to NPM
80-
shell: bash
81-
run: |
82-
#!/bin/bash
83-
84-
# Set npm configurations
85-
pnpm config set shamefully-hoist true
86-
pnpm config set strict-peer-dependencies false
87-
88-
# Set auth token
89-
pnpm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
90-
pnpm publish --no-git-checks
75+
run: npm publish --no-git-checks
9176

9277
- name: Merge changes from develop into master
9378
# Only run when a tag triggers the workflow

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ npm-debug.log
55
/.idea/
66
/dist/
77
\.source*
8+
/cypress/downloads
89
/cypress/screenshots
910
/cypress/videos
1011
.eslintcache

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.5.1
1+
v22.11.0

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 20.5.1
1+
nodejs 22.11.0

bundle.mjs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const plugins = [{
1010
const message = errors.length === 0 && warnings.length === 0
1111
? 'Build completed.'
1212
: `Build completed with ${errors.length} error(s) and ${warnings.length} warning(s).`;
13-
console.log(`[BUILD #${count.toString().padStart(3, '0')}]:`, message); });
13+
console.log(`[BUILD #${count.toString().padStart(3, '0')}]:`, message);
14+
});
1415
},
1516
}];
1617

@@ -20,7 +21,8 @@ const buildOptions = {
2021
loader: {
2122
'.js': 'jsx',
2223
'.css': 'css',
23-
'.svg': 'dataurl' },
24+
'.svg': 'dataurl'
25+
},
2426
minify: true,
2527
outfile: './dist/leaflet-geoman.js',
2628
sourcemap: true,
@@ -32,19 +34,19 @@ if (process.env.DEV) {
3234
// Watch in dev mode
3335
await ctx.watch();
3436
console.log('watching...');
35-
const { host, port } = await ctx.serve({
36-
port: 5500,
37-
servedir: '.',
38-
fallback: "./index.html"
39-
});
40-
console.log(`Serving app at http://${host}:${port}/demo`);
37+
const { host, port } = await ctx.serve({
38+
port: 5500,
39+
servedir: '.',
40+
fallback: "./index.html"
41+
});
42+
console.log(`Serving app at http://${host || 'localhost'}:${port}/demo`);
4143
} else {
4244
// Clean /dist folder
4345
fs.rmSync("./dist", { recursive: true, force: true });
4446

4547
// Build
4648
await ctx.rebuild();
47-
49+
4850
// Dispose context
4951
ctx.dispose();
5052

demo/customcontrols.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-console */
2-
/* eslint-disable no-alert */
31
const map = L.map('map').setView([40.0269319, 32.83604819], 13);
42

53
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {

demo/demo-canvas.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
const tiles1 = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
32
maxZoom: 19,
43
attribution:

demo/demo.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
const tiles1 = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
32
maxZoom: 19,
43
attribution:
@@ -50,7 +49,6 @@ const m1 = L.circleMarker([51.50313, -0.091223], { radius: 10 });
5049
const m2 = L.marker([51.50614, -0.0989]);
5150
const m3 = L.marker([51.50915, -0.096112], { pmIgnore: true });
5251

53-
// eslint-disable-next-line no-unused-vars
5452
const mGroup = L.layerGroup([m1, m2, m3]).addTo(map2);
5553
// mGroup.pm.enable();
5654

0 commit comments

Comments
 (0)