@unvt/charites 2.1.5 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.dockerignore ADDED
@@ -0,0 +1,92 @@
1
+ .envrc
2
+
3
+ # Logs
4
+ logs
5
+ *.log
6
+ npm-debug.log*
7
+ yarn-debug.log*
8
+ yarn-error.log*
9
+
10
+ # Runtime data
11
+ pids
12
+ *.pid
13
+ *.seed
14
+ *.pid.lock
15
+
16
+ # Directory for instrumented libs generated by jscoverage/JSCover
17
+ lib-cov
18
+
19
+ # Coverage directory used by tools like istanbul
20
+ coverage
21
+
22
+ # nyc test coverage
23
+ .nyc_output
24
+
25
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26
+ .grunt
27
+
28
+ # Bower dependency directory (https://bower.io/)
29
+ bower_components
30
+
31
+ # node-waf configuration
32
+ .lock-wscript
33
+
34
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
35
+ build/Release
36
+
37
+ # Dependency directories
38
+ node_modules/
39
+ jspm_packages/
40
+ src/referers.json
41
+
42
+ # TypeScript v1 declaration files
43
+ typings/
44
+
45
+ # Optional npm cache directory
46
+ .npm
47
+
48
+ # Optional eslint cache
49
+ .eslintcache
50
+
51
+ # Optional REPL history
52
+ .node_repl_history
53
+
54
+ # Output of 'npm pack'
55
+ *.tgz
56
+
57
+ # Yarn Integrity file
58
+ .yarn-integrity
59
+
60
+ # dotenv environment variables file
61
+ .env
62
+
63
+ # parcel-bundler cache (https://parceljs.org/)
64
+ .cache
65
+
66
+ # next.js build output
67
+ .next
68
+
69
+ # nuxt.js build output
70
+ .nuxt
71
+
72
+ # vuepress build output
73
+ .vuepress/dist
74
+
75
+ # Serverless directories
76
+ .serverless
77
+
78
+ test-results/
79
+
80
+
81
+ .github/
82
+ .devcontainer/
83
+ docs/
84
+ test/
85
+ .gitignore
86
+ .mocharc.json
87
+ .prettierrc.cjs
88
+ eslint.config.mjs
89
+ mocha-register.cjs
90
+ playwright.config.ts
91
+ README.md
92
+ .all-contributorsrc
@@ -12,6 +12,10 @@ on:
12
12
  branches:
13
13
  - main
14
14
 
15
+ permissions:
16
+ id-token: write # Required for OIDC
17
+ contents: read
18
+
15
19
  jobs:
16
20
  build:
17
21
  strategy:
@@ -60,16 +64,15 @@ jobs:
60
64
  needs: build
61
65
  if: startsWith(github.ref, 'refs/tags/v')
62
66
  steps:
63
- - uses: actions/checkout@v3
67
+ - uses: actions/checkout@v4
64
68
  # Setup .npmrc file to publish to npm
65
- - uses: actions/setup-node@v3
69
+ - uses: actions/setup-node@v4
66
70
  with:
67
71
  tag_name: 'v%s'
68
72
  node-version: '22.x'
69
73
  registry-url: 'https://registry.npmjs.org'
70
74
  scope: '@unvt'
75
+ - run: npm install -g npm@latest
71
76
  - run: npm install
72
77
  - run: npm run build
73
78
  - run: npm publish --access=public
74
- env:
75
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/Dockerfile ADDED
@@ -0,0 +1,9 @@
1
+ FROM node:24-slim
2
+
3
+ WORKDIR /app
4
+ COPY package*.json .
5
+ RUN npm install
6
+ COPY . .
7
+ RUN npm run build
8
+ RUN chmod +x /app/docker-entrypoint.sh
9
+ ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
package/README.md CHANGED
@@ -33,6 +33,25 @@ MIT
33
33
 
34
34
  - Node.js v20 or later
35
35
 
