Skip to content

Commit

Permalink
fix: same postfix rules (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
axyz authored Mar 17, 2022
1 parent c6d8a37 commit c5c5a9e
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 4 deletions.
7 changes: 7 additions & 0 deletions integration-test/packages/atoms/all/atom.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
.sMmOaU .R2GDg- {
color: green;
}
.EV62sS {
color: blue;
}

.JYUOso {
color: blue;
}
/* custom static css (e.g. normalize) can be added here */.YcXvtG {
color: #1a1a1a
}
Expand Down
2 changes: 1 addition & 1 deletion integration-test/packages/atoms/all/atom.min.css.snap

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions integration-test/packages/atoms/same-content/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.tsx
**/*.ts
!**/*.d.ts
7 changes: 7 additions & 0 deletions integration-test/packages/atoms/same-content/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.bar {
color: blue;
}

.foo_bar {
color: blue;
}
3 changes: 3 additions & 0 deletions integration-test/packages/atoms/same-content/index.d.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const bar: string;
declare const foo_bar: string
export { bar, foo_bar }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export var bar = "EV62sS";
export var foo_bar = "JYUOso"
4 changes: 4 additions & 0 deletions integration-test/packages/atoms/same-content/index.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
bar: "EV62sS",
foo_bar: "JYUOso"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"bar":"EV62sS","foo_bar":"JYUOso"}
7 changes: 7 additions & 0 deletions integration-test/packages/atoms/same-content/module.css.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.bar {
color: blue;
}

.foo_bar {
color: blue;
}
7 changes: 7 additions & 0 deletions integration-test/packages/atoms/same-content/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@my-org/same-content",
"version": "0.0.1",
"main": "index.js",
"module": "index.esm.js",
"sideEffects": false
}
7 changes: 7 additions & 0 deletions integration-test/packages/atoms/same-content/result.css.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.EV62sS {
color: blue;
}

.JYUOso {
color: blue;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@utilitycss/atomic",
"version": "0.19.1",
"version": "0.20.0",
"author": "Andrea Moretti (@axyz) <[email protected]>",
"description": "Atomic CSS composition for yarn workspaces",
"repository": "utilitycss/atomic",
Expand Down
2 changes: 1 addition & 1 deletion src/postcss/atomic-css-modules/generateScopedName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const generateScopedName: generateScopedName = ({
let pkgName = "";
const definitionsMap = new Map();
const isElectron = importedElectronRE.test(filename);
root.walkRules(new RegExp(`(\.${name}|:import)`), (rule): any => {
root.walkRules(new RegExp(`(\\.${name}|:import)`), (rule): any => {
if (isElectron) {
// ensure that a rule that appear multiple times has the same hash
// e.g. inside media queries or when ICSS imported in a different atom.
Expand Down
2 changes: 1 addition & 1 deletion templates/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "atomic start"
},
"devDependencies": {
"@utilitycss/atomic": "^0.19.0",
"@utilitycss/atomic": "^0.20.0",
"lerna": "3.13.3"
},
"workspaces": {
Expand Down

0 comments on commit c5c5a9e

Please sign in to comment.