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

Charites v2: Drop support providers, rewrite all to esm module #178

Merged
merged 12 commits into from
Sep 5, 2024

Conversation

smellman
Copy link
Contributor

@smellman smellman commented Jul 27, 2024

Thank you for submitting a pull request!

Description

Please describe what you changed briefly.

  • Drop support Mapbox and use current MapLibre Style Spec
  • Rewrite all module to esm
  • Use eslint 9.x

Type of Pull Request

  • Adding a feature
  • Fixing a bug
  • Maintaining documents
  • Others ()

Verify the followings

  • Code is up-to-date with the main branch
  • No build errors after npm run build
  • No lint errors after npm run lint
  • No errors on using charites help globally
  • Make sure all the existing features working well
  • Have you added at least one unit test if you are going to add new feature?
  • Have you updated documentation?

Refer to CONTRIBUTING.MD for more details.

@smellman smellman self-assigned this Jul 27, 2024
@smellman smellman mentioned this pull request Jul 27, 2024
11 tasks
@JinIgarashi
Copy link
Member

@smellman I would suggest you split this PR into two:

  • drop mapbox supports;
  • And all other changes.

dropping mapbox support can be a breaking change, it would be nice if you can make a PR which only focus on that. You can increase a major version after removing mapbox if we follow semantic versioning

@smellman
Copy link
Contributor Author

My main motivation is convert to ESM module from CommonJS and support MapLibre v4, so dropping mapbox support is related of this.

@smellman smellman changed the title Drop support Mapbox, rewrite all to esm module, use yaml-import instead of yaml-include Charites v2: Drop support Mapbox, rewrite all to esm module, use yaml-import instead of yaml-include Jul 29, 2024
@smellman
Copy link
Contributor Author

smellman commented Aug 22, 2024

  • idea: Create migration command from 0.5.4 to 2.0.0/1.0.0.
    Thanks you @keichan34

@smellman smellman changed the title Charites v2: Drop support Mapbox, rewrite all to esm module, use yaml-import instead of yaml-include Charites v2: Drop support Mapbox, rewrite all to esm module Aug 22, 2024
@smellman smellman requested a review from keichan34 August 22, 2024 23:21
@smellman smellman marked this pull request as ready for review August 22, 2024 23:22
Copy link
Member

@JinIgarashi JinIgarashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smellman I commented two things.

furtheremore, is it possible to switch to vite/vitest for better development experience?

@@ -1,6 +1,6 @@
{
"name": "@unvt/charites",
"version": "0.5.4",
"version": "2.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"version": "2.0.0",
"version": "1.0.0",

let's follow semantic versioning and increase a major version since it has breaking changes instead of skipping a version to v2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will release v1.0.0 after this release.

see: #170 (comment) this comment.

@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test'
import { test, expect } from '@playwright/test/index.mjs'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about dropping support to geolonia too, and make charites only focus on maplibre?

It does not make sense to me to remove mapbox and keep geolonia.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care about it because Geolonia still uses Charites.

How about you in this comment? > @keichan34 @naogify

Copy link
Member

@JinIgarashi JinIgarashi Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smellman There are possible 4 cases:

  1. geolonia is compatible with maplibre, but not mapbox.
  2. geolonia is compatible with mapbox, but not maplibre.
  3. geolonia is compatible with both mapbox and maplibre
  4. geolonia is not compatible with either mapbox or maplibre.

If it is case 1, it does not need to support geolonia. they can use charites as maplibre. No need to differentiate geolonia and maplibre. it is same thing.
if it is case 2, geolonia should be removed since mapbox is removed in this PR.
If it is case 3, geolonia can be removed from charites, but functionality is limited (not supporting mapbox featuer).
If it is case 4, it requires more efforts on third parties to support incompatible map library with maplibre.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JinIgarashi geolonia is an extension of maplibre, so that probably falls under case 1 (the parts we add are not really around styling). I'll double check our workflows to see if relying on vanilla maplibre works for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keichan34 @smellman if geolonia has no difference with maplibre in terms of style specification, I don't think dropping geolonia cause problems. geolonia can use maplibre in charites to style it. the same style from charites should work for geolonia as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keichan34 How about current status? I want to release until Sunday.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smellman Sorry about the late response. Yeah, let's drop geolonia. That leaves just maplibre, so I guess we can get rid of the provider option altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keichan34 Thank you for response. Yes, and we can drop $HOME/.charites/config.yml support too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keichan34 @JinIgarashi I remove all provider options and config.yml support.

@JinIgarashi
Copy link
Member

@smellman could you also do this issue in this PR? also please upgrade maplibre version from 2.4.0 to latest 4.6.0. currently, version is hard coded

#179

@smellman
Copy link
Contributor Author

@smellman could you also do this issue in this PR? also please upgrade maplibre version from 2.4.0 to latest 4.6.0. currently, version is hard coded

#179

maplibre version is not hard coded now.
But currently I don't care about NPM module, because I don't know how to apply npm module inside provider directory.

@smellman smellman changed the title Charites v2: Drop support Mapbox, rewrite all to esm module Charites v2: Drop support providers, rewrite all to esm module Sep 2, 2024
@smellman smellman requested a review from JinIgarashi September 4, 2024 06:21
Copy link
Member

@hfu hfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@smellman smellman merged commit 8f0ed0f into unvt:main Sep 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants