vite-plugin-sinwan 0.2.5 → 0.2.6
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 +8 -0
- package/__tests__/plugin.test.ts +17 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -8,6 +8,14 @@ Vite plugin for [Sinwan](https://sinwanjs.com) — JSX transformation with templ
|
|
|
8
8
|
bun add -d vite-plugin-sinwan
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Compiler updates
|
|
12
|
+
|
|
13
|
+
The plugin depends on `sinwan-compiler` with `>=0.2.5 <1.0.0` and does not bundle it. Publishing a new 0.x compiler does **not** require a plugin release.
|
|
14
|
+
|
|
15
|
+
- New installs resolve the newest compatible compiler automatically.
|
|
16
|
+
- Existing apps keep a lockfile pin until they run `bun update sinwan-compiler`.
|
|
17
|
+
- Republish this plugin only when the plugin API itself changes, or when `sinwan-compiler` reaches 1.0.
|
|
18
|
+
|
|
11
19
|
## Usage
|
|
12
20
|
|
|
13
21
|
```ts
|
package/__tests__/plugin.test.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from "bun:test";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
2
4
|
import { sinwan } from "../src/index";
|
|
3
5
|
|
|
4
6
|
describe("sinwan vite plugin", () => {
|
|
@@ -30,3 +32,18 @@ describe("sinwan vite plugin", () => {
|
|
|
30
32
|
expect(plugin.name).toBe("sinwan");
|
|
31
33
|
});
|
|
32
34
|
});
|
|
35
|
+
|
|
36
|
+
const COMPILER_RANGE = ">=0.2.5 <1.0.0";
|
|
37
|
+
|
|
38
|
+
describe("sinwan-compiler dependency range", () => {
|
|
39
|
+
it("accepts any 0.x compiler without a plugin republish", () => {
|
|
40
|
+
const pkg = JSON.parse(
|
|
41
|
+
fs.readFileSync(path.join(import.meta.dir, "..", "package.json"), "utf8"),
|
|
42
|
+
) as {
|
|
43
|
+
dependencies: Record<string, string>;
|
|
44
|
+
peerDependencies: Record<string, string>;
|
|
45
|
+
};
|
|
46
|
+
expect(pkg.dependencies["sinwan-compiler"]).toBe(COMPILER_RANGE);
|
|
47
|
+
expect(pkg.peerDependencies["sinwan-compiler"]).toBe(COMPILER_RANGE);
|
|
48
|
+
});
|
|
49
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-sinwan",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Vite plugin for sinwan",
|
|
5
5
|
"author": "Mohammed Ben Cheikh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,10 +36,11 @@
|
|
|
36
36
|
"typescript": "^5"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"sinwan-compiler": "
|
|
39
|
+
"sinwan-compiler": ">=0.2.5 <1.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"typescript": "^5",
|
|
43
|
-
"vite": "^5"
|
|
43
|
+
"vite": "^5",
|
|
44
|
+
"sinwan-compiler": ">=0.2.5 <1.0.0"
|
|
44
45
|
}
|
|
45
46
|
}
|