Skip to content

Commit 149dd93

Browse files
authored
Prepare for 0.4.0 release (#22)
1 parent 1700e55 commit 149dd93

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

.changeset/slow-birds-complain.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/two-drinks-double.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# postcss-typesafe-css-modules
22

3+
## 0.4.0
4+
5+
### Minor Changes
6+
7+
- 1700e55: Output .css instead of .module.css to prevent potential consumers from trying to double compile CSS modules
8+
9+
### Patch Changes
10+
11+
- 22c63e2: Add usage section to README
12+
313
## 0.3.0
414

515
### Minor Changes

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ A [PostCSS](https://postcss.org/) plugin for type safe [CSS modules](https://git
66

77
This plugin takes CSS modules one step further by generating `.js` and `.d.ts` files for each CSS module file. This means that CSS class names imported from a CSS module file will be typechecked so that developers can't reference non-existent classes. Source maps are also generated so that you can navigate from a CSS module class name directly to the Sass file.
88

9-
For example, if you have the following CSS module file:
9+
For example, if you have the following SCSS module file:
1010

1111
```css
12-
// header.module.css
12+
// header.module.scss
1313
.header {
1414
font-size: 1.5rem;
1515
}
@@ -19,7 +19,7 @@ In your corresponding TypeScript file, the following would work:
1919

2020
```tsx
2121
import React from "react";
22-
import * as css from "./header.module.css";
22+
import * as css from "./header.module.scss";
2323

2424
export const Header: React.FC = () => {
2525
return <header className={css.header}>Hello</header>;
@@ -30,7 +30,7 @@ However, referencing a non-existent class will fail to compile:
3030

3131
```tsx
3232
import React from "react";
33-
import * as css from "./header.module.css";
33+
import * as css from "./header.module.scss";
3434

3535
export const Header: React.FC = () => {
3636
// Will fail to compile
@@ -78,15 +78,17 @@ module.exports = {
7878
};
7979
```
8080

81-
For each CSS module file, the following files will get written to disk in the output directory (`--dir` if using the [postcss-cli](https://github.com/postcss/postcss-cli)):
81+
For each SCSS module file, the following files will get written to disk in the output directory (`--dir` if using the [postcss-cli](https://github.com/postcss/postcss-cli)):
8282

8383
```
8484
# In this example, build/postcss is the output directory for PostCSS
8585
src/
8686
hello.module.scss
87+
hello.tsx # Contains the import for header.module.scss
8788
build/
8889
postcss/
89-
hello.module.scss.js
90+
_hello.module.css # Compiled CSS that is imported by hello.module.scss.js
91+
hello.module.scss.js # File actually imported by hello.tsx
9092
hello.module.scss.js.map
9193
hello.module.scss.d.ts
9294
hello.module.scss.d.ts

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-typesafe-css-modules",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "PostCSS plugin for generating typesafe CSS modules",
55
"packageManager": "[email protected]",
66
"keywords": [

0 commit comments

Comments
 (0)