@inglorious/vite-plugin-jsx 1.0.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.
- package/.turbo/turbo-lint.log +5 -3
- package/.turbo/turbo-test.log +72 -57
- package/CHANGELOG.md +12 -0
- package/README.md +3 -2
- package/package.json +5 -4
- package/src/index.js +1 -0
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @inglorious/vite-plugin-jsx@1.1.1 lint /Users/iceonfire/Projects/ic/inglorious-forge/packages/vite-plugin-jsx
|
|
4
|
+
> eslint .
|
|
5
|
+
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,57 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[90m
|
|
10
|
-
[90m
|
|
11
|
-
[90m
|
|
12
|
-
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[32m
|
|
24
|
-
[32m
|
|
25
|
-
[32m
|
|
26
|
-
[32m
|
|
27
|
-
[32m
|
|
28
|
-
[32m
|
|
29
|
-
[32m
|
|
30
|
-
[32m
|
|
31
|
-
[32m
|
|
32
|
-
[32m
|
|
33
|
-
[32m
|
|
34
|
-
[32m
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[32m
|
|
38
|
-
[32m
|
|
39
|
-
[32m
|
|
40
|
-
[32m
|
|
41
|
-
[32m
|
|
42
|
-
[32m
|
|
43
|
-
[32m
|
|
44
|
-
[32m
|
|
45
|
-
[32m
|
|
46
|
-
[32m
|
|
47
|
-
[32m
|
|
48
|
-
[32m
|
|
49
|
-
[32m
|
|
50
|
-
[32m
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @inglorious/vite-plugin-jsx@1.1.0 test /Users/iceonfire/Projects/ic/inglorious-forge/packages/vite-plugin-jsx
|
|
4
|
+
> vitest run
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
[1m[7m[36m RUN [39m[27m[22m [36mv2.1.9 [39m[90m/Users/iceonfire/Projects/ic/inglorious-forge/packages/vite-plugin-jsx[39m
|
|
8
|
+
|
|
9
|
+
[?25l [90mยท[39m handles SVG self-closing tags correctly
|
|
10
|
+
[90mยท[39m expands self-closing non-void HTML tags
|
|
11
|
+
[90mยท[39m ignores empty expressions and comments
|
|
12
|
+
[90mยท[39m transforms capitalized components to api.render calls
|
|
13
|
+
[90mยท[39m injects api argument into render function if missing when using components
|
|
14
|
+
[90mยท[39m moves api parameter to the end if it is not the last one
|
|
15
|
+
[90mยท[39m does not change parameters if api is already the last argument
|
|
16
|
+
[90mยท[39m moves api parameter to the end when it is in the middle
|
|
17
|
+
[90mยท[39m does not inject api if no capitalized component is used
|
|
18
|
+
[90mยท[39m does not inject api if component is not inside a 'render' method
|
|
19
|
+
[90mยท[39m throws an error when trying to inject api with a rest parameter present
|
|
20
|
+
[90mยท[39m injects api argument when component is nested inside a Fragment
|
|
21
|
+
[90mยท[39m injects api argument when component is nested inside standard elements
|
|
22
|
+
[?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[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[G [32mโ[39m handles SVG self-closing tags correctly
|
|
23
|
+
[32mโ[39m expands self-closing non-void HTML tags
|
|
24
|
+
[32mโ[39m ignores empty expressions and comments
|
|
25
|
+
[32mโ[39m transforms capitalized components to api.render calls
|
|
26
|
+
[32mโ[39m injects api argument into render function if missing when using components
|
|
27
|
+
[32mโ[39m moves api parameter to the end if it is not the last one
|
|
28
|
+
[32mโ[39m does not change parameters if api is already the last argument
|
|
29
|
+
[32mโ[39m moves api parameter to the end when it is in the middle
|
|
30
|
+
[32mโ[39m does not inject api if no capitalized component is used
|
|
31
|
+
[32mโ[39m does not inject api if component is not inside a 'render' method
|
|
32
|
+
[32mโ[39m throws an error when trying to inject api with a rest parameter present
|
|
33
|
+
[32mโ[39m injects api argument when component is nested inside a Fragment
|
|
34
|
+
[32mโ[39m injects api argument when component is nested inside standard elements
|
|
35
|
+
[?25l[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[G [32mโ[39m [2msrc/[22mindex[2m.test.js[22m[2m (29)[22m[33m 457[2mms[22m[39m
|
|
36
|
+
[32mโ[39m vite-plugin-jsx[2m (29)[22m[33m 457[2mms[22m[39m
|
|
37
|
+
[32mโ[39m transforms basic JSX elements
|
|
38
|
+
[32mโ[39m injects the html import only when JSX is present
|
|
39
|
+
[32mโ[39m transforms className to class
|
|
40
|
+
[32mโ[39m handles event listeners (@event syntax)
|
|
41
|
+
[32mโ[39m handles boolean attributes
|
|
42
|
+
[32mโ[39m distinguishes between properties (.) and attributes
|
|
43
|
+
[32mโ[39m handles fragments
|
|
44
|
+
[32mโ[39m handles nested expressions and elements
|
|
45
|
+
[32mโ[39m transforms Array.map to repeat directive
|
|
46
|
+
[32mโ[39m transforms Array.map with key to keyed repeat directive
|
|
47
|
+
[32mโ[39m transforms ternary operators to when directive
|
|
48
|
+
[32mโ[39m transforms logical AND to when directive
|
|
49
|
+
[32mโ[39m merges imports if @inglorious/web is already imported
|
|
50
|
+
[32mโ[39m throws error for missing event handler expression
|
|
51
|
+
[32mโ[39m throws error for string literal event handler
|
|
52
|
+
[32mโ[39m does not generate closing tag for void elements
|
|
53
|
+
[32mโ[39m handles SVG self-closing tags correctly
|
|
54
|
+
[32mโ[39m expands self-closing non-void HTML tags
|
|
55
|
+
[32mโ[39m ignores empty expressions and comments
|
|
56
|
+
[32mโ[39m transforms capitalized components to api.render calls
|
|
57
|
+
[32mโ[39m injects api argument into render function if missing when using components
|
|
58
|
+
[32mโ[39m moves api parameter to the end if it is not the last one
|
|
59
|
+
[32mโ[39m does not change parameters if api is already the last argument
|
|
60
|
+
[32mโ[39m moves api parameter to the end when it is in the middle
|
|
61
|
+
[32mโ[39m does not inject api if no capitalized component is used
|
|
62
|
+
[32mโ[39m does not inject api if component is not inside a 'render' method
|
|
63
|
+
[32mโ[39m throws an error when trying to inject api with a rest parameter present
|
|
64
|
+
[32mโ[39m injects api argument when component is nested inside a Fragment
|
|
65
|
+
[32mโ[39m injects api argument when component is nested inside standard elements
|
|
66
|
+
|
|
67
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
68
|
+
[2m Tests [22m [1m[32m29 passed[39m[22m[90m (29)[39m
|
|
69
|
+
[2m Start at [22m 19:00:07
|
|
70
|
+
[2m Duration [22m 3.23s[2m (transform 66ms, setup 0ms, collect 1.26s, tests 457ms, environment 0ms, prepare 344ms)[22m
|
|
71
|
+
|
|
72
|
+
[?25h[?25h
|
package/CHANGELOG.md
CHANGED
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
|
|
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) =>
|
|
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.
|
|
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,14 +33,14 @@
|
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"vitest": "^2.0.4",
|
|
35
|
-
"@inglorious/eslint-config": "1.1.
|
|
36
|
+
"@inglorious/eslint-config": "1.1.2"
|
|
36
37
|
},
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">= 22"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
|
-
"format": "prettier --write
|
|
42
|
-
"lint": "eslint .
|
|
42
|
+
"format": "prettier --write .",
|
|
43
|
+
"lint": "eslint .",
|
|
43
44
|
"test:watch": "vitest",
|
|
44
45
|
"test": "vitest run"
|
|
45
46
|
}
|