worldwide 2.2.0 → 2.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0c997e23c5f4ee1ae1b12a1fbca3a9a6fb7c807d1d846b187661863835d5a3b
4
- data.tar.gz: 59a34f1f08733f73dfe1f20d1a1ee6b3b272ddfb968def8ef881737897b9cf37
3
+ metadata.gz: b9a82f1cb2c66512e0367a28af1a68d8b378870b58e8bef2b6aabec01ec332f5
4
+ data.tar.gz: d07213bf649760857f27130f6f8c604556d6b8e45c7339d359441925023db4af
5
5
  SHA512:
6
- metadata.gz: 557a21b9c39b758ad37e4e1cd36a8bbf69bb63118b591a4a652d8bb21406dff28524d63017e75f0e7f925898e68a2ff03e43db41411299cd822795b6e8d9e1c1
7
- data.tar.gz: 16c5eddd8ef7ba8df4edcc4f8355ecfce2a09007a3de6645297219c038b9f518a4ee7fdb40db190fa8817128be17a2184157ebf23640235d335fcb496c3a8fa9
6
+ metadata.gz: 3aba7ee187e2b91c354bb9a5a4c4722bde29f17cadcb3e5816001310817b91e1faf2fcfb82c895d4c98cbef8b4382aa1aa68931650790db33a61c50642ce36e0
7
+ data.tar.gz: d927aad70adcff18005794cf332e43dfd60d285696284984bc0ad1fb09c32690f17af02cc02a963a772cdba5af3c0e059c3802defa99e42e3cb270a52a9f4b06
@@ -20,11 +20,12 @@ The most important guidelines:
20
20
 
21
21
  - All changes should be covered by tests.
22
22
  - Your code should support all the Ruby versions we have enabled on CI.
23
- - Do not update the CHANGELOG, or the `Worldwide::VERSION` constant.
23
+ - Add an entry under `Unreleased` in [`CHANGELOG.md`](../CHANGELOG.md) for every change except routine updates such as dependency bumps. Add the public PR link once it exists.
24
+ - Leave `Worldwide::VERSION` unchanged unless this PR also prepares a release.
24
25
 
25
26
  ### Releasing
26
27
 
27
28
  1. Check the [semantic versioning page](http://semver.org) for info on how to version the new release.
28
29
  2. Update the `Worldwide::VERSION` constant in **lib/worldwide/version.rb**.
29
- 3. Add a `CHANGELOG.md` entry for the new release with the date.
30
+ 3. Move the entries for this release from `Unreleased` to a dated section in `CHANGELOG.md`.
30
31
  4. Release the gem to rubygems using ShipIt (this will create tag/push during deploy)
@@ -17,11 +17,11 @@ jobs:
17
17
  - name: Check out code
18
18
  uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
19
  - name: Setup Node
20
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
20
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
21
21
  with:
22
22
  node-version: 20
23
23
  - name: Setup PNPM
24
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
24
+ uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
25
25
  with:
26
26
  version: 9.1.3
27
27
  - name: Install dependencies
@@ -8,7 +8,9 @@ on:
8
8
 
9
9
  jobs:
10
10
  build:
11
- runs-on: ubuntu-latest
11
+ # ubuntu-latest moved to 26.04, whose tzdata no longer resolves America/Godthab (data/regions/GL.yml).
12
+ # Remove this pin once GL.yml uses America/Nuuk.
13
+ runs-on: ubuntu-24.04
12
14
  name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}
13
15
  strategy:
14
16
  fail-fast: false
@@ -22,7 +24,7 @@ jobs:
22
24
  - name: Check out code
23
25
  uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24
26
  - name: Set up Ruby ${{ matrix.ruby }}
25
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
27
+ uses: ruby/setup-ruby@b3aaceaef7e0ee231b499e7b5f49c03fc1d32199 # v1.338.0
26
28
  with:
27
29
  ruby-version: ${{ matrix.ruby }}
28
30
  bundler-cache: true
@@ -24,11 +24,11 @@ jobs:
24
24
  with:
25
25
  token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
26
26
  - name: Setup Node
27
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
27
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
28
28
  with:
29
29
  node-version: 24
30
30
  - name: Setup PNPM
31
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
31
+ uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
32
32
  with:
