@inglorious/vite-plugin-jsx 1.1.0 → 1.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.
@@ -1,2 +1,5 @@
1
- [?9001h[?1004h[?25l> @inglorious/vite-plugin-jsx@1.1.0 lint C:\Users\anton\Projects\ic\inglorious-forge\packages\vite-plugin-jsx
2
- > eslint .]0;C:\WINDOWS\system32\cmd.exe[?25h[?9001l[?1004l
1
+
2
+ 
3
+ > @inglorious/vite-plugin-jsx@1.1.1 lint /Users/iceonfire/Projects/ic/inglorious-forge/packages/vite-plugin-jsx
4
+ > eslint .
5
+
@@ -1,56 +1,72 @@
1
- [?9001h[?1004h[?25l> @inglorious/vite-plugin-jsx@1.0.0 test C:\Users\anton\Projects\ic\inglorious-forge\packages\vite-plugin-jsx
2
- > vitest run]0;C:\WINDOWS\system32\cmd.exe[?25h]0;node (vitest)
3
- [?25l RUN  v2.1.9 C:/Users/anton/Projects/ic/inglorious-forge/packages/vite-plugin-jsx[?25h]0;node (vitest 1)]0;node (vitest 3)]0;node (vitest 11)]0;node (vitest 5)]0;node (vitest 2)]0;node (vitest 4)]0;node (vitest 12)]0;node (vitest 10)]0;node (vitest 15)]0;node (vitest 9)]0;node (vitest 17)]0;node (vitest 6)]0;node (vitest 18)]0;node (vitest 7)]0;node (vitest 13)]0;node (vitest 19)]0;node (vitest 8)]0;node (vitest 14)]0;node (vitest 16)[?25l · moves api parameter to the end if it is not the last one
4
- · does not change parameters if api is already the last argument
5
- · moves api parameter to the end when it is in the middle
6
- · does not inject api if no capitalized component is used
7
- · does not inject api if component is not inside a 'render' method
8
- · throws an error when trying to inject api with a rest parameter present
9
- · injects api argument when component is nested inside a Fragment
10
- · injects api argument when component is nested inside standard elements
11
-  ✓ moves api parameter to the end if it is not the last one
12
- ✓ does not change parameters if api is already the last argument
13
- ✓ moves api parameter to the end when it is in the middle
14
- ✓ does not inject api if no capitalized component is used
15
- ✓ does not inject api if component is not inside a 'render' method
16
- ✓ throws an error when trying to inject api with a rest parameter present
17
- ✓ injects api argument when component is nested inside a Fragment
18
- ✓ injects api argument when component is nested inside standard elements
19
-  ✓ src/index.test.js (29) 591ms
20
- ✓ vite-plugin-jsx (29) 590ms
21
- ✓ transforms basic JSX elements
22
- ✓ injects the html import only when JSX is present
23
- ✓ transforms className to class
24
- ✓ handles event listeners (@event syntax)
25
- ✓ handles boolean attributes
26
- ✓ distinguishes between properties (.) and attributes
27
- ✓ handles fragments
28
- ✓ handles nested expressions and elements
29
- ✓ transforms Array.map to repeat directive
30
- ✓ transforms Array.map with key to keyed repeat directive
31
- ✓ transforms ternary operators to when directive
32
- ✓ transforms logical AND to when directive
33
- ✓ merges imports if @inglorious/web is already imported
34
- ✓ throws error for missing event handler expression
35
- ✓ throws error for string literal event handler
36
- ✓ does not generate closing tag for void elements
37
- ✓ handles SVG self-closing tags correctly
38
- ✓ expands self-closing non-void HTML tags
39
- ✓ ignores empty expressions and comments
40
- ✓ transforms capitalized components to api.render calls
41
- ✓ injects api argument into render function if missing when using components
42
- ✓ moves api parameter to the end if it is not the last one
43
- ✓ does not change parameters if api is already the last argument
44
- ✓ moves api parameter to the end when it is in the middle
45
- ✓ does not inject api if no capitalized component is used
46
- ✓ does not inject api if component is not inside a 'render' method
47
- ✓ throws an error when trying to inject api with a rest parameter present
48
- ✓ injects api argument when component is nested inside a Fragment
49
- ✓ injects api argument when component is nested inside standard elements
50
- 
51
- 
52
1
  Test Files  1 passed (1)
53
-  Tests  29 passed (29)
54
-  Start at  22:22:50
55
-  Duration  4.70s (transform 100ms, setup 0ms, collect 1.29s, tests 591ms, environment 0ms, prepare 1.50s)
56
- 
57
- 
2
+
3
+ 
4
+ > @inglorious/vite-plugin-jsx@1.1.0 test /Users/iceonfire/Projects/ic/inglorious-forge/packages/vite-plugin-jsx
5
+ > vitest run
6
+
7
+
8
+  RUN  v2.1.9 /Users/iceonfire/Projects/ic/inglorious-forge/packages/vite-plugin-jsx
9
+
10
+ [?25l · handles SVG self-closing tags correctly
11
+ · expands self-closing non-void HTML tags
12
+ · ignores empty expressions and comments
13
+ · transforms capitalized components to api.render calls
14
+ · injects api argument into render function if missing when using components
15
+ · moves api parameter to the end if it is not the last one
16
+ · does not change parameters if api is already the last argument
17
+ · moves api parameter to the end when it is in the middle
18
+ · does not inject api if no capitalized component is used
19
+ · does not inject api if component is not inside a 'render' method
20
+ · throws an error when trying to inject api with a rest parameter present
21
+ · injects api argument when component is nested inside a Fragment
22
+ · injects api argument when component is nested inside standard elements
23
+ [?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l ✓ handles SVG self-closing tags correctly
24
+ ✓ expands self-closing non-void HTML tags
25
+ ✓ ignores empty expressions and comments
26
+ ✓ transforms capitalized components to api.render calls
27
+ ✓ injects api argument into render function if missing when using components
28
+ ✓ moves api parameter to the end if it is not the last one
29
+ ✓ does not change parameters if api is already the last argument
30
+ ✓ moves api parameter to the end when it is in the middle
31
+ ✓ does not inject api if no capitalized component is used
32
+ ✓ does not inject api if component is not inside a 'render' method
33
+ ✓ throws an error when trying to inject api with a rest parameter present
34
+ ✓ injects api argument when component is nested inside a Fragment
35
+ ✓ injects api argument when component is nested inside standard elements
36
+ [?25l ✓ src/index.test.js (29) 457ms
37
+ ✓ vite-plugin-jsx (29) 457ms
38
+ ✓ transforms basic JSX elements
39
+ ✓ injects the html import only when JSX is present
40
+ ✓ transforms className to class
41
+ ✓ handles event listeners (@event syntax)
42
+ ✓ handles boolean attributes
43
+ ✓ distinguishes between properties (.) and attributes
44
+ ✓ handles fragments
45
+ ✓ handles nested expressions and elements
46
+ ✓ transforms Array.map to repeat directive
47
+ ✓ transforms Array.map with key to keyed repeat directive
48
+ ✓ transforms ternary operators to when directive
49
+ ✓ transforms logical AND to when directive
50
+ ✓ merges imports if @inglorious/web is already imported
51
+ ✓ throws error for missing event handler expression
52
+ ✓ throws error for string literal event handler
53
+ ✓ does not generate closing tag for void elements
54
+ ✓ handles SVG self-closing tags correctly
55
+ ✓ expands self-closing non-void HTML tags
56
+ ✓ ignores empty expressions and comments
57
+ ✓ transforms capitalized components to api.render calls
58
+ ✓ injects api argument into render function if missing when using components
59
+ ✓ moves api parameter to the end if it is not the last one
60
+ ✓ does not change parameters if api is already the last argument
61
+ ✓ moves api parameter to the end when it is in the middle
62
+ ✓ does not inject api if no capitalized component is used
63
+ ✓ does not inject api if component is not inside a 'render' method
64
+ ✓ throws an error when trying to inject api with a rest parameter present
65
+ ✓ injects api argument when component is nested inside a Fragment
66
+ ✓ injects api argument when component is nested inside standard elements
67
+
68
+  Test Files  1 passed (1)
69
+  Tests  29 passed (29)
70
+  Start at  19:00:07
71
+  Duration  3.23s (transform 66ms, setup 0ms, collect 1.26s, tests 457ms, environment 0ms, prepare 344ms)
72
+
73
+ [?25h[?25h
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @inglorious/vite-plugin-jsx
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Decrease bundles size
8
+
3
9
  ## 1.1.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -64,7 +64,7 @@ function render(entity, api) {
64
64
  {entity.visible && <h2>{entity.title}</h2>}
65
65
 
66
66
  {entity.items.map((item) => (
67
- <p key={item.id} onClick={() => api.select(item)}>
67
+ <p key={item.id} onClick={() => api.notify("select", item)}>
68
68
  {item.name}
69
69
  </p>
70
70
  ))}
@@ -83,7 +83,8 @@ function render(entity, api) {
83
83
  ${repeat(
84
84
  entity.items,
85
85
  (item) => item.id,
86
- (item) => html`<p @click=${() => api.select(item)}>${item.name}</p>`,
86
+ (item) =>
87
+ html`<p @click=${() => api.notify("select", item)}>${item.name}</p>`,
87
88
  )}
88
89
  </div>
89
90
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/vite-plugin-jsx",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A Vite plugin that transforms JSX into lit-html syntax.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -25,6 +25,7 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
+ "sideEffects": false,
28
29
  "dependencies": {
29
30
  "@babel/core": "^7.28.5",
30
31
  "@babel/plugin-syntax-jsx": "^7.28.6",
@@ -32,7 +33,7 @@
32
33
  },
33
34
  "devDependencies": {
34
35
  "vitest": "^2.0.4",
35
- "@inglorious/eslint-config": "1.1.1"
36
+ "@inglorious/eslint-config": "1.1.2"
36
37
  },
37
38
  "engines": {
38
39
  "node": ">= 22"