@dcheglakov/uk-translit 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 dcheglakov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # uk-translit
2
+
3
+ Official Ukrainian transliteration and slug generation for TypeScript, built according to the current rules of the Cabinet of Ministers of Ukraine Resolution No. 55. Designed for headless CMS workflows, with context-aware transliteration, clean slug output, strong test coverage, and no runtime dependencies.
4
+
5
+ The implementation follows the current text of the Resolution of the Cabinet of Ministers of Ukraine dated January 27, 2010, No. 55, current revision effective from January 12, 2016:
6
+ https://zakon.rada.gov.ua/go/55-2010-%D0%BF
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ bun add uk-translit
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```typescript
17
+ import { slugify, transliterate } from 'uk-translit';
18
+
19
+ transliterate('Київ'); // Kyiv
20
+ transliterate('Згурівка'); // Zghurivka
21
+ slugify('Паляниця для всіх!'); // palianytsia-dlia-vsikh
22
+ ```
23
+
24
+ ## API
25
+
26
+ ### `transliterate(input: string): string`
27
+
28
+ Transliterates Ukrainian text to Latin script according to KMU Resolution No. 55, including:
29
+
30
+ - word-start rules for `Є`, `Ї`, `Й`, `Ю`, `Я`
31
+ - `zgh` handling for `зг`
32
+ - omission of soft sign and apostrophes
33
+
34
+ ### `slugify(input: string, options?): string`
35
+
36
+ Builds an ASCII slug from transliterated text.
37
+
38
+ Options:
39
+
40
+ - `separator?: string` default `-`
41
+ - `lowercase?: boolean` default `true`
42
+
43
+ ## Contributing
44
+
45
+ Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.
46
+
47
+ ## License
48
+
49
+ MIT
@@ -0,0 +1,2 @@
1
+ declare function greet(name: string): string;
2
+ export { greet };
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // src/index.ts
2
+ function greet(name) {
3
+ return `Hello, ${name}!`;
4
+ }
5
+ export {
6
+ greet
7
+ };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@dcheglakov/uk-translit",
3
+ "version": "1.0.0",
4
+ "description": "Official Ukrainian transliteration and slug generation for TypeScript, built according to the current rules of the Cabinet of Ministers of Ukraine Resolution No. 55. Designed for headless CMS workflows, with context-aware transliteration, clean slug output, strong test coverage, and a modern release pipeline.",
5
+ "homepage": "https://github.com/dcheglakov/uk-translit#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/dcheglakov/uk-translit/issues"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/dcheglakov/uk-translit.git"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "type": "module",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "import": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ }
26
+ },
27
+ "./package.json": "./package.json"
28
+ },
29
+ "scripts": {
30
+ "build": "bunup",
31
+ "changeset": "changeset",
32
+ "dev": "bunup --watch",
33
+ "format": "oxfmt",
34
+ "lint": "oxlint",
35
+ "prepare": "bun simple-git-hooks",
36
+ "publish:ci": "bun run build && bun pm pack && npm publish ./*.tgz --access public",
37
+ "release": "changeset publish",
38
+ "test": "bun test",
39
+ "test:coverage": "bun test --coverage",
40
+ "test:watch": "bun test --watch",
41
+ "type-check": "tsc --noEmit",
42
+ "version-packages": "changeset version"
43
+ },
44
+ "devDependencies": {
45
+ "@changesets/cli": "^2.30.0",
46
+ "@types/bun": "^1.3.12",
47
+ "bumpp": "^11.0.1",
48
+ "bunup": "^0.16.31",
49
+ "oxfmt": "^0.45.0",
50
+ "oxlint": "^1.60.0",
51
+ "simple-git-hooks": "^2.13.1",
52
+ "typescript": "^6.0.2"
53
+ },
54
+ "peerDependencies": {
55
+ "typescript": ">=4.5.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "typescript": {
59
+ "optional": true
60
+ }
61
+ },
62
+ "simple-git-hooks": {
63
+ "pre-commit": "bun run lint && bun run type-check"
64
+ }
65
+ }