33
33
  version: 9.1.3
34
34
  - name: Install dependencies
data/.gitignore CHANGED
@@ -29,3 +29,6 @@ Thumbs.db
29
29
  # Vendored CLDR data downloaded during `rake cldr:data:import`
30
30
  # Contains temporary Unicode CLDR files used to generate data/cldr/
31
31
  /vendor/
32
+
33
+ # Files downloaded by the `postal:codes:import` rake task
34
+ /rake/postal/vendor/
data/AGENTS.md ADDED
@@ -0,0 +1,57 @@
1
+ # Contributing to Worldwide
2
+
3
+ Worldwide is a public Ruby gem for localization and address handling. It also contains the public `@shopify/worldwide` TypeScript package.
4
+
5
+ ## Keep contributions public
6
+
7
+ - Use public sources and synthetic address examples. Use a published address for a public institution only when the example needs a real location.
8
+ - Do not include customer or merchant data, internal links, private tickets, logs, screenshots, credentials, or unpublished findings. This rule also applies to PR text, comments, commit messages, fixtures, generated data, and CI output.
9
+ - Cite the public source for data changes. Prefer the relevant postal authority, government agency, ISO list, Unicode CLDR, or IANA time zone database. Check that readers can open the source without private access. Check the license and keep any required attribution.
10
+
11
+ ## Find the right file
12
+
13
+ | Change | Start here |
14
+ | --- | --- |
15
+ | Address layouts, postal rules, zone codes, country settings | `data/regions/<CC>.yml`, `lib/worldwide/region.rb`, `lib/worldwide/zip.rb` |
16
+ | Region labels and translations | `data/regions/<CC>/`, `data/cldr/`, `data/other/` |
17
+ | CLDR corrections | [`rake/cldr/patch.rb`](rake/cldr/patch.rb), [`rake/tasks/cldr.rake`](rake/tasks/cldr.rake) |
18
+ | Postal prefix imports | [`rake/postal/README.md`](rake/postal/README.md) |
19
+ | TypeScript address code | [`lang/typescript/`](lang/typescript/) |
20
+
21
+ ## Make the change easy to review
22
+
23
+ - Keep the change to one behavior or one related group of countries. Split unrelated cleanup and dependency updates into separate PRs.
24
+ - Match nearby YAML key order, indentation, and quoting. For generated CLDR data, change the patch or generator and include the matching output. Run `bundle exec rake cldr:data:generate_paths` after you add, move, or remove indexed data files.
25
+ - Treat changes to canonical codes, defaults, locale scripts, fallback rules, and validation as API changes. Show the old and new output. Keep historical codes as lookup alternates when appropriate. Test lookup by both codes and check the value the API returns.
26
+ - For postal changes, test old and new formats, normalization, and invalid input. Check that examples match the rule. An example can also affect the reported postal code type. For address layouts, check both `edit` and `show` where applicable. See [Address format strings](docs/address_format_strings.md).
27
+ - Add focused Minitest coverage next to related tests. For country-specific tests in `test/worldwide/regions/`, use `<cc>_test.rb` and a class such as `PaTest`. If shared region data changes, check its effect on the TypeScript package too.
28
+
29
+ ## Run checks
30
+
31
+ Use `.ruby-version` for local setup. Check [`worldwide.gemspec`](worldwide.gemspec) for the supported Ruby minimum and [Ruby CI](.github/workflows/ci.yml) for the test matrix. Do not assume the oldest Ruby in CI is the supported minimum.
32
+
33
+ ```sh
34
+ bundle install
35
+ bundle exec ruby -Itest test/worldwide/regions/pa_test.rb # example focused test
36
+ bin/test
37
+ bin/style
38
+ ```
39
+
40
+ Run `bin/test-cldr-rake-tasks` from a clean checkout to check that the full CLDR pipeline reproduces the committed data. The script downloads data and reports unexpected changes to the working tree.
41
+
42
+ For changes that affect TypeScript, use the Node and pnpm versions in [TypeScript CI](.github/workflows/ci-typescript.yml):
43
+
44
+ ```sh
45
+ cd lang/typescript
46
+ pnpm install
47
+ pnpm typecheck
48
+ pnpm lint
49
+ pnpm test
50
+ pnpm build
51
+ ```
52
+
53
+ ## Open the PR
54
+
55
+ - Use the [PR template](.github/pull_request_template.md). State the problem, why you chose this fix, which behavior changes, and what you tested. Include public sources, a small reproduction, or a before-and-after example when useful.
56
+ - Add an entry under `Unreleased` in [`CHANGELOG.md`](CHANGELOG.md) for every change except routine updates such as dependency bumps. Add the public PR link once it exists. Leave the version bump to the release unless a maintainer asks for both in the same PR.
57
+ - For a TypeScript change that affects package users, add a changeset with `pnpm changeset` from `lang/typescript`. See the [package README](lang/typescript/README.md) for the release process.
data/CHANGELOG.md CHANGED
@@ -29,6 +29,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
29
29
 
