dz-wilayas-core 1.0.3 โ†’ 1.1.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 ThaBugMaker
3
+ Copyright (c) 2025 - 2026 ThaBugMaker
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,168 +1,68 @@
1
1
  # dz-wilayas-core ๐Ÿ‡ฉ๐Ÿ‡ฟ
2
- ![npm](https://img.shields.io/npm/v/dz-wilayas-core?color=white&style=for-the-badge&logo=npm&logoColor=white)
3
- ![npm downloads](https://img.shields.io/npm/dm/dz-wilayas-core?color=black&style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3LjIyIDExLjc2Ij48cG9seWdvbiBwb2ludHM9IjQuNTkgNC45NCA0LjU5IDAgMi42MiAwIDIuNjIgNC45NCAwIDQuOTQgMy4yOCA5LjUzIDcuMjIgNC45NCA0LjU5IDQuOTQiLz48cmVjdCB4PSIwLjExIiB5PSIxMC43NiIgd2lkdGg9IjciIGhlaWdodD0iMSIvPjwvc3ZnPg==&logoColor=white)
4
- ![license](https://img.shields.io/npm/l/dz-wilayas-core?&logoColor=orange&color=orange&style=for-the-badge&logo=open-source-initiative)
5
- ![npm bundle size](https://img.shields.io/bundlephobia/min/dz-wilayas-core?color=lightblue&style=for-the-badge&logo=webpack&logoColor=lightblue)
6
- ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?logo=typescript&style=for-the-badge&color=blue)
7
- ![GitHub Repo stars](https://img.shields.io/github/stars/ThaBugMaker/dz-wilayas-core?color=yellow&style=for-the-badge&logo=github&logoColor=yellow)
8
- ![GitHub last commit](https://img.shields.io/github/last-commit/ThaBugMaker/dz-wilayas-core?&style=for-the-badge&logo=git&logoColor=F05032&color=F05032)
9
- ![GitHub issues](https://img.shields.io/github/issues/ThaBugMaker/dz-wilayas-core?color=red&style=for-the-badge&logo=github&logoColor=red)
10
2
 
3
+ [![npm version](https://img.shields.io/npm/v/dz-wilayas-core)](https://www.npmjs.com/package/dz-wilayas-core)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dz-wilayas-core)](https://www.npmjs.com/package/dz-wilayas-core)
5
+ [![License](https://img.shields.io/npm/l/dz-wilayas-core)](./LICENSE)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
11
7
 
8
+ A lightweight TypeScript library providing Algeria's wilaya and baladiya data, with utilities for lookup and search in JavaScript and TypeScript projects.
12
9
 
13
- **A TypeScript library providing Algeria's wilayat and baladiyat data with utility classes for easy lookup, search, and integration in any JavaScript or TypeScript project.**
10
+ **Current release:** `v1.1.0`
14
11
 
15
- ---
16
-
17
- ## ๐Ÿ“‘ Table of Contents
18
-
19
- - [Installation](#installation)
20
- - [Usage](#usage)
21
- - [API](#api)
22
- - [Data](#data)
23
- - [TypeScript Support](#typescript-support)
24
- - [Contributing](#contributing)
25
- - [Author](#author)
26
- - [Credits](#credits)
27
- - [License](#license)
12
+ ๐Ÿ“š **[Official Documentation](https://dz-wilayas-core.netlify.app/#introduction)** ยท [npm Package](https://www.npmjs.com/package/dz-wilayas-core) ยท [GitHub Repository](https://github.com/ThaBugMaker/dz-wilayas-core)
28
13
 
29
14
  ---
30
15
 
31
- ## โšก Installation
16
+ ## Installation
32
17
 
33
18
  ```bash
34
19
  npm install dz-wilayas-core
35
- # or
36
- yarn add dz-wilayas-core
37
20
  ```
38
21
 
39
- ---
22
+ Or with pnpm:
40
23
 
41
- ## ๐Ÿš€ Usage
24
+ ```bash
25
+ pnpm add dz-wilayas-core
26
+ ```
27
+
28
+ ## Quick Start
42
29
 
43
30
  ```ts
44
- import { WilayasStore, Wilaya, Baladiya } from "dz-wilayas-core";
31
+ import { WilayasStore } from "dz-wilayas-core";
45
32
 
46
33
  const store = new WilayasStore();
47
34
 
48
35
  // Get all wilayas
49
- const allWilayas: Wilaya[] = store.getAllWilayas();
36
+ const wilayas = store.getAllWilayas();
50
37
 
51
- // Get a wilaya by code
52
- const algerWilaya = store.getWilayaByCode("16");
38
+ // Find a wilaya by code
39
+ const alger = store.getWilayaByCode("16");
53
40
 
54
41
  // Search wilayas by name
55
- const searchResults = store.searchWilayaByName("Oran");
56
-
57
- // Get all baladiyat for a wilaya
58
- const algerBaladiyat: Baladiya[] = store.getBaladiyatByWilayaCode("16");
42
+ const results = store.searchWilayaByName("Oran");
59
43
 
60
- console.log(algerWilaya, algerBaladiyat);
44
+ // Get baladiyat for a wilaya
45
+ const baladiyat = store.getBaladiyatByWilayaCode("16");
61
46
  ```
62
47
 
63
- ---
64
-
65
- ## ๐Ÿ”Œ API
66
-
67
- ### `class WilayasStore`
48
+ ## Features
68
49
 
69
- | Method | Description |
70
- | ---------------------------------------------------- | ------------------------------------------ |
71
- | `getAllWilayas(): Wilaya[]` | Returns all wilayas. |
72
- | `getWilayaByCode(code: string): Wilaya \| undefined` | Find a wilaya by its code. |
73
- | `searchWilayaByName(name: string): Wilaya[]` | Search wilayas by name (case-insensitive). |
74
- | `getBaladiyatByWilayaCode(code: string): Baladiya[]` | Get all baladiyat for a given wilaya code. |
50
+ - Algerian wilaya and baladiya datasets.
51
+ - Lookup wilayas by code.
52
+ - Search wilayas by name.
53
+ - Retrieve baladiyat by wilaya code.
54
+ - TypeScript declarations included.
55
+ - Works with JavaScript and TypeScript projects.
75
56
 
76
- ---
77
-
78
- ## ๐Ÿ“Š Data
79
-
80
- - **Wilaya** object example:
81
-
82
- ```ts
83
- interface Wilaya {
84
- id: string;
85
- code: string;
86
- name: string;
87
- ar_name: string;
88
- }
89
- ```
57
+ For the complete API reference, data structure details, and usage examples, see the **[official documentation](https://dz-wilayas-core.netlify.app/#wilayas-store)**.
90
58
 
91
- - **Baladiya** object example:
59
+ ## Credits
92
60
 
93
- ```ts
94
- interface Baladiya {
95
- id: string;
96
- wilaya_id: string;
97
- name: string;
98
- ar_name: string;
99
- }
100
- ```
101
-
102
- All data is **preloaded from JSON** and typed for TypeScript.
103
-
104
- ---
61
+ - **Original data source:** [Wilaya-Of-Algeria](https://github.com/AbderrahmeneDZ/Wilaya-Of-Algeria) by [AbderrahmeneDZ](https://github.com/AbderrahmeneDZ) and [yamanidev](https://github.com/yamanidev).
62
+ - **2025โ€“2026 administrative update (69 wilayas):** [DZBuild โ€“ Algeria's 69 Wilayas List](https://dzbuild.com/blog/algeria-69-wilayas-list-2025-2026), used as a reference for the CSV datasets.
105
63
 
106
- ## ๐ŸŸฆ TypeScript Support
64
+ ## License
107
65
 
108
- - Fully **typed** out-of-the-box.
109
- - Provides `Wilaya` and `Baladiya` types.
110
- - Includes `.d.ts` files for complete IDE autocompletion.
111
-
112
- ---
113
-
114
- ## ๐Ÿค Contributing
115
-
116
- 1. Fork the repo
117
- 2. Create your branch (`git checkout -b feature/my-feature`)
118
- 3. Commit your changes (`git commit -am 'Add my feature'`)
119
- 4. Push to the branch (`git push origin feature/my-feature`)
120
- 5. Open a Pull Request
121
- 6. After your PR is merged, **uncomment the Contributors block below** and add yourself by replacing `<YourUsername>` with your GitHub username.
122
-
123
- <!-- --- -->
124
-
125
- <!--
126
- ## ๐Ÿ‘ฅ Contributors
127
-
128
- <table>
129
- <tr>
130
- <td align="center">
131
- <a href="https://github.com/<YourUsername>">
132
- <img src="https://avatars.githubusercontent.com/<YourUsername>" width="80px;" alt="<YourUsername>"/><br />
133
- <sub><b><YourUsername></b></sub>
134
- </a>
135
- </td>
136
- </tr>
137
- </table> -->
138
-
139
-
140
- ---
141
-
142
- ## ๐Ÿ‘ค Author
143
-
144
- <table>
145
- <tr>
146
- <td align="center">
147
- <a href="https://github.com/ThaBugMaker">
148
- <img src="https://avatars.githubusercontent.com/u/118787817?v=4" width="80px" style="border-radius:50%;" alt="ThaBugMaker"/><br>
149
- <sub><b>ThaBugMaker</b></sub>
150
- </a>
151
- </td>
152
- </tr>
153
- </table>
154
-
155
- ---
156
- ## ๐Ÿ™ Credits
157
-
158
- - **Data source:** [Wilaya-Of-Algeria](https://github.com/AbderrahmeneDZ/Wilaya-Of-Algeria) by [AbderrahmeneDZ](https://github.com/AbderrahmeneDZ) and [yamanidev](https://github.com/yamanidev)
159
-
160
- ---
161
-
162
- ## ๐Ÿ“„ License
163
-
164
- This project is licensed under the **MIT License**. See [LICENSE](LICENSE) for details.
165
-
166
- ---
66
+ MIT ยฉ 2025โ€“2026 [ThaBugMaker](https://github.com/ThaBugMaker)
167
67
 
168
- <p align="center">ยฉ 2025 ThaBugMaker All rights reserved.</p>
68
+ See [LICENSE](./LICENSE) for details.