mizdra / happy-css-modules

Typed, definition jumpable CSS Modules. Moreover, easy!
MIT License
233 stars 5 forks source link

Support `sass-embedded` #141

Closed mizdra closed 2 years ago

mizdra commented 2 years ago

close: #85

mizdra commented 2 years ago

In M1 Pro Mac, switching to sass-embedded seems to cause path joining to go wrong...

$ pnpm run test scss-transformer.test.ts

> happy-css-modules@0.3.0 test /Users/mizdra/src/github.com/mizdra/happy-css-modules
> NODE_OPTIONS="--experimental-vm-modules $NODE_OPTIONS" jest "scss-transformer.test.ts"

(node:60352) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
 FAIL  src/transformer/scss-transformer.test.ts
  ✕ handles sass features (216 ms)
  ✓ tracks dependencies that have been pre-bundled by sass compiler (36 ms)
  ✓ resolves specifier using resolver (50 ms)
  ✓ ignores http(s) protocol file (34 ms)

  ● handles sass features

    expect(received).toMatchInlineSnapshot(snapshot)

    Snapshot name: `handles sass features 1`

    - Snapshot  -  8
    + Received  + 40

    @@ -2,47 +2,79 @@
        dependencies: ["<fixtures>/test/2.scss", "<fixtures>/test/3.scss", "<fixtures>/test/4.scss"],
        tokens: [
          {
            name: "b_1",
            originalLocations: [
    -         { filePath: "<fixtures>/test/2.scss", start: { line: 1, column: 1 }, end: { line: 1, column: 3 } },
    +         {
    +           filePath: "/private/var/folders/0g<fixtures>/test/2.scss",
    +           start: { line: 1, column: 1 },
    +           end: { line: 1, column: 3 },
    +         },
            ],
          },