30
30
  ---
31
31
 
32
+ ## [2.3.0] - 2026-11-18
33
+
34
+ - Add an `AGENTS.md` contribution guide and document when contributors need a changelog entry. [#686](https://github.com/Shopify/worldwide/pull/686)
35
+ - Add the `postal:codes:import`, `postal:codes:check` and `postal:codes:zone_check` rake tasks. They build and check the `zip_prefixes` and `zips_crossing_provinces` data in `data/regions/<CC>.yml`. [#680](https://github.com/Shopify/worldwide/pull/680)
36
+ - Correct Gabon's default currency from XOF to XAF, as listed in [ISO 4217](https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml). XOF remains supported. [#684](https://github.com/Shopify/worldwide/pull/684)
37
+
38
+ ---
39
+
32
40
  ## [2.2.0] - 2026-11-12
33
41
 
34
42
  - The Italian province of Sulcis Iglesiente now uses its current official code `SU`. `CI` stays as a code alternate, so lookups by `CI` still resolve, but `zone.code` now returns `SU`. Its ISO code stays `IT-CI` to keep CLDR's Sulcis Iglesiente names (CLDR's `itsu` is the former Sud Sardegna). [#667](https://github.com/Shopify/worldwide/pull/667)
data/Gemfile CHANGED
@@ -26,6 +26,12 @@ group :development do
26
26
  gem "pry-byebug", "< 3.12", require: false
27
27
  end
28
28
 
29
+ # Used by the postal code rake tasks in rake/postal. The gemspec does not package rake/, so the gem does not depend on them.
30
+ group :development, :test do
31
+ gem "csv"
32
+ gem "rubyzip"
33
+ end
34
+
29
35
  group :test do
30
36
  gem "minitest", "~> 5.27"
31
37
  gem "minitest-reporters"
data/Gemfile.lock CHANGED
@@ -13,7 +13,7 @@ GIT
13
13
  PATH
14
14
  remote: .
15
15
  specs:
16
- worldwide (2.2.0)
16
+ worldwide (2.3.0)
17
17
  activesupport (>= 7.0)
18
18
  i18n (>= 1.15)
19
19
  phonelib (~> 0.8)
@@ -43,6 +43,7 @@ GEM
43
43
  coderay (1.1.3)
44
44
  concurrent-ruby (1.3.8)
45
45
  connection_pool (2.5.5)
46
+ csv (3.3.7)
46
47
  drb (2.2.3)
47
48
  i18n (1.15.2)
48
49
  concurrent-ruby (~> 1.0)
@@ -141,6 +142,7 @@ PLATFORMS
141
142
  x86_64-linux
142
143
 
143
144
  DEPENDENCIES
145
+ csv
144
146
  minitest (~> 5.27)
145
147
  minitest-focus
146
148
  minitest-reporters
@@ -155,6 +157,7 @@ DEPENDENCIES
155
157
  rubocop-shopify
156
158
  ruby-cldr!
157
159
  ruby-lsp
160
+ rubyzip
158
161
  worldwide!
159
162
 
160
163
  BUNDLED WITH
data/data/regions/GA.yml CHANGED
@@ -3,7 +3,7 @@ name: Gabon
3
3
  code: GA
4
4
  tax: 0.18
5
5
  tax_name: VAT
6
- currency: XOF
6
+ currency: XAF
7
7
  group: African Countries
8
8
  group_name: Africa
9
9
  unit_system: metric
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end