Skip to content

Commit 2ce7dc0

Browse files
test: layer at-rule (#255)
1 parent afcd292 commit 2ce7dc0

File tree

8 files changed

+1228
-952
lines changed

8 files changed

+1228
-952
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ jobs:
5757
- name: Security audit
5858
run: npm run security
5959

60-
- name: Check commit message
61-
uses: wagoid/commitlint-github-action@v5
60+
- name: Validate PR commits with commitlint
61+
if: github.event_name == 'pull_request'
62+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
6263

6364
test:
6465
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install commitlint --edit $1

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install lint-staged

package-lock.json

Lines changed: 1204 additions & 935 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
3939
"pretest": "npm run lint",
4040
"test": "npm run test:coverage",
41-
"prepare": "husky install && npm run build",
41+
"prepare": "husky && npm run build",
4242
"release": "standard-version"
4343
},
4444
"files": [
@@ -80,8 +80,8 @@
8080
"@babel/cli": "^7.23.9",
8181
"@babel/core": "^7.23.9",
8282
"@babel/preset-env": "^7.23.9",
83-
"@commitlint/cli": "^18.6.1",
84-
"@commitlint/config-conventional": "^18.6.2",
83+
"@commitlint/cli": "^19.0.0",
84+
"@commitlint/config-conventional": "^19.0.0",
8585
"@parcel/css": "^1.8.3",
8686
"@swc/css": "^0.0.28",
8787
"@types/clean-css": "^4.2.11",
@@ -99,11 +99,11 @@
9999
"csso": "^5.0.3",
100100
"del": "^6.1.0",
101101
"del-cli": "^5.1.0",
102-
"esbuild": "^0.19.12",
102+
"esbuild": "^0.20.1",
103103
"eslint": "^8.56.0",
104104
"eslint-config-prettier": "^9.1.0",
105105
"eslint-plugin-import": "^2.29.1",
106-
"husky": "^8.0.3",
106+
"husky": "^9.0.11",
107107
"jest": "^29.7.0",
108108
"lightningcss": "^1.23.0",
109109
"lint-staged": "^15.2.2",

test/__snapshots__/minimizerOptions-option.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ exports[`when applied with "minimizerOptions" option matches snapshot for "disca
1313

1414
exports[`when applied with "minimizerOptions" option matches snapshot for "discardComments" option (enable, with "removeAll" option): entry.css 1`] = `"body{color:red}"`;
1515

16-
exports[`when applied with "minimizerOptions" option matches snapshot for "discardEmpty" option (disable): entry.css 1`] = `"body{color:red}a{}"`;
16+
exports[`when applied with "minimizerOptions" option matches snapshot for "discardEmpty" option (disable): entry.css 1`] = `"@layer ui-components, foo-bar;body{color:red}a{}.foo{color:#000;& .class{color:#fff}}@layer ui-components{}"`;
1717

18-
exports[`when applied with "minimizerOptions" option matches snapshot for "discardEmpty" option (enable [default]): entry.css 1`] = `"body{color:red}"`;
18+
exports[`when applied with "minimizerOptions" option matches snapshot for "discardEmpty" option (enable [default]): entry.css 1`] = `"@layer ui-components, foo-bar;body{color:red}.foo{color:#000;& .class{color:#fff}}@layer ui-components{}"`;
1919

2020
exports[`when applied with "minimizerOptions" option matches snapshot for "mergeRules" option (disable): entry.css 1`] = `"body{color:red}body{font-weight:700}"`;
2121

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
@layer ui-components, foo-bar;
2+
13
body {
24
color: red;
35
}
46

57
a {
6-
}
8+
}
9+
10+
.foo {
11+
color: black;
12+
13+
& .class {
14+
color: white;
15+
}
16+
}
17+
18+
@layer ui-components {
19+
}

0 commit comments

Comments
 (0)