36
+ ## Docker
37
+
38
+ Build the Docker image:
39
+
40
+ ```bash
41
+ docker build -t charites:latest .
42
+ ```
43
+
44
+ Run charites commands in Docker:
45
+
46
+ ```bash
47
+ docker run --rm -v $(pwd):/data -u $(id -u):$(id -g) charites:latest init /data/my-style.yml
48
+ docker run --rm -v $(pwd):/data -u $(id -u):$(id -g) charites:latest convert /data/style.json /data/style.yml
49
+ docker run --rm -v $(pwd):/data -u $(id -u):$(id -g) charites:latest build /data/style.yml /data/style.json
50
+ docker run --init -it --rm -p 8080:8080 -v $(pwd):/data charites:latest serve /data/style.yml
51
+ ```
52
+
53
+ Note: `charites serve` requires running as root user because it needs to rebuild vite server inside the container.
54
+
36
55
  ## Contributors ✨
37
56
 
38
57
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
package/dist/cli/serve.js CHANGED
@@ -35,6 +35,7 @@ async function startProviderDevServer(options) {
35
35
  const config = {
36
36
  root: path.resolve(__dirname, '../../provider'),
37
37
  server: {
38
+ host: '0.0.0.0',
38
39
  port: parseInt(options.vitePort ?? '5137'),
39
40
  },
40
41
  };
@@ -169,7 +169,7 @@ export async function serve(source, options) {
169
169
  sockets.delete(ws);
170
170
  });
171
171
  });
172
- process.on('SIGINT', () => {
172
+ const cleanUpAndExit = () => {
173
173
  console.log('Cleaning up...');
174
174
  server.close();
175
175
  watcher.close();
@@ -178,6 +178,8 @@ export async function serve(source, options) {
178
178
  spriteOut = undefined;
179
179
  }
180
180
  process.exit(0);
181
- });
181
+ };
182
+ process.on('SIGINT', cleanUpAndExit);
183
+ process.on('SIGTERM', cleanUpAndExit);
182
184
  return server;
183
185
  }
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ # Run the application
5
+ exec npm run command -- "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvt/charites",
3
- "version": "2.1.5",
3
+ "version": "2.1.10",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "charites": "dist/cli.js"
@@ -17,53 +17,56 @@
17
17
  "workspaces": [
18
18
  "provider"
19
19
  ],
20
+ "repository": {
21
+ "url": "https://github.com/unvt/charites"
22
+ },
20
23
  "author": "",
21
24
  "license": "MIT",
22
25
  "dependencies": {
23
- "@maplibre/maplibre-gl-inspect": "^1.7.1",
24
- "@maplibre/maplibre-gl-style-spec": "^23.3.0",
26
+ "@maplibre/maplibre-gl-inspect": "^1.8.1",
27
+ "@maplibre/maplibre-gl-style-spec": "^24.3.1",
25
28
  "@unvt/sprite-one": "^0.1.1",
26
- "@watergis/maplibre-gl-legend": "^2.0.5",
27
- "commander": "^14.0.0",
28
- "glob": "^11.0.2",
29
+ "@watergis/maplibre-gl-legend": "^2.0.6",
30
+ "commander": "^14.0.2",
31
+ "glob": "^13.0.0",
29
32
  "jsonminify": "^0.4.2",
30
- "maplibre-gl": "^5.5.0",
33
+ "maplibre-gl": "^5.14.0",
31
34
  "node-watch": "^0.7.4",
32
- "open": "^10.1.2",
35
+ "open": "^11.0.0",
33
36
  "pmtiles": "^4.3.0",
34
- "vite": "^6.3.5",
35
- "ws": "^8.18.2",
36
- "yaml": "^2.8.0"
37
+ "vite": "^7.2.7",
38
+ "ws": "^8.18.3",
39
+ "yaml": "^2.8.2"
37
40
  },
