@modular-css/vite 29.1.3 → 30.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change Log
2
2
 
3
+ ## 30.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`edbbe96`](https://github.com/tivac/modular-css/commit/edbbe9667fa4333913bb95cd8c7e67f386f57054), [`ffab76d`](https://github.com/tivac/modular-css/commit/ffab76d4428211ba33e6f7a6d518618b5cfdef00)]:
8
+ - @modular-css/processor@29.0.1
9
+ - @modular-css/css-to-js@29.0.1
10
+
11
+ ## 30.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - [`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
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`7488bb1`](https://github.com/tivac/modular-css/commit/7488bb12add1175e8c5a1be59ca97ea8207a9d98), [`a61fa35`](https://github.com/tivac/modular-css/commit/a61fa35f81e0c5c181c425e596c27f017acd5096)]:
20
+ - @modular-css/css-to-js@29.0.0
21
+ - @modular-css/processor@29.0.0
22
+
3
23
  ## 29.1.3
4
24
 
5
25
  ### 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.3",
3
+ "version": "30.0.1",
4
4
  "description": "vite support for modular-css",
5
5
  "main": "./vite.js",
6
6
  "repository": {
@@ -26,8 +26,8 @@
26
26
  "postcss"
27
27
  ],
28
28
  "dependencies": {
29
- "@modular-css/css-to-js": "^28.4.1",
30
- "@modular-css/processor": "^28.1.5",
29
+ "@modular-css/css-to-js": "^29.0.1",
30
+ "@modular-css/processor": "^29.0.1",
31
31
  "@rollup/pluginutils": "^5.0.2"
32
32
  },
33
33
  "peerDependencies": {
@@ -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
+
@@ -1,9 +0,0 @@
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,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>
@@ -1,25 +1,25 @@
1
- import { test, expect } from "@playwright/test";
1
+ import { test as testBase, expect } from "@playwright/test";
2
2
 
3
- test.beforeEach(async ({ page }) => {
4
- await page.goto("/");
5
- })
6
-
7
- test("a is right", async ({ page }) => {
8
- const el = await page.getByText("A");
9
-
10
- await expect(el).toBeVisible();
11
-
12
- await expect(el).toHaveCSS("background-color", "rgb(0, 0, 255)");
13
- await expect(el).toHaveCSS("color", "rgb(255, 0, 0)");
14
- await expect(el).toHaveClass("mc_c mc_a");
3
+ const test = testBase.extend({
4
+ dir : [ "static", { option : true }],
15
5
  });
16
6
 
17
- test("b is right", async ({ page }) => {
18
- const el = await page.getByText("B");
7
+ test("style ordering", async ({ page, dir }) => {
8
+ await page.goto(`/${dir}/`);
9
+
10
+ const a = await page.getByText("A");
19
11
 
20
- await expect(el).toBeVisible();
12
+ await expect(a).toBeVisible();
21
13
 
22
- await expect(el).toHaveCSS("background-color", "rgb(0, 0, 255)");
23
- await expect(el).toHaveCSS("color", "rgb(255, 255, 255)");
24
- await expect(el).toHaveClass("mc_c mc_b");
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
25
  });
@@ -1,5 +0,0 @@
1
- .a {
2
- composes: c from "./c.mcss";
3
-
4
- color: red;
5
- }
@@ -1,5 +0,0 @@
1
- .b {
2
- composes: c from "./c.mcss";
3
-
4
- color: white;
5
- }
File without changes