@road-signs/om 0.0.0-stage → 0.1.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # @road-signs/om
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f798cfd: Add a README to every package, so the npm page for each one documents what it
8
+ contains and how to use it instead of rendering blank.
9
+
10
+ Country READMEs are generated from the same metadata that drives the docs site
11
+ plus live counts read from each registry, so they cannot drift from the code.
12
+
13
+ - Updated dependencies [f798cfd]
14
+ - @road-signs/core@0.1.1
package/README.md CHANGED
@@ -1,3 +1,57 @@
1
- # Temporary Holding Version
1
+ # @road-signs/om
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Road signs for Oman — a TypeScript registry with every sign's artwork inlined as SVG, plus typed lookup helpers.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install @road-signs/om
9
+ ```
10
+
11
+ ## At a glance
12
+
13
+ | | |
14
+ | ------------------- | -------------------------------------------------------- |
15
+ | Signs | 136 |
16
+ | With vector artwork | 136 |
17
+ | Categories | `information`, `prohibitory`, `warning` |
18
+ | Standard | Vienna Convention, bilingual Arabic/English (GCC Manual) |
19
+ | Regulator | ROP (GCC Manual) |
20
+ | Drive side | right-hand |
21
+ | Language(s) | Arabic, English |
22
+
23
+ ## Usage
24
+
25
+ ```ts
26
+ import { signs, getSign, getSignByCode, getSignsByCategory } from '@road-signs/om';
27
+
28
+ signs; // the whole registry
29
+ getSign('om-road-sign-101-om-road-sign-101'); // by slug id
30
+ getSignByCode('om-road-sign-101'); // by official code
31
+ getSignsByCategory('information'); // by category
32
+ ```
33
+
34
+ Each sign carries its own artwork, so nothing else has to be copied or served:
35
+
36
+ ```ts
37
+ const sign = getSign('om-road-sign-101-om-road-sign-101')!;
38
+
39
+ sign.svg; // inline, SVGO-optimised SVG markup
40
+ ```
41
+
42
+ > `sign.assets` holds paths into this repo's build-time `assets/` tree.
43
+ > That directory is ~16GB across all countries and is **not published** —
44
+ > render from `sign.svg` instead.
45
+
46
+ ## Sources
47
+
48
+ - [Wikimedia Commons — SVG road signs in Oman](https://commons.wikimedia.org/wiki/Category:SVG_road_signs_in_Oman)
49
+
50
+ ## Links
51
+
52
+ - [Documentation](https://karlnorling.github.io/road-signs)
53
+ - [Source](https://github.com/karlnorling/road-signs/tree/main/packages/@road-signs/om)
54
+
55
+ ## License
56
+
57
+ MIT © Karl Norling
@@ -0,0 +1,9 @@
1
+ import type { OMCategory, OMSign } from './types';
2
+ import { signs } from './signs.generated';
3
+ export type { OMCategory, OMSign } from './types';
4
+ export { signs };
5
+ export declare const getAllSigns: () => OMSign[];
6
+ export declare const getSign: (id: string) => OMSign | undefined;
7
+ export declare const getSignByCode: (code: string) => OMSign | undefined;
8
+ export declare const getSignsByCategory: (category: OMCategory) => OMSign[];
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAO,MAAM,WAAW,QAAO,MAAM,EAAgB,CAAC;AAEtD,eAAO,MAAM,OAAO,OAAQ,MAAM,KAAG,MAAM,GAAG,SACd,CAAC;AAEjC,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,MAAM,GAAG,SAClB,CAAC;AAErC,eAAO,MAAM,kBAAkB,aAAc,UAAU,KAAG,MAAM,EAClB,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSignsByCategory = exports.getSignByCode = exports.getSign = exports.getAllSigns = exports.signs = void 0;
4
+ const signs_generated_1 = require("./signs.generated");
5
+ Object.defineProperty(exports, "signs", { enumerable: true, get: function () { return signs_generated_1.signs; } });
6
+ const getAllSigns = () => [...signs_generated_1.signs];
7
+ exports.getAllSigns = getAllSigns;
8
+ const getSign = (id) => signs_generated_1.signs.find((s) => s.id === id);
9
+ exports.getSign = getSign;
10
+ const getSignByCode = (code) => signs_generated_1.signs.find((s) => s.code === code);
11
+ exports.getSignByCode = getSignByCode;
12
+ const getSignsByCategory = (category) => signs_generated_1.signs.filter((s) => s.category === category);
13
+ exports.getSignsByCategory = getSignsByCategory;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,uDAA0C;sFAAjC,uBAAK;AAKP,MAAM,WAAW,GAAG,GAAa,EAAE,CAAC,CAAC,GAAG,uBAAK,CAAC,CAAC;AAAzC,QAAA,WAAW,GAAX,WAAW,CAA8B;AAE/C,MAAM,OAAO,GAAG,CAAC,EAAU,EAAsB,EAAE,CACxD,uBAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AADpB,QAAA,OAAO,GAAP,OAAO,CACa;AAE1B,MAAM,aAAa,GAAG,CAAC,IAAY,EAAsB,EAAE,CAChE,uBAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AADxB,QAAA,aAAa,GAAb,aAAa,CACW;AAE9B,MAAM,kBAAkB,GAAG,CAAC,QAAoB,EAAY,EAAE,CACnE,uBAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AADlC,QAAA,kBAAkB,GAAlB,kBAAkB,CACgB"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,3 @@
1
+ import type { OMSign } from './types';
2
+ export declare const signs: OMSign[];
3
+ //# sourceMappingURL=signs.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signs.generated.d.ts","sourceRoot":"","sources":["../../src/signs.generated.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,KAAK,EAAE,MAAM,EAi3DzB,CAAC"}