@road-signs/se 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/se
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,64 @@
1
- # Temporary Holding Version
1
+ # @road-signs/se
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 Sweden — a TypeScript registry with most signs' artwork inlined as SVG, plus typed lookup helpers.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install @road-signs/se
9
+ ```
10
+
11
+ ## At a glance
12
+
13
+ | | |
14
+ | ------------------- | ---------------------------------------------------------------- |
15
+ | Signs | 267 |
16
+ | With vector artwork | 260 |
17
+ | Categories | `information`, `mandatory`, `priority`, `prohibitory`, `warning` |
18
+ | Standard | Vägmärkesförordning (VMF) — Vienna Convention |
19
+ | Regulator | Trafikverket (VMF) |
20
+ | Drive side | right-hand |
21
+ | Language(s) | Swedish |
22
+
23
+ ## Usage
24
+
25
+ ```ts
26
+ import { signs, getSign, getSignByCode, getSignsByCategory } from '@road-signs/se';
27
+
28
+ signs; // the whole registry
29
+ getSign('dangerous-curve-to-left-dangerous-curve-to-left'); // by slug id
30
+ getSignByCode('dangerous-curve-to-left'); // 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('dangerous-curve-to-left-dangerous-curve-to-left')!;
38
+
39
+ sign.svg; // inline, SVGO-optimised SVG markup
40
+ ```
41
+
42
+ > **7 of these signs carry inline artwork.**
43
+ > They have no usable vector source — either none was published upstream,
44
+ > or the only artwork is a monochrome trace that renders as a black shape.
45
+ > Vector sources for Sweden are welcome:
46
+ > see [the coverage notes](https://karlnorling.github.io/road-signs/countries/se/).
47
+
48
+ > `sign.assets` holds paths into this repo's build-time `assets/` tree.
49
+ > That directory is ~16GB across all countries and is **not published** —
50
+ > render from `sign.svg` instead.
51
+
52
+ ## Sources
53
+
54
+ - [Wikimedia Commons — Road signs in Sweden](https://commons.wikimedia.org/wiki/Category:SVG_road_signs_in_Sweden)
55
+ - [Wikimedia Commons — Road signs in Sweden (general)](https://commons.wikimedia.org/wiki/Category:Road_signs_in_Sweden)
56
+
57
+ ## Links
58
+
59
+ - [Documentation](https://karlnorling.github.io/road-signs)
60
+ - [Source](https://github.com/karlnorling/road-signs/tree/main/packages/@road-signs/se)
61
+
62
+ ## License
63
+
64
+ MIT © Karl Norling
@@ -0,0 +1,9 @@
1
+ import type { SECategory, SESign } from './types';
2
+ import { signs } from './signs.generated';
3
+ export type { SECategory, SESign } from './types';
4
+ export { signs };
5
+ export declare const getAllSigns: () => SESign[];
6
+ export declare const getSign: (id: string) => SESign | undefined;
7
+ export declare const getSignByCode: (code: string) => SESign | undefined;
8
+ export declare const getSignsByCategory: (category: SECategory) => SESign[];
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 { SESign } from './types';
2
+ export declare const signs: SESign[];
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,EA2pHzB,CAAC"}