Bumps [i18next-cli](https://github.com/i18next/i18next-cli) from 1.94.1 to 1.95.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/i18next/i18next-cli/blob/main/CHANGELOG.md">i18next-cli's changelog</a>.</em></p> <blockquote> <h2>1.95.1</h2> <ul> <li>fix(extract): a type read through a renaming import (<code>import { components as api }</code>, <code>import type</code>, <code>import * as</code>, re-exports) resolves the names inside it (<code>Omit<components['schemas']['Foo'], 'type'></code>) in the file that declares it; they were looked up in the importing file, which took another file's <code>components</code> and extracted its keys (<a href="https://redirect.github.com/i18next/i18next-cli/issues/330">#330</a>)</li> </ul> <h2>1.95.0</h2> <p>From a second run of <code>instrument</code> on the dashboard of the first one, this time all seven of its packages (about 1,200 files), its texts in the code; every rewrite read:</p> <ul> <li>fix(instrument): a variable that holds JSX (<code>const link = <Link …></code>) and <code>children</code> are never interpolated into a <code>t()</code> value, where they showed as <code>[object Object]</code>; the text stops at them.</li> <li>fix(instrument): the init file is generated when <code>i18next</code> shows up only in a string (a setup guide's snippet), not in an import or re-export statement; none is written at the root of a workspace without <code>src</code>, which no app imports from (a <code>pnpm-workspace.yaml</code> with settings only is no workspace).</li> <li>fix(instrument): a string in a TypeScript type is never wrapped (<code>useState<{ title: 'Hello there' }>()</code>), and no placeholder is named after an option of <code>t()</code> (<code>count</code>, <code>context</code>, …).</li> <li>fix(instrument): selectors of an optional call (<code>el?.querySelector('h1, h2')</code>) and everything under a <code>className</code>, <code>classNames</code>, <code>classes</code> or <code>style</code> property (<code>classNames: { container: () => 'btn btn-secondary' }</code>) stay as they are; so do strings pushed into an <code>ignore</code> list and a region code with acronyms (<code>EU VAT</code>, <code>CA GST/HST</code>).</li> <li>feat(instrument): a component's prop is text when its name is or ends in <code>label</code>, <code>title</code> or <code>message</code> (<code>saveLabel</code>), names a button's label (<code>labelConfirm</code>) or is the <code>text</code> of a component named for text (<code><FieldLabel text=…></code>), or when its value reads as a sentence; an icon's <code>aria-label</code> and <code>data-tip</code> are text; so are either branch of a choice in a text attribute (<code>data-tip={open ? 'Collapse' : 'Expand'}</code>), a single word under a text property (<code>{ label: 'has' }</code>) and what a title setter gets (<code>useDocumentTitle('Projects')</code>).</li> <li>feat(instrument): module-scope texts are translated when they are used instead of being skipped: JSX text there becomes a <code><Trans></code> (it translates when it renders; not in a Suspense <code>fallback</code>), and an object property's plain text value is read by a getter (<code>label: 'Projects'</code> becomes <code>get label () { return i18next.t('projects', 'Projects') }</code>). Left, and named with their lines: constants, entries of an array of strings, values computed on every read, properties of an object passed to a module-level call or kept to a type with <code>satisfies</code>, objects the file changes, and what code running at import reads, in any instrumented file (also through a function or class called at module scope). Review the getters (<code>--dry-run</code> marks them): a map of data that is sent or stored must stay as it was.</li> <li>fix(instrument): a property named for a format, a style or an event (<code>format: 'MMM D, YYYY'</code>, <code>transition</code>, <code>event</code>, <code>font</code>, <code>shortcut</code>) and a literal kept as its type (<code>'on' as const</code>) are no text; a one-line function component (<code>function App () { return <h1>…</h1> }</code>) gets its <code>useTranslation()</code> on a line of its own instead of a syntax error.</li> <li>fix(instrument): <code>writeExtractedKeys</code> also writes the keys of a split text and of the words in a placeholder's value.</li> <li>fix(instrument): the callback of a <code>.map()</code> (or another array method) at module scope, and an IIFE, run at import: their texts no longer get an <code>i18next.t()</code> that returned an empty string before i18next was initialized.</li> <li>feat(instrument): the words in a placeholder's value are texts of their own (<code>name || t('items', 'items')</code>), and a template literal with one optional part becomes two texts (<code>left ? t(…, 'uses AI tokens, {{left}} left') : t(…, 'uses AI tokens')</code>) instead of English words in a placeholder.</li> <li>feat(instrument): texts that only build data stay: a <code>mailto:</code> body or another URL part (<code>encodeURIComponent</code>), a file's content (<code>new Blob()</code>, <code>new File()</code>, <code>saveAs()</code>, <code>fs.writeFile()</code>, a zip's <code>.file(name, data)</code>), also through variables, as for <code>console</code> calls before.</li> <li>feat(instrument): in an object of strings, the sibling phrases of a text are texts too (<code>{ ht: 'by human', tm: 'by translation memory' }</code>).</li> <li>feat(instrument): the run names what to look at by hand, with lines: the module-scope texts left, and the parts of a sentence (<code>' (via CLI)'</code>, <code>', which needs {{name}}'</code>); <code>--dry-run</code> marks getters and two-text rewrites.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/i18next/i18next-cli/commit/32a3c32d8e7e60e3d936bba751fccdf9f56f68e7"><code>32a3c32</code></a> 1.95.1</li> <li><a href="https://github.com/i18next/i18next-cli/commit/74dd9c816f367e37ab745961bfe904dc76ad6d32"><code>74dd9c8</code></a> changelog for 1.95.1</li> <li><a href="https://github.com/i18next/i18next-cli/commit/7c48c1eb2296b60ff140ff565fb92583c78d181e"><code>7c48c1e</code></a> changelog: <a href="https://redirect.github.com/i18next/i18next-cli/issues/330">#330</a> follow-up under Unreleased</li> <li><a href="https://github.com/i18next/i18next-cli/commit/6d0961ed2ef8f8cea76900011190cbe3ef312190"><code>6d0961e</code></a> fix: a type read through a renaming import resolves the names inside it in th...</li> <li><a href="https://github.com/i18next/i18next-cli/commit/489d846eb041f525fd9d0b1821df5d84f0c7c2d9"><code>489d846</code></a> 1.95.0</li> <li><a href="https://github.com/i18next/i18next-cli/commit/27bd4fd098cc824db0b88448aa3798afc6a842d6"><code>27bd4fd</code></a> changelog for 1.95.0</li> <li><a href="https://github.com/i18next/i18next-cli/commit/dcf8414b224e6687ab77f8183c13f797694a0426"><code>dcf8414</code></a> instrument: translate module-scope texts when used, keep data texts, fixes fr...</li> <li><a href="https://github.com/i18next/i18next-cli/commit/020e3b20d9a3277569921aa594d856e49894b912"><code>020e3b2</code></a> 1.94.3</li> <li><a href="https://github.com/i18next/i18next-cli/commit/3d41e4cec37d5172f0dfec3936f85a4075c28210"><code>3d41e4c</code></a> changelog for 1.94.3</li> <li><a href="https://github.com/i18next/i18next-cli/commit/4b7954f901cf5699a915ae77a18a107a6bc813e9"><code>4b7954f</code></a> fix: keys from a t() call with context and no count, or with count under disa...</li> <li>Additional commits viewable in <a href="https://github.com/i18next/i18next-cli/compare/v1.94.1...v1.95.1">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Maputnik
A free and open visual editor for the MapLibre GL styles targeted at developers and map designers.
Usage
- 🔗 Design your maps online at https://www.maplibre.org/maputnik/ (all in local storage)
- 🔗 Use the Maputnik CLI for local style development
- In a Docker, run this command and browse to http://localhost:8888, Ctrl+C to stop the server.
docker run -it --rm -p 8888:8000 ghcr.io/maplibre/maputnik:main
To see the CLI options (for example file watching or style serving) run:
docker run -it --rm -p 8888:8000 ghcr.io/maplibre/maputnik:main --help
You might need to mount a volume (-v) to be able to use these options.
Documentation
The documentation can be found in the Wiki. You are welcome to collaborate!
- 🔗 Study the Maputnik Wiki
- 📹 Design a map from Scratch https://youtu.be/XoDh0gEnBQo
Develop
Maputnik is written in typescript and is using React and MapLibre GL JS.
We ensure building and developing Maputnik works with the current active LTS Node.js version and above.
Check out our Internationalization guide for UI text related changes.
Getting Involved
Join the #maplibre or #maputnik slack channel at OSMUS: get an invite at https://slack.openstreetmap.us/ Read the the below guide in order to get familiar with how we do things around here.
Install the deps, start the dev server and open the web browser on http://localhost:8888/.
# install dependencies
npm install
# start dev server
npm run start
If you want Maputnik to be accessible externally use the --host option:
# start externally accessible dev server
npm run start -- --host 0.0.0.0
The build process will watch for changes to the filesystem, rebuild and autoreload the editor.
npm run build
Lint the JavaScript code.
# run linter
npm run lint
npm run lint-css
npm run sort-styles
Tests
End-to-end tests
For E2E testing we use Playwright. The tests live in the e2e directory and drive the app through the MaputnikDriver page object.
The first time you run the tests, install the browser:
npx playwright install chromium
Playwright automatically starts the dev server (npm run start) for you, so you can just run:
npm run test
Some useful options:
# see the tests run in a headed browser
npm run test -- --headed
# run a single spec / filter by title
npm run test -- e2e/map.spec.ts
npm run test -- -g "zoom level"
# open the interactive UI mode
npx playwright test --ui
Running the E2E tests also produces a code-coverage report in coverage/ (collected via istanbul instrumentation of the dev server).
Unit & component tests
Unit tests and component tests run with Vitest; component tests (*.browser.test.tsx) use Vitest's browser mode with the Playwright provider.
npm run test-unit
Release process
- Review
CHANGELOG.md- Double-check that all changes included in the release are appropriately documented.
- To-be-released changes should be under the "main" header.
- Commit any final changes to the changelog.
- Run Create bump version PR by manual workflow dispatch and set the version number in the input. This will create a PR that changes the changelog and
package.jsonfile to review and merge. - Once merged, an automatic process will kick in and creates a GitHub release and uploads release assets.
Sponsors
Thanks to the supporters of the Kickstarter campaign. This project would not be possible without these commercial and individual sponsors. You can see this file's history for previous sponsors of the original Maputnik repo. Read more about the MapLibre Sponsorship Program at https://maplibre.org/sponsors/.
License
Maputnik is licensed under MIT and is Copyright (c) Lukas Martinelli and Maplibre contributors. As contributor please take extra care of not violating any Mapbox trademarks. Do not get inspired by other map studios and make your own decisions for a good style editor.
