You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0d0dbaf
Browse filesBrowse the repository at this point in the historyBrowse files
Every property directory shipped four identical declaration files
(`ranges.d.mts`, `regex.d.mts`, `code-points.d.mts`, `symbols.d.mts`),
about 4,000 files per package. They are now written once under `types/`
and selected through a generated `typesVersions` map in package.json.
Mapping directories (Case_Folding, Simple_Case_Mapping, Special_Casing,
Decomposition_Mapping) keep their own `code-points`/`symbols`
declarations, since their value types differ per directory; more
specific patterns route them there. The build removes per-directory
declarations left over from earlier runs.
`decode-ranges.d.mts` now exports the `UnicodeRange` type at module
level; previously `ranges.d.mts` imported a name that was only declared
inside a namespace, so TypeScript consumers saw an error. The README now
documents TypeScript 4.7 as the minimum, which is what `.d.mts` requires.
Verified with TypeScript 5.9 (node16, bundler and node10 resolution) and
TypeScript 4.7: imports resolve to the same types as before. A new test
checks the declaration layout and the typesVersions targets.
For Unicode 18.0.0 this shrinks the package from 378 KB to 312 KB packed
(1.38 MB to 1.08 MB unpacked) and from 8,352 to 4,320 files.
Assisted-By: Claude Fable 5.1
Issue: #109
Copy file name to clipboardExpand all lines: templates/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ npm install @unicode/unicode-<%= version %> --save-dev
12
12
13
13
**Note:**_@unicode/unicode-<%= version %>_ is supposed to be used in build scripts (i.e. as a `devDependency`), and not at runtime (i.e. as a regular `dependency`).
14
14
15
+
TypeScript declarations are included. They require TypeScript 4.7 or newer, which is the first version that understands `.d.mts` declaration files.
16
+
15
17
## Regular expressions
16
18
17
19
The Unicode data modules ship with pre-compiled regular expressions for categories, scripts, script extensions, blocks, and properties. But maybe you want to create a single regular expression that combines several categories, scripts, etc. In that case, [***you should use Regenerate***](https://mths.be/regenerate). For example, to construct a regex that matches all symbols in the Arabic and Greek scripts as per Unicode v6.3.0:
0 commit comments