sveld 0.26.0 → 0.26.2

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/README.md CHANGED
@@ -946,9 +946,16 @@ There are several ways to provide type information for contexts:
946
946
 
947
947
  - Context keys must be string literals (dynamic keys are not supported)
948
948
  - Variables passed to `setContext` should have JSDoc `@type` annotations for accurate types
949
- - The generated type name follows the pattern: `{PascalCase}Context`
950
- - `"simple-modal"` `SimpleModalContext`
951
- - `"Tabs"` `TabsContext`
949
+ - The generated type name follows the pattern: `{PascalCase}Context`. Separators (hyphens, underscores, dots, colons, slashes, spaces) are stripped and each segment is capitalized:
950
+ | Context Key | Generated Type Name |
951
+ | --- | --- |
952
+ | `"simple-modal"` | `SimpleModalContext` |
953
+ | `"user_settings"` | `UserSettingsContext` |
954
+ | `"Carbon.Modal"` | `CarbonModalContext` |
955
+ | `"Carbon:Modal"` | `CarbonModalContext` |
956
+ | `"app/modal"` | `AppModalContext` |
957
+ | `"My Context"` | `MyContextContext` |
958
+ | `"Tabs"` | `TabsContext` |
952
959
  - If no type annotation is found, the type defaults to `any` with a warning
953
960
 
954
961
  ### `@restProps`
@@ -128,7 +128,7 @@ const TYPEDEF_END_REGEX = /(\}|\};)$/;
128
128
  * // "my context" -> ["my", "context"]
129
129
  * ```
130
130
  */
131
- const CONTEXT_KEY_SPLIT_REGEX = /[-_\s]+/;
131
+ const CONTEXT_KEY_SPLIT_REGEX = /[-_.:/\s]+/;
132
132
  /**
133
133
  * Regular expression for matching component comment markers.
134
134
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveld",
3
- "version": "0.26.0",
3
+ "version": "0.26.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Generate TypeScript definitions for your Svelte components.",
6
6
  "main": "./lib/index.js",