nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: microsoft/botbuilder-python
Pull request #2185 (2024-10-30 13:24:33)

Port: Set TeamsNotifyUser alert to opposite of alert_in_meeting
Fixes #223 

## Description
Porting changes from https://github.com/microsoft/botbuilder-dotnet/pull/6136

The logic for `teams_notify_user` helper method is incorrect. It should set either alertInMeeting to true, or alert to true, but not both.
https://github.com/microsoft/botbuilder-python/blob/3e76e543477500b7e56f53ba20258b730ec4f924/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py#L74-L75

## Specific Changes
  - Set TeamsNotifyUser alert to opposite of alert_in_meeting

## Testing
The following image shows the related unit test passing.
<img width="796" alt="image" src="https://github.com/user-attachments/assets/29fd1611-342e-406a-b520-7cb5ff32db54">



Patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py
index e604cb08..253b31f5 100644
--- a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py
+++ b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py
@@ -71,7 +71,7 @@ def teams_notify_user(
         activity.channel_data = {}
 
     channel_data = TeamsChannelData().deserialize(activity.channel_data)
-    channel_data.notification = NotificationInfo(alert=True)
+    channel_data.notification = NotificationInfo(alert=not alert_in_meeting)
     channel_data.notification.alert_in_meeting = alert_in_meeting
     channel_data.notification.external_resource_url = external_resource_url
     activity.channel_data = channel_data


Test patch:
diff --git a/libraries/botbuilder-core/tests/teams/test_teams_extension.py b/libraries/botbuilder-core/tests/teams/test_teams_extension.py
index 1d2520bc..406d3cb3 100644
--- a/libraries/botbuilder-core/tests/teams/test_teams_extension.py
+++ b/libraries/botbuilder-core/tests/teams/test_teams_extension.py
@@ -155,6 +155,17 @@ class TestTeamsActivityHandler(aiounittest.AsyncTestCase):
         # Assert
         assert activity.channel_data.notification.alert
 
+    def test_teams_notify_user_alert_in_meeting(self):
+        # Arrange
+        activity = Activity()
+
+        # Act
+        teams_notify_user(activity, alert_in_meeting=True)
+
+        # Assert
+        assert activity.channel_data.notification.alert_in_meeting is True
+        assert activity.channel_data.notification.alert is False
+
     def test_teams_notify_user_with_no_activity(self):
         # Arrange
         activity = None
Repository: evcc-io/evcc
Pull request #13787 (2024-05-06 19:09:03)

Load management: fix handling overloaded circuits
Fix https://github.com/evcc-io/evcc/issues/13750


Patch:
diff --git a/core/circuit.go b/core/circuit.go
index 7feab2d6..cab7c12e 100644
--- a/core/circuit.go
+++ b/core/circuit.go
@@ -2,7 +2,6 @@ package core
 
 import (
 	"fmt"
-	"math"
 	"sync"
 
 	"github.com/evcc-io/evcc/api"
@@ -176,16 +175,14 @@ func (c *Circuit) updateLoadpoints(loadpoints []api.CircuitLoad) {
 
 func (c *Circuit) updateMeters() error {
 	if f, err := c.meter.CurrentPower(); err == nil {
-		// TODO handle negative powers
-		c.power = math.Abs(f)
+		c.power = f
 	} else {
 		return fmt.Errorf("circuit power: %w", err)
 	}
 
 	if phaseMeter, ok := c.meter.(api.PhaseCurrents); ok {
 		if l1, l2, l3, err := phaseMeter.Currents(); err == nil {
-			// TODO handle negative currents
-			c.current = max(math.Abs(l1), math.Abs(l2), math.Abs(l3))
+			c.current = max(l1, l2, l3)
 		} else {
 			return fmt.Errorf("circuit currents: %w", err)
 		}
@@ -246,8 +243,9 @@ func (c *Circuit) ValidatePower(old, new float64) float64 {
 	delta := max(0, new-old)
 
 	if c.maxPower != 0 {
-		if c.power+delta > c.maxPower {
-			new = max(0, new-(c.power+delta-c.maxPower))
+		potential := c.maxPower - c.power
+		if delta > potential {
+			new = max(0, old+potential)
 			c.log.DEBUG.Printf("validate power: %gW -> %gW <= %gW at %gW: capped at %gW", old, new, c.maxPower, c.power, new)
 		} else {
 			c.log.TRACE.Printf("validate power: %gW -> %gW <= %gW at %gW: ok", old, new, c.maxPower, c.power)
@@ -270,8 +268,9 @@ func (c *Circuit) ValidateCurrent(old, new float64) float64 {
 	delta := max(0, new-old)
 
 	if c.maxCurrent != 0 {
-		if c.current+delta > c.maxCurrent {
-			new = max(0, new-(c.current+delta-c.maxCurrent))
+		potential := c.maxCurrent - c.current
+		if delta > potential {
+			new = max(0, old+potential)
 			c.log.DEBUG.Printf("validate current: %gA -> %gA <= %gA at %gA: capped at %gA", old, new, c.maxCurrent, c.current, new)
 		} else {
 			c.log.TRACE.Printf("validate current: %gA -> %gA <= %gA at %gA: ok", old, new, c.maxCurrent, c.current)


Test patch:
diff --git a/core/circuit_test.go b/core/circuit_test.go
index 785ba154..73404908 100644
--- a/core/circuit_test.go
+++ b/core/circuit_test.go
@@ -37,7 +37,7 @@ func circuitTests() []circuitTest {
 		{0, 2, 0, 1, 1, 0}, // =
 		{0, 2, 0, 2, 2, 1}, // =
 		{0, 2, 0, 2, 3, 1}, // +
-		// {0, 2, 0, 2, 1, 1}, // -
+		{0, 2, 0, 2, 1, 1}, // -
 
 		// parent loaded
 		{1, 0, 0, 0, 0, 0}, // =
@@ -52,7 +52,7 @@ func circuitTests() []circuitTest {
 		{2, 0, 0, 1, 1, 0}, // =
 		{2, 0, 0, 2, 2, 1}, // =
 		{2, 0, 0, 2, 3, 1}, // +
-		// {2, 0, 0, 2, 1, 1}, // -
+		{2, 0, 0, 2, 1, 1}, // -
 	}
 }
Repository: amoffat/sh
Pull request #573 (2021-06-04 07:54:34)

Let Command know about baked call args when wrapping the module
Refs #559 


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ab69be2..3a7afb9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,7 @@
 # Changelog
+## 1.14.3
+*   bugfix where `Command` was not aware of default call args when wrapping the module [#559](https://github.com/amoffat/sh/pull/573)
+
 ## 1.14.1 - 10/24/20
 *   bugfix where setting `_ok_code` to not include 0, but 0 was the exit code [#545](https://github.com/amoffat/sh/pull/545)
 
diff --git a/sh.py b/sh.py
index 1baa6bf..830d9fe 100644
--- a/sh.py
+++ b/sh.py
@@ -3512,7 +3512,18 @@ class SelfWrapper(ModuleType):
         # if we set this to None.  and 3.3 needs a value for __path__
         self.__path__ = []
         self.__self_module = self_module
-        self.__env = Environment(globals(), baked_args=baked_args)
+
+        # Copy the Command class and add any baked call kwargs to it
+        cls_attrs = Command.__dict__.copy()
+        if baked_args:
+            call_args, _ = Command._extract_call_args(baked_args)
+            cls_attrs['_call_args'] = cls_attrs['_call_args'].copy()
+            cls_attrs['_call_args'].update(call_args)
+        command_cls = type(Command.__name__, Command.__bases__, cls_attrs)
+        globs = globals().copy()
+        globs[Command.__name__] = command_cls
+
+        self.__env = Environment(globs, baked_args=baked_args)
 
     def __getattr__(self, name):
         return self.__env[name]


Test patch:
diff --git a/test.py b/test.py
index d9cc1da..4e9e8e0 100644
--- a/test.py
+++ b/test.py
@@ -3138,6 +3138,13 @@ class ExecutionContextTests(unittest.TestCase):
         _sh.echo("-n", "TEST")
         self.assertEqual("TEST", out.getvalue())
 
+    def test_command_with_baked_call_args(self):
+        # Test that sh.Command() knows about baked call args
+        import sh
+        _sh = sh(_ok_code=1)
+        self.assertEqual(sh.Command._call_args['ok_code'], 0)
+        self.assertEqual(_sh.Command._call_args['ok_code'], 1)
+
     def test_importer_detects_module_name(self):
         import sh
         _sh = sh()
Repository: amoffat/sh
Pull request #628 (2022-10-19 10:43:40)

Make fd/file_chunk_consumer respect decode_errors
This fixes the example I provided at
https://github.com/amoffat/sh/issues/556#issuecomment-1281119556 by making fd/file_chunk_consumer respect decode_errors just like the other consumers.


Patch:
diff --git a/sh.py b/sh.py
index 4f6e4e9..90fdced 100644
--- a/sh.py
+++ b/sh.py
@@ -2902,7 +2902,7 @@ def determine_how_to_feed_output(handler, encoding, decode_errors):
         process, finish = get_stringio_chunk_consumer(handler, encoding, decode_errors)
 
     elif hasattr(handler, "write"):
-        process, finish = get_file_chunk_consumer(handler)
+        process, finish = get_file_chunk_consumer(handler, decode_errors)
 
     else:
         try:
@@ -2911,19 +2911,19 @@ def determine_how_to_feed_output(handler, encoding, decode_errors):
             def process(chunk): return False  # noqa: E731
             def finish(): return None  # noqa: E731
         else:
-            process, finish = get_fd_chunk_consumer(handler)
+            process, finish = get_fd_chunk_consumer(handler, decode_errors)
 
     return process, finish
 
 
-def get_fd_chunk_consumer(handler):
+def get_fd_chunk_consumer(handler, decode_errors):
     handler = fdopen(handler, "w", closefd=False)
-    return get_file_chunk_consumer(handler)
+    return get_file_chunk_consumer(handler, decode_errors)
 
 
-def get_file_chunk_consumer(handler):
+def get_file_chunk_consumer(handler, decode_errors):
     if getattr(handler, "encoding", None):
-        def encode(chunk): return chunk.decode(handler.encoding)  # noqa: E731
+        def encode(chunk): return chunk.decode(handler.encoding, decode_errors)  # noqa: E731
     else:
         def encode(chunk): return chunk  # noqa: E731
 


Test patch:
diff --git a/test.py b/test.py
index df10ebd..a8aca80 100644
--- a/test.py
+++ b/test.py
@@ -2160,9 +2160,9 @@ import os
 sys.stdout = os.fdopen(sys.stdout.fileno(), 'wb')
 IS_PY3 = sys.version_info[0] == 3
 if IS_PY3:
-    sys.stdout.write(bytes("te漢字st", "utf8"))
+    sys.stdout.write(bytes("te漢字st", "utf8") + "äåéë".encode("latin_1"))
 else:
-    sys.stdout.write("te漢字st")
+    sys.stdout.write("te漢字st" + u"äåéë".encode("latin_1"))
 """)
         fn = partial(python, py.name, _encoding="ascii")
 
@@ -2173,6 +2173,9 @@ else:
         p = python(py.name, _encoding="ascii", _decode_errors="ignore")
         self.assertEqual(p, "test")
 
+        p = python(py.name, _encoding="ascii", _decode_errors="ignore", _out=sys.stdout, _tee=True)
+        self.assertEqual(p, "test")
+
     def test_signal_exception(self):
         from sh import SignalException_15
Repository: amoffat/sh
Pull request #746 (2025-01-09 20:58:02)

async return_cmd should raise on failure
Commit 3a9d8ce9fb incorrectly suppresses exceptions when a return_cmd True RunningCommand is awaited.

Explicitly check for exceptions so they are properly raised.


Patch:
diff --git a/sh.py b/sh.py
index b02d6e1..8f8f3c6 100644
--- a/sh.py
+++ b/sh.py
@@ -890,6 +890,9 @@ class RunningCommand:
         async def wait_for_completion():
             await self.aio_output_complete.wait()
             if self.call_args["return_cmd"]:
+                # We know the command has completed already,
+                # but need to catch exceptions
+                self.wait()
                 return self
             else:
                 return str(self)


Test patch:
diff --git a/tests/sh_test.py b/tests/sh_test.py
index 0fe0311..0419806 100644
--- a/tests/sh_test.py
+++ b/tests/sh_test.py
@@ -1802,6 +1802,19 @@ sys.exit(0)
 
         asyncio.run(main())
 
+    def test_async_return_cmd_exc(self):
+        py = create_tmp_test(
+            """
+import sys
+sys.exit(1)
+"""
+        )
+
+        async def main():
+            await python(py.name, _async=True, _return_cmd=True)
+
+        self.assertRaises(sh.ErrorReturnCode_1, asyncio.run, main())
+
     def test_handle_both_out_and_err(self):
         py = create_tmp_test(
             """
Repository: amoffat/sh
Pull request #747 (2025-01-09 22:21:56)

v2.2.1


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f705b55..0eae0cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Changelog
 
+## 2.2.1 - 1/9/25
+
+- Bugfix where `async` and `return_cmd` does not raise exceptions [#746](https://github.com/amoffat/sh/pull/746)
+
 ## 2.2.0 - 1/9/25
 
 - `return_cmd` with `await` now works correctly [#743](https://github.com/amoffat/sh/issues/743)
diff --git a/pyproject.toml b/pyproject.toml
index 6621570..af03549 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "sh"
-version = "2.2.0"
+version = "2.2.1"
 description = "Python subprocess replacement"
 authors = ["Andrew Moffat <arwmoffat@gmail.com>"]
 readme = "README.rst"
diff --git a/sh.py b/sh.py
index b02d6e1..8f8f3c6 100644
--- a/sh.py
+++ b/sh.py
@@ -890,6 +890,9 @@ class RunningCommand:
         async def wait_for_completion():
             await self.aio_output_complete.wait()
             if self.call_args["return_cmd"]:
+                # We know the command has completed already,
+                # but need to catch exceptions
+                self.wait()
                 return self
             else:
                 return str(self)


Test patch:
diff --git a/tests/sh_test.py b/tests/sh_test.py
index 0fe0311..0419806 100644
--- a/tests/sh_test.py
+++ b/tests/sh_test.py
@@ -1802,6 +1802,19 @@ sys.exit(0)
 
         asyncio.run(main())
 
+    def test_async_return_cmd_exc(self):
+        py = create_tmp_test(
+            """
+import sys
+sys.exit(1)
+"""
+        )
+
+        async def main():
+            await python(py.name, _async=True, _return_cmd=True)
+
+        self.assertRaises(sh.ErrorReturnCode_1, asyncio.run, main())
+
     def test_handle_both_out_and_err(self):
         py = create_tmp_test(
             """
Repository: amoffat/sh
Pull request #756 (2025-05-08 03:32:30)

Quote arguments with whitespace when printing command
Currently, printing baked commands doesn't represent the way arguments are actually passed down to the program when values contain spaces.

The solution is to take such values in single quotes.

This is primarily to be able to copy printed commands and run them in a shell.

BEFORE:

```python
>>> from sh import ls
>>> print(ls.bake('How I Met Your Mother'))
/bin/ls How I Met Your Mother
```

AFTER:

```python
>>> print(ls.bake('How I Met Your Mother'))
/bin/ls 'How I Met Your Mother'
```


Patch:
diff --git a/sh.py b/sh.py
index d339b1e..84ed294 100644
--- a/sh.py
+++ b/sh.py
@@ -1391,10 +1391,10 @@ class Command:
         return fn
 
     def __str__(self):
-        baked_args = " ".join(self._partial_baked_args)
-        if baked_args:
-            baked_args = " " + baked_args
-        return self._path + baked_args
+        if not self._partial_baked_args:
+            return self._path
+        baked_args = " ".join(shlex_quote(arg) for arg in self._partial_baked_args)
+        return f"{self._path} {baked_args}"
 
     def __eq__(self, other):
         return str(self) == str(other)


Test patch:
diff --git a/tests/sh_test.py b/tests/sh_test.py
index 64b7018..74e514e 100644
--- a/tests/sh_test.py
+++ b/tests/sh_test.py
@@ -855,6 +855,12 @@ print(len(options.long_option.split()))
         num_args = int(python(py.name, "--long-option", "one's two's three's"))
         self.assertEqual(num_args, 3)
 
+        num_args = int(python(py.name, long_option="one's two's three's"))
+        self.assertEqual(num_args, 3)
+
+        cmd = str(python.bake(py.name, long_option="one two three"))
+        self.assertTrue(cmd.endswith(" '--long-option=one two three'"), cmd)
+
     def test_short_bool_option(self):
         py = create_tmp_test(
             """
@@ -2686,6 +2692,26 @@ p.wait()
         ll = ls.bake("-l")
         self.assertTrue(str(ll).endswith("/ls -l"))
 
+    def test_baked_command_can_be_printed_with_whitespace_args(self):
+        from sh import ls
+
+        ls_himym = ls.bake("How I Met Your Mother")
+        self.assertTrue(str(ls_himym).endswith("/ls 'How I Met Your Mother'"))
+        ls_himym = ls.bake("How I 'Met' Your Mother")
+        self.assertTrue(
+            str(ls_himym).endswith("""/ls 'How I '"'"'Met'"'"' Your Mother'""")
+        )
+        ls_himym = ls.bake('How I "Met" Your Mother')
+        self.assertTrue(str(ls_himym).endswith("""/ls 'How I "Met" Your Mother'"""))
+
+    def test_baked_command_can_be_printed_with_whitespace_in_options(self):
+        from sh import ls
+
+        cmd = ls.bake(o="one two")
+        self.assertTrue(str(cmd).endswith("""/ls -o 'one two'"""), str(cmd))
+        cmd = ls.bake(opt="one two")
+        self.assertTrue(str(cmd).endswith("""/ls '--opt=one two'"""), str(cmd))
+
     # https://github.com/amoffat/sh/issues/185
     def test_done_callback(self):
         import time
Repository: XKNX/xknx
Pull request #447 (2020-10-04 13:05:46)

Fix parsing floats
Small fix for parsing floating point DPT values and a test.


Patch:
diff --git a/changelog.md b/changelog.md
index 2d1038e8..61c44dbb 100644
--- a/changelog.md
+++ b/changelog.md
@@ -4,7 +4,6 @@
 
 ### Devices
 
-- BinarySensor: `reset_after` expects seconds, instead of ms now (to use same unit as `context_timeout`)
 - Binary Sensor: Change the default setting `context_timeout` for binary sensor from 1.0 to 0.0 and fixes a bug that would result in the update callback being executed twice thus executing certain automations in HA twice for binary sensor from 1.0 to 0.0 and fixes a bug that would result in the update callback being executed twice thus executing certain automations in HA twice.
 
 ## 0.15.0 Spring cleaning and quality of life changes
diff --git a/xknx/dpt/dpt.py b/xknx/dpt/dpt.py
index 951a8bef..f462ddca 100644
--- a/xknx/dpt/dpt.py
+++ b/xknx/dpt/dpt.py
@@ -97,7 +97,7 @@ class DPTBase:
             return DPTBase.transcoder_by_dpt(value_type)
         if isinstance(value_type, float):
             # avoid modulo for floating point rounding errors
-            main, sub = map(int, str(value_type).split("."))
+            main, sub = map(int, f"{value_type:.3f}".split("."))
             return DPTBase.transcoder_by_dpt(main, sub)
         if isinstance(value_type, str):
             _string_type = value_type.strip()
diff --git a/xknx/dpt/dpt_4byte_float.py b/xknx/dpt/dpt_4byte_float.py
index 3273f02f..278f752b 100644
--- a/xknx/dpt/dpt_4byte_float.py
+++ b/xknx/dpt/dpt_4byte_float.py
@@ -23,9 +23,6 @@ class DPT4ByteFloat(DPTBase):
     DPT 14.***
     """
 
-    dpt_main_number = 14
-    dpt_sub_number = None
-    value_type = "DPT-14"
     dpt_main_number = 14
     dpt_sub_number = None
     value_type = "4byte_float"


Test patch:
diff --git a/test/dpt_tests/dpt_test.py b/test/dpt_tests/dpt_test.py
index 06aca242..95a3575c 100644
--- a/test/dpt_tests/dpt_test.py
+++ b/test/dpt_tests/dpt_test.py
@@ -139,3 +139,6 @@ class TestDPTBase(unittest.TestCase):
         dpt6 = DPTBase.parse_transcoder("9.001")
         self.assertEqual(dpt4, dpt5)
         self.assertEqual(dpt5, dpt6)
+        dpt7 = DPTBase.parse_transcoder("active_energy")
+        dpt8 = DPTBase.parse_transcoder(13.010)
+        self.assertEqual(dpt7, dpt8, "parsing float failed")
Repository: gregberge/svgr
Pull request #757 (2022-08-13 02:58:24)

docs: correct function name

vercel[bot]: **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated |
| :--- | :----- | :------ | :------ |
| **svgr** | 🔄 Building ([Inspect](https://vercel.com/gregberge/svgr/2k9hGgF7mXo8xZExZevvsLKuDjVd)) |  | Aug 13, 2022 at 2:58AM (UTC) |



Patch:
diff --git a/packages/core/src/state.ts b/packages/core/src/state.ts
index 20e4f09..c9900d5 100644
--- a/packages/core/src/state.ts
+++ b/packages/core/src/state.ts
@@ -13,7 +13,7 @@ export interface State {
   }
 }
 
-const VALID_CHAR_REGEX = /[^a-zA-Z0-9_-]/g
+const VALID_CHAR_REGEX = /[^a-zA-Z0-9 _-]/g
 
 const getComponentName = (filePath?: string): string => {
   if (!filePath) return 'SvgComponent'
diff --git a/packages/hast-util-to-babel-ast/README.md b/packages/hast-util-to-babel-ast/README.md
index f4d3e93..87edbe2 100644
--- a/packages/hast-util-to-babel-ast/README.md
+++ b/packages/hast-util-to-babel-ast/README.md
@@ -16,7 +16,7 @@ npm install --save-dev @svgr/hast-util-to-babel-ast
 
 ```js
 import { parse } from 'svg-parser'
-import toBabelAST from '@svgr/hast-util-to-babel-ast'
+import hastToBabelAst from '@svgr/hast-util-to-babel-ast'
 
 const hastTree = parse(`<svg></svg>`)
 
diff --git a/website/pages/docs/ecosystem.mdx b/website/pages/docs/ecosystem.mdx
index ba7360e..cdca6c0 100644
--- a/website/pages/docs/ecosystem.mdx
+++ b/website/pages/docs/ecosystem.mdx
@@ -35,7 +35,7 @@ This is an incomplete list of awesome things built with SVGR.
 - [chin-plugin-svgr](https://www.npmjs.com/package/chin-plugin-svgr) - SVGR plugin for [chin](https://github.com/chinjs/chin)
 - [@nice-js/svgr-loader](https://www.npmjs.com/package/@nice-js/svgr-loader) - SVGR loader for Nice.js
 - [bs-svgr](https://www.npmjs.com/package/bs-svgr) - SVGR plugin for BuckleScript (Reason)
-- [vite-plugin-svgr](https://github.com/lucsky/vite-plugin-svgr) - SVGR loader for [Vite](https://vitejs.dev/)
+- [vite-plugin-svgr](https://github.com/pd4d10/vite-plugin-svgr) - SVGR loader for [Vite](https://vitejs.dev/)
 - [SVGR for Figma](https://www.figma.com/community/plugin/749818562498396194/SVG-to-JSX)
 - [esbuild-plugin-svgr](https://github.com/kazijawad/esbuild-plugin-svgr)
 


Test patch:
diff --git a/packages/core/src/state.test.ts b/packages/core/src/state.test.ts
index 26a304c..e2183d9 100644
--- a/packages/core/src/state.test.ts
+++ b/packages/core/src/state.test.ts
@@ -24,6 +24,11 @@ describe('state', () => {
         filePath: 'a&b~c-d_e.svg',
         componentName: 'SvgAbcDE',
       })
+      expect(expandState({ filePath: 'Arrow up.svg' })).toEqual({
+        filePath: 'Arrow up.svg',
+        componentName: 'SvgArrowUp',
+      })
+
     })
   })
 })
Repository: gregberge/svgr
Pull request #766 (2022-08-29 05:23:04)

docs: update vite plugin recommendation
## Summary

Updated the Vite plugin recommendation as the project listed in the current docs has been deprecated, see here: https://github.com/lucsky/vite-plugin-svgr/issues/5

## Test plan

None. This is a simple documentation change.


vercel[bot]: **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated |
| :--- | :----- | :------ | :------ |
| **svgr** | 🔄 Building ([Inspect](https://vercel.com/gregberge/svgr/FK4jSjMzHocrG4D65DeQ1pDdbwxV)) |  | Aug 29, 2022 at 5:23AM (UTC) |



Patch:
diff --git a/packages/core/src/state.ts b/packages/core/src/state.ts
index 20e4f09..c9900d5 100644
--- a/packages/core/src/state.ts
+++ b/packages/core/src/state.ts
@@ -13,7 +13,7 @@ export interface State {
   }
 }
 
-const VALID_CHAR_REGEX = /[^a-zA-Z0-9_-]/g
+const VALID_CHAR_REGEX = /[^a-zA-Z0-9 _-]/g
 
 const getComponentName = (filePath?: string): string => {
   if (!filePath) return 'SvgComponent'
diff --git a/website/pages/docs/ecosystem.mdx b/website/pages/docs/ecosystem.mdx
index ba7360e..cdca6c0 100644
--- a/website/pages/docs/ecosystem.mdx
+++ b/website/pages/docs/ecosystem.mdx
@@ -35,7 +35,7 @@ This is an incomplete list of awesome things built with SVGR.
 - [chin-plugin-svgr](https://www.npmjs.com/package/chin-plugin-svgr) - SVGR plugin for [chin](https://github.com/chinjs/chin)
 - [@nice-js/svgr-loader](https://www.npmjs.com/package/@nice-js/svgr-loader) - SVGR loader for Nice.js
 - [bs-svgr](https://www.npmjs.com/package/bs-svgr) - SVGR plugin for BuckleScript (Reason)
-- [vite-plugin-svgr](https://github.com/lucsky/vite-plugin-svgr) - SVGR loader for [Vite](https://vitejs.dev/)
+- [vite-plugin-svgr](https://github.com/pd4d10/vite-plugin-svgr) - SVGR loader for [Vite](https://vitejs.dev/)
 - [SVGR for Figma](https://www.figma.com/community/plugin/749818562498396194/SVG-to-JSX)
 - [esbuild-plugin-svgr](https://github.com/kazijawad/esbuild-plugin-svgr)
 


Test patch:
diff --git a/packages/core/src/state.test.ts b/packages/core/src/state.test.ts
index 26a304c..e2183d9 100644
--- a/packages/core/src/state.test.ts
+++ b/packages/core/src/state.test.ts
@@ -24,6 +24,11 @@ describe('state', () => {
         filePath: 'a&b~c-d_e.svg',
         componentName: 'SvgAbcDE',
       })
+      expect(expandState({ filePath: 'Arrow up.svg' })).toEqual({
+        filePath: 'Arrow up.svg',
+        componentName: 'SvgArrowUp',
+      })
+
     })
   })
 })