@modular-css/vite 29.1.2 → 30.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 30.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`7488bb1`](https://github.com/tivac/modular-css/commit/7488bb12add1175e8c5a1be59ca97ea8207a9d98) Thanks [@tivac](https://github.com/tivac)! - All the various interfaces to `@modular-css/processor` need to be updated because of the breaking changes to composition rules in #926
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`7488bb1`](https://github.com/tivac/modular-css/commit/7488bb12add1175e8c5a1be59ca97ea8207a9d98), [`a61fa35`](https://github.com/tivac/modular-css/commit/a61fa35f81e0c5c181c425e596c27f017acd5096)]:
12
+ - @modular-css/css-to-js@29.0.0
13
+ - @modular-css/processor@29.0.0
14
+
15
+ ## 29.1.3
16
+
17
+ ### Patch Changes
18
+
19
+ - [#919](https://github.com/tivac/modular-css/pull/919) [`989d1f0`](https://github.com/tivac/modular-css/commit/989d1f06caf0505d7cc7bfee52f29afd5a0a7760) Thanks [@tivac](https://github.com/tivac)! - Vite 4 support
20
+
3
21
  ## 29.1.2
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -49,4 +49,4 @@ You can set variable declaration kind, eg `var mc_rule = ...;`, by setting `vari
49
49
 
50
50
  ### Shared Options
51
51
 
52
- All other options are passed to the underlying `Processor` instance, see the [Processor Options](#processor-options).
52
+ All other options are passed to the underlying `Processor` instance, see the [Processor Options](https://m-css.com/api/#direct-usage-js-api-processor-options).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-css/vite",
3
- "version": "29.1.2",
3
+ "version": "30.0.0",
4
4
  "description": "vite support for modular-css",
5
5
  "main": "./vite.js",
6
6
  "repository": {
@@ -26,11 +26,11 @@
26
26
  "postcss"
27
27
  ],
28
28
  "dependencies": {
29
- "@modular-css/css-to-js": "^28.4.1",
30
- "@modular-css/processor": "^28.1.5",
31
- "@rollup/pluginutils": "^4.1.2"
29
+ "@modular-css/css-to-js": "^29.0.0",
30
+ "@modular-css/processor": "^29.0.0",
31
+ "@rollup/pluginutils": "^5.0.2"
32
32
  },
33
33
  "peerDependencies": {
34
- "vite": "^3.0.3"
34
+ "vite": "^3 || ^4"
35
35
  }
36
36
  }
@@ -0,0 +1,5 @@
1
+ .a {
2
+ composes: c from "../shared/dynamic-c.mcss";
3
+
4
+ color: red;
5
+ }
@@ -0,0 +1,5 @@
1
+ .b {
2
+ composes: c from "../shared/dynamic-c.mcss";
3
+
4
+ color: white;
5
+ }
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+
3
+ <body>
4
+ <div id="a">A</div>
5
+
6
+ <div id="b">B</div>
7
+
8
+ <script type="module" src="./script.js"></script>
9
+ </body>
@@ -0,0 +1,13 @@
1
+ const aEl = document.querySelector("#a");
2
+ const bEl = document.querySelector("#b");
3
+
4
+ (async function() {
5
+ const a = await import("./a.mcss");
6
+ const b = await import("./b.mcss");
7
+
8
+ console.log({ a, b });
9
+
10
+ aEl.className = a.a;
11
+ bEl.className = b.b;
12
+ }());
13
+
File without changes
@@ -0,0 +1,6 @@
1
+ .c {
2
+ background-color: blue;
3
+
4
+ width: 100px;
5
+ height: 100px;
6
+ }
@@ -0,0 +1,6 @@
1
+ .c {
2
+ background-color: blue;
3
+
4
+ width: 100px;
5
+ height: 100px;
6
+ }
@@ -0,0 +1,5 @@
1
+ .a {
2
+ composes: c from "../shared/static-c.mcss";
3
+
4
+ color: red;
5
+ }
@@ -0,0 +1,5 @@
1
+ .b {
2
+ composes: c from "../shared/static-c.mcss";
3
+
4
+ color: white;
5
+ }
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+
3
+ <body>
4
+ <div id="a">A</div>
5
+
6
+ <div id="b">B</div>
7
+
8
+ <script type="module" src="./script.js"></script>
9
+ </body>
@@ -0,0 +1,10 @@
1
+ import a from "./a.mcss";
2
+ import b from "./b.mcss";
3
+
4
+ console.log({ a, b });
5
+
6
+ const aEl = document.querySelector("#a");
7
+ const bEl = document.querySelector("#b");
8
+
9
+ aEl.className = a.a;
10
+ bEl.className = b.b;
@@ -0,0 +1,25 @@
1
+ import { test as testBase, expect } from "@playwright/test";
2
+
3
+ const test = testBase.extend({
4
+ dir : [ "static", { option : true }],
5
+ });
6
+
7
+ test("style ordering", async ({ page, dir }) => {
8
+ await page.goto(`/${dir}/`);
9
+
10
+ const a = await page.getByText("A");
11
+
12
+ await expect(a).toBeVisible();
13
+
14
+ await expect(a).toHaveCSS("background-color", "rgb(0, 0, 255)");
15
+ await expect(a).toHaveCSS("color", "rgb(255, 0, 0)");
16
+ await expect(a).toHaveClass("mc_c mc_a");
17
+
18
+ const b = await page.getByText("B");
19
+
20
+ await expect(b).toBeVisible();
21
+
22
+ await expect(b).toHaveCSS("background-color", "rgb(0, 0, 255)");
23
+ await expect(b).toHaveCSS("color", "rgb(255, 255, 255)");
24
+ await expect(b).toHaveClass("mc_c mc_b");
25
+ });