Skip to content

Commit 6437009

Browse files
authored
Merge pull request #1 from radical-data/svelte-5
Upgrade tooling and refactor
2 parents 858a0e5 + 3b5f1e4 commit 6437009

25 files changed

+3589
-230
lines changed

.eslintignore

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

.eslintrc.cjs

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

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: pnpm/action-setup@v4
11+
with:
12+
version: 10
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: '20'
16+
cache: 'pnpm'
17+
- name: Install deps
18+
run: pnpm install
19+
- name: Lint + typecheck + build + test
20+
run: pnpm lint && pnpm check && pnpm build && pnpm test

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ node_modules
88
!.env.example
99
vite.config.js.timestamp-*
1010
vite.config.ts.timestamp-*
11+
test-results/
12+
.netlify
13+
repomix.config.json
14+
.repomixignore
15+
repomix-output.xml

.husky/pre-commit

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

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"trailingComma": "none",
55
"printWidth": 100,
66
"plugins": ["prettier-plugin-svelte"],
7-
"pluginSearchDirs": ["."],
87
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
98
}

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,39 @@
22

33
Web app to reduce the size of GeoJSON files.
44

5+
## How This Tool Reduces GeoJSON
6+
7+
This tool reduces GeoJSON file sizes through two main techniques:
8+
9+
### 1. Coordinate Precision Truncation
10+
11+
Coordinates in GeoJSON files often have excessive decimal places (e.g., `1.123456789`). For most web mapping applications, 6 decimal places (~0.1 meters accuracy) is more than sufficient. This tool truncates coordinates to your specified precision, significantly reducing file size.
12+
13+
### 2. Property Filtering
14+
15+
GeoJSON features often contain many properties that aren't needed for display. You can select only the properties you need, removing unnecessary data.
16+
517
## Developing
618

7-
1. Install dependencies: `bun install`
8-
1. Run: `bun run dev`
19+
1. Install dependencies: `pnpm install`
20+
2. Run dev server: `pnpm dev`
21+
3. Run tests: `pnpm test`
22+
4. Run checks: `pnpm check && pnpm lint`
923

1024
## Building
1125

1226
To create a production version:
1327

1428
```bash
15-
bun run build
16-
```
29+
pnpm build
30+
```
31+
32+
## Testing
33+
34+
```bash
35+
# Run tests once
36+
pnpm test
37+
38+
# Watch mode
39+
pnpm test:watch
40+
```

bun.lockb

-94.6 KB
Binary file not shown.

eslint.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import js from '@eslint/js';
2+
import ts from 'typescript-eslint';
3+
import svelte from 'eslint-plugin-svelte';
4+
import prettier from 'eslint-config-prettier';
5+
import globals from 'globals';
6+
7+
/** @type {import('eslint').Linter.Config[]} */
8+
export default [
9+
{
10+
ignores: [
11+
'build/',
12+
'.svelte-kit/',
13+
'dist/',
14+
'node_modules/',
15+
'.netlify/',
16+
'test-results/',
17+
'playwright-report/'
18+
]
19+
},
20+
js.configs.recommended,
21+
...ts.configs.recommended,
22+
...svelte.configs['flat/recommended'],
23+
prettier,
24+
...svelte.configs['flat/prettier'],
25+
{
26+
languageOptions: {
27+
globals: {
28+
...globals.browser,
29+
...globals.node
30+
}
31+
}
32+
},
33+
{
34+
files: ['**/*.svelte'],
35+
languageOptions: {
36+
parserOptions: {
37+
parser: ts.parser
38+
}
39+
}
40+
},
41+
{
42+
files: ['src/app.d.ts'],
43+
rules: {
44+
'@typescript-eslint/no-explicit-any': 'off'
45+
}
46+
}
47+
];

package.json

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
11
{
2-
"name": "reducegeojson",
3-
"version": "0.0.1",
4-
"private": true,
5-
"scripts": {
6-
"dev": "vite dev",
7-
"build": "vite build",
8-
"preview": "vite preview",
9-
"test": "playwright test",
10-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12-
"lint": "prettier --plugin-search-dir . --check . && eslint .",
13-
"format": "prettier --plugin-search-dir . --write ."
14-
},
15-
"devDependencies": {
16-
"@playwright/test": "^1.28.1",
17-
"@sveltejs/adapter-auto": "^2.0.0",
18-
"@sveltejs/adapter-netlify": "^2.0.8",
19-
"@sveltejs/kit": "^1.20.4",
20-
"@typescript-eslint/eslint-plugin": "^6.0.0",
21-
"@typescript-eslint/parser": "^6.0.0",
22-
"bun-types": "^1.0.7",
23-
"eslint": "^8.28.0",
24-
"eslint-config-prettier": "^8.5.0",
25-
"eslint-plugin-svelte": "^2.30.0",
26-
"prettier": "^2.8.0",
27-
"prettier-plugin-svelte": "^2.10.1",
28-
"svelte": "^4.0.5",
29-
"svelte-check": "^3.4.3",
30-
"tslib": "^2.4.1",
31-
"typescript": "^5.0.0",
32-
"vite": "^4.4.2"
33-
},
34-
"type": "module",
35-
"dependencies": {
36-
"@turf/truncate": "^6.5.0",
37-
"@types/geojson": "^7946.0.12"
38-
}
2+
"name": "reducegeojson",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite dev",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"test": "vitest run",
10+
"test:watch": "vitest",
11+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13+
"lint": "prettier --check . && eslint .",
14+
"format": "prettier --write .",
15+
"prepare": "husky"
16+
},
17+
"lint-staged": {
18+
"*.{js,ts,svelte,css,md,json}": [
19+
"prettier --write",
20+
"eslint --fix"
21+
]
22+
},
23+
"devDependencies": {
24+
"@eslint/js": "^9.39.1",
25+
"@sveltejs/adapter-netlify": "^5.2.4",
26+
"@sveltejs/kit": "^2.20.3",
27+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
28+
"eslint": "^9.39.1",
29+
"eslint-config-prettier": "^10.1.8",
30+
"eslint-plugin-svelte": "^3.13.0",
31+
"globals": "^15.14.0",
32+
"husky": "^9.1.7",
33+
"lint-staged": "^16.2.7",
34+
"prettier": "^3.4.2",
35+
"prettier-plugin-svelte": "^3.3.3",
36+
"svelte": "^5.43.6",
37+
"svelte-check": "^4.2.6",
38+
"tslib": "^2.8.1",
39+
"typescript": "^5.7.2",
40+
"typescript-eslint": "^8.46.4",
41+
"vite": "^7.2.2",
42+
"vitest": "^2.1.8"
43+
},
44+
"type": "module",
45+
"dependencies": {
46+
"@turf/truncate": "^7.2.0",
47+
"@types/geojson": "^7946.0.14"
48+
}
3949
}

0 commit comments

Comments
 (0)