38
41
  "devDependencies": {
39
- "@eslint/eslintrc": "^3.3.1",
40
- "@eslint/js": "^9.27.0",
41
- "@playwright/test": "^1.52.0",
42
- "@types/chai": "^5.2.2",
42
+ "@eslint/eslintrc": "^3.3.3",
43
+ "@eslint/js": "^9.39.1",
44
+ "@playwright/test": "^1.57.0",
45
+ "@types/chai": "^5.2.3",
43
46
  "@types/chai-as-promised": "^8.0.2",
44
47
  "@types/fs-extra": "^11.0.4",
45
48
  "@types/geojson": "^7946.0.16",
46
49
  "@types/jsonminify": "^0.4.3",
47
50
  "@types/mapbox__point-geometry": "^0.1.4",
48
51
  "@types/mocha": "^10.0.10",
49
- "@types/node": "^22.15.19",
52
+ "@types/node": "^24.10.1",
50
53
  "@types/ws": "^8.18.1",
51
- "@typescript-eslint/eslint-plugin": "^8.32.1",
52
- "@typescript-eslint/parser": "^8.32.1",
53
- "chai": "^5.2.0",
54
- "chai-as-promised": "^8.0.1",
55
- "eslint": "^9.27.0",
56
- "eslint-config-prettier": "^10.1.5",
57
- "eslint-plugin-prettier": "^5.4.0",
58
- "fs-extra": "^11.3.0",
54
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
55
+ "@typescript-eslint/parser": "^8.48.1",
56
+ "chai": "^6.2.1",
57
+ "chai-as-promised": "^8.0.2",
58
+ "eslint": "^9.39.1",
59
+ "eslint-config-prettier": "^10.1.8",
60
+ "eslint-plugin-prettier": "^5.5.4",
61
+ "fs-extra": "^11.3.2",
59
62
  "kill-port-process": "^3.2.1",
60
- "mocha": "^11.4.0",
63
+ "mocha": "^11.7.5",
61
64
  "node-abort-controller": "^3.1.1",
62
- "prettier": "^3.5.3",
65
+ "prettier": "^3.7.4",
63
66
  "ts-node": "^10.9.2",
64
67
  "tsconfig-paths": "^4.2.0",
65
- "tsx": "^4.19.4",
66
- "typescript": "^5.8.3"
68
+ "tsx": "^4.21.0",
69
+ "typescript": "^5.9.3"
67
70
  },
68
71
  "type": "module"
69
72
  }
@@ -5,6 +5,7 @@ import {
5
5
  NavigationControl,
6
6
  addProtocol,
7
7
  IControl,
8
+ GlobeControl,
8
9
  } from 'maplibre-gl'
9
10
  import 'maplibre-gl/dist/maplibre-gl.css'
10
11
  import '@maplibre/maplibre-gl-inspect/dist/maplibre-gl-inspect.css'
@@ -131,6 +132,7 @@ const init = async () => {
131
132
  }),
132
133
  )
133
134
  map.addControl(new NavigationControl(), 'top-right')
135
+ map.addControl(new GlobeControl(), 'top-right')
134
136
  map.addControl(
135
137
  new MaplibreLegendControl(
136
138
  {},
package/src/cli/serve.ts CHANGED
@@ -39,6 +39,7 @@ async function startProviderDevServer(options: serveOptions) {
39
39
  const config: InlineConfig = {
40
40
  root: path.resolve(__dirname, '../../provider'),
41
41
  server: {
42
+ host: '0.0.0.0',
42
43
  port: parseInt(options.vitePort ?? '5137'),
43
44
  },
44
45
  }
@@ -201,7 +201,7 @@ export async function serve(source: string, options: serveOptions) {
201
201
  })
202
202
  })
203
203
 
204
- process.on('SIGINT', () => {
204
+ const cleanUpAndExit = () => {
205
205
  console.log('Cleaning up...')
206
206
  server.close()
207
207
  watcher.close()
@@ -210,7 +210,10 @@ export async function serve(source: string, options: serveOptions) {
210
210
  spriteOut = undefined
211
211
  }
212
212
  process.exit(0)
213
- })
213
+ }
214
+
215
+ process.on('SIGINT', cleanUpAndExit)
216
+ process.on('SIGTERM', cleanUpAndExit)
214
217
 
215
218
  return server
216
219
  }