Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates esbuild to 8.56, prettier to 3.2.4 and fixes lint config (1444) and swap to esbuild #1445

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"L": true,
"window": true,
"document": true
}
},
"ignorePatterns": [
"cypress/libs"
]
}
39 changes: 39 additions & 0 deletions bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const esbuild = require('esbuild');
const path = require('path');
const fs = require('fs');

// Define the entry point
const entryPoint = './src/js/L.PM.js';

// Define the output directory
const outdir = path.resolve(__dirname, 'dist');
fs.mkdirSync(outdir, { recursive: true });

// Define an async function to handle the build
async function build() {
try {
await esbuild.build({
entryPoints: [entryPoint],
bundle: true,
minify: true,
sourcemap: false,
outdir,
loader: {
'.js': 'jsx',
'.css': 'css',
'.svg': 'dataurl',
},
});

// Copy the leaflet-geoman.d.ts file
fs.copyFileSync('leaflet-geoman.d.ts', path.join(outdir, 'leaflet-geoman.d.ts'));
fs.renameSync(path.join(outdir, 'L.PM.js'), path.join(outdir, 'leaflet-geoman.min.js'));
fs.renameSync(path.join(outdir, 'L.PM.css'), path.join(outdir, 'leaflet-geoman.css'));
} catch (error) {
console.error(error);
process.exit(1);
}
}

// Call the build function
build();
10 changes: 4 additions & 6 deletions cypress/integration/polygon.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,8 @@ describe('Draw & Edit Poly', () => {
onStop() {
expect(poly.pm.hasSelfIntersection()).to.equal(true);

const toucherSelfIntersectionFalse = handSelfIntersectionFalse.growFinger(
'mouse'
);
const toucherSelfIntersectionFalse =
handSelfIntersectionFalse.growFinger('mouse');
toucherSelfIntersectionFalse
.wait(100)
.moveTo(504, 337, 100)
Expand All @@ -744,9 +743,8 @@ describe('Draw & Edit Poly', () => {
allowSelfIntersectionEdit: true,
});

const toucherSelfIntersectionTrue = handSelfIntersectionTrue.growFinger(
'mouse'
);
const toucherSelfIntersectionTrue =
handSelfIntersectionTrue.growFinger('mouse');
toucherSelfIntersectionTrue
.wait(100)
.moveTo(294, 114, 100)
Expand Down
2 changes: 1 addition & 1 deletion demo/demo-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const geoJsonData = {
coordinates: [
[
[-0.15483856201171872, 51.527329038465936],
[-0.16977310180664062, 51.51643437722083],
[-0.1697731018066406, 51.51643437722083],
[-0.15964508056640625, 51.50094238217541],
[-0.13149261474609375, 51.5042549065934],
[-0.11758804321289061, 51.518463972439385],
Expand Down
Loading
Loading