Skip to content

Commit 6d4a108

Browse files
authored
Merge pull request #66 from utilitycss/fix/node-18
fix: node 18
2 parents 3823a5e + cbbdcc7 commit 6d4a108

5 files changed

Lines changed: 115 additions & 338 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- 14
3+
- 18
44
cache:
55
yarn: true
66
script:

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@utilitycss/utility",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Generator for Utility CSS frameworks",
55
"author": "Andrea Moretti (@axyz) <axyzxp@gmail.com>",
66
"repository": "utilitycss/utility",
@@ -19,18 +19,17 @@
1919
},
2020
"dependencies": {
2121
"commander": "7.0.0",
22-
"cssstats": "^4.0.0",
2322
"deepmerge": "^4.2.2",
2423
"open": "^7.4.0",
2524
"chalk": "^4.1.0",
2625
"lodash": "^4.17.20",
2726
"mocha": "^8.3.0",
28-
"postcss": "8.2.6"
27+
"postcss": "8.4.29"
2928
},
3029
"devDependencies": {
3130
"@types/mocha": "^8.2.0",
3231
"@types/lodash": "^4.14.168",
33-
"@types/node": "^14.14.27",
32+
"@types/node": "^18.17.14",
3433
"@types/prettier": "^2.2.1",
3534
"@typescript-eslint/eslint-plugin": "^4.15.0",
3635
"@typescript-eslint/parser": "^4.15.0",
@@ -47,8 +46,8 @@
4746
"postcss-cli": "^8.3.1",
4847
"prettier": "^2.2.1",
4948
"prettydiff": "^101.2.6",
50-
"ts-node": "^9.1.1",
51-
"typescript": "^4.1.5"
49+
"ts-node": "^10.9.1",
50+
"typescript": "^4.2.5"
5251
},
5352
"husky": {
5453
"hooks": {

src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ program
7474
debug("Building CSS bundle...");
7575
postcss([builder(config)])
7676
.process(input)
77-
.then(async (result) => {
77+
.then(async (result: any) => {
7878
await write(result.css);
7979
// eslint-disable-next-line no-console
8080
debug("Success!");
8181
})
8282
// eslint-disable-next-line no-console
83-
.catch((e) => console.error(chalk.red(e)));
83+
.catch((e: Error) => console.error(chalk.red(e)));
8484
});
8585

8686
program.command("*", null, { noHelp: true }).action(() => {

src/helpers/build-stats.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import path from "path";
22
import { promises as fsAsync } from "fs";
33
import _ from "lodash";
44

5-
// eslint-disable-next-line @typescript-eslint/no-var-requires
6-
const cssstats = require("cssstats");
7-
85
interface BuildStats {
96
atomCss: string;
107
}
118

9+
/* FIXME: Temporarily disabled due to cssstats's dependency to postcss-safe-parser, that causes issues in node 18 */
1210
export default async function buildStats({
1311
atomCss,
1412
}: BuildStats): Promise<string> {
@@ -26,7 +24,7 @@ export default async function buildStats({
2624
} = {} as any,
2725
declarations: { total: totalDecls, unique: uniqueDecls } = {} as any,
2826
mediaQueries: { total: totalMedia } = {} as any,
29-
} = cssstats(atomCss) as any;
27+
} = {} as any;
3028

3129
const statsTemplate = _.template(
3230
await fsAsync.readFile(

0 commit comments

Comments
 (0)